Example #1
0
        public override void AfterInit()
        {
            mxEventProcessModule = GetMng().GetModule <NFCEventModule>();
            mxKernelModule       = GetMng().GetModule <NFIKernelModule>();
            mxLogicClassModule   = GetMng().GetModule <NFILogicClassModule>();
            mxProxyToWorldModule = GetMng().GetModule <NFIProxyToWorldModule>();
            mxProxyToGameModule  = GetMng().GetModule <NFIProxyToGameModule>();
            mxElementInfoModule  = GetMng().GetModule <NFIElementModule>();

            System.Diagnostics.Debug.Assert(null != mxEventProcessModule);
            System.Diagnostics.Debug.Assert(null != mxKernelModule);
            System.Diagnostics.Debug.Assert(null != mxLogicClassModule);
            System.Diagnostics.Debug.Assert(null != mxProxyToWorldModule);
            System.Diagnostics.Debug.Assert(null != mxProxyToGameModule);
            System.Diagnostics.Debug.Assert(null != mxElementInfoModule);


            NFILogicClass xLogicClass = mxLogicClassModule.GetElement("Server");

            if (xLogicClass != null)
            {
                List <string> xNameList = xLogicClass.GetConfigNameList();

                foreach (string strConfigName in xNameList)
                {
                    Int64 nServerType = mxElementInfoModule.QueryPropertyInt(strConfigName, "Type");
                    Int64 nServerID   = mxElementInfoModule.QueryPropertyInt(strConfigName, "ServerID");
                    if (nServerType == (long)NFServer_def.NF_SERVER_TYPES.NF_ST_PROXY && GetMng().GetAPPID() == nServerID)
                    {
                        long   nPort       = mxElementInfoModule.QueryPropertyInt(strConfigName, "Port");
                        long   nMaxConnect = mxElementInfoModule.QueryPropertyInt(strConfigName, "MaxOnline");
                        long   nCpus       = mxElementInfoModule.QueryPropertyInt(strConfigName, "CpuCount");
                        string strName     = mxElementInfoModule.QueryPropertyString(strConfigName, "Name");
                        string strIP       = mxElementInfoModule.QueryPropertyString(strConfigName, "IP");

                        //GetNetHandler().RegisterEventCallback(OnSocketEvent);
                        //GetNetHandler().RegisterPackCallback(-1, OnRecivePack);

                        Initialization((UInt32)nMaxConnect, (UInt16)nPort);
                    }
                }
            }
        }
        public override void AfterInit()
        {
            mxEventProcessModule = GetMng().GetModule<NFCEventModule>();
            mxKernelModule = GetMng().GetModule<NFIKernelModule>();
            mxLogicClassModule = GetMng().GetModule<NFILogicClassModule>();
            mxProxyToWorldModule = GetMng().GetModule<NFIProxyToWorldModule>();
            mxProxyToGameModule = GetMng().GetModule<NFIProxyToGameModule>();
            mxElementInfoModule = GetMng().GetModule<NFIElementModule>();

            System.Diagnostics.Debug.Assert(null != mxEventProcessModule);
            System.Diagnostics.Debug.Assert(null != mxKernelModule);
            System.Diagnostics.Debug.Assert(null != mxLogicClassModule);
            System.Diagnostics.Debug.Assert(null != mxProxyToWorldModule);
            System.Diagnostics.Debug.Assert(null != mxProxyToGameModule);
            System.Diagnostics.Debug.Assert(null != mxElementInfoModule);

            NFILogicClass xLogicClass = mxLogicClassModule.GetElement("Server");
            if (xLogicClass != null)
            {
                List<string> xNameList = xLogicClass.GetConfigNameList();

                foreach(string strConfigName in xNameList)
                {
                    Int64 nServerType = mxElementInfoModule.QueryPropertyInt(strConfigName, "Type");
                    Int64 nServerID = mxElementInfoModule.QueryPropertyInt(strConfigName, "ServerID");
                    if (nServerType == (long)NFServer_def.NF_SERVER_TYPES.NF_ST_PROXY && GetMng().GetAPPID() == nServerID)
                    {
                        long nPort = mxElementInfoModule.QueryPropertyInt(strConfigName, "Port");
                        long nMaxConnect = mxElementInfoModule.QueryPropertyInt(strConfigName, "MaxOnline");
                        long nCpus = mxElementInfoModule.QueryPropertyInt(strConfigName, "CpuCount");
                        string strName = mxElementInfoModule.QueryPropertyString(strConfigName, "Name");
                        string strIP = mxElementInfoModule.QueryPropertyString(strConfigName, "IP");

                        //GetNetHandler().RegisterEventCallback(OnSocketEvent);
                        //GetNetHandler().RegisterPackCallback(-1, OnRecivePack);

                        Initialization((UInt32)nMaxConnect, (UInt16)nPort);
                    }
                }
            }
        }