Permalink
Browse files

added option to enable/disable hosting an own server

  • Loading branch information...
1 parent 72ac012 commit ace5aef2f0b3c7dd20cda40a00170ed366083222 @NobodysNightmare committed Feb 24, 2012

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
@@ -1,33 +1,36 @@
-<?xml version='1.0' encoding='utf-8'?>
-<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" GeneratedClassNamespace="BlockDefender" GeneratedClassName="AppSettings">
- <Profiles />
- <Settings>
- <Setting Name="MoveUp" Type="Microsoft.Xna.Framework.Input.Keys" Scope="User">
- <Value Profile="(Default)">W</Value>
- </Setting>
- <Setting Name="MoveDown" Type="Microsoft.Xna.Framework.Input.Keys" Scope="User">
- <Value Profile="(Default)">S</Value>
- </Setting>
- <Setting Name="MoveLeft" Type="Microsoft.Xna.Framework.Input.Keys" Scope="User">
- <Value Profile="(Default)">A</Value>
- </Setting>
- <Setting Name="MoveRight" Type="Microsoft.Xna.Framework.Input.Keys" Scope="User">
- <Value Profile="(Default)">D</Value>
- </Setting>
- <Setting Name="Exit" Type="Microsoft.Xna.Framework.Input.Keys" Scope="User">
- <Value Profile="(Default)">Escape</Value>
- </Setting>
+<?xml version='1.0' encoding='utf-8'?>
+<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" GeneratedClassNamespace="BlockDefender" GeneratedClassName="AppSettings">
+ <Profiles />
+ <Settings>
+ <Setting Name="MoveUp" Type="Microsoft.Xna.Framework.Input.Keys" Scope="User">
+ <Value Profile="(Default)">W</Value>
+ </Setting>
+ <Setting Name="MoveDown" Type="Microsoft.Xna.Framework.Input.Keys" Scope="User">
+ <Value Profile="(Default)">S</Value>
+ </Setting>
+ <Setting Name="MoveLeft" Type="Microsoft.Xna.Framework.Input.Keys" Scope="User">
+ <Value Profile="(Default)">A</Value>
+ </Setting>
+ <Setting Name="MoveRight" Type="Microsoft.Xna.Framework.Input.Keys" Scope="User">
+ <Value Profile="(Default)">D</Value>
+ </Setting>
+ <Setting Name="Exit" Type="Microsoft.Xna.Framework.Input.Keys" Scope="User">
+ <Value Profile="(Default)">Escape</Value>
+ </Setting>
<Setting Name="ListenPort" Type="System.Int32" Scope="User">
<Value Profile="(Default)">1337</Value>
</Setting>
- <Setting Name="Interact" Type="Microsoft.Xna.Framework.Input.Keys" Scope="User">
- <Value Profile="(Default)">E</Value>
- </Setting>
- <Setting Name="ConnectHost" Type="System.String" Scope="User">
- <Value Profile="(Default)">127.0.0.1</Value>
- </Setting>
- <Setting Name="ConnectPort" Type="System.Int32" Scope="User">
- <Value Profile="(Default)">1337</Value>
- </Setting>
- </Settings>
+ <Setting Name="Interact" Type="Microsoft.Xna.Framework.Input.Keys" Scope="User">
+ <Value Profile="(Default)">E</Value>
+ </Setting>
+ <Setting Name="ConnectHost" Type="System.String" Scope="User">
+ <Value Profile="(Default)">127.0.0.1</Value>
+ </Setting>
+ <Setting Name="ConnectPort" Type="System.Int32" Scope="User">
+ <Value Profile="(Default)">1337</Value>
+ </Setting>
+ <Setting Name="EnableServer" Type="System.Boolean" Scope="User">
+ <Value Profile="(Default)">True</Value>
+ </Setting>
+ </Settings>
</SettingsFile>
@@ -38,8 +38,11 @@ public BlockDefenderGame()
protected override void Initialize()
{
- GameServer server = new GameServer(new Map(16, 9), AppSettings.Default.ListenPort);
- server.Start();
+ if (AppSettings.Default.EnableServer)
+ {
+ GameServer server = new GameServer(new Map(16, 9), AppSettings.Default.ListenPort);
+ server.Start();
+ }
NetworkClient = new NetworkClient();
Playground = NetworkClient.EstablishConnection();
Oops, something went wrong.

0 comments on commit ace5aef

Please sign in to comment.