Francesco149 / ojsama

pure javascript implementation of https://github.com/Francesco149/oppai-ng
The Unlicense
26 stars 7 forks source link

"NotImplementedError: this gamemode is not yet supported" on all gamemodes when feeding file #9

Closed pfych closed 5 years ago

pfych commented 5 years ago

I have a function that downloads a map, unzips the osz and returns the path of the first .osu in the unzipped directory.

with downloadMapData() getting the .osz and returing something like /path/to/map.osz and getMapData() getting the .osu and returing something like /path/to/map.osu

Here is the code for my function

async function tests() {
  let id = "573700"
  let path = filePath.resolve(__dirname, await getMapData(await downloadMapData(id)))
  let parser = new osu.parser();

  await fs.readFile(path, "utf8",  (err, file) => {
    if (err) console.log(err);
    parser.feed(file)
    console.log(osu.ppv2({map: parser.map}).toString()); 
    // Do stuff
  })
}

However, When running with either a Mania or Standard map I get the error NotImplementedError: this gamemode is not yet supported

I know that I am doing something wrong but I cant figure it out.

Francesco149 commented 5 years ago

for the mania map it would be correct as this calculator only support std at the moment. are you sure it fails on std maps too though? could you send me a sample osu file that fails?

also, do you really need to download the entire .osz? cause you can get the .osu file by itself at https://osu.ppy.sh/osu/difficulty_id

pfych commented 5 years ago

I just ran a test again and it all seems to work fine with std, My bad.

Sucks about the mania issue, I might fork and try implementing this: https://docs.google.com/document/d/1RJfGKcXfiiA7uMaIROzY3VF9mgexAgVsS1Ls2ADTojM/ As I think this is what is in use right now.