#if USE_UNI_LUA
|
using LuaAPI = UniLua.Lua;
|
using RealStatePtr = UniLua.ILuaState;
|
using LuaCSFunction = UniLua.CSharpFunctionDelegate;
|
#else
|
using LuaAPI = XLua.LuaDLL.Lua;
|
using RealStatePtr = System.IntPtr;
|
using LuaCSFunction = XLua.LuaDLL.lua_CSFunction;
|
#endif
|
|
using XLua;
|
using System.Collections.Generic;
|
|
|
namespace XLua.CSObjectWrap
|
{
|
using Utils = XLua.Utils;
|
public class DebugUtilityWrap
|
{
|
public static void __Register(RealStatePtr L)
|
{
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
System.Type type = typeof(DebugUtility);
|
Utils.BeginObjectRegister(type, L, translator, 0, 3, 2, 1);
|
|
Utils.RegisterFunc(L, Utils.METHOD_IDX, "Init", _m_Init);
|
Utils.RegisterFunc(L, Utils.METHOD_IDX, "CreateDebugRoot", _m_CreateDebugRoot);
|
Utils.RegisterFunc(L, Utils.METHOD_IDX, "RequestDebugAuthority", _m_RequestDebugAuthority);
|
|
|
Utils.RegisterFunc(L, Utils.GETTER_IDX, "debugAccount", _g_get_debugAccount);
|
Utils.RegisterFunc(L, Utils.GETTER_IDX, "debugBranch", _g_get_debugBranch);
|
|
Utils.RegisterFunc(L, Utils.SETTER_IDX, "debugBranch", _s_set_debugBranch);
|
|
|
Utils.EndObjectRegister(type, L, translator, null, null,
|
null, null, null);
|
|
Utils.BeginClassRegister(type, L, __CreateInstance, 5, 0, 0);
|
Utils.RegisterFunc(L, Utils.CLS_IDX, "SetLogAble", _m_SetLogAble_xlua_st_);
|
Utils.RegisterFunc(L, Utils.CLS_IDX, "SetLogWarningAble", _m_SetLogWarningAble_xlua_st_);
|
Utils.RegisterFunc(L, Utils.CLS_IDX, "SetLogErrorAble", _m_SetLogErrorAble_xlua_st_);
|
Utils.RegisterFunc(L, Utils.CLS_IDX, "SetLogNetAble", _m_SetLogNetAble_xlua_st_);
|
|
|
|
|
|
|
Utils.EndClassRegister(type, L, translator);
|
}
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
static int __CreateInstance(RealStatePtr L)
|
{
|
|
try {
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
if(LuaAPI.lua_gettop(L) == 1)
|
{
|
|
DebugUtility gen_ret = new DebugUtility();
|
translator.Push(L, gen_ret);
|
|
return 1;
|
}
|
|
}
|
catch(System.Exception gen_e) {
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
}
|
return LuaAPI.luaL_error(L, "invalid arguments to DebugUtility constructor!");
|
|
}
|
|
|
|
|
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
static int _m_Init(RealStatePtr L)
|
{
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
DebugUtility gen_to_be_invoked = (DebugUtility)translator.FastGetCSObj(L, 1);
|
|
|
|
{
|
|
gen_to_be_invoked.Init( );
|
|
|
|
return 0;
|
}
|
|
} catch(System.Exception gen_e) {
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
}
|
|
}
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
static int _m_CreateDebugRoot(RealStatePtr L)
|
{
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
DebugUtility gen_to_be_invoked = (DebugUtility)translator.FastGetCSObj(L, 1);
|
|
|
|
{
|
|
gen_to_be_invoked.CreateDebugRoot( );
|
|
|
|
return 0;
|
}
|
|
} catch(System.Exception gen_e) {
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
}
|
|
}
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
static int _m_RequestDebugAuthority(RealStatePtr L)
|
{
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
DebugUtility gen_to_be_invoked = (DebugUtility)translator.FastGetCSObj(L, 1);
|
|
|
|
{
|
string __account = LuaAPI.lua_tostring(L, 2);
|
|
gen_to_be_invoked.RequestDebugAuthority( __account );
|
|
|
|
return 0;
|
}
|
|
} catch(System.Exception gen_e) {
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
}
|
|
}
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
static int _m_SetLogAble_xlua_st_(RealStatePtr L)
|
{
|
try {
|
|
|
|
|
{
|
bool __able = LuaAPI.lua_toboolean(L, 1);
|
|
DebugUtility.SetLogAble( __able );
|
|
|
|
return 0;
|
}
|
|
} catch(System.Exception gen_e) {
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
}
|
|
}
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
static int _m_SetLogWarningAble_xlua_st_(RealStatePtr L)
|
{
|
try {
|
|
|
|
|
{
|
bool __able = LuaAPI.lua_toboolean(L, 1);
|
|
DebugUtility.SetLogWarningAble( __able );
|
|
|
|
return 0;
|
}
|
|
} catch(System.Exception gen_e) {
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
}
|
|
}
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
static int _m_SetLogErrorAble_xlua_st_(RealStatePtr L)
|
{
|
try {
|
|
|
|
|
{
|
bool __able = LuaAPI.lua_toboolean(L, 1);
|
|
DebugUtility.SetLogErrorAble( __able );
|
|
|
|
return 0;
|
}
|
|
} catch(System.Exception gen_e) {
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
}
|
|
}
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
static int _m_SetLogNetAble_xlua_st_(RealStatePtr L)
|
{
|
try {
|
|
|
|
|
{
|
bool __able = LuaAPI.lua_toboolean(L, 1);
|
|
DebugUtility.SetLogNetAble( __able );
|
|
|
|
return 0;
|
}
|
|
} catch(System.Exception gen_e) {
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
}
|
|
}
|
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
static int _g_get_debugAccount(RealStatePtr L)
|
{
|
try {
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
DebugUtility gen_to_be_invoked = (DebugUtility)translator.FastGetCSObj(L, 1);
|
LuaAPI.lua_pushboolean(L, gen_to_be_invoked.debugAccount);
|
} catch(System.Exception gen_e) {
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
}
|
return 1;
|
}
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
static int _g_get_debugBranch(RealStatePtr L)
|
{
|
try {
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
DebugUtility gen_to_be_invoked = (DebugUtility)translator.FastGetCSObj(L, 1);
|
LuaAPI.xlua_pushinteger(L, gen_to_be_invoked.debugBranch);
|
} catch(System.Exception gen_e) {
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
}
|
return 1;
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
static int _s_set_debugBranch(RealStatePtr L)
|
{
|
try {
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
DebugUtility gen_to_be_invoked = (DebugUtility)translator.FastGetCSObj(L, 1);
|
gen_to_be_invoked.debugBranch = LuaAPI.xlua_tointeger(L, 2);
|
|
} catch(System.Exception gen_e) {
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
}
|
return 0;
|
}
|
|
|
|
|
|
}
|
}
|