示例#1
0
 public UpdGathering(int port)
 {
     this.mPort = port;
     this.mManager = new TrafficManager();
     this.mConnection = new UdpConnection();
     this.mConnection.Bind(this.mPort, User.Current.ID);
     this.mManager.SetConnection(this.mConnection);
 }
示例#2
0
 private void mSupcomTCPConnection_OnExit(object sender, EventArgs e)
 {
     try
     {
         EventLog.WriteLine("Exiting supcom.", LogCategory.Get("SupComGameManager"), new object[0]);
         if (this.BeforeExit != null)
         {
             this.BeforeExit(this, EventArgs.Empty);
         }
         EventLog.WriteLine("BeforeExit Complete.", LogCategory.Get("SupComGameManager"), new object[0]);
         try
         {
             Thread.Sleep(0x3e8);
         }
         catch (ThreadInterruptedException exception)
         {
             ErrorLog.WriteLine(exception);
         }
         try
         {
             Thread.Sleep(0x3e8);
         }
         catch (ThreadInterruptedException exception2)
         {
             ErrorLog.WriteLine(exception2);
         }
         try
         {
             Thread.Sleep(0x3e8);
         }
         catch (ThreadInterruptedException exception3)
         {
             ErrorLog.WriteLine(exception3);
         }
         this.MessageGame("//NOTIFYEXIT " + User.Current.ID.ToString() + " " + User.Current.Name);
         if (this.mGameState != GPG.Multiplayer.Game.GameState.Playing)
         {
             ThreadQueue.Quazal.Enqueue(typeof(Game), "StartGame", null, null, new object[0]);
         }
         if (this.mIsHost)
         {
             ThreadQueue.Quazal.Enqueue(typeof(DataAccess), "ExecuteQuery", null, null, new object[] { "GameEvent", new object[] { User.Current.ID, "ExitFromPlaying: " + System.Enum.GetName(typeof(GPG.Multiplayer.Game.GameState), this.mGameState), this.mGameName, this.mGameName, this.mGameName } });
         }
         int num = 0;
         foreach (SupcomPlayerInfo info in this.GameInfo.Players)
         {
             if (info.Status.ToUpper() != "PLAYING")
             {
                 num++;
             }
         }
         if (ConfigSettings.GetBool("IgnoreResultCount", false))
         {
             num = 0;
         }
         if (ConfigSettings.GetBool("AlwaysKeepGathering", true))
         {
             num = 1;
         }
         if ((ConfigSettings.GetBool("DoEndGame", false) || (this.GameName.IndexOf("AUTOMATCH") < 0)) && ((num == 0) || (this.GameName.IndexOf("AUTOMATCH") < 0)))
         {
             ThreadQueue.Quazal.Enqueue(typeof(Game), "EndGame", null, null, new object[0]);
         }
         if (ConfigSettings.GetBool("OriginalLeaveGame", true))
         {
             ThreadQueue.Quazal.Enqueue(typeof(Game), "LeaveGame", null, null, new object[0]);
         }
         if (this.DoReplay)
         {
             ThreadQueue.Quazal.Enqueue(typeof(DataAccess), "ExecuteQuery", null, null, new object[] { "ReplayCompleted", new object[] { this.mReplayID } });
         }
         EventLog.WriteLine("Calling On Exit.", LogCategory.Get("SupComGameManager"), new object[0]);
         if (this.OnExit != null)
         {
             this.OnExit(this, EventArgs.Empty);
         }
         if (!ConfigSettings.GetBool("OriginalLeaveGame", true))
         {
             ThreadQueue.Quazal.Enqueue(typeof(Game), "LeaveGame", null, null, new object[0]);
         }
         if (this.mTrafficManager != null)
         {
             this.mConnections.Clear();
             this.mTrafficManager.Dispose();
             this.mTrafficManager = null;
         }
     }
     catch (Exception exception4)
     {
         ErrorLog.WriteLine(exception4);
     }
 }
示例#3
0
 public void AbortGame()
 {
     this.mSupcomTCPConnection.Close();
     this.mTrafficManager.Dispose();
     this.mTrafficManager = null;
 }
示例#4
0
 public void Dispose()
 {
     this.mTrafficManager.Dispose();
     this.mTrafficManager = null;
 }