outcommented kick and post method. now just logging everything
This commit is contained in:
parent
258a880da5
commit
c5a201ab8a
@ -41,8 +41,10 @@ public void OnPluginStart()
|
|||||||
SetFailState("Failed to detour CGameClient::ExecuteStringCommand()");
|
SetFailState("Failed to detour CGameClient::ExecuteStringCommand()");
|
||||||
|
|
||||||
// And a post hook.
|
// And a post hook.
|
||||||
|
/*
|
||||||
if (!DHookEnableDetour(hExecuteStringCommand, true, Detour_OnExecuteStringCommand_Post))
|
if (!DHookEnableDetour(hExecuteStringCommand, true, Detour_OnExecuteStringCommand_Post))
|
||||||
SetFailState("Failed to detour ExecuteStringCommand post.");
|
SetFailState("Failed to detour ExecuteStringCommand post.");
|
||||||
|
*/
|
||||||
|
|
||||||
// Setup quick hack to get the client index of the IClient this pointer in the detour callback.
|
// Setup quick hack to get the client index of the IClient this pointer in the detour callback.
|
||||||
StartPrepSDKCall(SDKCall_Raw);
|
StartPrepSDKCall(SDKCall_Raw);
|
||||||
@ -52,11 +54,11 @@ public void OnPluginStart()
|
|||||||
delete conf;
|
delete conf;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
public MRESReturn Detour_OnExecuteStringCommand_Post(Address pThis, Handle hReturn, Handle hParams)
|
public MRESReturn Detour_OnExecuteStringCommand_Post(Address pThis, Handle hReturn, Handle hParams)
|
||||||
{
|
{
|
||||||
int client = SDKCall(hGetPlayerSlot, pThis) + 1;
|
int client = SDKCall(hGetPlayerSlot, pThis) + 1;
|
||||||
char sBuffer[512];
|
char sBuffer[2048];
|
||||||
DHookGetParamString(hParams, 1, sBuffer, sizeof(sBuffer));
|
DHookGetParamString(hParams, 1, sBuffer, sizeof(sBuffer));
|
||||||
if((sBuffer[0] == 'r' && sBuffer[1] == 'p' && sBuffer[2] == 't'))
|
if((sBuffer[0] == 'r' && sBuffer[1] == 'p' && sBuffer[2] == 't'))
|
||||||
{
|
{
|
||||||
@ -68,6 +70,7 @@ public MRESReturn Detour_OnExecuteStringCommand_Post(Address pThis, Handle hRetu
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
public MRESReturn ExecuteStringCommand(Address addrThis, Handle hReturn, Handle hParams)
|
public MRESReturn ExecuteStringCommand(Address addrThis, Handle hReturn, Handle hParams)
|
||||||
@ -76,6 +79,11 @@ public MRESReturn ExecuteStringCommand(Address addrThis, Handle hReturn, Handle
|
|||||||
|
|
||||||
char cmd[512];
|
char cmd[512];
|
||||||
DHookGetParamString(hParams, 1, cmd, 512);
|
DHookGetParamString(hParams, 1, cmd, 512);
|
||||||
|
char sSID[64];
|
||||||
|
GetClientAuthId(client, AuthId_Steam2, sSID, sizeof(sSID));
|
||||||
|
|
||||||
|
LogMessage("client: %N. steamid: %s. command: %s", client, sSID, cmd);
|
||||||
|
/*
|
||||||
// "rpt", "rpt_"
|
// "rpt", "rpt_"
|
||||||
if((cmd[0] == 'r' && cmd[1] == 'p' && cmd[2] == 't'))
|
if((cmd[0] == 'r' && cmd[1] == 'p' && cmd[2] == 't'))
|
||||||
{
|
{
|
||||||
@ -85,5 +93,7 @@ public MRESReturn ExecuteStringCommand(Address addrThis, Handle hReturn, Handle
|
|||||||
KickClient(client, "DO NOT USE EXPLOITS ON THIS SERVER");
|
KickClient(client, "DO NOT USE EXPLOITS ON THIS SERVER");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
return MRES_Ignored;
|
return MRES_Ignored;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user