428 lines
14 KiB
C#
428 lines
14 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 BFDeepLinkManagerWrap
|
|
{
|
|
public static void __Register(RealStatePtr L)
|
|
{
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
System.Type type = typeof(BF.DeepLinkManager);
|
|
Utils.BeginObjectRegister(type, L, translator, 0, 6, 1, 1);
|
|
|
|
Utils.RegisterFunc(L, Utils.METHOD_IDX, "Init", _m_Init);
|
|
Utils.RegisterFunc(L, Utils.METHOD_IDX, "GetDeepLinkURL", _m_GetDeepLinkURL);
|
|
Utils.RegisterFunc(L, Utils.METHOD_IDX, "GetDeepLinkParamsDic", _m_GetDeepLinkParamsDic);
|
|
Utils.RegisterFunc(L, Utils.METHOD_IDX, "GetDeepLinkParamsJson", _m_GetDeepLinkParamsJson);
|
|
Utils.RegisterFunc(L, Utils.METHOD_IDX, "GetDeepLinkValueByKey", _m_GetDeepLinkValueByKey);
|
|
Utils.RegisterFunc(L, Utils.METHOD_IDX, "SetLuaDeepLinkActiveCallback", _m_SetLuaDeepLinkActiveCallback);
|
|
|
|
|
|
Utils.RegisterFunc(L, Utils.GETTER_IDX, "luaDeepLinkActiveCallback", _g_get_luaDeepLinkActiveCallback);
|
|
|
|
Utils.RegisterFunc(L, Utils.SETTER_IDX, "luaDeepLinkActiveCallback", _s_set_luaDeepLinkActiveCallback);
|
|
|
|
|
|
Utils.EndObjectRegister(type, L, translator, null, null,
|
|
null, null, null);
|
|
|
|
Utils.BeginClassRegister(type, L, __CreateInstance, 4, 5, 5);
|
|
|
|
|
|
Utils.RegisterObject(L, translator, Utils.CLS_IDX, "ENTRANCE_LAN", BF.DeepLinkManager.ENTRANCE_LAN);
|
|
Utils.RegisterObject(L, translator, Utils.CLS_IDX, "TRUE_FLAG", BF.DeepLinkManager.TRUE_FLAG);
|
|
Utils.RegisterObject(L, translator, Utils.CLS_IDX, "FALSE_FLAG", BF.DeepLinkManager.FALSE_FLAG);
|
|
|
|
Utils.RegisterFunc(L, Utils.CLS_GETTER_IDX, "ENTRANCE", _g_get_ENTRANCE);
|
|
Utils.RegisterFunc(L, Utils.CLS_GETTER_IDX, "ENV", _g_get_ENV);
|
|
Utils.RegisterFunc(L, Utils.CLS_GETTER_IDX, "GM", _g_get_GM);
|
|
Utils.RegisterFunc(L, Utils.CLS_GETTER_IDX, "LOG", _g_get_LOG);
|
|
Utils.RegisterFunc(L, Utils.CLS_GETTER_IDX, "PACKAGE", _g_get_PACKAGE);
|
|
|
|
Utils.RegisterFunc(L, Utils.CLS_SETTER_IDX, "ENTRANCE", _s_set_ENTRANCE);
|
|
Utils.RegisterFunc(L, Utils.CLS_SETTER_IDX, "ENV", _s_set_ENV);
|
|
Utils.RegisterFunc(L, Utils.CLS_SETTER_IDX, "GM", _s_set_GM);
|
|
Utils.RegisterFunc(L, Utils.CLS_SETTER_IDX, "LOG", _s_set_LOG);
|
|
Utils.RegisterFunc(L, Utils.CLS_SETTER_IDX, "PACKAGE", _s_set_PACKAGE);
|
|
|
|
|
|
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.DeepLinkManager();
|
|
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.DeepLinkManager constructor!");
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _m_Init(RealStatePtr L)
|
|
{
|
|
try {
|
|
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
|
|
BF.DeepLinkManager gen_to_be_invoked = (BF.DeepLinkManager)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_GetDeepLinkURL(RealStatePtr L)
|
|
{
|
|
try {
|
|
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
|
|
BF.DeepLinkManager gen_to_be_invoked = (BF.DeepLinkManager)translator.FastGetCSObj(L, 1);
|
|
|
|
|
|
|
|
{
|
|
|
|
var gen_ret = gen_to_be_invoked.GetDeepLinkURL( );
|
|
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_GetDeepLinkParamsDic(RealStatePtr L)
|
|
{
|
|
try {
|
|
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
|
|
BF.DeepLinkManager gen_to_be_invoked = (BF.DeepLinkManager)translator.FastGetCSObj(L, 1);
|
|
|
|
|
|
|
|
{
|
|
|
|
var gen_ret = gen_to_be_invoked.GetDeepLinkParamsDic( );
|
|
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_GetDeepLinkParamsJson(RealStatePtr L)
|
|
{
|
|
try {
|
|
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
|
|
BF.DeepLinkManager gen_to_be_invoked = (BF.DeepLinkManager)translator.FastGetCSObj(L, 1);
|
|
|
|
|
|
|
|
{
|
|
|
|
var gen_ret = gen_to_be_invoked.GetDeepLinkParamsJson( );
|
|
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_GetDeepLinkValueByKey(RealStatePtr L)
|
|
{
|
|
try {
|
|
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
|
|
BF.DeepLinkManager gen_to_be_invoked = (BF.DeepLinkManager)translator.FastGetCSObj(L, 1);
|
|
|
|
|
|
|
|
{
|
|
string _key = LuaAPI.lua_tostring(L, 2);
|
|
|
|
var gen_ret = gen_to_be_invoked.GetDeepLinkValueByKey( _key );
|
|
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_SetLuaDeepLinkActiveCallback(RealStatePtr L)
|
|
{
|
|
try {
|
|
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
|
|
BF.DeepLinkManager gen_to_be_invoked = (BF.DeepLinkManager)translator.FastGetCSObj(L, 1);
|
|
|
|
|
|
|
|
{
|
|
System.Action<string, string> _callback = translator.GetDelegate<System.Action<string, string>>(L, 2);
|
|
|
|
gen_to_be_invoked.SetLuaDeepLinkActiveCallback( _callback );
|
|
|
|
|
|
|
|
return 0;
|
|
}
|
|
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _g_get_ENTRANCE(RealStatePtr L)
|
|
{
|
|
try {
|
|
|
|
LuaAPI.lua_pushstring(L, BF.DeepLinkManager.ENTRANCE);
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
return 1;
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _g_get_ENV(RealStatePtr L)
|
|
{
|
|
try {
|
|
|
|
LuaAPI.lua_pushstring(L, BF.DeepLinkManager.ENV);
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
return 1;
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _g_get_GM(RealStatePtr L)
|
|
{
|
|
try {
|
|
|
|
LuaAPI.lua_pushstring(L, BF.DeepLinkManager.GM);
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
return 1;
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _g_get_LOG(RealStatePtr L)
|
|
{
|
|
try {
|
|
|
|
LuaAPI.lua_pushstring(L, BF.DeepLinkManager.LOG);
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
return 1;
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _g_get_PACKAGE(RealStatePtr L)
|
|
{
|
|
try {
|
|
|
|
LuaAPI.lua_pushstring(L, BF.DeepLinkManager.PACKAGE);
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
return 1;
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _g_get_luaDeepLinkActiveCallback(RealStatePtr L)
|
|
{
|
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
BF.DeepLinkManager gen_to_be_invoked = (BF.DeepLinkManager)translator.FastGetCSObj(L, 1);
|
|
translator.Push(L, gen_to_be_invoked.luaDeepLinkActiveCallback);
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
return 1;
|
|
}
|
|
|
|
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _s_set_ENTRANCE(RealStatePtr L)
|
|
{
|
|
try {
|
|
|
|
BF.DeepLinkManager.ENTRANCE = LuaAPI.lua_tostring(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_ENV(RealStatePtr L)
|
|
{
|
|
try {
|
|
|
|
BF.DeepLinkManager.ENV = LuaAPI.lua_tostring(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_GM(RealStatePtr L)
|
|
{
|
|
try {
|
|
|
|
BF.DeepLinkManager.GM = LuaAPI.lua_tostring(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_LOG(RealStatePtr L)
|
|
{
|
|
try {
|
|
|
|
BF.DeepLinkManager.LOG = LuaAPI.lua_tostring(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_PACKAGE(RealStatePtr L)
|
|
{
|
|
try {
|
|
|
|
BF.DeepLinkManager.PACKAGE = LuaAPI.lua_tostring(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_luaDeepLinkActiveCallback(RealStatePtr L)
|
|
{
|
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
BF.DeepLinkManager gen_to_be_invoked = (BF.DeepLinkManager)translator.FastGetCSObj(L, 1);
|
|
gen_to_be_invoked.luaDeepLinkActiveCallback = translator.GetDelegate<System.Action<string, string>>(L, 2);
|
|
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
}
|