#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 ServerListCenterWrap
|
{
|
public static void __Register(RealStatePtr L)
|
{
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
System.Type type = typeof(ServerListCenter);
|
Utils.BeginObjectRegister(type, L, translator, 0, 10, 6, 3);
|
|
Utils.RegisterFunc(L, Utils.METHOD_IDX, "GetServerData", _m_GetServerData);
|
Utils.RegisterFunc(L, Utils.METHOD_IDX, "RequestJumpUrl", _m_RequestJumpUrl);
|
Utils.RegisterFunc(L, Utils.METHOD_IDX, "RequestServerList", _m_RequestServerList);
|
Utils.RegisterFunc(L, Utils.METHOD_IDX, "RequestServerListPlayer", _m_RequestServerListPlayer);
|
Utils.RegisterFunc(L, Utils.METHOD_IDX, "TryGetServerGroup", _m_TryGetServerGroup);
|
Utils.RegisterFunc(L, Utils.METHOD_IDX, "ParseServerLocalServerList", _m_ParseServerLocalServerList);
|
Utils.RegisterFunc(L, Utils.METHOD_IDX, "GetAllServerGroup", _m_GetAllServerGroup);
|
|
Utils.RegisterFunc(L, Utils.METHOD_IDX, "onServerListRefreshEvent", _e_onServerListRefreshEvent);
|
Utils.RegisterFunc(L, Utils.METHOD_IDX, "serverGroupSelectEvent", _e_serverGroupSelectEvent);
|
Utils.RegisterFunc(L, Utils.METHOD_IDX, "serverSelectEvent", _e_serverSelectEvent);
|
|
Utils.RegisterFunc(L, Utils.GETTER_IDX, "serverInfoPlayer", _g_get_serverInfoPlayer);
|
Utils.RegisterFunc(L, Utils.GETTER_IDX, "serverInfoCommon", _g_get_serverInfoCommon);
|
Utils.RegisterFunc(L, Utils.GETTER_IDX, "currentServer", _g_get_currentServer);
|
Utils.RegisterFunc(L, Utils.GETTER_IDX, "currentServerGroup", _g_get_currentServerGroup);
|
Utils.RegisterFunc(L, Utils.GETTER_IDX, "serverListGot", _g_get_serverListGot);
|
Utils.RegisterFunc(L, Utils.GETTER_IDX, "localSaveServerId", _g_get_localSaveServerId);
|
|
Utils.RegisterFunc(L, Utils.SETTER_IDX, "currentServer", _s_set_currentServer);
|
Utils.RegisterFunc(L, Utils.SETTER_IDX, "currentServerGroup", _s_set_currentServerGroup);
|
Utils.RegisterFunc(L, Utils.SETTER_IDX, "localSaveServerId", _s_set_localSaveServerId);
|
|
|
Utils.EndObjectRegister(type, L, translator, null, null,
|
null, null, null);
|
|
Utils.BeginClassRegister(type, L, __CreateInstance, 2, 2, 2);
|
|
|
Utils.RegisterObject(L, translator, Utils.CLS_IDX, "JUMP_URL", ServerListCenter.JUMP_URL);
|
|
Utils.RegisterFunc(L, Utils.CLS_GETTER_IDX, "SERVERLIST_URL_COMMON", _g_get_SERVERLIST_URL_COMMON);
|
Utils.RegisterFunc(L, Utils.CLS_GETTER_IDX, "SERVERLIST_URL_PLAYER", _g_get_SERVERLIST_URL_PLAYER);
|
|
Utils.RegisterFunc(L, Utils.CLS_SETTER_IDX, "SERVERLIST_URL_COMMON", _s_set_SERVERLIST_URL_COMMON);
|
Utils.RegisterFunc(L, Utils.CLS_SETTER_IDX, "SERVERLIST_URL_PLAYER", _s_set_SERVERLIST_URL_PLAYER);
|
|
|
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)
|
{
|
|
ServerListCenter gen_ret = new ServerListCenter();
|
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 ServerListCenter constructor!");
|
|
}
|
|
|
|
|
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
static int _m_GetServerData(RealStatePtr L)
|
{
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
ServerListCenter gen_to_be_invoked = (ServerListCenter)translator.FastGetCSObj(L, 1);
|
|
|
|
{
|
int __id = LuaAPI.xlua_tointeger(L, 2);
|
|
ServerData gen_ret = gen_to_be_invoked.GetServerData( __id );
|
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_RequestJumpUrl(RealStatePtr L)
|
{
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
ServerListCenter gen_to_be_invoked = (ServerListCenter)translator.FastGetCSObj(L, 1);
|
|
|
|
{
|
|
gen_to_be_invoked.RequestJumpUrl( );
|
|
|
|
return 0;
|
}
|
|
} catch(System.Exception gen_e) {
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
}
|
|
}
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
static int _m_RequestServerList(RealStatePtr L)
|
{
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
ServerListCenter gen_to_be_invoked = (ServerListCenter)translator.FastGetCSObj(L, 1);
|
|
|
|
{
|
|
gen_to_be_invoked.RequestServerList( );
|
|
|
|
return 0;
|
}
|
|
} catch(System.Exception gen_e) {
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
}
|
|
}
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
static int _m_RequestServerListPlayer(RealStatePtr L)
|
{
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
ServerListCenter gen_to_be_invoked = (ServerListCenter)translator.FastGetCSObj(L, 1);
|
|
|
|
{
|
string __accountName = LuaAPI.lua_tostring(L, 2);
|
|
gen_to_be_invoked.RequestServerListPlayer( __accountName );
|
|
|
|
return 0;
|
}
|
|
} catch(System.Exception gen_e) {
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
}
|
|
}
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
static int _m_TryGetServerGroup(RealStatePtr L)
|
{
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
ServerListCenter gen_to_be_invoked = (ServerListCenter)translator.FastGetCSObj(L, 1);
|
|
|
|
{
|
string __key = LuaAPI.lua_tostring(L, 2);
|
ServerGroup __group;
|
|
bool gen_ret = gen_to_be_invoked.TryGetServerGroup( __key, out __group );
|
LuaAPI.lua_pushboolean(L, gen_ret);
|
translator.Push(L, __group);
|
|
|
|
|
return 2;
|
}
|
|
} catch(System.Exception gen_e) {
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
}
|
|
}
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
static int _m_ParseServerLocalServerList(RealStatePtr L)
|
{
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
ServerListCenter gen_to_be_invoked = (ServerListCenter)translator.FastGetCSObj(L, 1);
|
|
|
|
{
|
|
gen_to_be_invoked.ParseServerLocalServerList( );
|
|
|
|
return 0;
|
}
|
|
} catch(System.Exception gen_e) {
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
}
|
|
}
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
static int _m_GetAllServerGroup(RealStatePtr L)
|
{
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
ServerListCenter gen_to_be_invoked = (ServerListCenter)translator.FastGetCSObj(L, 1);
|
|
|
|
{
|
|
System.Collections.Generic.List<string> gen_ret = gen_to_be_invoked.GetAllServerGroup( );
|
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 _g_get_serverInfoPlayer(RealStatePtr L)
|
{
|
try {
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
ServerListCenter gen_to_be_invoked = (ServerListCenter)translator.FastGetCSObj(L, 1);
|
translator.Push(L, gen_to_be_invoked.serverInfoPlayer);
|
} catch(System.Exception gen_e) {
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
}
|
return 1;
|
}
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
static int _g_get_serverInfoCommon(RealStatePtr L)
|
{
|
try {
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
ServerListCenter gen_to_be_invoked = (ServerListCenter)translator.FastGetCSObj(L, 1);
|
translator.Push(L, gen_to_be_invoked.serverInfoCommon);
|
} catch(System.Exception gen_e) {
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
}
|
return 1;
|
}
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
static int _g_get_currentServer(RealStatePtr L)
|
{
|
try {
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
ServerListCenter gen_to_be_invoked = (ServerListCenter)translator.FastGetCSObj(L, 1);
|
translator.Push(L, gen_to_be_invoked.currentServer);
|
} catch(System.Exception gen_e) {
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
}
|
return 1;
|
}
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
static int _g_get_currentServerGroup(RealStatePtr L)
|
{
|
try {
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
ServerListCenter gen_to_be_invoked = (ServerListCenter)translator.FastGetCSObj(L, 1);
|
LuaAPI.lua_pushstring(L, gen_to_be_invoked.currentServerGroup);
|
} catch(System.Exception gen_e) {
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
}
|
return 1;
|
}
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
static int _g_get_serverListGot(RealStatePtr L)
|
{
|
try {
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
ServerListCenter gen_to_be_invoked = (ServerListCenter)translator.FastGetCSObj(L, 1);
|
LuaAPI.lua_pushboolean(L, gen_to_be_invoked.serverListGot);
|
} catch(System.Exception gen_e) {
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
}
|
return 1;
|
}
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
static int _g_get_localSaveServerId(RealStatePtr L)
|
{
|
try {
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
ServerListCenter gen_to_be_invoked = (ServerListCenter)translator.FastGetCSObj(L, 1);
|
LuaAPI.xlua_pushinteger(L, gen_to_be_invoked.localSaveServerId);
|
} catch(System.Exception gen_e) {
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
}
|
return 1;
|
}
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
static int _g_get_SERVERLIST_URL_COMMON(RealStatePtr L)
|
{
|
try {
|
|
LuaAPI.lua_pushstring(L, ServerListCenter.SERVERLIST_URL_COMMON);
|
} catch(System.Exception gen_e) {
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
}
|
return 1;
|
}
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
static int _g_get_SERVERLIST_URL_PLAYER(RealStatePtr L)
|
{
|
try {
|
|
LuaAPI.lua_pushstring(L, ServerListCenter.SERVERLIST_URL_PLAYER);
|
} catch(System.Exception gen_e) {
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
}
|
return 1;
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
static int _s_set_currentServer(RealStatePtr L)
|
{
|
try {
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
ServerListCenter gen_to_be_invoked = (ServerListCenter)translator.FastGetCSObj(L, 1);
|
ServerData gen_value;translator.Get(L, 2, out gen_value);
|
gen_to_be_invoked.currentServer = gen_value;
|
|
} catch(System.Exception gen_e) {
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
}
|
return 0;
|
}
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
static int _s_set_currentServerGroup(RealStatePtr L)
|
{
|
try {
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
ServerListCenter gen_to_be_invoked = (ServerListCenter)translator.FastGetCSObj(L, 1);
|
gen_to_be_invoked.currentServerGroup = LuaAPI.lua_tostring(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_localSaveServerId(RealStatePtr L)
|
{
|
try {
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
ServerListCenter gen_to_be_invoked = (ServerListCenter)translator.FastGetCSObj(L, 1);
|
gen_to_be_invoked.localSaveServerId = 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_SERVERLIST_URL_COMMON(RealStatePtr L)
|
{
|
try {
|
|
ServerListCenter.SERVERLIST_URL_COMMON = 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_SERVERLIST_URL_PLAYER(RealStatePtr L)
|
{
|
try {
|
|
ServerListCenter.SERVERLIST_URL_PLAYER = 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 _e_onServerListRefreshEvent(RealStatePtr L)
|
{
|
try {
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
int gen_param_count = LuaAPI.lua_gettop(L);
|
ServerListCenter gen_to_be_invoked = (ServerListCenter)translator.FastGetCSObj(L, 1);
|
System.Action gen_delegate = translator.GetDelegate<System.Action>(L, 3);
|
if (gen_delegate == null) {
|
return LuaAPI.luaL_error(L, "#3 need System.Action!");
|
}
|
|
if (gen_param_count == 3)
|
{
|
|
if (LuaAPI.xlua_is_eq_str(L, 2, "+")) {
|
gen_to_be_invoked.onServerListRefreshEvent += gen_delegate;
|
return 0;
|
}
|
|
|
if (LuaAPI.xlua_is_eq_str(L, 2, "-")) {
|
gen_to_be_invoked.onServerListRefreshEvent -= gen_delegate;
|
return 0;
|
}
|
|
}
|
} catch(System.Exception gen_e) {
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
}
|
LuaAPI.luaL_error(L, "invalid arguments to ServerListCenter.onServerListRefreshEvent!");
|
return 0;
|
}
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
static int _e_serverGroupSelectEvent(RealStatePtr L)
|
{
|
try {
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
int gen_param_count = LuaAPI.lua_gettop(L);
|
ServerListCenter gen_to_be_invoked = (ServerListCenter)translator.FastGetCSObj(L, 1);
|
System.Action gen_delegate = translator.GetDelegate<System.Action>(L, 3);
|
if (gen_delegate == null) {
|
return LuaAPI.luaL_error(L, "#3 need System.Action!");
|
}
|
|
if (gen_param_count == 3)
|
{
|
|
if (LuaAPI.xlua_is_eq_str(L, 2, "+")) {
|
gen_to_be_invoked.serverGroupSelectEvent += gen_delegate;
|
return 0;
|
}
|
|
|
if (LuaAPI.xlua_is_eq_str(L, 2, "-")) {
|
gen_to_be_invoked.serverGroupSelectEvent -= gen_delegate;
|
return 0;
|
}
|
|
}
|
} catch(System.Exception gen_e) {
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
}
|
LuaAPI.luaL_error(L, "invalid arguments to ServerListCenter.serverGroupSelectEvent!");
|
return 0;
|
}
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
static int _e_serverSelectEvent(RealStatePtr L)
|
{
|
try {
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
int gen_param_count = LuaAPI.lua_gettop(L);
|
ServerListCenter gen_to_be_invoked = (ServerListCenter)translator.FastGetCSObj(L, 1);
|
System.Action gen_delegate = translator.GetDelegate<System.Action>(L, 3);
|
if (gen_delegate == null) {
|
return LuaAPI.luaL_error(L, "#3 need System.Action!");
|
}
|
|
if (gen_param_count == 3)
|
{
|
|
if (LuaAPI.xlua_is_eq_str(L, 2, "+")) {
|
gen_to_be_invoked.serverSelectEvent += gen_delegate;
|
return 0;
|
}
|
|
|
if (LuaAPI.xlua_is_eq_str(L, 2, "-")) {
|
gen_to_be_invoked.serverSelectEvent -= gen_delegate;
|
return 0;
|
}
|
|
}
|
} catch(System.Exception gen_e) {
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
}
|
LuaAPI.luaL_error(L, "invalid arguments to ServerListCenter.serverSelectEvent!");
|
return 0;
|
}
|
|
|
|
}
|
}
|