[Stats] Correctly write stats to file (not steam's remote storage)
This commit is contained in:
parent
5351472f74
commit
676866ca54
@ -4,12 +4,6 @@ namespace Components
|
|||||||
{
|
{
|
||||||
int QuickPatch::FrameTime = 0;
|
int QuickPatch::FrameTime = 0;
|
||||||
|
|
||||||
int64_t* QuickPatch::GetStatsID()
|
|
||||||
{
|
|
||||||
static int64_t id = 0x110000100001337;
|
|
||||||
return &id;
|
|
||||||
}
|
|
||||||
|
|
||||||
void QuickPatch::UnlockStats()
|
void QuickPatch::UnlockStats()
|
||||||
{
|
{
|
||||||
if (Dedicated::IsEnabled()) return;
|
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
|
// Exploit fixes
|
||||||
Utils::Hook::Set<BYTE>(0x412370, 0xC3); // SV_SteamAuthClient
|
Utils::Hook::Set<BYTE>(0x412370, 0xC3); // SV_SteamAuthClient
|
||||||
Utils::Hook::Set<BYTE>(0x5A8C70, 0xC3); // CL_HandleRelayPacket
|
Utils::Hook::Set<BYTE>(0x5A8C70, 0xC3); // CL_HandleRelayPacket
|
||||||
|
@ -16,8 +16,6 @@ namespace Components
|
|||||||
private:
|
private:
|
||||||
static int FrameTime;
|
static int FrameTime;
|
||||||
|
|
||||||
static int64_t* GetStatsID();
|
|
||||||
|
|
||||||
static void SelectStringTableEntryInDvarStub();
|
static void SelectStringTableEntryInDvarStub();
|
||||||
|
|
||||||
static int MsgReadBitsCompressCheckSV(const char *from, char *to, int size);
|
static int MsgReadBitsCompressCheckSV(const char *from, char *to, int size);
|
||||||
|
@ -2,6 +2,12 @@
|
|||||||
|
|
||||||
namespace Components
|
namespace Components
|
||||||
{
|
{
|
||||||
|
int64_t* Stats::GetStatsID()
|
||||||
|
{
|
||||||
|
static int64_t id = 0x110000100001337;
|
||||||
|
return &id;
|
||||||
|
}
|
||||||
|
|
||||||
bool Stats::IsMaxLevel()
|
bool Stats::IsMaxLevel()
|
||||||
{
|
{
|
||||||
// 2516000 should be the max experience.
|
// 2516000 should be the max experience.
|
||||||
@ -69,6 +75,24 @@ namespace Components
|
|||||||
Utils::Hook::Set<BYTE>(0x4376FD, 0xEB);
|
Utils::Hook::Set<BYTE>(0x4376FD, 0xEB);
|
||||||
|
|
||||||
// ToDo: Allow playerdata changes in setPlayerData UI script.
|
// 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()
|
Stats::~Stats()
|
||||||
|
@ -14,5 +14,6 @@ namespace Components
|
|||||||
static void UpdateClasses(UIScript::Token token);
|
static void UpdateClasses(UIScript::Token token);
|
||||||
static void SendStats();
|
static void SendStats();
|
||||||
|
|
||||||
|
static int64_t* GetStatsID();
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user