Skip to content
Snippets Groups Projects
Commit 570064e3 authored by Sillinger Péter's avatar Sillinger Péter
Browse files

Connect said parser to Main.

parent dc02d02f
No related branches found
No related tags found
No related merge requests found
......@@ -35,7 +35,7 @@ namespace zsirozas
//client options
//
[Option("connect", SetName = "toplevel", HelpText = "Connect to the specified game server using the RawTcp protocol.", MetaValue = "IP PORT LISTENPORT", Min = 3, Max = 3)]
[Option("connect", SetName = "toplevel", HelpText = "Connect to the specified game server using the RawTcp protocol.\nThe server will push to LISTENPORT.", MetaValue = "IP PORT LISTENPORT", Min = 3, Max = 3)]
public IEnumerable<string> TcpConnectParams { get; set; }
[Option("connect-signalr", SetName = "toplevel", HelpText = "Connect to server with SignalR instead.", MetaValue = "URL")]
......@@ -50,15 +50,34 @@ namespace zsirozas
{
public static void Main(string[] args)
{
if (args.Contains("--server"))
//if (args.Contains("--server"))
//{
// var srv = new GameServer(args.Contains("--bigroom"), args.Contains("--oneshot"));
// new ServerWrapper(srv).Run(args.Contains("--signalr"), !args.Contains("--notcp"));
//}
//else
//{
// Application.Run(new Form1());
//}
Parser.Default.ParseArguments<CommandLineOptions>(args).WithParsed((options) =>
{
var srv = new GameServer(args.Contains("--bigroom"), args.Contains("--oneshot"));
new ServerWrapper(srv).Run(args.Contains("--signalr"), !args.Contains("--notcp"));
if (options.StartServer)
{
var srv = new GameServer(options.BigRoom, options.OneShot);
new ServerWrapper(srv).Run(options.StartSignalR, !options.NoTcp);
}
else
{
if (options.WithConsole)
{
Console.WriteLine("This is not yet supported. Sorry :(");
}
else
{
Application.Run(new Form1());
}
}
});
}
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment