[server] Implement/match RconSocketReply

This commit is contained in:
RD42
2025-12-31 13:06:09 -08:00
parent 8d89e9abd3
commit 8e404ba8f4
2 changed files with 29 additions and 0 deletions
+26
View File
@@ -0,0 +1,26 @@
#include "main.h"
BOOL bRconSocketReply = FALSE;
SOCKET cur_sock = INVALID_SOCKET;
char* cur_data = NULL;
int cur_datalen = 0;
sockaddr_in to;
void RconSocketReply(char* szMessage)
{
if (bRconSocketReply)
{
char* newdata = (char*)malloc(cur_datalen + strlen(szMessage) + sizeof(WORD));
char* keep_ptr = newdata;
memcpy(newdata, cur_data, cur_datalen);
newdata += cur_datalen;
*(WORD*)newdata = (WORD)strlen(szMessage);
newdata += sizeof(WORD);
memcpy(newdata, szMessage, strlen(szMessage));
newdata += strlen(szMessage);
sendto(cur_sock, keep_ptr, (int)(newdata - keep_ptr), 0, (sockaddr*)&to, sizeof(to));
free(keep_ptr);
}
}
+3
View File
@@ -818,6 +818,9 @@
<File
RelativePath=".\plugins.h">
</File>
<File
RelativePath=".\query.cpp">
</File>
<File
RelativePath=".\resource.h">
</File>