Ejemplo n.º 1
0
    private static int TryFixNet(IntPtr L)
    {
        int num = LuaDLL.lua_gettop(L);

        if (num == 3)
        {
            HotfixManager hotfixManager = (HotfixManager)LuaScriptMgr.GetNetObjectSelf(L, 1, "HotfixManager");
            HotfixMode    mode          = (HotfixMode)((int)LuaScriptMgr.GetNetObject(L, 2, typeof(HotfixMode)));
            string        luaString     = LuaScriptMgr.GetLuaString(L, 3);
            bool          b             = hotfixManager.TryFixNet(mode, luaString);
            LuaScriptMgr.Push(L, b);
            return(1);
        }
        if (num == 4)
        {
            HotfixManager hotfixManager2 = (HotfixManager)LuaScriptMgr.GetNetObjectSelf(L, 1, "HotfixManager");
            HotfixMode    mode2          = (HotfixMode)((int)LuaScriptMgr.GetNetObject(L, 2, typeof(HotfixMode)));
            uint          udid           = (uint)LuaScriptMgr.GetNumber(L, 3);
            object        varObject      = LuaScriptMgr.GetVarObject(L, 4);
            bool          b2             = hotfixManager2.TryFixNet(mode2, udid, varObject);
            LuaScriptMgr.Push(L, b2);
            return(1);
        }
        LuaDLL.luaL_error(L, "invalid arguments to method: HotfixManager.TryFixNet");
        return(0);
    }
Ejemplo n.º 2
0
 public bool TryFixNet(HotfixMode _mode, string _route)
 {
     if (!this.useHotfix || !this.init)
     {
         return(false);
     }
     if (_mode == HotfixMode.BEFORE)
     {
         if (this.func_net_b != null)
         {
             object[] array = this.func_net_b.Call(new object[]
             {
                 _route
             });
             return((bool)array[0]);
         }
     }
     else if (this.func_net_a != null)
     {
         object[] array2 = this.func_net_a.Call(new object[]
         {
             _route
         });
         return((bool)array2[0]);
     }
     return(false);
 }
Ejemplo n.º 3
0
 public bool TryFixClick(HotfixMode _mode, string _path)
 {
     if (!this.useHotfix || !this.init)
     {
         return(false);
     }
     if (_mode == HotfixMode.BEFORE)
     {
         if (this.func_click_b != null)
         {
             object[] array = this.func_click_b.Call(new object[]
             {
                 _path
             });
             return(array != null && (bool)array[0]);
         }
     }
     else
     {
         if (this.func_click_a != null)
         {
             object[] array2 = this.func_click_a.Call(new object[]
             {
                 _path
             });
             return(array2 != null && (bool)array2[0]);
         }
         XSingleton <XDebug> .singleton.AddErrorLog("func _a is nul", null, null, null, null, null);
     }
     return(false);
 }
Ejemplo n.º 4
0
    private static int TryFixClick(IntPtr L)
    {
        LuaScriptMgr.CheckArgsCount(L, 3);
        HotfixManager hotfixManager = (HotfixManager)LuaScriptMgr.GetNetObjectSelf(L, 1, "HotfixManager");
        HotfixMode    mode          = (HotfixMode)((int)LuaScriptMgr.GetNetObject(L, 2, typeof(HotfixMode)));
        string        luaString     = LuaScriptMgr.GetLuaString(L, 3);
        bool          b             = hotfixManager.TryFixClick(mode, luaString);

        LuaScriptMgr.Push(L, b);
        return(1);
    }
Ejemplo n.º 5
0
    private static int TryFixHandler(IntPtr L)
    {
        LuaScriptMgr.CheckArgsCount(L, 4);
        HotfixManager hotfixManager = (HotfixManager)LuaScriptMgr.GetNetObjectSelf(L, 1, "HotfixManager");
        HotfixMode    mode          = (HotfixMode)((int)LuaScriptMgr.GetNetObject(L, 2, typeof(HotfixMode)));
        string        luaString     = LuaScriptMgr.GetLuaString(L, 3);
        GameObject    go            = (GameObject)LuaScriptMgr.GetUnityObject(L, 4, typeof(GameObject));
        bool          b             = hotfixManager.TryFixHandler(mode, luaString, go);

        LuaScriptMgr.Push(L, b);
        return(1);
    }
Ejemplo n.º 6
0
 public bool TryFixRefresh(HotfixMode _mode, string _pageName, GameObject go)
 {
     if (_pageName == "LoadingDlg" || _pageName == "LoginDlg" || _pageName == "LoginTip")
     {
         return(false);
     }
     if (this.useHotfix && this.init)
     {
         string name = "Hotfix" + _pageName + ".lua";
         bool   flag = this.DoLuaFile(name);
         if (flag)
         {
             this.func_refresh = null;
             if (_mode == HotfixMode.BEFORE)
             {
                 this.func_refresh = this.hotfixLua.lua.GetFunction(_pageName + ".BeforeRefresh");
             }
             else if (_mode == HotfixMode.AFTER)
             {
                 this.func_refresh = this.hotfixLua.lua.GetFunction(_pageName + ".AfterRefresh");
             }
             else if (_mode == HotfixMode.HIDE)
             {
                 this.func_refresh = this.hotfixLua.lua.GetFunction(_pageName + ".Hide");
             }
             if (this.func_refresh != null)
             {
                 object[] array = this.func_refresh.Call(new object[]
                 {
                     go
                 });
                 this.func_refresh.Release();
                 return(array != null && (bool)array[0]);
             }
             XSingleton <XDebug> .singleton.AddLog(string.Concat(new object[]
             {
                 "func is null!",
                 _pageName,
                 " mode: ",
                 _mode
             }), null, null, null, null, null, XDebugColor.XDebug_None);
         }
     }
     return(false);
 }
Ejemplo n.º 7
0
 public bool TryFixHandler(HotfixMode _mode, string _handlerName, GameObject go)
 {
     if (this.useHotfix && this.init)
     {
         string name = "Hotfix" + _handlerName + ".lua";
         bool   flag = this.DoLuaFile(name);
         if (flag)
         {
             this.func_refresh = this.hotfixLua.lua.GetFunction((_mode != HotfixMode.BEFORE) ? (_handlerName + ".AfterHandlerShow") : (_handlerName + ".BeforeHandlerShow"));
             if (this.func_refresh != null)
             {
                 object[] array = this.func_refresh.Call(new object[]
                 {
                     go
                 });
                 this.func_refresh.Release();
                 return(array != null && (bool)array[0]);
             }
             XSingleton <XDebug> .singleton.AddErrorLog("func is null! " + _handlerName, null, null, null, null, null);
         }
     }
     return(false);
 }