640 lines
20 KiB
C#
640 lines
20 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 BFGameLaunchManagerWrap
|
|
{
|
|
public static void __Register(RealStatePtr L)
|
|
{
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
System.Type type = typeof(BF.GameLaunchManager);
|
|
Utils.BeginObjectRegister(type, L, translator, 0, 16, 3, 1);
|
|
|
|
Utils.RegisterFunc(L, Utils.METHOD_IDX, "SetMono", _m_SetMono);
|
|
Utils.RegisterFunc(L, Utils.METHOD_IDX, "Init", _m_Init);
|
|
Utils.RegisterFunc(L, Utils.METHOD_IDX, "Update", _m_Update);
|
|
Utils.RegisterFunc(L, Utils.METHOD_IDX, "Destroy", _m_Destroy);
|
|
Utils.RegisterFunc(L, Utils.METHOD_IDX, "ShowIOSATTrack", _m_ShowIOSATTrack);
|
|
Utils.RegisterFunc(L, Utils.METHOD_IDX, "LaunchGame", _m_LaunchGame);
|
|
Utils.RegisterFunc(L, Utils.METHOD_IDX, "LaunchForLogin", _m_LaunchForLogin);
|
|
Utils.RegisterFunc(L, Utils.METHOD_IDX, "LaunchForRelogin", _m_LaunchForRelogin);
|
|
Utils.RegisterFunc(L, Utils.METHOD_IDX, "LaunchForLanguage", _m_LaunchForLanguage);
|
|
Utils.RegisterFunc(L, Utils.METHOD_IDX, "IsNetworkReachability", _m_IsNetworkReachability);
|
|
Utils.RegisterFunc(L, Utils.METHOD_IDX, "IsWifi", _m_IsWifi);
|
|
Utils.RegisterFunc(L, Utils.METHOD_IDX, "SetCurrentProcessor", _m_SetCurrentProcessor);
|
|
Utils.RegisterFunc(L, Utils.METHOD_IDX, "IsVersionWhiteList", _m_IsVersionWhiteList);
|
|
Utils.RegisterFunc(L, Utils.METHOD_IDX, "GetFirstAB", _m_GetFirstAB);
|
|
Utils.RegisterFunc(L, Utils.METHOD_IDX, "GetCurrentVersion", _m_GetCurrentVersion);
|
|
Utils.RegisterFunc(L, Utils.METHOD_IDX, "QuitGame", _m_QuitGame);
|
|
|
|
|
|
Utils.RegisterFunc(L, Utils.GETTER_IDX, "LaunchRequester", _g_get_LaunchRequester);
|
|
Utils.RegisterFunc(L, Utils.GETTER_IDX, "LaunchTimes", _g_get_LaunchTimes);
|
|
Utils.RegisterFunc(L, Utils.GETTER_IDX, "LoadedFirstAb", _g_get_LoadedFirstAb);
|
|
|
|
Utils.RegisterFunc(L, Utils.SETTER_IDX, "LoadedFirstAb", _s_set_LoadedFirstAb);
|
|
|
|
|
|
Utils.EndObjectRegister(type, L, translator, null, null,
|
|
null, null, null);
|
|
|
|
Utils.BeginClassRegister(type, L, __CreateInstance, 3, 0, 0);
|
|
Utils.RegisterFunc(L, Utils.CLS_IDX, "Create", _m_Create_xlua_st_);
|
|
Utils.RegisterFunc(L, Utils.CLS_IDX, "ForJustice", _m_ForJustice_xlua_st_);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Utils.EndClassRegister(type, L, translator);
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int __CreateInstance(RealStatePtr L)
|
|
{
|
|
return LuaAPI.luaL_error(L, "BF.GameLaunchManager does not have a constructor!");
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _m_Create_xlua_st_(RealStatePtr L)
|
|
{
|
|
try {
|
|
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
var gen_ret = BF.GameLaunchManager.Create( );
|
|
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_SetMono(RealStatePtr L)
|
|
{
|
|
try {
|
|
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
|
|
BF.GameLaunchManager gen_to_be_invoked = (BF.GameLaunchManager)translator.FastGetCSObj(L, 1);
|
|
|
|
|
|
|
|
{
|
|
UnityEngine.MonoBehaviour _mono = (UnityEngine.MonoBehaviour)translator.GetObject(L, 2, typeof(UnityEngine.MonoBehaviour));
|
|
|
|
gen_to_be_invoked.SetMono( _mono );
|
|
|
|
|
|
|
|
return 0;
|
|
}
|
|
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _m_Init(RealStatePtr L)
|
|
{
|
|
try {
|
|
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
|
|
BF.GameLaunchManager gen_to_be_invoked = (BF.GameLaunchManager)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_Update(RealStatePtr L)
|
|
{
|
|
try {
|
|
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
|
|
BF.GameLaunchManager gen_to_be_invoked = (BF.GameLaunchManager)translator.FastGetCSObj(L, 1);
|
|
|
|
|
|
|
|
{
|
|
|
|
gen_to_be_invoked.Update( );
|
|
|
|
|
|
|
|
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.GameLaunchManager gen_to_be_invoked = (BF.GameLaunchManager)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_ShowIOSATTrack(RealStatePtr L)
|
|
{
|
|
try {
|
|
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
|
|
BF.GameLaunchManager gen_to_be_invoked = (BF.GameLaunchManager)translator.FastGetCSObj(L, 1);
|
|
|
|
|
|
|
|
{
|
|
|
|
gen_to_be_invoked.ShowIOSATTrack( );
|
|
|
|
|
|
|
|
return 0;
|
|
}
|
|
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _m_LaunchGame(RealStatePtr L)
|
|
{
|
|
try {
|
|
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
|
|
BF.GameLaunchManager gen_to_be_invoked = (BF.GameLaunchManager)translator.FastGetCSObj(L, 1);
|
|
|
|
|
|
|
|
{
|
|
|
|
gen_to_be_invoked.LaunchGame( );
|
|
|
|
|
|
|
|
return 0;
|
|
}
|
|
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _m_LaunchForLogin(RealStatePtr L)
|
|
{
|
|
try {
|
|
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
|
|
BF.GameLaunchManager gen_to_be_invoked = (BF.GameLaunchManager)translator.FastGetCSObj(L, 1);
|
|
|
|
|
|
|
|
{
|
|
string _versionJson = LuaAPI.lua_tostring(L, 2);
|
|
|
|
gen_to_be_invoked.LaunchForLogin( _versionJson );
|
|
|
|
|
|
|
|
return 0;
|
|
}
|
|
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _m_LaunchForRelogin(RealStatePtr L)
|
|
{
|
|
try {
|
|
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
|
|
BF.GameLaunchManager gen_to_be_invoked = (BF.GameLaunchManager)translator.FastGetCSObj(L, 1);
|
|
|
|
|
|
|
|
{
|
|
string _versionJson = LuaAPI.lua_tostring(L, 2);
|
|
|
|
gen_to_be_invoked.LaunchForRelogin( _versionJson );
|
|
|
|
|
|
|
|
return 0;
|
|
}
|
|
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _m_LaunchForLanguage(RealStatePtr L)
|
|
{
|
|
try {
|
|
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
|
|
BF.GameLaunchManager gen_to_be_invoked = (BF.GameLaunchManager)translator.FastGetCSObj(L, 1);
|
|
|
|
|
|
|
|
{
|
|
string _language = LuaAPI.lua_tostring(L, 2);
|
|
|
|
gen_to_be_invoked.LaunchForLanguage( _language );
|
|
|
|
|
|
|
|
return 0;
|
|
}
|
|
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _m_IsNetworkReachability(RealStatePtr L)
|
|
{
|
|
try {
|
|
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
|
|
BF.GameLaunchManager gen_to_be_invoked = (BF.GameLaunchManager)translator.FastGetCSObj(L, 1);
|
|
|
|
|
|
|
|
{
|
|
|
|
var gen_ret = gen_to_be_invoked.IsNetworkReachability( );
|
|
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 _m_IsWifi(RealStatePtr L)
|
|
{
|
|
try {
|
|
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
|
|
BF.GameLaunchManager gen_to_be_invoked = (BF.GameLaunchManager)translator.FastGetCSObj(L, 1);
|
|
|
|
|
|
|
|
{
|
|
|
|
var gen_ret = gen_to_be_invoked.IsWifi( );
|
|
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 _m_SetCurrentProcessor(RealStatePtr L)
|
|
{
|
|
try {
|
|
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
|
|
BF.GameLaunchManager gen_to_be_invoked = (BF.GameLaunchManager)translator.FastGetCSObj(L, 1);
|
|
|
|
|
|
|
|
{
|
|
BF.GameLaunchProcessorBase _processor = (BF.GameLaunchProcessorBase)translator.GetObject(L, 2, typeof(BF.GameLaunchProcessorBase));
|
|
|
|
gen_to_be_invoked.SetCurrentProcessor( _processor );
|
|
|
|
|
|
|
|
return 0;
|
|
}
|
|
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _m_IsVersionWhiteList(RealStatePtr L)
|
|
{
|
|
try {
|
|
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
|
|
BF.GameLaunchManager gen_to_be_invoked = (BF.GameLaunchManager)translator.FastGetCSObj(L, 1);
|
|
|
|
|
|
|
|
{
|
|
|
|
var gen_ret = gen_to_be_invoked.IsVersionWhiteList( );
|
|
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 _m_GetFirstAB(RealStatePtr L)
|
|
{
|
|
try {
|
|
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
|
|
BF.GameLaunchManager gen_to_be_invoked = (BF.GameLaunchManager)translator.FastGetCSObj(L, 1);
|
|
|
|
|
|
|
|
{
|
|
|
|
var gen_ret = gen_to_be_invoked.GetFirstAB( );
|
|
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_GetCurrentVersion(RealStatePtr L)
|
|
{
|
|
try {
|
|
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
|
|
BF.GameLaunchManager gen_to_be_invoked = (BF.GameLaunchManager)translator.FastGetCSObj(L, 1);
|
|
|
|
|
|
|
|
{
|
|
|
|
var gen_ret = gen_to_be_invoked.GetCurrentVersion( );
|
|
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 _m_QuitGame(RealStatePtr L)
|
|
{
|
|
try {
|
|
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
|
|
BF.GameLaunchManager gen_to_be_invoked = (BF.GameLaunchManager)translator.FastGetCSObj(L, 1);
|
|
|
|
|
|
|
|
{
|
|
|
|
gen_to_be_invoked.QuitGame( );
|
|
|
|
|
|
|
|
return 0;
|
|
}
|
|
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _m_ForJustice_xlua_st_(RealStatePtr L)
|
|
{
|
|
try {
|
|
|
|
|
|
|
|
|
|
{
|
|
string _str = LuaAPI.lua_tostring(L, 1);
|
|
|
|
var gen_ret = BF.GameLaunchManager.ForJustice( _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_LaunchRequester(RealStatePtr L)
|
|
{
|
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
BF.GameLaunchManager gen_to_be_invoked = (BF.GameLaunchManager)translator.FastGetCSObj(L, 1);
|
|
translator.Push(L, gen_to_be_invoked.LaunchRequester);
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
return 1;
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _g_get_LaunchTimes(RealStatePtr L)
|
|
{
|
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
BF.GameLaunchManager gen_to_be_invoked = (BF.GameLaunchManager)translator.FastGetCSObj(L, 1);
|
|
LuaAPI.xlua_pushinteger(L, gen_to_be_invoked.LaunchTimes);
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
return 1;
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _g_get_LoadedFirstAb(RealStatePtr L)
|
|
{
|
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
BF.GameLaunchManager gen_to_be_invoked = (BF.GameLaunchManager)translator.FastGetCSObj(L, 1);
|
|
LuaAPI.lua_pushboolean(L, gen_to_be_invoked.LoadedFirstAb);
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
return 1;
|
|
}
|
|
|
|
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _s_set_LoadedFirstAb(RealStatePtr L)
|
|
{
|
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
BF.GameLaunchManager gen_to_be_invoked = (BF.GameLaunchManager)translator.FastGetCSObj(L, 1);
|
|
gen_to_be_invoked.LoadedFirstAb = LuaAPI.lua_toboolean(L, 2);
|
|
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
}
|