[Stats] Optimize stat reuploading and maxlevel function

This commit is contained in:
momo5502
2017-02-28 11:40:33 +01:00
parent 4651c3476f
commit 1267a4a9f3
3 changed files with 24 additions and 16 deletions

View File

@ -17,6 +17,7 @@ namespace Game
CL_DownloadsComplete_t CL_DownloadsComplete = CL_DownloadsComplete_t(0x42CE90);
CL_DrawStretchPicPhysical_t CL_DrawStretchPicPhysical = CL_DrawStretchPicPhysical_t(0x4FC120);
CL_GetConfigString_t CL_GetConfigString = CL_GetConfigString_t(0x44ADB0);
CL_GetMaxRank_t CL_GetMaxRank = CL_GetMaxRank_t(0x44BA30);
CL_GetRankForXP_t CL_GetRankForXP = CL_GetRankForXP_t(0x4FF8A0);
CL_GetRankIcon_t CL_GetRankIcon = CL_GetRankIcon_t(0x4A7B30);
CL_HandleRelayPacket_t CL_HandleRelayPacket = CL_HandleRelayPacket_t(0x5A8C70);
@ -231,6 +232,8 @@ namespace Game
Steam_JoinLobby_t Steam_JoinLobby = Steam_JoinLobby_t(0x49CF70);
StringTable_Lookup_t StringTable_Lookup = StringTable_Lookup_t(0x42F0E0);
SV_GameClientNum_Score_t SV_GameClientNum_Score = SV_GameClientNum_Score_t(0x469AC0);
SV_GameSendServerCommand_t SV_GameSendServerCommand = SV_GameSendServerCommand_t(0x4BC3A0);
SV_Cmd_TokenizeString_t SV_Cmd_TokenizeString = SV_Cmd_TokenizeString_t(0x4B5780);
@ -722,4 +725,11 @@ namespace Game
g_parse[1056 * *(reinterpret_cast<DWORD*>(g_parse) + 4224) + 1032] = parse != 0;
}
}
int CL_GetMaxXP()
{
StringTable* rankTable = DB_FindXAssetHeader(ASSET_TYPE_STRINGTABLE, "mp/rankTable.csv").stringTable;
const char* maxrank = StringTable_Lookup(rankTable, 0, "maxrank", 1);
return atoi(StringTable_Lookup(rankTable, 0, maxrank, 7));
}
}

View File

@ -38,6 +38,9 @@ namespace Game
typedef const char*(_cdecl* CL_GetConfigString_t)(int index);
extern CL_GetConfigString_t CL_GetConfigString;
typedef int(_cdecl* CL_GetMaxRank_t)();
extern CL_GetMaxRank_t CL_GetMaxRank;
typedef int(_cdecl* CL_GetRankForXP_t)(int xp);
extern CL_GetRankForXP_t CL_GetRankForXP;
@ -553,6 +556,9 @@ namespace Game
typedef void(__cdecl * Steam_JoinLobby_t)(SteamID, char);
extern Steam_JoinLobby_t Steam_JoinLobby;
typedef const char*(__cdecl * StringTable_Lookup_t)(StringTable *table, const int comparisonColumn, const char *value, const int valueColumn);
extern StringTable_Lookup_t StringTable_Lookup;
typedef int(__cdecl* SV_GameClientNum_Score_t)(int clientID);
extern SV_GameClientNum_Score_t SV_GameClientNum_Score;
@ -759,4 +765,6 @@ namespace Game
char* Com_GetParseThreadInfo();
void Com_SetParseNegativeNumbers(int parse);
int CL_GetMaxXP();
}