diff --git a/Bot/Main.cpp b/Bot/Main.cpp index 1b4dc01..d2f2505 100644 --- a/Bot/Main.cpp +++ b/Bot/Main.cpp @@ -50,15 +50,13 @@ void onExit() void inputLoop() { - const size_t inputSize = 1024; - char *input = new char[inputSize]; + char input[2048]; while (ftell(stdin) != -1) // This can be expanded later to check for EBADF specifically. { - fgets(input, inputSize, stdin); + fgets(input, sizeof(input), stdin); input[strcspn(input, "\r\n")] = 0; inputQueue.enqueue(input); } - delete[] input; } int main(int argc, const char **args) @@ -149,7 +147,7 @@ int main(int argc, const char **args) Jupiter_checkTimers(); serverManager->think(); Jupiter::ReferenceString input = (const char *)inputQueue.dequeue(); - if (input != nullptr) + if (input.isNotEmpty()) { Jupiter::ReferenceString command = input.getWord(0, WHITESPACE); diff --git a/Release/Bot.lib b/Release/Bot.lib index 42759c5..0df49a8 100644 Binary files a/Release/Bot.lib and b/Release/Bot.lib differ diff --git a/Release/Plugins/RenX.Core.lib b/Release/Plugins/RenX.Core.lib index 2b39927..e242396 100644 Binary files a/Release/Plugins/RenX.Core.lib and b/Release/Plugins/RenX.Core.lib differ diff --git a/RenX.Core/RenX_Tags.cpp b/RenX.Core/RenX_Tags.cpp index 9818f66..a09d7ab 100644 --- a/RenX.Core/RenX_Tags.cpp +++ b/RenX.Core/RenX_Tags.cpp @@ -628,7 +628,7 @@ void TagsImp::processTags(Jupiter::StringType &msg, const RenX::LadderDatabase:: PROCESS_TAG(this->INTERNAL_GDI_LOSSES_TAG, Jupiter::StringS::Format("%u", entry.total_gdi_games - entry.total_gdi_wins - entry.total_gdi_ties)); PROCESS_TAG(this->INTERNAL_GDI_WIN_LOSS_RATIO_TAG, Jupiter::StringS::Format("%.2f", get_ratio(static_cast(entry.total_gdi_wins), static_cast(entry.total_gdi_games - entry.total_gdi_wins - entry.total_gdi_ties)))); PROCESS_TAG(this->INTERNAL_GDI_SCORE_TAG, Jupiter::StringS::Format("%llu", entry.total_gdi_score)); - PROCESS_TAG(this->INTERNAL_GDI_SPM_TAG, Jupiter::StringS::Format("%u", get_ratio(static_cast(entry.total_gdi_score), static_cast(entry.total_gdi_game_time)))); + PROCESS_TAG(this->INTERNAL_GDI_SPM_TAG, Jupiter::StringS::Format("%.2f", get_ratio(static_cast(entry.total_gdi_score), static_cast(entry.total_gdi_game_time) / 60.0))); PROCESS_TAG(this->INTERNAL_GDI_GAME_TIME_TAG, Jupiter::StringS::Format("%u", entry.total_gdi_game_time)); PROCESS_TAG(this->INTERNAL_GDI_TIES_TAG, Jupiter::StringS::Format("%u", entry.total_gdi_ties)); PROCESS_TAG(this->INTERNAL_GDI_BEACON_PLACEMENTS_TAG, Jupiter::StringS::Format("%u", entry.total_gdi_beacon_placements)); @@ -651,7 +651,7 @@ void TagsImp::processTags(Jupiter::StringType &msg, const RenX::LadderDatabase:: PROCESS_TAG(this->INTERNAL_NOD_LOSSES_TAG, Jupiter::StringS::Format("%u", entry.total_nod_games - entry.total_nod_wins - entry.total_nod_ties)); PROCESS_TAG(this->INTERNAL_NOD_WIN_LOSS_RATIO_TAG, Jupiter::StringS::Format("%.2f", get_ratio(static_cast(entry.total_nod_wins), static_cast(entry.total_nod_games - entry.total_nod_wins - entry.total_nod_ties)))); PROCESS_TAG(this->INTERNAL_NOD_SCORE_TAG, Jupiter::StringS::Format("%llu", entry.total_nod_score)); - PROCESS_TAG(this->INTERNAL_NOD_SPM_TAG, Jupiter::StringS::Format("%u", get_ratio(static_cast(entry.total_nod_score), static_cast(entry.total_nod_game_time)))); + PROCESS_TAG(this->INTERNAL_NOD_SPM_TAG, Jupiter::StringS::Format("%.2f", get_ratio(static_cast(entry.total_nod_score), static_cast(entry.total_nod_game_time) / 60.0))); PROCESS_TAG(this->INTERNAL_NOD_GAME_TIME_TAG, Jupiter::StringS::Format("%u", entry.total_nod_game_time)); PROCESS_TAG(this->INTERNAL_NOD_TIES_TAG, Jupiter::StringS::Format("%u", entry.total_nod_ties)); PROCESS_TAG(this->INTERNAL_NOD_BEACON_PLACEMENTS_TAG, Jupiter::StringS::Format("%u", entry.total_nod_beacon_placements));