[Stats] Correctly write stats to file (not steam's remote storage)

This commit is contained in:
momo5502 2017-06-29 15:54:40 +02:00
parent 5351472f74
commit 676866ca54
4 changed files with 25 additions and 18 deletions

View File

@ -4,12 +4,6 @@ namespace Components
{
int QuickPatch::FrameTime = 0;
int64_t* QuickPatch::GetStatsID()
{
static int64_t id = 0x110000100001337;
return &id;
}
void QuickPatch::UnlockStats()
{
if (Dedicated::IsEnabled()) return;
@ -401,16 +395,6 @@ namespace Components
}
});
// Rename stat file
Utils::Hook::SetString(0x71C048, "iw4x.stat");
// Patch stats steamid
Utils::Hook::Nop(0x682EBF, 20);
Utils::Hook::Nop(0x6830B1, 20);
Utils::Hook(0x682EBF, QuickPatch::GetStatsID, HOOK_CALL).install()->quick();
Utils::Hook(0x6830B1, QuickPatch::GetStatsID, HOOK_CALL).install()->quick();
//Utils::Hook::Set<BYTE>(0x68323A, 0xEB);
// Exploit fixes
Utils::Hook::Set<BYTE>(0x412370, 0xC3); // SV_SteamAuthClient
Utils::Hook::Set<BYTE>(0x5A8C70, 0xC3); // CL_HandleRelayPacket

View File

@ -16,8 +16,6 @@ namespace Components
private:
static int FrameTime;
static int64_t* GetStatsID();
static void SelectStringTableEntryInDvarStub();
static int MsgReadBitsCompressCheckSV(const char *from, char *to, int size);

View File

@ -2,6 +2,12 @@
namespace Components
{
int64_t* Stats::GetStatsID()
{
static int64_t id = 0x110000100001337;
return &id;
}
bool Stats::IsMaxLevel()
{
// 2516000 should be the max experience.
@ -69,6 +75,24 @@ namespace Components
Utils::Hook::Set<BYTE>(0x4376FD, 0xEB);
// ToDo: Allow playerdata changes in setPlayerData UI script.
// Rename stat file
Utils::Hook::SetString(0x71C048, "iw4x.stat");
// Patch stats steamid
Utils::Hook::Nop(0x682EBF, 20);
Utils::Hook::Nop(0x6830B1, 20);
Utils::Hook(0x682EBF, Stats::GetStatsID, HOOK_CALL).install()->quick();
Utils::Hook(0x6830B1, Stats::GetStatsID, HOOK_CALL).install()->quick();
//Utils::Hook::Set<BYTE>(0x68323A, 0xEB);
// Never use remote stat saving
Utils::Hook::Set<BYTE>(0x682F39, 0xEB);
// Don't create stat backup
Utils::Hook::Nop(0x402CE6, 2);
}
Stats::~Stats()

View File

@ -14,5 +14,6 @@ namespace Components
static void UpdateClasses(UIScript::Token token);
static void SendStats();
static int64_t* GetStatsID();
};
}