Skip to content

Commit

Permalink
2022052400 support
Browse files Browse the repository at this point in the history
  • Loading branch information
Meta-link committed Aug 20, 2022
1 parent 7ea7570 commit 62521b2
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 10 deletions.
47 changes: 37 additions & 10 deletions jubeat-hook/dllmain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ void printDebug(auto str)

void ChartDump()
{
printf(" === TUNE %i ===\n", currentSong - 1);
printf(" === TUNE %i ===\n", currentSong + 1);
printf("Song ID = %i\n", chart->ChartId);
printf("Song difficulty = %s\n", Difficulty[chart->ChartDifficulty]);
printf("Song level = %i.%i\n", chart->ChartLevel, chart->ChartDecimal);
Expand Down Expand Up @@ -203,15 +203,21 @@ void ProcessScore()
try
{
KamaiResponse = json::parse(r.text);
r = cpr::Get(cpr::Url{ KamaiResponse["body"]["url"] });

KamaiResponse = json::parse(r.text);
printDebug(KamaiResponse["description"]);

if (!KamaiResponse["body"]["import"]["errors"].empty())
if (KamaiResponse["success"] == true)
{
r = cpr::Get(cpr::Url{ KamaiResponse["body"]["url"] });
KamaiResponse = json::parse(r.text);
printDebug(KamaiResponse["description"]);

if (!KamaiResponse["body"]["import"]["errors"].empty())
{
printDebug("Error :");
printDebug(KamaiResponse["body"]["import"]["errors"][0]["message"]);
}
}
else
{
printDebug("Error :");
printDebug(KamaiResponse["body"]["import"]["errors"][0]["message"]);
printDebug(KamaiResponse["description"]);
}
}
catch (json::parse_error& e)
Expand Down Expand Up @@ -248,7 +254,28 @@ DWORD WINAPI InitHook(LPVOID dllInstance)

XMLDocument doc;
doc.LoadFile("prop/ea3-config.xml");
const char* dateCode = doc.FirstChildElement("ea3")->FirstChildElement("soft")->FirstChildElement("ext")->GetText();

const char* dateCode;
printDebug("Parsing ea3-config.xml to find datecode");
if (doc.FirstChildElement("ea3")->FirstChildElement("soft") != NULL)
{
dateCode = doc.FirstChildElement("ea3")->FirstChildElement("soft")->FirstChildElement("ext")->GetText();
}
else
{
printDebug("Parsing ea3-ident.xml to find datecode");
doc.LoadFile("prop/ea3-ident.xml");
if (doc.FirstChildElement("ea3_conf") != NULL)
{
dateCode = doc.FirstChildElement("ea3_conf")->FirstChildElement("soft")->FirstChildElement("ext")->GetText();
}
else
{
printDebug("No valid XML to parse, exiting now ...");
return EXIT_FAILURE;
}
}

printDebug("Datecode : " + (string)dateCode);

for (int i = 0; i < sizeof(GameAdresses) / sizeof(GameAdresses[0]); i++)
Expand Down
1 change: 1 addition & 0 deletions jubeat-hook/jubeat-hook.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ struct Adresses GameAdresses[] = {
{"2018070901", 0xBDF8B6C, 0xBDC0F5F, 0xBDB4E18, 0xBDDF5B4, 0xBDC2730, clan},
//festo
{"2018112702", 0x1074F860, 0xF50A6C, 0x11C5E60, 0x122C104, 0xF579C0, festo},
{"2022052400", 0x107752C0, 0xF93084, 0x120D190, 0x124EC64, 0xF9A6C0, festo},
};

const int32_t ScoreSize = 0xA0;
Expand Down

0 comments on commit 62521b2

Please sign in to comment.