limit message size

This commit is contained in:
neon 2022-06-16 21:17:35 +01:00
parent 13485194ab
commit 93897dfc4f

View File

@ -706,7 +706,7 @@ public void CallAdmin_OnReportPost(int client, int target, const char[] reason)
} }
} }
char sMessage[4096]; char sMessage[1900];
if(ActiveAdmins) if(ActiveAdmins)
Format(sMessage, sizeof(sMessage), "```***ACTIVE ADMINS IN-GAME***``````\n%s - Tick: %d``````New report on server: %s (%s:%d)\nReportID: %d\nReporter: %s (%s)\nTarget: %s (%s)\nReason: %s\nJoin Server: steam://connect/%s:%d\nwhen in game, type !calladmin_handle %d or /calladmin_handle %d in chat to handle this report```", currentMap, GetGameTickCount(), sServerName, sServerIP, serverPort, g_iLastReportID, sClientName, sClientID, sTargetName, sTargetID, reason, sServerIP, serverPort, g_iLastReportID, g_iLastReportID); Format(sMessage, sizeof(sMessage), "```***ACTIVE ADMINS IN-GAME***``````\n%s - Tick: %d``````New report on server: %s (%s:%d)\nReportID: %d\nReporter: %s (%s)\nTarget: %s (%s)\nReason: %s\nJoin Server: steam://connect/%s:%d\nwhen in game, type !calladmin_handle %d or /calladmin_handle %d in chat to handle this report```", currentMap, GetGameTickCount(), sServerName, sServerIP, serverPort, g_iLastReportID, sClientName, sClientID, sTargetName, sTargetID, reason, sServerIP, serverPort, g_iLastReportID, g_iLastReportID);
else else
@ -728,7 +728,7 @@ public void CallAdmin_OnReportHandled(int client, int id)
return; return;
} }
char sMessage[1024]; char sMessage[1900];
Format(sMessage, sizeof(sMessage), "```Last report (%d) was handled by: %N```", g_iLastReportID, client); Format(sMessage, sizeof(sMessage), "```Last report (%d) was handled by: %N```", g_iLastReportID, client);
char sUsername[MAX_NAME_LENGTH]; char sUsername[MAX_NAME_LENGTH];
@ -751,7 +751,7 @@ public Action Oryx_OnTrigger(int client, int &level, char[] cheat)
char sAuthID[32]; char sAuthID[32];
GetClientAuthId(client, AuthId_Steam2, sAuthID, sizeof(sAuthID), false); GetClientAuthId(client, AuthId_Steam2, sAuthID, sizeof(sAuthID), false);
char sMessage[4096]; char sMessage[1900];
Format(sMessage, sizeof(sMessage), "```%s - Tick: %d``````NAME: %N\nSTEAMID: %s\nTRIGGER LEVEL: %i\n%s```", currentMap, GetGameTickCount(), client, sAuthID, level, cheat); Format(sMessage, sizeof(sMessage), "```%s - Tick: %d``````NAME: %N\nSTEAMID: %s\nTRIGGER LEVEL: %i\n%s```", currentMap, GetGameTickCount(), client, sAuthID, level, cheat);
if (g_sAvatarURL[client][0] != '\0') if (g_sAvatarURL[client][0] != '\0')
@ -770,7 +770,7 @@ public void AntiBhopCheat_OnClientDetected(int client, char[] sReason, char[] sS
char currentMap[64]; char currentMap[64];
GetCurrentMap(currentMap, sizeof(currentMap)); GetCurrentMap(currentMap, sizeof(currentMap));
char sMessage[4096]; char sMessage[1900];
Format(sMessage, sizeof(sMessage), "```%s - Tick: %d``````%s\n%s```", currentMap, GetGameTickCount(), sReason, sStats); Format(sMessage, sizeof(sMessage), "```%s - Tick: %d``````%s\n%s```", currentMap, GetGameTickCount(), sReason, sStats);
if (g_sAvatarURL[client][0] != '\0') if (g_sAvatarURL[client][0] != '\0')
@ -787,7 +787,7 @@ public void EW_OnClientRestricted(int client, int target, int length)
char currentMap[64]; char currentMap[64];
GetCurrentMap(currentMap, sizeof(currentMap)); GetCurrentMap(currentMap, sizeof(currentMap));
char sMessageTmp[4096]; char sMessageTmp[1900];
if (length == -1) if (length == -1)
{ {
@ -803,7 +803,7 @@ public void EW_OnClientRestricted(int client, int target, int length)
} }
char sMessage[4096]; char sMessage[1900];
Format(sMessage, sizeof(sMessage), "```%s - Tick: %d``````%s```", currentMap, GetGameTickCount(), sMessageTmp); Format(sMessage, sizeof(sMessage), "```%s - Tick: %d``````%s```", currentMap, GetGameTickCount(), sMessageTmp);
if (g_sAvatarURL[target][0] != '\0') if (g_sAvatarURL[target][0] != '\0')
@ -821,14 +821,14 @@ public void EW_OnClientUnrestricted(int client, int target)
char currentMap[64]; char currentMap[64];
GetCurrentMap(currentMap, sizeof(currentMap)); GetCurrentMap(currentMap, sizeof(currentMap));
char sMessageTmp[4096]; char sMessageTmp[1900];
Format(sMessageTmp, sizeof(sMessageTmp), "%L got unrestricted by %L", target, client); Format(sMessageTmp, sizeof(sMessageTmp), "%L got unrestricted by %L", target, client);
char sMessage[4096]; char sMessage[1900];
Format(sMessage, sizeof(sMessage), "```%s - Tick: %d``````%s```", currentMap, GetGameTickCount(), sMessageTmp); Format(sMessage, sizeof(sMessage), "```%s - Tick: %d``````%s```", currentMap, GetGameTickCount(), sMessageTmp);
if (g_sAvatarURL[target][0] != '\0') if (g_sAvatarURL[target][0] != '\0')
Discord_POST(DISCORD_ENTWATCH_WEBHOOKURL, sMessage, true, sUsername, true, g_sAvatarURL[target], false); Discord_POST(DISCORD_ENTWATCH_WEBHOOKURL, sMessage, true, sUsername, true, g_sAvatarURL[target], false);
else else
Discord_POST(DISCORD_ENTWATCH_WEBHOOKURL, sMessage, true, sUsername, false, "", false); Discord_POST(DISCORD_ENTWATCH_WEBHOOKURL, sMessage, true, sUsername, false, "", false);
} }