├── .gitattributes ├── .gitignore ├── LICENSE ├── README.md └── osu-rank ├── .Elas └── ElasConfiguration.props ├── osu-rank.sln └── osu-rank ├── A@2x.png ├── APis.cs ├── About.xaml ├── About.xaml.cs ├── App.config ├── App.xaml ├── App.xaml.cs ├── Drapeaux ├── AD.png ├── AE.png ├── AG.png ├── AL.png ├── AM.png ├── AR.png ├── AT.png ├── AU.png ├── AZ.png ├── BA.png ├── BB.png ├── BD.png ├── BE.png ├── BF.png ├── BG.png ├── BH.png ├── BJ.png ├── BN.png ├── BO.png ├── BR.png ├── BS.png ├── BT.png ├── BW.png ├── BY.png ├── BZ.png ├── CA.png ├── CD.png ├── CH.png ├── CI.png ├── CL.png ├── CM.png ├── CN.png ├── CO.png ├── CR.png ├── CU.png ├── CY.png ├── CZ.png ├── DE.png ├── DJ.png ├── DK.png ├── DM.png ├── DO.png ├── DZ.png ├── EC.png ├── EE.png ├── EG.png ├── ES.png ├── ET.png ├── FI.png ├── FJ.png ├── FR.png ├── GA.png ├── GB.png ├── GD.png ├── GE.png ├── GF.png ├── GH.png ├── GR.png ├── GT.png ├── GY.png ├── HK.png ├── HM.png ├── HN.png ├── HR.png ├── HU.png ├── IE.png ├── IL.png ├── IN.png ├── IQ.png ├── IR.png ├── IS.png ├── IT.png ├── JM.png ├── JO.png ├── JP.png ├── KE.png ├── KH.png ├── KN.png ├── KR.png ├── KW.png ├── KZ.png ├── LA.png ├── LB.png ├── LC.png ├── LI.png ├── LK.png ├── LT.png ├── LU.png ├── LV.png ├── LY.png ├── MA.png ├── MC.png ├── MD.png ├── ME.png ├── MF.png ├── MG.png ├── MH.png ├── MK.png ├── MM.png ├── MN.png ├── MR.png ├── MT.png ├── MU.png ├── MV.png ├── MW.png ├── MX.png ├── MY.png ├── MZ.png ├── NA.png ├── NE.png ├── NG.png ├── NI.png ├── NL.png ├── NO.png ├── NP.png ├── NZ.png ├── OM.png ├── PA.png ├── PE.png ├── PG.png ├── PH.png ├── PK.png ├── PL.png ├── PT.png ├── PY.png ├── QA.png ├── RE.png ├── RO.png ├── RS.png ├── RU.png ├── SA.png ├── SB.png ├── SC.png ├── SD.png ├── SE.png ├── SG.png ├── SI.png ├── SK.png ├── SL.png ├── SM.png ├── SN.png ├── SR.png ├── ST.png ├── SV.png ├── SY.png ├── TG.png ├── TH.png ├── TL.png ├── TN.png ├── TR.png ├── TT.png ├── TW.png ├── TZ.png ├── UA.png ├── US.png ├── UY.png ├── UZ.png ├── VA.png ├── VC.png ├── VE.png ├── VN.png ├── VU.png ├── YE.png ├── ZA.png ├── ZM.png └── unknown.png ├── ElementList.txt ├── FodyWeavers.xml ├── Fonts ├── Exo2 - OFL.txt ├── Exo2-Black.ttf ├── Exo2-BlackItalic.ttf ├── Exo2-Bold.ttf ├── Exo2-BoldItalic.ttf ├── Exo2-ExtraBold.ttf ├── Exo2-ExtraBoldItalic.ttf ├── Exo2-ExtraLight.ttf ├── Exo2-ExtraLightItalic.ttf ├── Exo2-Italic.ttf ├── Exo2-Light.ttf ├── Exo2-LightItalic.ttf ├── Exo2-Medium.ttf ├── Exo2-MediumItalic.ttf ├── Exo2-Regular.ttf ├── Exo2-SemiBold.ttf ├── Exo2-SemiBoldItalic.ttf ├── Exo2-Thin.ttf └── Exo2-ThinItalic.ttf ├── MainWindow.xaml ├── MainWindow.xaml.cs ├── Options.xaml ├── Options.xaml.cs ├── OsuPages ├── Compare.xaml ├── Compare.xaml.cs ├── OneUser.xaml └── OneUser.xaml.cs ├── Properties ├── AssemblyInfo.cs ├── Resources.Designer.cs ├── Resources.resx ├── Resources.resx.xlf ├── Settings.Designer.cs └── Settings.settings ├── RipplePages ├── Compare.xaml ├── Compare.xaml.cs ├── OneUser.xaml └── OneUser.xaml.cs ├── S@2x.png ├── Settings.cs ├── Stringlists ├── README.md ├── StringList 3.0.txt ├── StringList 3.1.txt ├── StringList 4.0.txt ├── StringList 4.3.txt ├── StringList 4.4.txt └── StringList 4.5.txt ├── Translation ├── README.md ├── osu_rank.txd └── txdVersion.txt ├── X@2x.png ├── osu!rank-icon-by-Xial.ico ├── osu!rank-icon-by-Xial.png ├── osu-rank.csproj ├── osu-small.png ├── packages.config ├── std-small.png └── version.txt /.gitattributes: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Set default behavior to automatically normalize line endings. 3 | ############################################################################### 4 | * text=auto 5 | 6 | ############################################################################### 7 | # Set default behavior for command prompt diff. 8 | # 9 | # This is need for earlier builds of msysgit that does not have it on by 10 | # default for csharp files. 11 | # Note: This is only used by command line 12 | ############################################################################### 13 | #*.cs diff=csharp 14 | 15 | ############################################################################### 16 | # Set the merge driver for project and solution files 17 | # 18 | # Merging from the command prompt will add diff markers to the files if there 19 | # are conflicts (Merging from VS is not affected by the settings below, in VS 20 | # the diff markers are never inserted). Diff markers may cause the following 21 | # file extensions to fail to load in VS. An alternative would be to treat 22 | # these files as binary and thus will always conflict and require user 23 | # intervention with every merge. To do so, just uncomment the entries below 24 | ############################################################################### 25 | #*.sln merge=binary 26 | #*.csproj merge=binary 27 | #*.vbproj merge=binary 28 | #*.vcxproj merge=binary 29 | #*.vcproj merge=binary 30 | #*.dbproj merge=binary 31 | #*.fsproj merge=binary 32 | #*.lsproj merge=binary 33 | #*.wixproj merge=binary 34 | #*.modelproj merge=binary 35 | #*.sqlproj merge=binary 36 | #*.wwaproj merge=binary 37 | 38 | ############################################################################### 39 | # behavior for image files 40 | # 41 | # image files are treated as binary by default. 42 | ############################################################################### 43 | #*.jpg binary 44 | #*.png binary 45 | #*.gif binary 46 | 47 | ############################################################################### 48 | # diff behavior for common document formats 49 | # 50 | # Convert binary document formats to text before diffing them. This feature 51 | # is only available from the command line. Turn it on by uncommenting the 52 | # entries below. 53 | ############################################################################### 54 | #*.doc diff=astextplain 55 | #*.DOC diff=astextplain 56 | #*.docx diff=astextplain 57 | #*.DOCX diff=astextplain 58 | #*.dot diff=astextplain 59 | #*.DOT diff=astextplain 60 | #*.pdf diff=astextplain 61 | #*.PDF diff=astextplain 62 | #*.rtf diff=astextplain 63 | #*.RTF diff=astextplain 64 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | 4 | # User-specific files 5 | *.suo 6 | *.user 7 | *.userosscache 8 | *.sln.docstates 9 | 10 | # User-specific files (MonoDevelop/Xamarin Studio) 11 | *.userprefs 12 | 13 | # Build results 14 | [Dd]ebug/ 15 | [Dd]ebugPublic/ 16 | [Rr]elease/ 17 | [Rr]eleases/ 18 | x64/ 19 | x86/ 20 | bld/ 21 | [Bb]in/ 22 | [Oo]bj/ 23 | [Ll]og/ 24 | 25 | # Visual Studio 2015 cache/options directory 26 | .vs/ 27 | # Uncomment if you have tasks that create the project's static files in wwwroot 28 | #wwwroot/ 29 | 30 | # MSTest test Results 31 | [Tt]est[Rr]esult*/ 32 | [Bb]uild[Ll]og.* 33 | 34 | # NUNIT 35 | *.VisualState.xml 36 | TestResult.xml 37 | 38 | # Build Results of an ATL Project 39 | [Dd]ebugPS/ 40 | [Rr]eleasePS/ 41 | dlldata.c 42 | 43 | # DNX 44 | project.lock.json 45 | artifacts/ 46 | 47 | *_i.c 48 | *_p.c 49 | *_i.h 50 | *.ilk 51 | *.meta 52 | *.obj 53 | *.pch 54 | *.pdb 55 | *.pgc 56 | *.pgd 57 | *.rsp 58 | *.sbr 59 | *.tlb 60 | *.tli 61 | *.tlh 62 | *.tmp 63 | *.tmp_proj 64 | *.log 65 | *.vspscc 66 | *.vssscc 67 | .builds 68 | *.pidb 69 | *.svclog 70 | *.scc 71 | 72 | # Chutzpah Test files 73 | _Chutzpah* 74 | 75 | # Visual C++ cache files 76 | ipch/ 77 | *.aps 78 | *.ncb 79 | *.opendb 80 | *.opensdf 81 | *.sdf 82 | *.cachefile 83 | *.VC.db 84 | *.VC.VC.opendb 85 | 86 | # Visual Studio profiler 87 | *.psess 88 | *.vsp 89 | *.vspx 90 | *.sap 91 | 92 | # TFS 2012 Local Workspace 93 | $tf/ 94 | 95 | # Guidance Automation Toolkit 96 | *.gpState 97 | 98 | # ReSharper is a .NET coding add-in 99 | _ReSharper*/ 100 | *.[Rr]e[Ss]harper 101 | *.DotSettings.user 102 | 103 | # JustCode is a .NET coding add-in 104 | .JustCode 105 | 106 | # TeamCity is a build add-in 107 | _TeamCity* 108 | 109 | # DotCover is a Code Coverage Tool 110 | *.dotCover 111 | 112 | # NCrunch 113 | _NCrunch_* 114 | .*crunch*.local.xml 115 | nCrunchTemp_* 116 | 117 | # MightyMoose 118 | *.mm.* 119 | AutoTest.Net/ 120 | 121 | # Web workbench (sass) 122 | .sass-cache/ 123 | 124 | # Installshield output folder 125 | [Ee]xpress/ 126 | 127 | # DocProject is a documentation generator add-in 128 | DocProject/buildhelp/ 129 | DocProject/Help/*.HxT 130 | DocProject/Help/*.HxC 131 | DocProject/Help/*.hhc 132 | DocProject/Help/*.hhk 133 | DocProject/Help/*.hhp 134 | DocProject/Help/Html2 135 | DocProject/Help/html 136 | 137 | # Click-Once directory 138 | publish/ 139 | 140 | # Publish Web Output 141 | *.[Pp]ublish.xml 142 | *.azurePubxml 143 | # TODO: Comment the next line if you want to checkin your web deploy settings 144 | # but database connection strings (with potential passwords) will be unencrypted 145 | *.pubxml 146 | *.publishproj 147 | 148 | # Microsoft Azure Web App publish settings. Comment the next line if you want to 149 | # checkin your Azure Web App publish settings, but sensitive information contained 150 | # in these scripts will be unencrypted 151 | PublishScripts/ 152 | 153 | # NuGet Packages 154 | *.nupkg 155 | # The packages folder can be ignored because of Package Restore 156 | **/packages/* 157 | # except build/, which is used as an MSBuild target. 158 | !**/packages/build/ 159 | # Uncomment if necessary however generally it will be regenerated when needed 160 | #!**/packages/repositories.config 161 | # NuGet v3's project.json files produces more ignoreable files 162 | *.nuget.props 163 | *.nuget.targets 164 | 165 | # Microsoft Azure Build Output 166 | csx/ 167 | *.build.csdef 168 | 169 | # Microsoft Azure Emulator 170 | ecf/ 171 | rcf/ 172 | 173 | # Windows Store app package directories and files 174 | AppPackages/ 175 | BundleArtifacts/ 176 | Package.StoreAssociation.xml 177 | _pkginfo.txt 178 | 179 | # Visual Studio cache files 180 | # files ending in .cache can be ignored 181 | *.[Cc]ache 182 | # but keep track of directories ending in .cache 183 | !*.[Cc]ache/ 184 | 185 | # Others 186 | ClientBin/ 187 | ~$* 188 | *~ 189 | *.dbmdl 190 | *.dbproj.schemaview 191 | *.pfx 192 | *.publishsettings 193 | node_modules/ 194 | orleans.codegen.cs 195 | 196 | # Since there are multiple workflows, uncomment next line to ignore bower_components 197 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) 198 | #bower_components/ 199 | 200 | # RIA/Silverlight projects 201 | Generated_Code/ 202 | 203 | # Backup & report files from converting an old project file 204 | # to a newer Visual Studio version. Backup files are not needed, 205 | # because we have git ;-) 206 | _UpgradeReport_Files/ 207 | Backup*/ 208 | UpgradeLog*.XML 209 | UpgradeLog*.htm 210 | 211 | # SQL Server files 212 | *.mdf 213 | *.ldf 214 | 215 | # Business Intelligence projects 216 | *.rdl.data 217 | *.bim.layout 218 | *.bim_*.settings 219 | 220 | # Microsoft Fakes 221 | FakesAssemblies/ 222 | 223 | # GhostDoc plugin setting file 224 | *.GhostDoc.xml 225 | 226 | # Node.js Tools for Visual Studio 227 | .ntvs_analysis.dat 228 | 229 | # Visual Studio 6 build log 230 | *.plg 231 | 232 | # Visual Studio 6 workspace options file 233 | *.opt 234 | 235 | # Visual Studio LightSwitch build output 236 | **/*.HTMLClient/GeneratedArtifacts 237 | **/*.DesktopClient/GeneratedArtifacts 238 | **/*.DesktopClient/ModelManifest.xml 239 | **/*.Server/GeneratedArtifacts 240 | **/*.Server/ModelManifest.xml 241 | _Pvt_Extensions 242 | 243 | # Paket dependency manager 244 | .paket/paket.exe 245 | paket-files/ 246 | 247 | # FAKE - F# Make 248 | .fake/ 249 | 250 | # JetBrains Rider 251 | .idea/ 252 | *.sln.iml 253 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ![icon by xial](http://puu.sh/stg7G/04ad0ed806.png) 2 | 3 | _Icon by [Xial](https://osu.ppy.sh/u/Xial)_ 4 | 5 | # osu!rank 4.5.1 6 | 7 | Small open-source utility to show your rank or compare two players without the need to open the website (osu! and Ripple) 8 | 9 | Requires you to use your own osu! API key (if you want to use the osu! part), available [here](http://osu.ppy.sh/p/api). Just fill in whatever name and website, it's automated. 10 | 11 | Our discord server is located right [here](https://discord.gg/3DkH4q6). Come and say hi (or drop some feedback)! 12 | 13 | [osu!forums topic](https://osu.ppy.sh/forum/t/478865) 14 | 15 | ripple forums topic - as soon as ripple forums come (if they ever come) 16 | 17 | ### Notes to translators: 18 | 19 | **lol forget onesky, please stick to pull requests or stringlists + issues. works well** 20 | 21 | What it can do 22 | -------------- 23 | ### Check your own stats: 24 | * Rank and country rank 25 | * Performance points 26 | * Ranked and total score 27 | * Your level and experience 28 | * Your playcount 29 | * Your SS/S/A 30 | * Your UID <-- mainly to fill the space, but just in case it can still be useful 31 | 32 | ### Compare two players on their: 33 | * Rank 34 | * Ranked and total scores 35 | * Accuracy 36 | * Playcount 37 | * Performance points 38 | 39 | It also displays the avatar of the user. 40 | 41 | What it doesn't do (but might happen if asked, drop an issue if interested) 42 | ------------------------------------ 43 | * Retrieve your top plays 44 | 45 | What it won't ever do 46 | --------------------- 47 | * Compare more than two players (looks quite hard to implement the way I'm doing things) 48 | 49 | If you want to build yourself... 50 | -------------------------------- 51 | You'll need Visual Studio 2015 to open the solution 52 | -------------------------------------------------------------------------------- /osu-rank/.Elas/ElasConfiguration.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | en-US 13 | 14 | 15 | 16 | 17 | 18 | Unmodifiable 19 | 20 | 21 | Unmodifiable 22 | 23 | 24 | Unmodifiable 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /osu-rank/osu-rank.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 14 4 | VisualStudioVersion = 14.0.24720.0 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "osu-rank", "osu-rank\osu-rank.csproj", "{81186FED-8E05-4578-B8D1-B1464A5DD942}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Debug|x64 = Debug|x64 12 | Debug|x86 = Debug|x86 13 | Release|Any CPU = Release|Any CPU 14 | Release|x64 = Release|x64 15 | Release|x86 = Release|x86 16 | EndGlobalSection 17 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 18 | {81186FED-8E05-4578-B8D1-B1464A5DD942}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 19 | {81186FED-8E05-4578-B8D1-B1464A5DD942}.Debug|Any CPU.Build.0 = Debug|Any CPU 20 | {81186FED-8E05-4578-B8D1-B1464A5DD942}.Debug|x64.ActiveCfg = Debug|x64 21 | {81186FED-8E05-4578-B8D1-B1464A5DD942}.Debug|x64.Build.0 = Debug|x64 22 | {81186FED-8E05-4578-B8D1-B1464A5DD942}.Debug|x86.ActiveCfg = Debug|x86 23 | {81186FED-8E05-4578-B8D1-B1464A5DD942}.Debug|x86.Build.0 = Debug|x86 24 | {81186FED-8E05-4578-B8D1-B1464A5DD942}.Release|Any CPU.ActiveCfg = Release|Any CPU 25 | {81186FED-8E05-4578-B8D1-B1464A5DD942}.Release|Any CPU.Build.0 = Release|Any CPU 26 | {81186FED-8E05-4578-B8D1-B1464A5DD942}.Release|x64.ActiveCfg = Release|x64 27 | {81186FED-8E05-4578-B8D1-B1464A5DD942}.Release|x64.Build.0 = Release|x64 28 | {81186FED-8E05-4578-B8D1-B1464A5DD942}.Release|x86.ActiveCfg = Release|x86 29 | {81186FED-8E05-4578-B8D1-B1464A5DD942}.Release|x86.Build.0 = Release|x86 30 | EndGlobalSection 31 | GlobalSection(SolutionProperties) = preSolution 32 | HideSolutionNode = FALSE 33 | EndGlobalSection 34 | EndGlobal 35 | -------------------------------------------------------------------------------- /osu-rank/osu-rank/A@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/otaku-overclocks/osu-rank/a78cddc13148dcd3244dd5348ef1907399fee762/osu-rank/osu-rank/A@2x.png -------------------------------------------------------------------------------- /osu-rank/osu-rank/APis.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using Newtonsoft.Json; 7 | using System.Windows; 8 | using Unclassified.TxLib; 9 | using System.Net.Http; 10 | using System.IO; 11 | 12 | // TODO: Look closely at all possible cases for the get_scores API method on both osu! and Ripple servers 13 | // and return an "universal" format (aka if i accidentally use osu!'s method into a ripple page osu!rank 14 | // doesn't insult me) 15 | // example: get_scores when there's no result: 16 | // - osu! returns `[]` (empty json array) 17 | // - ripple returns `null` (null json value) 18 | // mark's fix with maxIntgr might be of some help... 19 | 20 | namespace osurank 21 | { 22 | // osu!rank related 23 | public class osu 24 | { 25 | static int[] maxIntgr = {int.MaxValue}; 26 | // sync 27 | static public dynamic GetUser(string player, string apikey, int gamemode = 0, bool showErrors = true) 28 | { 29 | if (player != "") 30 | { 31 | try { 32 | dynamic userdata = JsonConvert.DeserializeObject(new System.Net.WebClient().DownloadString("http://osu.ppy.sh/api/get_user?type=string&u=" + player + "&m=" + gamemode + "&k=" + apikey)); 33 | if (Convert.ToString(userdata) == "[]" || userdata == null) 34 | { 35 | if (showErrors == true) MessageBox.Show(Tx.T("errors.Does not exist", "name", player), Tx.T("errors.Error"), MessageBoxButton.OK, MessageBoxImage.Error); 36 | return maxIntgr; 37 | } 38 | else if (userdata[0].pp_rank == null) 39 | { 40 | if (showErrors == true) MessageBox.Show(Tx.T("errors.Did not play yet", "name", player), Tx.T("errors.Error"), MessageBoxButton.OK, MessageBoxImage.Exclamation); 41 | return maxIntgr; 42 | } 43 | else return userdata; 44 | } 45 | catch (Exception) 46 | { 47 | MessageBox.Show(Tx.T("osu rank.Servers unavailable", "server", "osu!"), Tx.T("errors.Error"), MessageBoxButton.OK, MessageBoxImage.Error); 48 | Environment.Exit(0); 49 | return maxIntgr; 50 | } 51 | } 52 | else 53 | { 54 | if (showErrors == true) MessageBox.Show(Tx.T("errors.No name entered"), Tx.T("errors.Error"), MessageBoxButton.OK, MessageBoxImage.Error); 55 | return maxIntgr; 56 | } 57 | } 58 | static public dynamic GetScores(string apikey, int beatmap, int gamemode = 0, string player = "") 59 | { 60 | return JsonConvert.DeserializeObject(new System.Net.WebClient().DownloadString("http://osu.ppy.sh/api/get_scores?type=string&u=" + player + "&m=" + gamemode + "&k=" + apikey + "&b=" + beatmap)); 61 | } 62 | 63 | //async 64 | static public async Task GetUserAsync(string player, string apikey, int gamemode = 0, bool showErrors = true) 65 | { 66 | if (player != "") 67 | { 68 | try 69 | { 70 | dynamic userdata = null; 71 | using (HttpClient apiCall = new HttpClient()) 72 | { 73 | userdata = JsonConvert.DeserializeObject(await apiCall.GetStringAsync("http://osu.ppy.sh/api/get_user?type=string&u=" + player + "&m=" + gamemode + "&k=" + apikey)); 74 | } 75 | if (Convert.ToString(userdata) == "[]" || userdata == null) 76 | { 77 | if (showErrors == true) MessageBox.Show(Tx.T("errors.Does not exist", "name", player), Tx.T("errors.Error"), MessageBoxButton.OK, MessageBoxImage.Error); 78 | return maxIntgr; 79 | } 80 | else if (userdata[0].pp_rank == null) 81 | { 82 | if (showErrors == true) MessageBox.Show(Tx.T("errors.Did not play yet", "name", player), Tx.T("errors.Error"), MessageBoxButton.OK, MessageBoxImage.Exclamation); 83 | return maxIntgr; 84 | } 85 | else return userdata; 86 | } 87 | catch (Exception) 88 | { 89 | MessageBox.Show(Tx.T("osu rank.Servers unavailable", "server", "osu!"), Tx.T("errors.Error"), MessageBoxButton.OK, MessageBoxImage.Error); 90 | Environment.Exit(0); 91 | return maxIntgr; 92 | } 93 | } 94 | else 95 | { 96 | if (showErrors == true) MessageBox.Show(Tx.T("errors.No name entered"), Tx.T("errors.Error"), MessageBoxButton.OK, MessageBoxImage.Error); 97 | return maxIntgr; 98 | } 99 | } 100 | static public async Task GetScoresAsync(string apikey, int beatmap, int gamemode = 0, string player = "") 101 | { 102 | return JsonConvert.DeserializeObject(await new HttpClient().GetStringAsync("http://osu.ppy.sh/api/get_scores?type=string&u=" + player + "&m=" + gamemode + "&k=" + apikey + "&b=" + beatmap)); 103 | } 104 | } 105 | 106 | public class ripple 107 | { 108 | static int[] maxIntgr = { int.MaxValue }; 109 | // sync 110 | static public dynamic GetUser(string player, int gamemode = 0, bool showErrors = true) 111 | { 112 | if (player != "") 113 | { 114 | try 115 | { 116 | dynamic userdata = JsonConvert.DeserializeObject(new System.Net.WebClient().DownloadString("http://ripple.moe/api/get_user?type=string&u=" + player + "&m=" + gamemode)); 117 | if (Convert.ToString(userdata) == "[]" || userdata == null) 118 | { 119 | if (showErrors == true) MessageBox.Show(Tx.T("errors.Does not exist", "name", player), Tx.T("errors.Error"), MessageBoxButton.OK, MessageBoxImage.Error); 120 | return maxIntgr; 121 | } 122 | else if (userdata[0].pp_rank == null) 123 | { 124 | if (showErrors == true) MessageBox.Show(Tx.T("errors.Did not play yet", "name", player), Tx.T("errors.Error"), MessageBoxButton.OK, MessageBoxImage.Exclamation); 125 | return maxIntgr; 126 | } 127 | else return userdata; 128 | } 129 | catch (Exception) 130 | { 131 | MessageBox.Show(Tx.T("osu rank.Servers unavailable", "server", "Ripple"), Tx.T("errors.Error"), MessageBoxButton.OK, MessageBoxImage.Error); 132 | Environment.Exit(0); 133 | return maxIntgr; 134 | } 135 | } 136 | else 137 | { 138 | if (showErrors == true) MessageBox.Show(Tx.T("errors.No name entered"), Tx.T("errors.Error"), MessageBoxButton.OK, MessageBoxImage.Error); 139 | return maxIntgr; 140 | } 141 | } 142 | static public dynamic GetScores(int beatmap, int gamemode = 0, string player = "") 143 | { 144 | return JsonConvert.DeserializeObject(new System.Net.WebClient().DownloadString("http://ripple.moe/api/get_scores?type=string&u=" + player + "&m=" + gamemode + "&b=" + beatmap)); 145 | } 146 | 147 | //async 148 | static public async Task GetUserAsync(string player, int gamemode = 0, bool showErrors = true) 149 | { 150 | if (player != "") 151 | { 152 | try 153 | { 154 | dynamic userdata = null; 155 | using (HttpClient apiCall = new HttpClient()) 156 | { 157 | userdata = JsonConvert.DeserializeObject(await apiCall.GetStringAsync("http://ripple.moe/api/get_user?type=string&u=" + player + "&m=" + gamemode)); 158 | } 159 | if (Convert.ToString(userdata) == "[]" || userdata == null) 160 | { 161 | if (showErrors == true) MessageBox.Show(Tx.T("errors.Does not exist", "name", player), Tx.T("errors.Error"), MessageBoxButton.OK, MessageBoxImage.Error); 162 | return maxIntgr; 163 | } 164 | else if (userdata[0].pp_rank == null) 165 | { 166 | if (showErrors == true) MessageBox.Show(Tx.T("errors.Did not play yet", "name", player), Tx.T("errors.Error"), MessageBoxButton.OK, MessageBoxImage.Exclamation); 167 | return maxIntgr; 168 | } 169 | else return userdata; 170 | } 171 | catch (Exception) 172 | { 173 | MessageBox.Show(Tx.T("osu rank.Servers unavailable","server","Ripple"), Tx.T("errors.Error"), MessageBoxButton.OK, MessageBoxImage.Error); 174 | Environment.Exit(0); 175 | return maxIntgr; 176 | } 177 | } 178 | else 179 | { 180 | if (showErrors == true) MessageBox.Show(Tx.T("errors.No name entered"), Tx.T("errors.Error"), MessageBoxButton.OK, MessageBoxImage.Error); 181 | return maxIntgr; 182 | } 183 | } 184 | static public async Task GetScoresAsync(int beatmap, int gamemode = 0, string player = "") 185 | { 186 | return JsonConvert.DeserializeObject(await new HttpClient().GetStringAsync("http://ripple.moe/api/get_scores?type=string&u=" + player + "&m=" + gamemode + "&b=" + beatmap)); 187 | } 188 | } 189 | 190 | // helper 191 | public static class WebUtils 192 | { 193 | public static Task DownloadAsync(string requestUri, string filename) 194 | { 195 | if (requestUri == null) 196 | throw new ArgumentNullException("requestUri"); 197 | 198 | return DownloadAsync(new Uri(requestUri), filename); 199 | } 200 | 201 | public static async Task DownloadAsync(Uri requestUri, string filename) 202 | { 203 | if (filename == null) 204 | throw new ArgumentNullException("filename"); 205 | 206 | using (var httpClient = new HttpClient()) 207 | { 208 | using (var request = new HttpRequestMessage(HttpMethod.Get, requestUri)) 209 | { 210 | using ( 211 | Stream contentStream = await (await httpClient.SendAsync(request)).Content.ReadAsStreamAsync(), 212 | stream = new FileStream(filename, FileMode.Create, FileAccess.Write, FileShare.None, 4096, true)) 213 | { 214 | await contentStream.CopyToAsync(stream); 215 | } 216 | } 217 | } 218 | } 219 | } 220 | } 221 | -------------------------------------------------------------------------------- /osu-rank/osu-rank/About.xaml: -------------------------------------------------------------------------------- 1 |  16 | 17 | 18 | 64 | 65 | -------------------------------------------------------------------------------- /osu-rank/osu-rank/About.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Diagnostics; 4 | using System.Linq; 5 | using System.Reflection; 6 | using System.Text; 7 | using System.Threading.Tasks; 8 | using System.Windows; 9 | using System.Windows.Controls; 10 | using System.Windows.Data; 11 | using System.Windows.Documents; 12 | using System.Windows.Input; 13 | using System.Windows.Media; 14 | using System.Windows.Media.Imaging; 15 | using System.Windows.Navigation; 16 | using System.Windows.Shapes; 17 | 18 | namespace osurank 19 | { 20 | /// 21 | /// Logique d'interaction pour About.xaml 22 | /// 23 | public partial class About : Page 24 | { 25 | public About() 26 | { 27 | InitializeComponent(); 28 | about.Content = "osu!rank " + Assembly.GetExecutingAssembly().GetName().Version.Major 29 | + "." + Assembly.GetExecutingAssembly().GetName().Version.Minor 30 | + "." + Assembly.GetExecutingAssembly().GetName().Version.Build; 31 | } 32 | 33 | private void page_loaded(object sender, RoutedEventArgs e) 34 | { 35 | RenderOptions.SetBitmapScalingMode(osuSmall, BitmapScalingMode.HighQuality); 36 | RenderOptions.SetBitmapScalingMode(stdSmall, BitmapScalingMode.HighQuality); 37 | } 38 | 39 | private void goTopic_Click(object sender, RoutedEventArgs e) 40 | { 41 | Process.Start("https://osu.ppy.sh/forum/t/478865"); 42 | } 43 | 44 | private void goGeetHub_Click(object sender, RoutedEventArgs e) 45 | { 46 | Process.Start("https://github.com/Jeremiidesu/osu-rank"); 47 | } 48 | 49 | private void reportBug_Click(object sender, RoutedEventArgs e) 50 | { 51 | Process.Start("https://github.com/Jeremiidesu/osu-rank/issues"); 52 | } 53 | 54 | private void goContribute_Click(object sender, RoutedEventArgs e) 55 | { 56 | Process.Start("https://github.com/Jeremiidesu/osu-rank/tree/master/osu-rank/osu-rank/Stringlists"); 57 | } 58 | 59 | private void goXial_Click(object sender, RoutedEventArgs e) 60 | { 61 | Process.Start("https://osu.ppy.sh/u/Xial"); 62 | } 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /osu-rank/osu-rank/App.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 |
6 |
7 | 8 | 9 |
10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | OneUser 19 | 20 | 21 | 22 | 23 | 24 | True 25 | 26 | 27 | 15 28 | 29 | 30 | peppy 31 | 32 | 33 | Cookiezi 34 | 35 | 36 | 0 37 | 38 | 39 | False 40 | 41 | 42 | 43 | 44 | 45 | True 46 | 47 | 48 | False 49 | 50 | 51 | 52 | 53 | OneUser 54 | 55 | 56 | 57 | 58 | 59 | 60 | 5eaf09f888b192ed8d4a81b7ff3f531f508d87c9 61 | 62 | 63 | 64 | 65 | -------------------------------------------------------------------------------- /osu-rank/osu-rank/App.xaml: -------------------------------------------------------------------------------- 1 |  8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 |