Game Development Community

Why Dedicated Server Reset when the last player is leaving?

by elvince · in Torque 3D Professional · 03/04/2010 (11:35 pm) · 1 replies

Hi,

This is a strange behavior and I didn't find yet where it comes from. In fact, when you are in dedicated server mode, when the last player is leaving, the map reset.

Any idea where I should look at?

Thanks,
For the moment, I have not check the C++ part.

#1
03/04/2010 (11:52 pm)
Ok I found.
It was pretty obvious.. I don't know why I didn't get it soon.

FYI:
function GameConnection::onDrop(%client, %reason)
{
   %client.onClientLeaveGame();
   
   removeFromServerGuidList( %client.guid );
   messageAllExcept(%client, -1, 'MsgClientDrop', '\c1%1 has left the game.', %client.playerName, %client);

   removeTaggedString(%client.playerName);
   echo("CDROP: " @ %client @ " " @ %client.getAddress());
   $Server::PlayerCount--;
   
   //// Reset the server if everyone has left the game
   //if( $Server::PlayerCount == 0 && $Server::Dedicated)
      //schedule(0, 0, "resetServerDefaults");
}