예제 #1
0
파일: Service.cs 프로젝트: clavalle/OCTGN
 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
파일: Service.cs 프로젝트: clavalle/OCTGN
 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);
         }
     }
 }