Blockland Forums > Modification Help
Flood Protection
herb:
Just remake the servercmdmessagesent and create your own flood protection, so you can give variables and what not; that's all i can say, since i have no clue what the overall attempt here is.
MegaScientifical:
--- Quote from: herb on July 25, 2010, 07:32:23 PM ---Just remake the servercmdmessagesent and create your own flood protection, so you can give variables and what not; that's all i can say, since i have no clue what the overall attempt here is.
--- End quote ---
^ Bad idea. There's tons of protection in the command. Rewriting it breaks the protection, allowing tons of bad stuff.
General:
--- Quote from: herb on July 25, 2010, 07:32:23 PM ---that's all i can say, since i have no clue what the overall attempt here is.
--- End quote ---
It seems I haven't made myself clear enough?
My overall attempt is to make a script which checks that the client is not under flood protection before continuing with the main code, for example: If somebody says "What are the rules?" The rules will appear in the message hud, but if the client is under flood protection it will ignore it.
I can't possibly make myself clearer?
General:
Quark and I recently found out another way we could find if the client is under flood protection, and it worked!
--- Code: ---package TEST
{
function serverCmdMessageSent(%client, %text)
{
%time = getSimTime();
%spamTime = %client.spamProtectStart;
if(%time - %spamTime < 10000 || %text $= %client.lastMsgSent && !%client.isAdmin)
{
cancel(%client.lastMsgSentSchedule);
%client.lastMsgSentSchedule = schedule(15000,0,eval,%client @ ".lastMsgSent = '';");
}
else
{
//code goes here
}
%client.lastMsgSent = %text;
parent::serverCmdMessageSent(%client, %text);
}
};
activatepackage(TEST);
--- End code ---
Reguardless, thank you all for your help.