refactor: Window Title According to Network State
This commit is contained in:
parent
65073ec1ca
commit
5afb8b69bf
|
@ -1,4 +1,4 @@
|
||||||
using System;
|
using System;
|
||||||
|
|
||||||
using Microsoft.Xna.Framework;
|
using Microsoft.Xna.Framework;
|
||||||
using Microsoft.Xna.Framework.Graphics;
|
using Microsoft.Xna.Framework.Graphics;
|
||||||
|
@ -139,13 +139,21 @@ public class GamePong : Game
|
||||||
if (commandLineArguments.Length != 1)
|
if (commandLineArguments.Length != 1)
|
||||||
{
|
{
|
||||||
if (commandLineArguments[1].Equals("server", StringComparison.OrdinalIgnoreCase))
|
if (commandLineArguments[1].Equals("server", StringComparison.OrdinalIgnoreCase))
|
||||||
|
{
|
||||||
pongManager.BehaviourController.AddBehaviour<NetworkServer>().Start(8888, 2);
|
pongManager.BehaviourController.AddBehaviour<NetworkServer>().Start(8888, 2);
|
||||||
else
|
Window.Title = "Pong - Server";
|
||||||
pongManager.BehaviourController.AddBehaviour<NetworkClient>().Connect(commandLineArguments[1], 8888);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
|
Window.Title = $"Pong - Client -> {commandLineArguments[1]}";
|
||||||
|
pongManager.BehaviourController.AddBehaviour<NetworkClient>().Connect(commandLineArguments[1], 8888);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
pongManager.BehaviourController.AddBehaviour<NetworkClient>().Connect("127.0.0.1", 8888);
|
pongManager.BehaviourController.AddBehaviour<NetworkClient>().Connect("127.0.0.1", 8888);
|
||||||
|
Window.Title = $"Pong - Client -> 127.0.0.1";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void Update(GameTime gameTime)
|
protected override void Update(GameTime gameTime)
|
||||||
|
|
Loading…
Reference in New Issue