holly-hacker / oppaisharp Goto Github PK
View Code? Open in Web Editor NEWA C# port of oppai-ng
License: The Unlicense
A C# port of oppai-ng
License: The Unlicense
If your system culture settings don't match osu's beatmap format (for example separator is ',' instead of '.') float parsing will fail with Input string was not in a correct format.
This fails when count300 is negative with Either countObjects or Count300 must be specified
. Example would be inputting an unfinished (failed) score.
oppai-ng is handling this properly.
Some values changed. Reminder
when doing the example program on README.md, but instead of passing c100: 8 we pass c100: beatmap.CountCircles
the resulting pp will be of a 100% acc play
Alternatively, if a value higher than beatmap.CountCircles is passed Either countObjects or Count300 must be specified
will be thrown
Tested with https://osu.ppy.sh/b/706711
2 ranked:
https://osu.ppy.sh/b/1391940
https://github.com/HoLLy-HaCKeR/OppaiSharp/blob/master/OppaiSharp/Parser.cs#L182
I also have several modified/unmodified submited/unsubmited maps that simply fail to parse, while osu has no problems with them. 141(of with 99 is one huge mappack) of them to be specific. Should I also include these?
code used for testing:
public void run(){
var maps = Directory.GetFiles(@"D:\Random\OppaiFailedMaps\");
DiffCalc diffCalculator = new DiffCalc();
foreach (var filelocation in maps)
{
var fileinfo = new FileInfo(filelocation);
if (fileinfo.Length == 0) continue;
Console.WriteLine(filelocation);
using (var stream = new FileStream(filelocation, FileMode.Open))
{
using (var reader = new StreamReader(stream))
{
var beatmap = Beatmap.Read(reader);
var beatmapCalc = diffCalculator.Calc(beatmap, Mods.NoMod);
new PPv2(beatmapCalc.Aim, beatmapCalc.Speed, beatmap);
if (beatmap.Objects.Count > 0) //crashes when beatmap has no objects
{
GetPp(beatmap, 99.9d);
GetPp(beatmap, 99d);
GetPp(beatmap, 98d);
GetPp(beatmap, 95d);
GetPp(beatmap, 90d);
}
}
}
}
}
public double GetPp(Beatmap beatmap, double acc)
{
Accuracy _accCalculator = new Accuracy(acc, beatmap.Objects.Count, 0);
PPv2 _ppCalculator = new PPv2(new PPv2Parameters(beatmap, _accCalculator.Count100, _accCalculator.Count50, _accCalculator.CountMiss, -1, _accCalculator.Count300));
return Math.Round(_ppCalculator.Total, 2);
}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.