540 lines
18 KiB
C#
540 lines
18 KiB
C#
#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 BFBFMainWrap
|
|
{
|
|
public static void __Register(RealStatePtr L)
|
|
{
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
System.Type type = typeof(BF.BFMain);
|
|
Utils.BeginObjectRegister(type, L, translator, 0, 2, 14, 0);
|
|
|
|
Utils.RegisterFunc(L, Utils.METHOD_IDX, "StartGame", _m_StartGame);
|
|
Utils.RegisterFunc(L, Utils.METHOD_IDX, "Destroy", _m_Destroy);
|
|
|
|
|
|
Utils.RegisterFunc(L, Utils.GETTER_IDX, "GameLaunchMgr", _g_get_GameLaunchMgr);
|
|
Utils.RegisterFunc(L, Utils.GETTER_IDX, "LuaMgr", _g_get_LuaMgr);
|
|
Utils.RegisterFunc(L, Utils.GETTER_IDX, "LoomMgr", _g_get_LoomMgr);
|
|
Utils.RegisterFunc(L, Utils.GETTER_IDX, "PoolMgr", _g_get_PoolMgr);
|
|
Utils.RegisterFunc(L, Utils.GETTER_IDX, "TouchMgr", _g_get_TouchMgr);
|
|
Utils.RegisterFunc(L, Utils.GETTER_IDX, "RenderMgr", _g_get_RenderMgr);
|
|
Utils.RegisterFunc(L, Utils.GETTER_IDX, "ResMgr", _g_get_ResMgr);
|
|
Utils.RegisterFunc(L, Utils.GETTER_IDX, "NetMgr", _g_get_NetMgr);
|
|
Utils.RegisterFunc(L, Utils.GETTER_IDX, "WebRequestMgr", _g_get_WebRequestMgr);
|
|
Utils.RegisterFunc(L, Utils.GETTER_IDX, "OneShotManager", _g_get_OneShotManager);
|
|
Utils.RegisterFunc(L, Utils.GETTER_IDX, "SoundManager", _g_get_SoundManager);
|
|
Utils.RegisterFunc(L, Utils.GETTER_IDX, "TaskMgr", _g_get_TaskMgr);
|
|
Utils.RegisterFunc(L, Utils.GETTER_IDX, "BIReport", _g_get_BIReport);
|
|
Utils.RegisterFunc(L, Utils.GETTER_IDX, "SDKMgr", _g_get_SDKMgr);
|
|
|
|
|
|
|
|
Utils.EndObjectRegister(type, L, translator, null, null,
|
|
null, null, null);
|
|
|
|
Utils.BeginClassRegister(type, L, __CreateInstance, 6, 5, 5);
|
|
Utils.RegisterFunc(L, Utils.CLS_IDX, "SetServerTime", _m_SetServerTime_xlua_st_);
|
|
Utils.RegisterFunc(L, Utils.CLS_IDX, "ForFree", _m_ForFree_xlua_st_);
|
|
|
|
|
|
Utils.RegisterObject(L, translator, Utils.CLS_IDX, "CLIENT_VERSION", BF.BFMain.CLIENT_VERSION);
|
|
Utils.RegisterObject(L, translator, Utils.CLS_IDX, "FILE_HEAD", BF.BFMain.FILE_HEAD);
|
|
Utils.RegisterObject(L, translator, Utils.CLS_IDX, "FILE_HEAD_BASE64", BF.BFMain.FILE_HEAD_BASE64);
|
|
|
|
Utils.RegisterFunc(L, Utils.CLS_GETTER_IDX, "IsStandAlone", _g_get_IsStandAlone);
|
|
Utils.RegisterFunc(L, Utils.CLS_GETTER_IDX, "IsShenhe", _g_get_IsShenhe);
|
|
Utils.RegisterFunc(L, Utils.CLS_GETTER_IDX, "IsGotServerTime", _g_get_IsGotServerTime);
|
|
Utils.RegisterFunc(L, Utils.CLS_GETTER_IDX, "ServerTime", _g_get_ServerTime);
|
|
Utils.RegisterFunc(L, Utils.CLS_GETTER_IDX, "DifferenceTime", _g_get_DifferenceTime);
|
|
|
|
Utils.RegisterFunc(L, Utils.CLS_SETTER_IDX, "IsStandAlone", _s_set_IsStandAlone);
|
|
Utils.RegisterFunc(L, Utils.CLS_SETTER_IDX, "IsShenhe", _s_set_IsShenhe);
|
|
Utils.RegisterFunc(L, Utils.CLS_SETTER_IDX, "IsGotServerTime", _s_set_IsGotServerTime);
|
|
Utils.RegisterFunc(L, Utils.CLS_SETTER_IDX, "ServerTime", _s_set_ServerTime);
|
|
Utils.RegisterFunc(L, Utils.CLS_SETTER_IDX, "DifferenceTime", _s_set_DifferenceTime);
|
|
|
|
|
|
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 BF.BFMain();
|
|
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 BF.BFMain constructor!");
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _m_StartGame(RealStatePtr L)
|
|
{
|
|
try {
|
|
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
|
|
BF.BFMain gen_to_be_invoked = (BF.BFMain)translator.FastGetCSObj(L, 1);
|
|
|
|
|
|
|
|
{
|
|
|
|
gen_to_be_invoked.StartGame( );
|
|
|
|
|
|
|
|
return 0;
|
|
}
|
|
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _m_Destroy(RealStatePtr L)
|
|
{
|
|
try {
|
|
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
|
|
BF.BFMain gen_to_be_invoked = (BF.BFMain)translator.FastGetCSObj(L, 1);
|
|
|
|
|
|
|
|
{
|
|
|
|
gen_to_be_invoked.Destroy( );
|
|
|
|
|
|
|
|
return 0;
|
|
}
|
|
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _m_SetServerTime_xlua_st_(RealStatePtr L)
|
|
{
|
|
try {
|
|
|
|
|
|
|
|
|
|
{
|
|
long _serverTime = LuaAPI.lua_toint64(L, 1);
|
|
|
|
BF.BFMain.SetServerTime( _serverTime );
|
|
|
|
|
|
|
|
return 0;
|
|
}
|
|
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _m_ForFree_xlua_st_(RealStatePtr L)
|
|
{
|
|
try {
|
|
|
|
|
|
|
|
|
|
{
|
|
string _str = LuaAPI.lua_tostring(L, 1);
|
|
|
|
var gen_ret = BF.BFMain.ForFree( _str );
|
|
LuaAPI.lua_pushstring(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_GameLaunchMgr(RealStatePtr L)
|
|
{
|
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
BF.BFMain gen_to_be_invoked = (BF.BFMain)translator.FastGetCSObj(L, 1);
|
|
translator.Push(L, gen_to_be_invoked.GameLaunchMgr);
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
return 1;
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _g_get_LuaMgr(RealStatePtr L)
|
|
{
|
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
BF.BFMain gen_to_be_invoked = (BF.BFMain)translator.FastGetCSObj(L, 1);
|
|
translator.Push(L, gen_to_be_invoked.LuaMgr);
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
return 1;
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _g_get_LoomMgr(RealStatePtr L)
|
|
{
|
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
BF.BFMain gen_to_be_invoked = (BF.BFMain)translator.FastGetCSObj(L, 1);
|
|
translator.Push(L, gen_to_be_invoked.LoomMgr);
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
return 1;
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _g_get_PoolMgr(RealStatePtr L)
|
|
{
|
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
BF.BFMain gen_to_be_invoked = (BF.BFMain)translator.FastGetCSObj(L, 1);
|
|
translator.Push(L, gen_to_be_invoked.PoolMgr);
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
return 1;
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _g_get_TouchMgr(RealStatePtr L)
|
|
{
|
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
BF.BFMain gen_to_be_invoked = (BF.BFMain)translator.FastGetCSObj(L, 1);
|
|
translator.Push(L, gen_to_be_invoked.TouchMgr);
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
return 1;
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _g_get_RenderMgr(RealStatePtr L)
|
|
{
|
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
BF.BFMain gen_to_be_invoked = (BF.BFMain)translator.FastGetCSObj(L, 1);
|
|
translator.Push(L, gen_to_be_invoked.RenderMgr);
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
return 1;
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _g_get_ResMgr(RealStatePtr L)
|
|
{
|
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
BF.BFMain gen_to_be_invoked = (BF.BFMain)translator.FastGetCSObj(L, 1);
|
|
translator.Push(L, gen_to_be_invoked.ResMgr);
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
return 1;
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _g_get_NetMgr(RealStatePtr L)
|
|
{
|
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
BF.BFMain gen_to_be_invoked = (BF.BFMain)translator.FastGetCSObj(L, 1);
|
|
translator.Push(L, gen_to_be_invoked.NetMgr);
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
return 1;
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _g_get_WebRequestMgr(RealStatePtr L)
|
|
{
|
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
BF.BFMain gen_to_be_invoked = (BF.BFMain)translator.FastGetCSObj(L, 1);
|
|
translator.Push(L, gen_to_be_invoked.WebRequestMgr);
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
return 1;
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _g_get_OneShotManager(RealStatePtr L)
|
|
{
|
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
BF.BFMain gen_to_be_invoked = (BF.BFMain)translator.FastGetCSObj(L, 1);
|
|
translator.Push(L, gen_to_be_invoked.OneShotManager);
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
return 1;
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _g_get_SoundManager(RealStatePtr L)
|
|
{
|
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
BF.BFMain gen_to_be_invoked = (BF.BFMain)translator.FastGetCSObj(L, 1);
|
|
translator.Push(L, gen_to_be_invoked.SoundManager);
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
return 1;
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _g_get_TaskMgr(RealStatePtr L)
|
|
{
|
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
BF.BFMain gen_to_be_invoked = (BF.BFMain)translator.FastGetCSObj(L, 1);
|
|
translator.Push(L, gen_to_be_invoked.TaskMgr);
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
return 1;
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _g_get_BIReport(RealStatePtr L)
|
|
{
|
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
BF.BFMain gen_to_be_invoked = (BF.BFMain)translator.FastGetCSObj(L, 1);
|
|
translator.Push(L, gen_to_be_invoked.BIReport);
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
return 1;
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _g_get_SDKMgr(RealStatePtr L)
|
|
{
|
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
BF.BFMain gen_to_be_invoked = (BF.BFMain)translator.FastGetCSObj(L, 1);
|
|
translator.Push(L, gen_to_be_invoked.SDKMgr);
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
return 1;
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _g_get_IsStandAlone(RealStatePtr L)
|
|
{
|
|
try {
|
|
|
|
LuaAPI.lua_pushboolean(L, BF.BFMain.IsStandAlone);
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
return 1;
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _g_get_IsShenhe(RealStatePtr L)
|
|
{
|
|
try {
|
|
|
|
LuaAPI.lua_pushboolean(L, BF.BFMain.IsShenhe);
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
return 1;
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _g_get_IsGotServerTime(RealStatePtr L)
|
|
{
|
|
try {
|
|
|
|
LuaAPI.lua_pushboolean(L, BF.BFMain.IsGotServerTime);
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
return 1;
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _g_get_ServerTime(RealStatePtr L)
|
|
{
|
|
try {
|
|
|
|
LuaAPI.lua_pushint64(L, BF.BFMain.ServerTime);
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
return 1;
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _g_get_DifferenceTime(RealStatePtr L)
|
|
{
|
|
try {
|
|
|
|
LuaAPI.lua_pushint64(L, BF.BFMain.DifferenceTime);
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
return 1;
|
|
}
|
|
|
|
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _s_set_IsStandAlone(RealStatePtr L)
|
|
{
|
|
try {
|
|
|
|
BF.BFMain.IsStandAlone = LuaAPI.lua_toboolean(L, 1);
|
|
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _s_set_IsShenhe(RealStatePtr L)
|
|
{
|
|
try {
|
|
|
|
BF.BFMain.IsShenhe = LuaAPI.lua_toboolean(L, 1);
|
|
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _s_set_IsGotServerTime(RealStatePtr L)
|
|
{
|
|
try {
|
|
|
|
BF.BFMain.IsGotServerTime = LuaAPI.lua_toboolean(L, 1);
|
|
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _s_set_ServerTime(RealStatePtr L)
|
|
{
|
|
try {
|
|
|
|
BF.BFMain.ServerTime = LuaAPI.lua_toint64(L, 1);
|
|
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _s_set_DifferenceTime(RealStatePtr L)
|
|
{
|
|
try {
|
|
|
|
BF.BFMain.DifferenceTime = LuaAPI.lua_toint64(L, 1);
|
|
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
}
|