another stoat support
This commit is contained in:
parent
f3995b4b6d
commit
cd4937521b
@ -29,6 +29,8 @@ ArrayList g_arrQueuedMessages = null;
|
|||||||
Handle g_hDataTimer = null;
|
Handle g_hDataTimer = null;
|
||||||
Handle g_hReplaceConfigFile = null;
|
Handle g_hReplaceConfigFile = null;
|
||||||
|
|
||||||
|
static Handle g_hForwardDiscord;
|
||||||
|
|
||||||
UserMsg g_umSayText2 = INVALID_MESSAGE_ID;
|
UserMsg g_umSayText2 = INVALID_MESSAGE_ID;
|
||||||
|
|
||||||
bool g_bLoadedLate;
|
bool g_bLoadedLate;
|
||||||
@ -59,7 +61,7 @@ public Plugin myinfo =
|
|||||||
public APLRes AskPluginLoad2(Handle hThis, bool bLate, char[] sError, int err_max)
|
public APLRes AskPluginLoad2(Handle hThis, bool bLate, char[] sError, int err_max)
|
||||||
{
|
{
|
||||||
g_bLoadedLate = bLate;
|
g_bLoadedLate = bLate;
|
||||||
|
RegPluginLibrary("Discord_UNLOZE");
|
||||||
return APLRes_Success;
|
return APLRes_Success;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -68,6 +70,9 @@ public void OnPluginStart()
|
|||||||
char sRegexErr[32];
|
char sRegexErr[32];
|
||||||
RegexError RegexErr;
|
RegexError RegexErr;
|
||||||
|
|
||||||
|
g_hForwardDiscord = CreateGlobalForward("GetDiscordToStoat", ET_Ignore, Param_String, Param_String, Param_Cell);
|
||||||
|
|
||||||
|
|
||||||
g_Regex_Clyde = CompileRegex(".*(clyde).*", PCRE_CASELESS, sRegexErr, sizeof(sRegexErr), RegexErr);
|
g_Regex_Clyde = CompileRegex(".*(clyde).*", PCRE_CASELESS, sRegexErr, sizeof(sRegexErr), RegexErr);
|
||||||
|
|
||||||
if (RegexErr != REGEX_ERROR_NONE)
|
if (RegexErr != REGEX_ERROR_NONE)
|
||||||
@ -114,6 +119,7 @@ public void OnPluginEnd()
|
|||||||
{
|
{
|
||||||
delete g_arrQueuedMessages;
|
delete g_arrQueuedMessages;
|
||||||
delete g_hDataTimer;
|
delete g_hDataTimer;
|
||||||
|
CloseHandle(g_hForwardDiscord);
|
||||||
|
|
||||||
UnhookUserMessage(g_umSayText2, Hook_UserMessage, false);
|
UnhookUserMessage(g_umSayText2, Hook_UserMessage, false);
|
||||||
}
|
}
|
||||||
@ -567,7 +573,7 @@ public int OnHTTPRequestCompleted(Handle hRequest, bool bFailure, bool bRequestS
|
|||||||
|
|
||||||
int iRatelimitReset = StringToInt(sTmp);
|
int iRatelimitReset = StringToInt(sTmp);
|
||||||
|
|
||||||
if (iRatelimitRemaining < iLastRatelimitRemaining || iRatelimitReset >= iLastRatelimitReset) //don't be fooled by different completion times
|
if (iRatelimitRemaining < iLastRatelimitRemaining || iRatelimitReset >= iLastRatelimitReset) //dont be fooled by different completion times
|
||||||
{
|
{
|
||||||
g_iRatelimitRemaining = iRatelimitRemaining;
|
g_iRatelimitRemaining = iRatelimitRemaining;
|
||||||
g_iRatelimitReset = iRatelimitReset;
|
g_iRatelimitReset = iRatelimitReset;
|
||||||
@ -614,6 +620,12 @@ public Action OnLogAction(Handle hSource, Identity ident, int client, int target
|
|||||||
else
|
else
|
||||||
Discord_POST(DISCORD_ADMINLOGS_WEBHOOKURL, sFinal, true, sClientName, false, "", false);
|
Discord_POST(DISCORD_ADMINLOGS_WEBHOOKURL, sFinal, true, sClientName, false, "", false);
|
||||||
|
|
||||||
|
Call_StartForward(g_hForwardDiscord);
|
||||||
|
Call_PushString(sClientName);
|
||||||
|
Call_PushString(sFinal);
|
||||||
|
Call_PushCell(1);
|
||||||
|
Call_Finish();
|
||||||
|
|
||||||
return Plugin_Handled;
|
return Plugin_Handled;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -693,6 +705,12 @@ public void BanDetectorPost1(int client, const char[] detected_sourceban)
|
|||||||
Discord_POST(DISCORD_BAN_DETECTOR, sMessage, true, sClientName, true, g_sAvatarURL[client], false);
|
Discord_POST(DISCORD_BAN_DETECTOR, sMessage, true, sClientName, true, g_sAvatarURL[client], false);
|
||||||
else
|
else
|
||||||
Discord_POST(DISCORD_BAN_DETECTOR, sMessage, true, sClientName, false, "", false);
|
Discord_POST(DISCORD_BAN_DETECTOR, sMessage, true, sClientName, false, "", false);
|
||||||
|
|
||||||
|
Call_StartForward(g_hForwardDiscord);
|
||||||
|
Call_PushString(sClientName);
|
||||||
|
Call_PushString(sMessage);
|
||||||
|
Call_PushCell(4);
|
||||||
|
Call_Finish();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void CallAdmin_OnReportPost(int client, int target, const char[] reason)
|
public void CallAdmin_OnReportPost(int client, int target, const char[] reason)
|
||||||
@ -821,6 +839,12 @@ public void AntiBhopCheat_OnClientDetected(int client, char[] sReason, char[] sS
|
|||||||
Discord_POST(DISCORD_ANTIBHOPCHEAT_WEBHOOKURL, sMessage, true, sUsername, true, g_sAvatarURL[client], false);
|
Discord_POST(DISCORD_ANTIBHOPCHEAT_WEBHOOKURL, sMessage, true, sUsername, true, g_sAvatarURL[client], false);
|
||||||
else
|
else
|
||||||
Discord_POST(DISCORD_ANTIBHOPCHEAT_WEBHOOKURL, sMessage, true, sUsername, false, "", false);
|
Discord_POST(DISCORD_ANTIBHOPCHEAT_WEBHOOKURL, sMessage, true, sUsername, false, "", false);
|
||||||
|
|
||||||
|
Call_StartForward(g_hForwardDiscord);
|
||||||
|
Call_PushString(sUsername);
|
||||||
|
Call_PushString(sMessage);
|
||||||
|
Call_PushCell(2);
|
||||||
|
Call_Finish();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void EW_OnClientRestricted(int client, int target, int hours, int minutes)
|
public void EW_OnClientRestricted(int client, int target, int hours, int minutes)
|
||||||
@ -852,6 +876,12 @@ public void EW_OnClientRestricted(int client, int target, int hours, int minutes
|
|||||||
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);
|
||||||
|
|
||||||
|
Call_StartForward(g_hForwardDiscord);
|
||||||
|
Call_PushString(sUsername);
|
||||||
|
Call_PushString(sMessage);
|
||||||
|
Call_PushCell(3);
|
||||||
|
Call_Finish();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -879,4 +909,10 @@ public void EW_OnClientUnrestricted(int client, int target)
|
|||||||
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);
|
||||||
|
|
||||||
|
Call_StartForward(g_hForwardDiscord);
|
||||||
|
Call_PushString(sUsername);
|
||||||
|
Call_PushString(sMessage);
|
||||||
|
Call_PushCell(3);
|
||||||
|
Call_Finish();
|
||||||
}
|
}
|
||||||
|
|||||||
25
Discord_UNLOZE/scripting/include/Discord_UNLOZE.inc
Executable file
25
Discord_UNLOZE/scripting/include/Discord_UNLOZE.inc
Executable file
@ -0,0 +1,25 @@
|
|||||||
|
#if defined _Discord_UNLOZE_Included
|
||||||
|
#endinput
|
||||||
|
#endif
|
||||||
|
#define _Discord_UNLOZE_Included
|
||||||
|
|
||||||
|
/**
|
||||||
|
|
||||||
|
* @noreturn
|
||||||
|
*/
|
||||||
|
forward void GetDiscordToStoat(const char[] username, const char[] message, int type);
|
||||||
|
|
||||||
|
|
||||||
|
/* Do not edit below this line */
|
||||||
|
public SharedPlugin __pl_Discord_UNLOZE =
|
||||||
|
{
|
||||||
|
name = "Discord_UNLOZE",
|
||||||
|
file = "Discord_UNLOZE.smx",
|
||||||
|
#if defined REQUIRE_PLUGIN
|
||||||
|
required = 1,
|
||||||
|
#else
|
||||||
|
required = 0,
|
||||||
|
#endif
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
Loading…
Reference in New Issue
Block a user