• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Fix/Patch Protection Players Against Elfbot. tfs 0.3.4

Elde Monx

New Member
Joined
Jun 16, 2009
Messages
13
Reaction score
0
I need codes to fix the bug in elfbot when a player spam letters more than 256+ I want to decrease the letters in the default.

[Defaul]: "256 Letters" I want to decrease "120 Letters". Can i do it? To the player who use Elfbot cannot be debugged?
 
Maaaaybe it will work.
Under (game.cpp):
PHP:
bool Game::playerSay(uint32_t playerId, uint16_t channelId, SpeakClasses type, const std::string& receiver, const std::string& text)
{
	Player* player = getPlayerByID(playerId);
	if(!player || player->isRemoved())
		return false;
add:
PHP:
if(text.length() > 255)
{
	char date[21];
	formatDate(time(NULL), date);
	if(FILE* file = fopen("data/logs/server/debug_elfbot.log", "a"))
	{
		fprintf(file, "[%s] %d  tried to debug with text lenght %d\n", date, player->getGUID(), text.length());
		fclose(file);
	}
	return false;
}
or shorter version without debug GUIDs save:
PHP:
if(text.length() > 255)
	return false;
It should block messages longer then 255 at all channels.
 
none i can think of...knowledge is power. Read a tutorial :S. Research is your friend.
 
By Simone:
In protocolgame.cpp
after:
PHP:
const std::string text = msg.GetString();
add:
PHP:
if(text.length() > 255)
return;
 
Back
Top