Jump to content
  • 0

Chatbox spam on server join


Bonsai

Question

Hi,

from time to time, random people join my server and spam ads in the chat. Usually this isn't so bad as they only do it once and never come back.

But today some guy kept joining over and over again spamming stuff.

The problem is, apparently he is able to get around the function that handles every output to the chat.

function Chat.redirect(message, messageType)
	
	if not isElement(source) then return end
	
	cancelEvent()
	
	local arenaElement = getElementParent(source)
	
	if not arenaElement or getElementType(arenaElement) ~= "Arena" then return end
		
	local chat_color = getElementData(source, "setting:chat_color") or "#ffffff"
	
	local message = Chat.parseEmotis(message)	
	
	if not getElementData(arenaElement, "showSpectatorChat") and getElementData(source, "Spectator") then
		
		Chat.outputSpectatorChat(arenaElement, getPlayerName(source).."#ffffff: "..chat_color..message)
	
		return
	
	end
	
	if messageType == 0 then

		if getElementData(arenaElement, "silence") and not exports["CCS"]:export_acl_check(source, "silence") then
	
			outputChatBox("Sorry, Silence mode is active!", source, 255, 0, 128)
			return
		
		end
	
		Chat.outputArenaChat(arenaElement, getPlayerName(source).."#ffffff: "..chat_color..message)

	elseif messageType == 1 then
	
		if getElementData(arenaElement, "silence") and not exports["CCS"]:export_acl_check(source, "silence") then
	
			outputChatBox("Sorry, Silence mode is active!", source, 255, 0, 128)
			return
		
		end
	
		Chat.outputArenaChat(arenaElement, "#ff00ff* "..getPlayerName(source):gsub("#%x%x%x%x%x%x", "").." "..message:gsub("#%x%x%x%x%x%x", ""))

	elseif messageType == 2 then

		local team = getPlayerTeam(source)
	
		if not team then return end
	
		for i, p in pairs(getPlayersInTeam(team)) do
		
			outputChatBox("#00f000[Team] #ffffff"..getPlayerName(source).."#ffffff: "..chat_color..message, p, 255, 255, 255, true)
		
		end	
		
		triggerEvent("onServerChatMessage", root, "#00f000[Team] #ffffff"..getPlayerName(source).."#ffffff: "..chat_color..message)
	
	end

end
addEventHandler("onPlayerChat", root, Chat.redirect)

Normally, he shouldn't be able to write anything in the chat without going through this function.

But it seems when you join a server and very fast after that spam a message, it will be output to the chatbox without trigger the "onPlayerChat" event.

[2017-03-07 10:55:47] KICK: MAFYA=BALTROS was kicked from the game by  (Command Flood)
[2017-03-07 10:55:47] CHAT: MAFYA=BALTROS: multi theft auto turkis de +70 araç +70 sikin adminilklerimiz indirimdedirrrrr!!!

[2017-03-07 10:56:04] KICK: MAFYA=BALTROS was kicked from the game by  (Command Flood)
[2017-03-07 10:56:04] CHAT: MAFYA=BALTROS: multi theft auto turkis de +70 araç +70 sikin adminilklerimiz indirimdedirrrrr!!!

[2017-03-07 10:56:12] KICK: MAFYA=BALTROS was kicked from the game by  (Command Flood)
[2017-03-07 10:56:12] CHAT: MAFYA=BALTROS: multi theft auto turkis de +70 araç +70 sikin adminilklerimiz indirimdedirrrrr!!!

[2017-03-07 10:56:27] KICK: MAFYA=BALTROS was kicked from the game by  (Command Flood)
[2017-03-07 10:56:27] CHAT: MAFYA=BALTROS: multi theft auto turkis de +70 araç +70 sikin adminilklerimiz indirimdedirrrrr!!!

[2017-03-07 10:56:33] CONNECT: MAFYA=BALTROS connected (IP: 78.174.8.126  Serial: 0D3C0C3E418D7DEDF4E60FE33CB64753  Version: 1.5.3-9.11204.0)
[2017-03-07 10:56:33] JOIN: MAFYA=BALTROS joined the game (IP: 78.174.8.126)
[2017-03-07 10:56:35] KICK: MAFYA=BALTROS was kicked from the game by  (Command Flood)
[2017-03-07 10:56:35] CHAT: MAFYA=BALTROS: multi theft auto turkis de +70 araç +70 sikin adminilklerimiz indirimdedirrrrr!!!

I would also like to request a tempory ban or something like that for this guy. Maybe it will teach him and his friends a lesson.

 

Bonsai

Link to comment

1 answer to this question

Recommended Posts

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...