aboutsummaryrefslogtreecommitdiff
path: root/NorthstarDLL/clientchathooks.cpp
diff options
context:
space:
mode:
authorBobTheBob9 <for.oliver.kirkham@gmail.com>2022-07-12 14:05:02 +0100
committerBobTheBob9 <for.oliver.kirkham@gmail.com>2022-07-12 14:05:02 +0100
commit6ae30c9b15fcc200c7b642016e7adbfdf9b979f4 (patch)
treef645afba242a092e1e920582f37ae396e35b5e06 /NorthstarDLL/clientchathooks.cpp
parent1068b3daeb95322461e69a2d8f0203309bd22830 (diff)
downloadNorthstarLauncher-6ae30c9b15fcc200c7b642016e7adbfdf9b979f4.tar.gz
NorthstarLauncher-6ae30c9b15fcc200c7b642016e7adbfdf9b979f4.zip
move exploit prevention and limits code out of serverauthentication, and have actual defs for CBasePlayer
Diffstat (limited to 'NorthstarDLL/clientchathooks.cpp')
-rw-r--r--NorthstarDLL/clientchathooks.cpp32
1 files changed, 13 insertions, 19 deletions
diff --git a/NorthstarDLL/clientchathooks.cpp b/NorthstarDLL/clientchathooks.cpp
index 8e1f7c77..ca783f88 100644
--- a/NorthstarDLL/clientchathooks.cpp
+++ b/NorthstarDLL/clientchathooks.cpp
@@ -12,9 +12,7 @@ void,, (void* self, const char* message, int inboxId, bool isTeam, bool isDead))
{
// This hook is called for each HUD, but we only want our logic to run once.
if (self != *CHudChat::allHuds)
- {
return;
- }
if (g_pClientSquirrel->setupfunc("CHudChat_ProcessMessageStartThread") != SQRESULT_ERROR)
{
@@ -31,7 +29,7 @@ void,, (void* self, const char* message, int inboxId, bool isTeam, bool isDead))
payload = message + 1;
}
- g_pClientSquirrel->pushinteger(g_pClientSquirrel->sqvm2, (int) senderId - 1);
+ g_pClientSquirrel->pushinteger(g_pClientSquirrel->sqvm2, (int)senderId - 1);
g_pClientSquirrel->pushstring(g_pClientSquirrel->sqvm2, payload);
g_pClientSquirrel->pushbool(g_pClientSquirrel->sqvm2, isTeam);
g_pClientSquirrel->pushbool(g_pClientSquirrel->sqvm2, isDead);
@@ -39,42 +37,38 @@ void,, (void* self, const char* message, int inboxId, bool isTeam, bool isDead))
g_pClientSquirrel->call(g_pClientSquirrel->sqvm2, 5);
}
else
- {
for (CHudChat* hud = *CHudChat::allHuds; hud != NULL; hud = hud->next)
- {
CHudChat__AddGameLine(hud, message, inboxId, isTeam, isDead);
- }
- }
}
// void NSChatWrite( int context, string str )
-static SQRESULT SQ_ChatWrite(void* sqvm)
+SQRESULT SQ_ChatWrite(void* sqvm)
{
- int context = g_pClientSquirrel->getinteger(g_pClientSquirrel->sqvm2, 1);
- const char* str = g_pClientSquirrel->getstring(g_pClientSquirrel->sqvm2, 2);
+ int context = g_pClientSquirrel->getinteger(sqvm, 1);
+ const char* str = g_pClientSquirrel->getstring(sqvm, 2);
LocalChatWriter((LocalChatWriter::Context)context).Write(str);
- return SQRESULT_NOTNULL;
+ return SQRESULT_NULL;
}
// void NSChatWriteRaw( int context, string str )
-static SQRESULT SQ_ChatWriteRaw(void* sqvm)
+SQRESULT SQ_ChatWriteRaw(void* sqvm)
{
- int context = g_pClientSquirrel->getinteger(g_pClientSquirrel->sqvm2, 1);
- const char* str = g_pClientSquirrel->getstring(g_pClientSquirrel->sqvm2, 2);
+ int context = g_pClientSquirrel->getinteger(sqvm, 1);
+ const char* str = g_pClientSquirrel->getstring(sqvm, 2);
LocalChatWriter((LocalChatWriter::Context)context).InsertText(str);
- return SQRESULT_NOTNULL;
+ return SQRESULT_NULL;
}
// void NSChatWriteLine( int context, string str )
-static SQRESULT SQ_ChatWriteLine(void* sqvm)
+SQRESULT SQ_ChatWriteLine(void* sqvm)
{
- int context = g_pClientSquirrel->getinteger(g_pClientSquirrel->sqvm2, 1);
- const char* str = g_pClientSquirrel->getstring(g_pClientSquirrel->sqvm2, 2);
+ int context = g_pClientSquirrel->getinteger(sqvm, 1);
+ const char* str = g_pClientSquirrel->getstring(sqvm, 2);
LocalChatWriter((LocalChatWriter::Context)context).WriteLine(str);
- return SQRESULT_NOTNULL;
+ return SQRESULT_NULL;
}
ON_DLL_LOAD_CLIENT_RELIESON("client.dll", ClientChatHooks, ClientSquirrel, (HMODULE baseAddress))