mirror of
https://github.com/dashr9230/SA-MP.git
synced 2026-10-10 11:43:04 +08:00
[saco] Match ClientMessage; the 256-byte buffer forces the 8-byte stack realign
This commit is contained in:
@@ -65,6 +65,8 @@ public:
|
||||
|
||||
void AddInfoMessage(CHAR *szFormat, ...); // .text:10068070
|
||||
|
||||
void AddClientMessage(DWORD dwColor, CHAR *szMessage); // .text:10068170
|
||||
|
||||
int SetPageSize(int iPageSize); // .text:100672A0
|
||||
|
||||
void ResetDialogControls(CDXUTDialog *pGameUI);
|
||||
|
||||
+25
-1
@@ -3,6 +3,7 @@
|
||||
|
||||
extern CNetGame* pNetGame;
|
||||
extern CGame * pGame;
|
||||
extern CChatWindow *pChatWindow;
|
||||
|
||||
// MATCH
|
||||
BYTE Checksum(BYTE *pData, WORD wLen)
|
||||
@@ -65,7 +66,30 @@ void GameModeRestart(RPCParameters *rpcParams)
|
||||
pNetGame->sub_1000A540();
|
||||
}
|
||||
void ConnectionRejected(RPCParameters *rpcParams) {}
|
||||
void ClientMessage(RPCParameters *rpcParams) {}
|
||||
// MATCH
|
||||
void ClientMessage(RPCParameters *rpcParams)
|
||||
{
|
||||
PCHAR Data = reinterpret_cast<PCHAR>(rpcParams->input);
|
||||
int iBitLength = rpcParams->numberOfBitsOfData;
|
||||
|
||||
DWORD dwColor;
|
||||
DWORD dwStrLen;
|
||||
char szMessage[256];
|
||||
|
||||
RakNet::BitStream bsData(Data,(iBitLength/8)+1,false);
|
||||
|
||||
memset(szMessage,0,sizeof(szMessage));
|
||||
|
||||
bsData.Read(dwColor);
|
||||
bsData.Read(dwStrLen);
|
||||
|
||||
if(dwStrLen > 255) return;
|
||||
|
||||
bsData.Read(szMessage,dwStrLen);
|
||||
szMessage[dwStrLen] = '\0';
|
||||
|
||||
pChatWindow->AddClientMessage(dwColor,szMessage);
|
||||
}
|
||||
// MATCH
|
||||
void WorldTime(RPCParameters *rpcParams)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user