コード例 #1
0
ファイル: IDataServer.cs プロジェクト: 372285834/GServer
        /*
         * public string TestAutoCode(CSCommon.Data.RoleDetail obj)
         * {
         *  Type objType = obj.GetType();
         *  object[] propsTab = objType.GetCustomAttributes(typeof(DBBindTable), false);
         *  if (propsTab == null)
         *      return null;
         *  DBBindTable bindTab = propsTab[0] as DBBindTable;
         *  System.Reflection.PropertyInfo[] props = objType.GetProperties();
         *  bool first = true;
         *  string result = "";
         *  string temp = "            if (this.{name} != cmp.{name}) \r\n fields.Add(new KeyValuePair<string,object>(\"{name}\",{name})); \r\n";
         *  foreach (System.Reflection.PropertyInfo p in props)
         *  {
         *
         *      object[] attrs = p.GetCustomAttributes(typeof(DBBindField), true);
         *      if (attrs == null || attrs.Length == 0)
         *          continue;
         *      DBBindField dbBind = attrs[0] as DBBindField;
         *      if (dbBind == null)
         *          continue;
         *      result += temp.Replace("{name}", p.Name);
         *  }
         *  return result;
         * }*/


        public void Stop()
        {
            AsyncExecuteThreadManager.Instance.StopThread();

            Thread.AccountLoginThread.Instance.StopThread();
            Thread.PlayerEnterThread.Instance.StopThread();
            Thread.DBConnectManager.Instance.StopThreadPool();

            while (Thread.DBConnectManager.Instance.IsEmptyPool() == false)
            {
                System.Threading.Thread.Sleep(5);
            }

            mTcpSrv.ReceiveData          -= RPC.RPCNetworkMgr.Instance.ServerReceiveData;
            mTcpSrv.CloseConnect         -= this.ServerDisConnected;
            mRegisterConnect.ReceiveData -= RPC.RPCNetworkMgr.Instance.ClientReceiveData;
            mRegisterConnect.NewConnect  -= this.OnRegisterConnected;

            mRegisterConnect.Close();
            mTcpSrv.Close();
            mGateServers.Clear();
            System.Diagnostics.Debug.WriteLine("数据服务器关闭");
            mLinkState = DataServerState.None;

            Log.FileLog.Instance.End();
        }
コード例 #2
0
ファイル: IPlanesServer.cs プロジェクト: 372285834/GServer
        public void Stop()
        {
            Planes.LogicProcessorManager.Instance.StopProcessors();
            //Navigation.INavigation.Instance.CleanupPathFinder();

            mTcpSrv.ReceiveData  -= RPC.RPCNetworkMgr.Instance.ServerReceiveData;
            mTcpSrv.CloseConnect -= this.GateServerDisConnected;

            mRegisterConnect.ReceiveData -= RPC.RPCNetworkMgr.Instance.ClientReceiveData;
            mRegisterConnect.NewConnect  -= this.OnRegisterConnected;

            mDataConnect.ReceiveData -= RPC.RPCNetworkMgr.Instance.ClientReceiveData;
            mDataConnect.NewConnect  -= this.OnDataServerConnected;

            mComConnect.ReceiveData -= RPC.RPCNetworkMgr.Instance.ClientReceiveData;
            mComConnect.NewConnect  -= this.OnComServerConnected;

            //mPathFindConnect.ReceiveData -= RPC.RPCNetworkMgr.Instance.ClientReceiveData;
            //mPathFindConnect.NewConnect -= this.OnFindPathServerConnected;

            mDataConnect.Close();
            mComConnect.Close();
            mRegisterConnect.Close();
            mTcpSrv.Close();
            System.Diagnostics.Debug.WriteLine("位面服务器关闭");
            mLinkState = PlanesServerState.None;

            Log.FileLog.Instance.End();
        }
コード例 #3
0
ファイル: ILogServer.cs プロジェクト: 372285834/GServer
        public void Stop()
        {
            if (mDBConnect != null)
            {
                System.Windows.Forms.MessageBox.Show("数据服务器关闭!");
                mDBConnect.CloseConnect();
                mDBConnect = null;
            }

            mTcpSrv.ReceiveData          -= RPC.RPCNetworkMgr.Instance.ServerReceiveData;
            mTcpSrv.CloseConnect         -= this.ServerDisConnected;
            mRegisterConnect.ReceiveData -= RPC.RPCNetworkMgr.Instance.ClientReceiveData;
            mRegisterConnect.NewConnect  -= this.OnRegisterConnected;

            mRegisterConnect.Close();
            mTcpSrv.Close();
            System.Diagnostics.Debug.WriteLine("数据服务器关闭");
            mLinkState = LogServerState.None;

            Log.FileLog.Instance.End();
        }