Example #1
0
            private void Init(int param)
            {
                bool ok = ServerCoreLoader.InitSocketProServer(param);

                m_sps      = this;
                m_onAccept = new DOnAccept(OnAccept);
                ServerCoreLoader.SetOnAccept(m_onAccept);
                m_onClose = new DOnClose(OnClose);
                ServerCoreLoader.SetOnClose(m_onClose);
                m_onIdle = new DOnIdle(OnIdle);
                ServerCoreLoader.SetOnIdle(m_onIdle);
                m_onIsPermitted = new DOnIsPermitted(IsPermitted);
                ServerCoreLoader.SetOnIsPermitted(m_onIsPermitted);
                m_shc = new DOnSSLHandShakeCompleted(OnSSLShakeCompleted);
                ServerCoreLoader.SetOnSSLHandShakeCompleted(m_shc);
            }
Example #2
0
        public void luaInit()
        {
            LuaEnv   luaEnv    = GameEntry.Lua.GetLuaEnv();
            LuaTable scriptEnv = luaEnv.NewTable();
            LuaTable meta      = luaEnv.NewTable();

            meta.Set("__index", luaEnv.Global);
            scriptEnv.SetMetaTable(meta);

            meta.Dispose();

            scriptEnv.Set("self", this);
            // 防止误操作 改良一下做法
            string gameObjectName = this.transform.name;

            if (gameObjectName.Contains("(Clone)"))
            {
                gameObjectName = gameObjectName.Split(new string[] { "(Clone)" }, StringSplitOptions.RemoveEmptyEntries)[0];
            }
            //string contents = "require(\"" + nluas[0] + "\")";
            byte[] contents = File.ReadAllBytes(Application.dataPath + "/LuaScripts/" + gameObjectName + ".lua");
            luaEnv.DoString(contents, gameObjectName, scriptEnv);
            Debug.Log("gameObjectName : " + gameObjectName);
            LuaOnInit    = scriptEnv.GetInPath <DOnInit>(gameObjectName + ".OnInit");
            LuaOnRecycle = scriptEnv.GetInPath <Action>(gameObjectName + ".OnRecycle");
            LuaOnOpen    = scriptEnv.GetInPath <Action <object> >(gameObjectName + ".OnOpen");

            dOnClose    = scriptEnv.GetInPath <DOnClose>(gameObjectName + ".OnClose");
            LuaOnPause  = scriptEnv.GetInPath <Action>(gameObjectName + ".OnPause");
            LuaOnResume = scriptEnv.GetInPath <Action>(gameObjectName + ".OnResume");

            LuaOnCover   = scriptEnv.GetInPath <Action>(gameObjectName + ".OnCover");
            LuaOnReveal  = scriptEnv.GetInPath <Action>(gameObjectName + ".OnReveal");
            LuaOnRefocus = scriptEnv.GetInPath <Action <object> >(gameObjectName + ".OnRefocus");

            towNumbers            = scriptEnv.GetInPath <TowFNumbers>(gameObjectName + ".OnUpdate");
            LuaOnDepthChanged     = scriptEnv.GetInPath <Action>(gameObjectName + ".OnDepthChanged");
            LuaInternalSetVisible = scriptEnv.GetInPath <Action>(gameObjectName + ".InternalSetVisible");
        }
Example #3
0
 internal static extern void SetOnClose(DOnClose p);
Example #4
0
 internal static extern void SetOnClose(DOnClose p);