dedicated: start a new server instance once previous game is finished (configurable)
This commit is contained in:
@@ -303,6 +303,8 @@ namespace OpenRA
|
||||
viewport = new Viewport(new int2(Renderer.Resolution), Rectangle.Empty, Renderer);
|
||||
|
||||
if (Game.Settings.Server.Dedicated)
|
||||
{
|
||||
while (true)
|
||||
{
|
||||
Game.CreateServer(new ServerSettings(Game.Settings.Server));
|
||||
while(true)
|
||||
@@ -314,10 +316,19 @@ namespace OpenRA
|
||||
{
|
||||
Console.WriteLine("No one is playing, shutting down...");
|
||||
server.Shutdown();
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (Game.Settings.Server.DedicatedLoop)
|
||||
{
|
||||
Console.WriteLine("Starting a new server instance...");
|
||||
continue;
|
||||
}
|
||||
else
|
||||
break;
|
||||
}
|
||||
System.Environment.Exit(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
modData.LoadScreen.StartGame();
|
||||
|
||||
@@ -35,6 +35,7 @@ namespace OpenRA.GameRules
|
||||
public string[] Ban = null;
|
||||
public int TimeOut = 0;
|
||||
public bool Dedicated = false;
|
||||
public bool DedicatedLoop = true;
|
||||
|
||||
public ServerSettings() { }
|
||||
|
||||
@@ -51,6 +52,7 @@ namespace OpenRA.GameRules
|
||||
Ban = other.Ban;
|
||||
TimeOut = other.TimeOut;
|
||||
Dedicated = other.Dedicated;
|
||||
DedicatedLoop = other.DedicatedLoop;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user