白名单和审核模式

This commit is contained in:
chenxi 2023-06-21 11:36:31 +08:00
parent 5f9898ee06
commit b56dc5fe04
6 changed files with 29 additions and 1 deletions

View File

@ -17,6 +17,7 @@ namespace BF
// 是否是单机版
public static bool IsStandAlone = false;
public static bool IsShenhe = false;
public static bool IsWhite = false;
public static bool IsGotServerTime = false;
public const string FILE_HEAD = "for_file_head";
public const string FILE_HEAD_BASE64 = "Zm9yX2ZpbGVfaGVhZ";

View File

@ -47,7 +47,7 @@ namespace XLua.CSObjectWrap
Utils.EndObjectRegister(type, L, translator, null, null,
null, null, null);
Utils.BeginClassRegister(type, L, __CreateInstance, 6, 5, 5);
Utils.BeginClassRegister(type, L, __CreateInstance, 6, 6, 6);
Utils.RegisterFunc(L, Utils.CLS_IDX, "SetServerTime", _m_SetServerTime_xlua_st_);
Utils.RegisterFunc(L, Utils.CLS_IDX, "ForFree", _m_ForFree_xlua_st_);
@ -58,12 +58,14 @@ namespace XLua.CSObjectWrap
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, "IsWhite", _g_get_IsWhite);
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, "IsWhite", _s_set_IsWhite);
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);
@ -428,6 +430,18 @@ namespace XLua.CSObjectWrap
return 1;
}
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
static int _g_get_IsWhite(RealStatePtr L)
{
try {
LuaAPI.lua_pushboolean(L, BF.BFMain.IsWhite);
} 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)
{
@ -492,6 +506,19 @@ namespace XLua.CSObjectWrap
return 0;
}
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
static int _s_set_IsWhite(RealStatePtr L)
{
try {
BF.BFMain.IsWhite = 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)
{

Binary file not shown.