Пример #1
0
        public static void Main(string[] args)
        {
            CliArgs cliArgs = new CliArgs().ParseArgs(args);

            if (cliArgs.IsServer)
            {
                NetworkEngine.GetInstance().NetworkEngineSupport = new Server();
            }
            else if (cliArgs.IsClient)
            {
                NetworkEngine.GetInstance().NetworkEngineSupport = new Client();
            }
            else
            {
                Utils.WriteError("Not Server or Client: Please specify -server or -client.");
                return;
            }

            NetworkEngine.GetInstance().Start();
        }
Пример #2
0
 public static NetworkEngine GetInstance()
 {
     return(_instance ?? (_instance = new NetworkEngine()));
 }