UPnP source code fixes
as suggested by Chris Forbes
This commit is contained in:
committed by
Chris Forbes
parent
a831e72fa2
commit
aa36a56b27
@@ -1,6 +1,6 @@
|
||||
#region Copyright & License Information
|
||||
/*
|
||||
* Copyright 2007-2011 The OpenRA Developers (see AUTHORS)
|
||||
* Copyright 2007-2012 The OpenRA Developers (see AUTHORS)
|
||||
* This file is part of OpenRA, which is free software. It is made
|
||||
* available to you under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation. For more information,
|
||||
@@ -22,6 +22,7 @@ namespace OpenRA.Mods.RA.Widgets.Logic
|
||||
Action onExit;
|
||||
Map map;
|
||||
bool advertiseOnline;
|
||||
bool allowUPnP;
|
||||
|
||||
[ObjectCreator.UseCtor]
|
||||
public ServerCreationLogic(Widget widget, Action onExit, Action openLobby)
|
||||
@@ -64,6 +65,10 @@ namespace OpenRA.Mods.RA.Widgets.Logic
|
||||
var advertiseCheckbox = panel.Get<CheckboxWidget>("ADVERTISE_CHECKBOX");
|
||||
advertiseCheckbox.IsChecked = () => advertiseOnline;
|
||||
advertiseCheckbox.OnClick = () => advertiseOnline ^= true;
|
||||
|
||||
var UPnPCheckbox = panel.Get<CheckboxWidget>("UPNP_CHECKBOX");
|
||||
UPnPCheckbox.IsChecked = () => allowUPnP;
|
||||
UPnPCheckbox.OnClick = () => allowUPnP ^= true;
|
||||
}
|
||||
|
||||
void CreateAndJoin()
|
||||
@@ -81,6 +86,7 @@ namespace OpenRA.Mods.RA.Widgets.Logic
|
||||
Game.Settings.Server.ListenPort = listenPort;
|
||||
Game.Settings.Server.ExternalPort = externalPort;
|
||||
Game.Settings.Server.AdvertiseOnline = advertiseOnline;
|
||||
Game.Settings.Server.AllowUPnP = allowUPnP;
|
||||
Game.Settings.Server.Map = map.Uid;
|
||||
Game.Settings.Save();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user