Пример #1
0
 protected override void OnStop()
 {
     StopCalled = true;
     Log.Info("OnStop Called");
     if (!Program.Local)
     {
         SasManagerServiceClient.GetContext().Stop();
     }
     Server.Stop();
     this.FireOnServiceStop();
     Log.Info("OnStop Completed");
     LogManager.Shutdown();
 }
Пример #2
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");
 }
Пример #3
0
 public void SetStatus(EnumHostedGameStatus status)
 {
     lock (Locker)
     {
         State.Status = status;
         // Don't use the SasManagerServiceClient if local
         if (IsLocal)
         {
             return;
         }
         if (SasManagerServiceClient.GetContext().ConnectionState == ConnectionState.Connected)
         {
             SasManagerServiceClient.GetContext().HubProxy.Send <ISASToSASManagerService>().Invoke().HostedGameStateChanged(State.Id, status);
         }
     }
 }