mirror of
https://github.com/ChocoTaco1/TacoServer.git
synced 2026-04-21 11:35:20 +00:00
Remote Unbanning
This commit is contained in:
parent
3d876eb0de
commit
4d7cc2cc55
2 changed files with 220 additions and 43 deletions
|
|
@ -5,7 +5,7 @@
|
|||
//exec("scripts/autoexec/zzDiscordBot.cs");
|
||||
|
||||
//ip of the bot
|
||||
$discordBot::IP = "";
|
||||
$discordBot::IP = "127.0.0.1:28003";
|
||||
$discordBot::reconnectTimeout = 3 * 60000;
|
||||
//auto connect on start
|
||||
$discordBot::autoStart = 0;
|
||||
|
|
@ -203,7 +203,6 @@ function discordBotProcess(%type, %var1, %var2, %var3, %var4, %var5, %var6)
|
|||
sendToDiscordEmote(%msg, $discordBot::serverFeed);
|
||||
}
|
||||
}
|
||||
|
||||
function sendToDiscord(%msg,%channel)
|
||||
{
|
||||
if(isObject(discord) && %msg !$= "")
|
||||
|
|
@ -353,6 +352,33 @@ function discord::onLine(%this, %line){
|
|||
discord.schedule((%i+1)*32,"send","PROCSTACK" @ $discordBot::cmdSplit @ ($discordBot::monitorChannel) @ $discordBot::cmdSplit @ "msgList" @ "\r\n");
|
||||
}
|
||||
}
|
||||
case "BANLIST":
|
||||
if($dtBanList::NameListCount){
|
||||
for (%i = 0; %i < $dtBanList::NameListCount; %i++){
|
||||
%fieldList = $dtBanList::NameList[%i];
|
||||
%msg = "Index:" @ %i SPC "Name:" @ getField(%fieldList,0) SPC "GUID:" @ getField(%fieldList,1) SPC "IP:" @ getField(%fieldList,2);
|
||||
discord.schedule(%i*32,"send","MSGSTACK" @ $discordBot::cmdSplit @ ($discordBot::monitorChannel) @ $discordBot::cmdSplit @ %msg @ "\r\n");
|
||||
}
|
||||
discord.schedule((%i+1)*32,"send","PROCSTACK" @ $discordBot::cmdSplit @ ($discordBot::monitorChannel) @ $discordBot::cmdSplit @ "banList" @ "\r\n");
|
||||
}
|
||||
else{
|
||||
sendToDiscord("No active bans, see ban file for manual/older entries", $discordBot::monitorChannel);
|
||||
}
|
||||
case "UNBANINDEX":
|
||||
%var = getWord(%lineStrip,1);
|
||||
if(%var < $dtBanList::NameListCount){
|
||||
%name = unbanIndex(%var);
|
||||
if(%name !$= ""){
|
||||
sendToDiscord("User:" @ %name SPC "has been unbanned", $discordBot::monitorChannel);
|
||||
}
|
||||
else{
|
||||
sendToDiscord("Index Removed", $discordBot::monitorChannel);
|
||||
}
|
||||
}
|
||||
else{
|
||||
sendToDiscord("Invalid Index", $discordBot::monitorChannel);
|
||||
}
|
||||
|
||||
default:
|
||||
error("Discord Bad Command" SPC %line);
|
||||
}
|
||||
|
|
@ -482,4 +508,5 @@ function pathMapData(){ //loop to collect player position data
|
|||
error("Player Plot Tracking Has Ended");
|
||||
sendPrx(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue