• 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!

Dance Limitation

WTF.Error

Member
Joined
Aug 8, 2007
Messages
489
Reaction score
10
I looking for ideas to limitate player rotation.

example.
a player send 1000 rotates in 1 sec server debug players near.


Code:
----- 8/7/2010 6:48:14 - Bugador (187.15.54.29) -----
Comment: 
Graphic Engine: DirectX5 (0)
Operating System: Windows XP Professional in BRA
Processor: Intel Pentium DUAL E220
Video Card: Intel (R) G33/G
Last Packet Types: 107 107 107 107 107 107 107 107 107 107
Last Packet: 107 059 000 087 000 012 002 099 000 119 242 000 016 000 107 059
Player Position: [59,87,12]
Player Name: Bugador (Gamers-BR)
Player Action: 055 052 046 056 054 046 055 056 046 050 049 058 055 049 055 050
Player.cpp 361: exception occurred, reason:
Network.cpp 992: exception occurred (ErrorCode = 0), reason:
Control.cpp 1330: exception occurred (Type = -1) (MainWindow = 148085824), reason:
Network.cpp 491: exception occurred, reason:
Network.cpp 478: exception occurred, reason:
Network.cpp 444: packet size does not fit to symmetric encryption (PacketSize = 15341)
Wed Jul 07 23:48:00 2010
Debug Assertion 8.54 Network.cpp 444
 
Server bug?
Client bug?
Maybe you can remake this function to delay rotate player.
protocolgame.cpp ->

Code:
void ProtocolGame::parseTurn(NetworkMessage& msg, Direction dir)
{
	addGameTaskTimed(DISPATCHER_TASK_EXPIRATION, &Game::playerTurn, player->getID(), dir);
}

This is a small clue ;)
 
Hmm.. how player "send 1000 rotates in 1 sec" ?? it's imposible ;|
... some crash application?
 
Yes it is possible, I though about g_scheduler but it is not meant for that, on the other hand it will work:

Normal function in game.cpp:
PHP:
bool Game::playerTurn(uint32_t playerId, Direction dir)
{
	Player* player = getPlayerByID(playerId);
	if(!player || player->isRemoved())
		return false;
		
	player->setIdleTime(0, false);
	return internalCreatureTurn(player, dir);
}

And a little change to the function, and it may look like this:
PHP:
bool Game::playerTurn(uint32_t playerId, Direction dir)
{
	Player* player = getPlayerByID(playerId);
	if(!player || player->isRemoved())
		return false;
		
	player->setIdleTime(0, false);
	return g_scheduler.addEvent(createSchedulerTask(200, boost::bind(&Game::internalCreatureTurn, this,player,dir)));
}

It will add new event to the game scheduler making it 200 ms delayed.
 
Back
Top