Skip to content

Commit

Permalink
Use new protobuf access method
Browse files Browse the repository at this point in the history
  • Loading branch information
komashchenko committed Jun 15, 2024
1 parent 231653c commit e71d4d6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/client_cvar_value.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ PLUGIN_EXPOSE(ClientCvarValue, g_ClientCvarValue);

IVEngineServer2* engine = nullptr;

SH_DECL_MANUALHOOK1(OnProcessRespondCvarValue, ProcessRespondCvarValueOffset, 0, 0, bool, const CCLCMsg_RespondCvarValue&);
SH_DECL_MANUALHOOK1(OnProcessRespondCvarValue, ProcessRespondCvarValueOffset, 0, 0, bool, const CNetMessagePB<CCLCMsg_RespondCvarValue>&);
SH_DECL_HOOK6_void(ISource2GameClients, OnClientConnected, SH_NOATTRIB, 0, CPlayerSlot, char const*, uint64, const char*, const char*, bool);
SH_DECL_HOOK5_void(ISource2GameClients, ClientDisconnect, SH_NOATTRIB, 0, CPlayerSlot, ENetworkDisconnectionReason, const char*, uint64, const char*);

Expand Down Expand Up @@ -78,7 +78,7 @@ void* ClientCvarValue::OnMetamodQuery(const char* iface, int* ret)
return nullptr;
}

bool ClientCvarValue::OnProcessRespondCvarValue(const CCLCMsg_RespondCvarValue& msg)
bool ClientCvarValue::OnProcessRespondCvarValue(const CNetMessagePB<CCLCMsg_RespondCvarValue>& msg)
{
int nSlot = DynLibUtils::CMemory(META_IFACEPTR(void)).Offset(ClientSlotOffset).GetValue<int>();

Expand Down
3 changes: 2 additions & 1 deletion src/client_cvar_value.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#include <sh_vector.h>
#include "iclientcvarvalue.h"
#include <playerslot.h>
#include <networksystem/netmessage.h>
#include <netmessages.pb.h>
#include <string>
#include <array>
Expand All @@ -42,7 +43,7 @@ class ClientCvarValue final : public ISmmPlugin, public IMetamodListener, public
const char* GetDate();
const char* GetLogTag();

bool OnProcessRespondCvarValue(const CCLCMsg_RespondCvarValue& msg);
bool OnProcessRespondCvarValue(const CNetMessagePB<CCLCMsg_RespondCvarValue>& msg);
void OnClientConnected(CPlayerSlot nSlot, const char* pszName, uint64 xuid, const char* pszNetworkID, const char* pszAddress, bool bFakePlayer);
void OnClientDisconnect(CPlayerSlot nSlot, ENetworkDisconnectionReason reason, const char* pszName, uint64 xuid, const char* pszNetworkID);

Expand Down

0 comments on commit e71d4d6

Please sign in to comment.