Example #1
0
        static void Main(string[] args)
        {
            Log.InfoFormat("Starting {0}", Assembly.GetEntryAssembly().GetName().Name);
#if (DEBUG)
            Debug = true;
            Log.Debug("Debug mode enabled.");
#else
            //if (UpdateManager.GetContext().Update()) return;
            //UpdateManager.GetContext().OnUpdateDetected += OnOnUpdateDetected;
            //UpdateManager.GetContext().Start();
            AppDomain.CurrentDomain.UnhandledException += CurrentDomainOnUnhandledException;
#endif
            if (HandleArguments(args))
            {
                // arguments didn't fail, so do stuff
                // Setup game state engine
                GameStateEngine.SetContext(HostedGame.ToHostedGameState(EnumHostedGameStatus.Booting), Local);
                //if (Debug || Local)
                //else StartService();
                StartServiceCommandLine();
            }
            if (Debug)
            {
                Console.WriteLine();
                Console.WriteLine("Any key to exit");
                Console.ReadKey();
            }
        }
Example #2
0
 public static void SetContext(IHostedGameState state, bool isLocal)
 {
     lock (SingletonLocker)
     {
         if (current == null)
             current = new GameStateEngine(state, isLocal);
     }
 }
Example #3
0
 public static void SetContext(IHostedGameState state, bool isLocal)
 {
     lock (SingletonLocker)
     {
         if (current == null)
         {
             current = new GameStateEngine(state, isLocal);
         }
     }
 }
Example #4
0
 public void Start()
 {
     Log.Info("Starting");
     this.OnStart(null);
     Server         = new Server(GameStateEngine.GetContext(), Program.BroadcastPort);
     Server.OnStop += (sender, args) => { if (!StopCalled)
                                          {
                                              this.Stop();
                                          }
     };
     Log.Info("Started");
 }
Example #5
0
 public void Start()
 {
     Log.Info("Starting");
     this.OnStart(null);
     if (!Program.Local)
     {
         SasManagerServiceClient.GetContext().Start();
     }
     Server         = new Server(GameStateEngine.GetContext());
     Server.OnStop += (sender, args) => { if (!StopCalled)
                                          {
                                              this.Stop();
                                          }
     };
     Log.Info("Started");
 }