Exemplo n.º 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();
 }
Exemplo n.º 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");
 }
Exemplo n.º 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);
         }
     }
 }