Changed ServerSettings cloning to a more reliable approach
This commit is contained in:
@@ -358,7 +358,7 @@ namespace OpenRA
|
|||||||
{
|
{
|
||||||
Settings.Server.Map = WidgetUtils.ChooseInitialMap(Settings.Server.Map);
|
Settings.Server.Map = WidgetUtils.ChooseInitialMap(Settings.Server.Map);
|
||||||
Settings.Save();
|
Settings.Save();
|
||||||
CreateServer(new ServerSettings(Settings.Server));
|
CreateServer(Settings.Server.Clone());
|
||||||
|
|
||||||
while (true)
|
while (true)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -74,27 +74,9 @@ namespace OpenRA
|
|||||||
|
|
||||||
public string TimestampFormat = "s";
|
public string TimestampFormat = "s";
|
||||||
|
|
||||||
public ServerSettings() { }
|
public ServerSettings Clone()
|
||||||
|
|
||||||
public ServerSettings(ServerSettings other)
|
|
||||||
{
|
{
|
||||||
Name = other.Name;
|
return (ServerSettings)MemberwiseClone();
|
||||||
ListenPort = other.ListenPort;
|
|
||||||
ExternalPort = other.ExternalPort;
|
|
||||||
AdvertiseOnline = other.AdvertiseOnline;
|
|
||||||
Password = other.Password;
|
|
||||||
MasterServer = other.MasterServer;
|
|
||||||
DiscoverNatDevices = other.DiscoverNatDevices;
|
|
||||||
AllowPortForward = other.AllowPortForward;
|
|
||||||
NatDeviceAvailable = other.NatDeviceAvailable;
|
|
||||||
NatDiscoveryTimeout = other.NatDiscoveryTimeout;
|
|
||||||
VerboseNatDiscovery = other.VerboseNatDiscovery;
|
|
||||||
Map = other.Map;
|
|
||||||
Ban = other.Ban;
|
|
||||||
TimeOut = other.TimeOut;
|
|
||||||
Dedicated = other.Dedicated;
|
|
||||||
DedicatedLoop = other.DedicatedLoop;
|
|
||||||
LockBots = other.LockBots;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -118,7 +118,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
Game.Settings.Save();
|
Game.Settings.Save();
|
||||||
|
|
||||||
// Take a copy so that subsequent changes don't affect the server
|
// Take a copy so that subsequent changes don't affect the server
|
||||||
var settings = new ServerSettings(Game.Settings.Server);
|
var settings = Game.Settings.Server.Clone();
|
||||||
|
|
||||||
// Create and join the server
|
// Create and join the server
|
||||||
try
|
try
|
||||||
|
|||||||
Reference in New Issue
Block a user