Add a 'Shutting down' state to the gameserver.

Tell the masterserver about it, so it can quickly remove games
from the list when they are finished, rather than waiting for the
5 minute TTL to expire.
This commit is contained in:
Sam Hegarty
2012-11-22 20:04:27 +13:00
committed by Chris Forbes
parent 3a77082c66
commit 0c104cfc3a
5 changed files with 48 additions and 20 deletions

View File

@@ -20,6 +20,7 @@ namespace OpenRA.Server
public interface INotifyServerShutdown { void ServerShutdown(Server server); }
public interface IStartGame { void GameStarted(Server server); }
public interface IClientJoined { void ClientJoined(Server server, Connection conn); }
public interface IEndGame { void GameEnded(Server server); }
public interface ITick
{
void Tick(Server server);
@@ -28,7 +29,7 @@ namespace OpenRA.Server
public abstract class ServerTrait {}
public class DebugServerTrait : ServerTrait, IInterpretCommand, IStartGame, INotifySyncLobbyInfo, INotifyServerStart, INotifyServerShutdown
public class DebugServerTrait : ServerTrait, IInterpretCommand, IStartGame, INotifySyncLobbyInfo, INotifyServerStart, INotifyServerShutdown, IEndGame
{
public bool InterpretCommand(Server server, Connection conn, Session.Client client, string cmd)
{
@@ -55,5 +56,10 @@ namespace OpenRA.Server
{
Console.WriteLine("ServerShutdown()");
}
public void GameEnded(Server server)
{
Console.WriteLine("GameEnded()");
}
}
}