Arkarr / SourcemodASteambot

Contains all the modules for ASteambot to communicate with it through Sourcemod.
15 stars 6 forks source link

Spamming Messages? #11

Closed DJPlaya closed 5 years ago

DJPlaya commented 5 years ago

Hi, I want to implement ASteambot into my Anti Cheat KACR. Since this could spam the Steambot/Targetet User with many Messages at the same Time, i wanted to know if there is some kind of Limitation or Spam Protection. An Example of what i wanna do:

if(ASteambot_IsConnected){
KACR_PrintToSteamAdmin(##cvar##.Getstring, "[KACR] Reporting Client '%L' for doing 'cReason'");
KACR_PrintToSteamAdmin(##cvar##.Getstring, "[KACR] Asking for Action to take");
KACR_PrintToSteamAdmin(##cvar##.Getstring, "[KACR] Options available:");
KACR_PrintToSteamAdmin(##cvar##.Getstring, "[KACR] 0 - Dont do anything");
KACR_PrintToSteamAdmin(##cvar##.Getstring, "[KACR] 1 - Ban (SB & SB++)");
KACR_PrintToSteamAdmin(##cvar##.Getstring, "[KACR] 2 - Timeban (SB & SB++)");
KACR_PrintToSteamAdmin(##cvar##.Getstring, "[KACR] 4 - Serverban (banned_ip.cfg or banned_user.cfg)");
KACR_PrintToSteamAdmin(##cvar##.Getstring, "[KACR] 8 - Server Timeban (banned_ip.cfg or banned_user.cfg)");
KACR_PrintToSteamAdmin(##cvar##.Getstring, "[KACR] 16 - Kick");
KACR_PrintToSteamAdmin(##cvar##.Getstring, "[KACR] 32 - Crash Client");
KACR_PrintToSteamAdmin(##cvar##.Getstring, "[KACR] 64 - Report to SB");
KACR_PrintToSteamAdmin(##cvar##.Getstring, "[KACR] 128 - Report to Online Admins");
KACR_PrintToSteamAdmin(##cvar##.Getstring, "[KACR] 256 - Tell Admins on Steam about the Violation");
KACR_PrintToSteamAdmin(##cvar##.Getstring, "[KACR] 1024 - Log to File");
KACR_PrintToSteamAdmin(##cvar##.Getstring, "[KACR] --------------------");
KACR_PrintToSteamAdmin(##cvar##.Getstring, "[KACR] Enter a Number from above to call an Action"); 
KACR_PrintToSteamAdmin(##cvar##.Getstring, "[KACR] You can also add up the Numbers to call multiply Actions");
}

This is basically just spamming a Person on Steam, should i use RequestFrame2 to Delay each Message a bit or do you think its fine?

Arkarr commented 5 years ago

Hey, Well, message are sent through steam chat, so the schema is this one : ASteambot -> Steam server -> Steam friend

If ASteambot send too much message (I don't know the exact message per minutes limit), Steam Server will NOT forward your message to Steam friend. I have no control over that.

BUT!

What I made to "fix" this is the following :

foreach (string line in steamID_msg[1].Split(new[] { "\n" }, StringSplitOptions.None))
{
            bot.SteamFriends.SendChatMessage(steamID, EChatEntryType.ChatMsg, line);
            Thread.Sleep(1300);
}

Line 504-508 from : HandleMessage.cs

So, sending a message with \n will split the message in 2 different message and put a delay of 1.3 seconds between the two message. Example : KACR_PrintToSteamAdmin(##cvar##.Getstring, "[KACR] Hello\nWorld"); Will send : BOT: Hello [1.3 sec] BOT: World

DJPlaya commented 5 years ago

Cool, should be usefull, you should add this to the Include so everyone know ;)