diff --git a/Release/Plugins/RenX.Core.lib b/Release/Plugins/RenX.Core.lib index 9a3bc6f..8f82da1 100644 Binary files a/Release/Plugins/RenX.Core.lib and b/Release/Plugins/RenX.Core.lib differ diff --git a/RenX.Core/RenX_BanDatabase.cpp b/RenX.Core/RenX_BanDatabase.cpp index 8f372cb..e1d640a 100644 --- a/RenX.Core/RenX_BanDatabase.cpp +++ b/RenX.Core/RenX_BanDatabase.cpp @@ -37,6 +37,9 @@ bool RenX::BanDatabase::load(const Jupiter::ReadableString &fname) while (!feof(file)) if (fgetc(file) == '\n') break; + Jupiter::String playerName(16); + Jupiter::String key(32); + Jupiter::String value(32); Entry *entry; char c; while (!feof(file)) @@ -57,12 +60,36 @@ bool RenX::BanDatabase::load(const Jupiter::ReadableString &fname) { if (c == '\0') { - // add plugin data. + key.truncate(key.size()); + value.truncate(value.size()); + c = fgetc(file); + while (c != '\n' && c != EOF) + { + while (c != '\0') + { + key += c; + c = fgetc(file); + if (c == EOF) + { + fprintf(stderr, "ERROR: Unexpected EOF in %s at %lu", RenX::BanDatabase::filename.c_str(), ftell(file)); + break; + } + } + c = fgetc(file); + while (c != '\n' && c != EOF) + { + value += c; + c = fgetc(file); + } + entry->varData.set(key, value); + c = fgetc(file); + } break; } - entry->name += c; + playerName += c; c = fgetc(file); } + entry->name = playerName; entries.add(entry); } fclose(file); diff --git a/RenX.Core/RenX_BanDatabase.h b/RenX.Core/RenX_BanDatabase.h index 491c6eb..ec24102 100644 --- a/RenX.Core/RenX_BanDatabase.h +++ b/RenX.Core/RenX_BanDatabase.h @@ -52,6 +52,7 @@ namespace RenX uint64_t steamid /** SteamID of the banned player */; uint32_t ip /** IPv4 address of the banned player */; Jupiter::StringS name /** Name of the banned player */; + Jupiter::INIFile::Section varData; /** Variable entry data */ }; /**