private static int GetNoticeInfo(IntPtr L)
    {
        int result;

        try
        {
            ToLua.CheckArgsCount(L, 2);
            CenterServerManager centerServerManager = (CenterServerManager)ToLua.CheckObject(L, 1, typeof(CenterServerManager));
            LuaTypes            luaTypes            = LuaDLL.lua_type(L, 2);
            Action <string>     callback;
            if (luaTypes != LuaTypes.LUA_TFUNCTION)
            {
                callback = (Action <string>)ToLua.CheckObject(L, 2, typeof(Action <string>));
            }
            else
            {
                LuaFunction func = ToLua.ToLuaFunction(L, 2);
                callback = (DelegateFactory.CreateDelegate(typeof(Action <string>), func) as Action <string>);
            }
            centerServerManager.GetNoticeInfo(callback);
            result = 0;
        }
        catch (Exception e)
        {
            result = LuaDLL.toluaL_exception(L, e, null);
        }
        return(result);
    }
Esempio n. 2
0
 static int GetNoticeInfo(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 2);
         CenterServerManager    obj  = (CenterServerManager)ToLua.CheckObject(L, 1, typeof(CenterServerManager));
         System.Action <string> arg0 = (System.Action <string>)ToLua.CheckDelegate <System.Action <string> >(L, 2);
         obj.GetNoticeInfo(arg0);
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }