Initial commit: Client Doc docs Server Tools
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,718 @@
|
||||
#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 = XLuaBase.lua_CSFunction;
|
||||
#endif
|
||||
|
||||
using XLua;
|
||||
using System.Collections.Generic;
|
||||
|
||||
|
||||
namespace XLua.CSObjectWrap
|
||||
{
|
||||
using Utils = XLua.Utils;
|
||||
public class XLuaLuaEnvWrap
|
||||
{
|
||||
public static void __Register(RealStatePtr L)
|
||||
{
|
||||
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
||||
System.Type type = typeof(XLua.LuaEnv);
|
||||
Utils.BeginObjectRegister(type, L, translator, 0, 14, 4, 2);
|
||||
|
||||
Utils.RegisterFunc(L, Utils.METHOD_IDX, "LoadString", _m_LoadString);
|
||||
Utils.RegisterFunc(L, Utils.METHOD_IDX, "DoString", _m_DoString);
|
||||
Utils.RegisterFunc(L, Utils.METHOD_IDX, "Alias", _m_Alias);
|
||||
Utils.RegisterFunc(L, Utils.METHOD_IDX, "Tick", _m_Tick);
|
||||
Utils.RegisterFunc(L, Utils.METHOD_IDX, "GC", _m_GC);
|
||||
Utils.RegisterFunc(L, Utils.METHOD_IDX, "NewTable", _m_NewTable);
|
||||
Utils.RegisterFunc(L, Utils.METHOD_IDX, "Dispose", _m_Dispose);
|
||||
Utils.RegisterFunc(L, Utils.METHOD_IDX, "ThrowExceptionFromError", _m_ThrowExceptionFromError);
|
||||
Utils.RegisterFunc(L, Utils.METHOD_IDX, "AddLoader", _m_AddLoader);
|
||||
Utils.RegisterFunc(L, Utils.METHOD_IDX, "AddBuildin", _m_AddBuildin);
|
||||
Utils.RegisterFunc(L, Utils.METHOD_IDX, "FullGc", _m_FullGc);
|
||||
Utils.RegisterFunc(L, Utils.METHOD_IDX, "StopGc", _m_StopGc);
|
||||
Utils.RegisterFunc(L, Utils.METHOD_IDX, "RestartGc", _m_RestartGc);
|
||||
Utils.RegisterFunc(L, Utils.METHOD_IDX, "GcStep", _m_GcStep);
|
||||
|
||||
|
||||
Utils.RegisterFunc(L, Utils.GETTER_IDX, "Global", _g_get_Global);
|
||||
Utils.RegisterFunc(L, Utils.GETTER_IDX, "GcPause", _g_get_GcPause);
|
||||
Utils.RegisterFunc(L, Utils.GETTER_IDX, "GcStepmul", _g_get_GcStepmul);
|
||||
Utils.RegisterFunc(L, Utils.GETTER_IDX, "Memroy", _g_get_Memroy);
|
||||
|
||||
Utils.RegisterFunc(L, Utils.SETTER_IDX, "GcPause", _s_set_GcPause);
|
||||
Utils.RegisterFunc(L, Utils.SETTER_IDX, "GcStepmul", _s_set_GcStepmul);
|
||||
|
||||
|
||||
Utils.EndObjectRegister(type, L, translator, null, null,
|
||||
null, null, null);
|
||||
|
||||
Utils.BeginClassRegister(type, L, __CreateInstance, 4, 0, 0);
|
||||
Utils.RegisterFunc(L, Utils.CLS_IDX, "AddIniter", _m_AddIniter_xlua_st_);
|
||||
|
||||
|
||||
Utils.RegisterObject(L, translator, Utils.CLS_IDX, "CSHARP_NAMESPACE", XLua.LuaEnv.CSHARP_NAMESPACE);
|
||||
Utils.RegisterObject(L, translator, Utils.CLS_IDX, "MAIN_SHREAD", XLua.LuaEnv.MAIN_SHREAD);
|
||||
|
||||
|
||||
|
||||
|
||||
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)
|
||||
{
|
||||
|
||||
var gen_ret = new XLua.LuaEnv();
|
||||
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 XLua.LuaEnv constructor!");
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
||||
static int _m_AddIniter_xlua_st_(RealStatePtr L)
|
||||
{
|
||||
try {
|
||||
|
||||
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
||||
|
||||
|
||||
|
||||
|
||||
{
|
||||
System.Action<XLua.LuaEnv, XLua.ObjectTranslator> _initer = translator.GetDelegate<System.Action<XLua.LuaEnv, XLua.ObjectTranslator>>(L, 1);
|
||||
|
||||
XLua.LuaEnv.AddIniter( _initer );
|
||||
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
} catch(System.Exception gen_e) {
|
||||
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
||||
static int _m_LoadString(RealStatePtr L)
|
||||
{
|
||||
try {
|
||||
|
||||
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
||||
|
||||
|
||||
XLua.LuaEnv gen_to_be_invoked = (XLua.LuaEnv)translator.FastGetCSObj(L, 1);
|
||||
|
||||
|
||||
int gen_param_count = LuaAPI.lua_gettop(L);
|
||||
|
||||
if(gen_param_count == 4&& (LuaAPI.lua_isnil(L, 2) || LuaAPI.lua_type(L, 2) == LuaTypes.LUA_TSTRING)&& (LuaAPI.lua_isnil(L, 3) || LuaAPI.lua_type(L, 3) == LuaTypes.LUA_TSTRING)&& (LuaAPI.lua_isnil(L, 4) || LuaAPI.lua_type(L, 4) == LuaTypes.LUA_TTABLE))
|
||||
{
|
||||
string _chunk = LuaAPI.lua_tostring(L, 2);
|
||||
string _chunkName = LuaAPI.lua_tostring(L, 3);
|
||||
XLua.LuaTable _env = (XLua.LuaTable)translator.GetObject(L, 4, typeof(XLua.LuaTable));
|
||||
|
||||
var gen_ret = gen_to_be_invoked.LoadString( _chunk, _chunkName, _env );
|
||||
translator.Push(L, gen_ret);
|
||||
|
||||
|
||||
|
||||
return 1;
|
||||
}
|
||||
if(gen_param_count == 3&& (LuaAPI.lua_isnil(L, 2) || LuaAPI.lua_type(L, 2) == LuaTypes.LUA_TSTRING)&& (LuaAPI.lua_isnil(L, 3) || LuaAPI.lua_type(L, 3) == LuaTypes.LUA_TSTRING))
|
||||
{
|
||||
string _chunk = LuaAPI.lua_tostring(L, 2);
|
||||
string _chunkName = LuaAPI.lua_tostring(L, 3);
|
||||
|
||||
var gen_ret = gen_to_be_invoked.LoadString( _chunk, _chunkName );
|
||||
translator.Push(L, gen_ret);
|
||||
|
||||
|
||||
|
||||
return 1;
|
||||
}
|
||||
if(gen_param_count == 2&& (LuaAPI.lua_isnil(L, 2) || LuaAPI.lua_type(L, 2) == LuaTypes.LUA_TSTRING))
|
||||
{
|
||||
string _chunk = LuaAPI.lua_tostring(L, 2);
|
||||
|
||||
var gen_ret = gen_to_be_invoked.LoadString( _chunk );
|
||||
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 XLua.LuaEnv.LoadString!");
|
||||
|
||||
}
|
||||
|
||||
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
||||
static int _m_DoString(RealStatePtr L)
|
||||
{
|
||||
try {
|
||||
|
||||
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
||||
|
||||
|
||||
XLua.LuaEnv gen_to_be_invoked = (XLua.LuaEnv)translator.FastGetCSObj(L, 1);
|
||||
|
||||
|
||||
int gen_param_count = LuaAPI.lua_gettop(L);
|
||||
|
||||
if(gen_param_count == 4&& (LuaAPI.lua_isnil(L, 2) || LuaAPI.lua_type(L, 2) == LuaTypes.LUA_TSTRING)&& (LuaAPI.lua_isnil(L, 3) || LuaAPI.lua_type(L, 3) == LuaTypes.LUA_TSTRING)&& (LuaAPI.lua_isnil(L, 4) || LuaAPI.lua_type(L, 4) == LuaTypes.LUA_TTABLE))
|
||||
{
|
||||
byte[] _chunk = LuaAPI.lua_tobytes(L, 2);
|
||||
string _chunkName = LuaAPI.lua_tostring(L, 3);
|
||||
XLua.LuaTable _env = (XLua.LuaTable)translator.GetObject(L, 4, typeof(XLua.LuaTable));
|
||||
|
||||
var gen_ret = gen_to_be_invoked.DoString( _chunk, _chunkName, _env );
|
||||
translator.Push(L, gen_ret);
|
||||
|
||||
|
||||
|
||||
return 1;
|
||||
}
|
||||
if(gen_param_count == 3&& (LuaAPI.lua_isnil(L, 2) || LuaAPI.lua_type(L, 2) == LuaTypes.LUA_TSTRING)&& (LuaAPI.lua_isnil(L, 3) || LuaAPI.lua_type(L, 3) == LuaTypes.LUA_TSTRING))
|
||||
{
|
||||
byte[] _chunk = LuaAPI.lua_tobytes(L, 2);
|
||||
string _chunkName = LuaAPI.lua_tostring(L, 3);
|
||||
|
||||
var gen_ret = gen_to_be_invoked.DoString( _chunk, _chunkName );
|
||||
translator.Push(L, gen_ret);
|
||||
|
||||
|
||||
|
||||
return 1;
|
||||
}
|
||||
if(gen_param_count == 2&& (LuaAPI.lua_isnil(L, 2) || LuaAPI.lua_type(L, 2) == LuaTypes.LUA_TSTRING))
|
||||
{
|
||||
byte[] _chunk = LuaAPI.lua_tobytes(L, 2);
|
||||
|
||||
var gen_ret = gen_to_be_invoked.DoString( _chunk );
|
||||
translator.Push(L, gen_ret);
|
||||
|
||||
|
||||
|
||||
return 1;
|
||||
}
|
||||
if(gen_param_count == 4&& (LuaAPI.lua_isnil(L, 2) || LuaAPI.lua_type(L, 2) == LuaTypes.LUA_TSTRING)&& (LuaAPI.lua_isnil(L, 3) || LuaAPI.lua_type(L, 3) == LuaTypes.LUA_TSTRING)&& (LuaAPI.lua_isnil(L, 4) || LuaAPI.lua_type(L, 4) == LuaTypes.LUA_TTABLE))
|
||||
{
|
||||
string _chunk = LuaAPI.lua_tostring(L, 2);
|
||||
string _chunkName = LuaAPI.lua_tostring(L, 3);
|
||||
XLua.LuaTable _env = (XLua.LuaTable)translator.GetObject(L, 4, typeof(XLua.LuaTable));
|
||||
|
||||
var gen_ret = gen_to_be_invoked.DoString( _chunk, _chunkName, _env );
|
||||
translator.Push(L, gen_ret);
|
||||
|
||||
|
||||
|
||||
return 1;
|
||||
}
|
||||
if(gen_param_count == 3&& (LuaAPI.lua_isnil(L, 2) || LuaAPI.lua_type(L, 2) == LuaTypes.LUA_TSTRING)&& (LuaAPI.lua_isnil(L, 3) || LuaAPI.lua_type(L, 3) == LuaTypes.LUA_TSTRING))
|
||||
{
|
||||
string _chunk = LuaAPI.lua_tostring(L, 2);
|
||||
string _chunkName = LuaAPI.lua_tostring(L, 3);
|
||||
|
||||
var gen_ret = gen_to_be_invoked.DoString( _chunk, _chunkName );
|
||||
translator.Push(L, gen_ret);
|
||||
|
||||
|
||||
|
||||
return 1;
|
||||
}
|
||||
if(gen_param_count == 2&& (LuaAPI.lua_isnil(L, 2) || LuaAPI.lua_type(L, 2) == LuaTypes.LUA_TSTRING))
|
||||
{
|
||||
string _chunk = LuaAPI.lua_tostring(L, 2);
|
||||
|
||||
var gen_ret = gen_to_be_invoked.DoString( _chunk );
|
||||
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 XLua.LuaEnv.DoString!");
|
||||
|
||||
}
|
||||
|
||||
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
||||
static int _m_Alias(RealStatePtr L)
|
||||
{
|
||||
try {
|
||||
|
||||
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
||||
|
||||
|
||||
XLua.LuaEnv gen_to_be_invoked = (XLua.LuaEnv)translator.FastGetCSObj(L, 1);
|
||||
|
||||
|
||||
|
||||
{
|
||||
System.Type _type = (System.Type)translator.GetObject(L, 2, typeof(System.Type));
|
||||
string _alias = LuaAPI.lua_tostring(L, 3);
|
||||
|
||||
gen_to_be_invoked.Alias( _type, _alias );
|
||||
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
} catch(System.Exception gen_e) {
|
||||
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
||||
static int _m_Tick(RealStatePtr L)
|
||||
{
|
||||
try {
|
||||
|
||||
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
||||
|
||||
|
||||
XLua.LuaEnv gen_to_be_invoked = (XLua.LuaEnv)translator.FastGetCSObj(L, 1);
|
||||
|
||||
|
||||
|
||||
{
|
||||
|
||||
gen_to_be_invoked.Tick( );
|
||||
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
} catch(System.Exception gen_e) {
|
||||
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
||||
static int _m_GC(RealStatePtr L)
|
||||
{
|
||||
try {
|
||||
|
||||
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
||||
|
||||
|
||||
XLua.LuaEnv gen_to_be_invoked = (XLua.LuaEnv)translator.FastGetCSObj(L, 1);
|
||||
|
||||
|
||||
|
||||
{
|
||||
|
||||
gen_to_be_invoked.GC( );
|
||||
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
} catch(System.Exception gen_e) {
|
||||
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
||||
static int _m_NewTable(RealStatePtr L)
|
||||
{
|
||||
try {
|
||||
|
||||
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
||||
|
||||
|
||||
XLua.LuaEnv gen_to_be_invoked = (XLua.LuaEnv)translator.FastGetCSObj(L, 1);
|
||||
|
||||
|
||||
|
||||
{
|
||||
|
||||
var gen_ret = gen_to_be_invoked.NewTable( );
|
||||
translator.Push(L, gen_ret);
|
||||
|
||||
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
} catch(System.Exception gen_e) {
|
||||
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
||||
static int _m_Dispose(RealStatePtr L)
|
||||
{
|
||||
try {
|
||||
|
||||
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
||||
|
||||
|
||||
XLua.LuaEnv gen_to_be_invoked = (XLua.LuaEnv)translator.FastGetCSObj(L, 1);
|
||||
|
||||
|
||||
int gen_param_count = LuaAPI.lua_gettop(L);
|
||||
|
||||
if(gen_param_count == 1)
|
||||
{
|
||||
|
||||
gen_to_be_invoked.Dispose( );
|
||||
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
if(gen_param_count == 2&& LuaTypes.LUA_TBOOLEAN == LuaAPI.lua_type(L, 2))
|
||||
{
|
||||
bool _dispose = LuaAPI.lua_toboolean(L, 2);
|
||||
|
||||
gen_to_be_invoked.Dispose( _dispose );
|
||||
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
} catch(System.Exception gen_e) {
|
||||
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
||||
}
|
||||
|
||||
return LuaAPI.luaL_error(L, "invalid arguments to XLua.LuaEnv.Dispose!");
|
||||
|
||||
}
|
||||
|
||||
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
||||
static int _m_ThrowExceptionFromError(RealStatePtr L)
|
||||
{
|
||||
try {
|
||||
|
||||
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
||||
|
||||
|
||||
XLua.LuaEnv gen_to_be_invoked = (XLua.LuaEnv)translator.FastGetCSObj(L, 1);
|
||||
|
||||
|
||||
|
||||
{
|
||||
int _oldTop = LuaAPI.xlua_tointeger(L, 2);
|
||||
|
||||
gen_to_be_invoked.ThrowExceptionFromError( _oldTop );
|
||||
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
} catch(System.Exception gen_e) {
|
||||
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
||||
static int _m_AddLoader(RealStatePtr L)
|
||||
{
|
||||
try {
|
||||
|
||||
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
||||
|
||||
|
||||
XLua.LuaEnv gen_to_be_invoked = (XLua.LuaEnv)translator.FastGetCSObj(L, 1);
|
||||
|
||||
|
||||
|
||||
{
|
||||
XLua.LuaEnv.CustomLoader _loader = translator.GetDelegate<XLua.LuaEnv.CustomLoader>(L, 2);
|
||||
|
||||
gen_to_be_invoked.AddLoader( _loader );
|
||||
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
} catch(System.Exception gen_e) {
|
||||
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
||||
static int _m_AddBuildin(RealStatePtr L)
|
||||
{
|
||||
try {
|
||||
|
||||
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
||||
|
||||
|
||||
XLua.LuaEnv gen_to_be_invoked = (XLua.LuaEnv)translator.FastGetCSObj(L, 1);
|
||||
|
||||
|
||||
|
||||
{
|
||||
string _name = LuaAPI.lua_tostring(L, 2);
|
||||
XLuaBase.lua_CSFunction _initer = translator.GetDelegate<XLuaBase.lua_CSFunction>(L, 3);
|
||||
|
||||
gen_to_be_invoked.AddBuildin( _name, _initer );
|
||||
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
} catch(System.Exception gen_e) {
|
||||
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
||||
static int _m_FullGc(RealStatePtr L)
|
||||
{
|
||||
try {
|
||||
|
||||
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
||||
|
||||
|
||||
XLua.LuaEnv gen_to_be_invoked = (XLua.LuaEnv)translator.FastGetCSObj(L, 1);
|
||||
|
||||
|
||||
|
||||
{
|
||||
|
||||
gen_to_be_invoked.FullGc( );
|
||||
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
} catch(System.Exception gen_e) {
|
||||
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
||||
static int _m_StopGc(RealStatePtr L)
|
||||
{
|
||||
try {
|
||||
|
||||
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
||||
|
||||
|
||||
XLua.LuaEnv gen_to_be_invoked = (XLua.LuaEnv)translator.FastGetCSObj(L, 1);
|
||||
|
||||
|
||||
|
||||
{
|
||||
|
||||
gen_to_be_invoked.StopGc( );
|
||||
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
} catch(System.Exception gen_e) {
|
||||
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
||||
static int _m_RestartGc(RealStatePtr L)
|
||||
{
|
||||
try {
|
||||
|
||||
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
||||
|
||||
|
||||
XLua.LuaEnv gen_to_be_invoked = (XLua.LuaEnv)translator.FastGetCSObj(L, 1);
|
||||
|
||||
|
||||
|
||||
{
|
||||
|
||||
gen_to_be_invoked.RestartGc( );
|
||||
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
} catch(System.Exception gen_e) {
|
||||
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
||||
static int _m_GcStep(RealStatePtr L)
|
||||
{
|
||||
try {
|
||||
|
||||
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
||||
|
||||
|
||||
XLua.LuaEnv gen_to_be_invoked = (XLua.LuaEnv)translator.FastGetCSObj(L, 1);
|
||||
|
||||
|
||||
|
||||
{
|
||||
int _data = LuaAPI.xlua_tointeger(L, 2);
|
||||
|
||||
var gen_ret = gen_to_be_invoked.GcStep( _data );
|
||||
LuaAPI.lua_pushboolean(L, gen_ret);
|
||||
|
||||
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
} catch(System.Exception gen_e) {
|
||||
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
||||
static int _g_get_Global(RealStatePtr L)
|
||||
{
|
||||
try {
|
||||
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
||||
|
||||
XLua.LuaEnv gen_to_be_invoked = (XLua.LuaEnv)translator.FastGetCSObj(L, 1);
|
||||
translator.Push(L, gen_to_be_invoked.Global);
|
||||
} catch(System.Exception gen_e) {
|
||||
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
||||
static int _g_get_GcPause(RealStatePtr L)
|
||||
{
|
||||
try {
|
||||
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
||||
|
||||
XLua.LuaEnv gen_to_be_invoked = (XLua.LuaEnv)translator.FastGetCSObj(L, 1);
|
||||
LuaAPI.xlua_pushinteger(L, gen_to_be_invoked.GcPause);
|
||||
} catch(System.Exception gen_e) {
|
||||
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
||||
static int _g_get_GcStepmul(RealStatePtr L)
|
||||
{
|
||||
try {
|
||||
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
||||
|
||||
XLua.LuaEnv gen_to_be_invoked = (XLua.LuaEnv)translator.FastGetCSObj(L, 1);
|
||||
LuaAPI.xlua_pushinteger(L, gen_to_be_invoked.GcStepmul);
|
||||
} catch(System.Exception gen_e) {
|
||||
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
||||
static int _g_get_Memroy(RealStatePtr L)
|
||||
{
|
||||
try {
|
||||
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
||||
|
||||
XLua.LuaEnv gen_to_be_invoked = (XLua.LuaEnv)translator.FastGetCSObj(L, 1);
|
||||
LuaAPI.xlua_pushinteger(L, gen_to_be_invoked.Memroy);
|
||||
} catch(System.Exception gen_e) {
|
||||
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
|
||||
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
||||
static int _s_set_GcPause(RealStatePtr L)
|
||||
{
|
||||
try {
|
||||
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
||||
|
||||
XLua.LuaEnv gen_to_be_invoked = (XLua.LuaEnv)translator.FastGetCSObj(L, 1);
|
||||
gen_to_be_invoked.GcPause = LuaAPI.xlua_tointeger(L, 2);
|
||||
|
||||
} catch(System.Exception gen_e) {
|
||||
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
||||
static int _s_set_GcStepmul(RealStatePtr L)
|
||||
{
|
||||
try {
|
||||
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
||||
|
||||
XLua.LuaEnv gen_to_be_invoked = (XLua.LuaEnv)translator.FastGetCSObj(L, 1);
|
||||
gen_to_be_invoked.GcStepmul = LuaAPI.xlua_tointeger(L, 2);
|
||||
|
||||
} catch(System.Exception gen_e) {
|
||||
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user