[Structs] Complete client_t

This commit is contained in:
Diavolo
2022-08-20 12:30:34 +02:00
parent 28b089f070
commit 6276ef2e24
7 changed files with 53 additions and 20 deletions

View File

@ -294,7 +294,8 @@ namespace Components
Bots::Bots()
{
AssertOffset(Game::client_s, bIsTestClient, 0x41AF0);
AssertOffset(Game::client_t, bIsTestClient, 0x41AF0);
AssertOffset(Game::client_t, ping, 0x212C8);
// Replace connect string
Utils::Hook::Set<const char*>(0x48ADA6, "connect bot%d \"\\cg_predictItems\\1\\cl_anonymous\\0\\color\\4\\head\\default\\model\\multi\\snaps\\20\\rate\\5000\\name\\%s\\protocol\\%d\\checksum\\%d\\statver\\%d %u\\qport\\%d\"");

View File

@ -410,6 +410,8 @@ namespace Components
Chat::Chat()
{
AssertOffset(Game::client_t, steamID, 0x43F00);
cg_chatWidth = Dvar::Register<int>("cg_chatWidth", 52, 1, std::numeric_limits<int>::max(), Game::DVAR_ARCHIVE, "The normalized maximum width of a chat message");
sv_disableChat = Dvar::Register<bool>("sv_disableChat", false, Game::DVAR_NONE, "Disable chat messages from clients");
Events::OnSVInit(AddChatCommands);

View File

@ -761,13 +761,13 @@ namespace Components
else
{
// Score and ping are irrelevant
const char* namePtr = Game::PartyHost_GetMemberName(reinterpret_cast<Game::PartyData*>(0x1081C00), i);
const char* namePtr = Game::PartyHost_GetMemberName(Game::g_lobbyData, i);
if (!namePtr || !namePtr[0]) continue;
playerInfo["name"] = namePtr;
}
players.push_back(playerInfo);
players.emplace_back(playerInfo);
}
info["players"] = players;

View File

@ -276,7 +276,7 @@ namespace Components
const auto* ent = Game::GetPlayerEntity(entref);
auto* client = Script::GetClient(ent);
client->ping = static_cast<int16_t>(ping);
client->ping = ping;
});
}

View File

@ -70,7 +70,7 @@ namespace Components
// set snapshot num to 1 behind (T6 does this, why shouldn't we?)
for (int i = 0; i < *Game::svs_clientCount; ++i)
{
Game::svs_clients[i].snapNum = *Game::svs_time - 1;
Game::svs_clients[i].nextSnapshotTime = *Game::svs_time - 1;
}
}