#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 LuaGameNetPackBaseWrap
|
{
|
public static void __Register(RealStatePtr L)
|
{
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
System.Type type = typeof(LuaGameNetPackBase);
|
Utils.BeginObjectRegister(type, L, translator, 0, 14, 1, 1);
|
|
Utils.RegisterFunc(L, Utils.METHOD_IDX, "RegistWriteToBytes", _m_RegistWriteToBytes);
|
Utils.RegisterFunc(L, Utils.METHOD_IDX, "WriteShortBytes", _m_WriteShortBytes);
|
Utils.RegisterFunc(L, Utils.METHOD_IDX, "WriteUintsBytes", _m_WriteUintsBytes);
|
Utils.RegisterFunc(L, Utils.METHOD_IDX, "WriteIntsBytes", _m_WriteIntsBytes);
|
Utils.RegisterFunc(L, Utils.METHOD_IDX, "WriteStringBytes", _m_WriteStringBytes);
|
Utils.RegisterFunc(L, Utils.METHOD_IDX, "WriteShortsWriteLenBytes", _m_WriteShortsWriteLenBytes);
|
Utils.RegisterFunc(L, Utils.METHOD_IDX, "WriteIntsWriteLenBytes", _m_WriteIntsWriteLenBytes);
|
Utils.RegisterFunc(L, Utils.METHOD_IDX, "Send", _m_Send);
|
Utils.RegisterFunc(L, Utils.METHOD_IDX, "TransUintBytes", _m_TransUintBytes);
|
Utils.RegisterFunc(L, Utils.METHOD_IDX, "TransIntBytes", _m_TransIntBytes);
|
Utils.RegisterFunc(L, Utils.METHOD_IDX, "TransUshortBytes", _m_TransUshortBytes);
|
Utils.RegisterFunc(L, Utils.METHOD_IDX, "TransByteBytes", _m_TransByteBytes);
|
Utils.RegisterFunc(L, Utils.METHOD_IDX, "TransStringBytes", _m_TransStringBytes);
|
Utils.RegisterFunc(L, Utils.METHOD_IDX, "TransVShortsBytes", _m_TransVShortsBytes);
|
|
|
Utils.RegisterFunc(L, Utils.GETTER_IDX, "cmd", _g_get_cmd);
|
|
Utils.RegisterFunc(L, Utils.SETTER_IDX, "cmd", _s_set_cmd);
|
|
|
Utils.EndObjectRegister(type, L, translator, null, null,
|
null, null, null);
|
|
Utils.BeginClassRegister(type, L, __CreateInstance, 1, 0, 0);
|
|
|
|
|
|
|
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)
|
{
|
|
LuaGameNetPackBase gen_ret = new LuaGameNetPackBase();
|
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 LuaGameNetPackBase constructor!");
|
|
}
|
|
|
|
|
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
static int _m_RegistWriteToBytes(RealStatePtr L)
|
{
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
LuaGameNetPackBase gen_to_be_invoked = (LuaGameNetPackBase)translator.FastGetCSObj(L, 1);
|
|
|
|
{
|
System.Action _action = translator.GetDelegate<System.Action>(L, 2);
|
|
gen_to_be_invoked.RegistWriteToBytes( _action );
|
|
|
|
return 0;
|
}
|
|
} catch(System.Exception gen_e) {
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
}
|
|
}
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
static int _m_WriteShortBytes(RealStatePtr L)
|
{
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
LuaGameNetPackBase gen_to_be_invoked = (LuaGameNetPackBase)translator.FastGetCSObj(L, 1);
|
|
|
|
{
|
ushort _value = (ushort)LuaAPI.xlua_tointeger(L, 2);
|
LuaGameNetSystem.NetDataType _type;translator.Get(L, 3, out _type);
|
|
gen_to_be_invoked.WriteShortBytes( _value, _type );
|
|
|
|
return 0;
|
}
|
|
} catch(System.Exception gen_e) {
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
}
|
|
}
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
static int _m_WriteUintsBytes(RealStatePtr L)
|
{
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
LuaGameNetPackBase gen_to_be_invoked = (LuaGameNetPackBase)translator.FastGetCSObj(L, 1);
|
|
|
|
{
|
uint _value = LuaAPI.xlua_touint(L, 2);
|
LuaGameNetSystem.NetDataType _type;translator.Get(L, 3, out _type);
|
|
gen_to_be_invoked.WriteUintsBytes( _value, _type );
|
|
|
|
return 0;
|
}
|
|
} catch(System.Exception gen_e) {
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
}
|
|
}
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
static int _m_WriteIntsBytes(RealStatePtr L)
|
{
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
LuaGameNetPackBase gen_to_be_invoked = (LuaGameNetPackBase)translator.FastGetCSObj(L, 1);
|
|
|
|
{
|
int _value = LuaAPI.xlua_tointeger(L, 2);
|
LuaGameNetSystem.NetDataType _type;translator.Get(L, 3, out _type);
|
|
gen_to_be_invoked.WriteIntsBytes( _value, _type );
|
|
|
|
return 0;
|
}
|
|
} catch(System.Exception gen_e) {
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
}
|
|
}
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
static int _m_WriteStringBytes(RealStatePtr L)
|
{
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
LuaGameNetPackBase gen_to_be_invoked = (LuaGameNetPackBase)translator.FastGetCSObj(L, 1);
|
|
|
|
{
|
string _value = LuaAPI.lua_tostring(L, 2);
|
LuaGameNetSystem.NetDataType _type;translator.Get(L, 3, out _type);
|
|
gen_to_be_invoked.WriteStringBytes( _value, _type );
|
|
|
|
return 0;
|
}
|
|
} catch(System.Exception gen_e) {
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
}
|
|
}
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
static int _m_WriteShortsWriteLenBytes(RealStatePtr L)
|
{
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
LuaGameNetPackBase gen_to_be_invoked = (LuaGameNetPackBase)translator.FastGetCSObj(L, 1);
|
|
|
|
{
|
ushort[] _values = (ushort[])translator.GetObject(L, 2, typeof(ushort[]));
|
LuaGameNetSystem.NetDataType _type;translator.Get(L, 3, out _type);
|
|
gen_to_be_invoked.WriteShortsWriteLenBytes( _values, _type );
|
|
|
|
return 0;
|
}
|
|
} catch(System.Exception gen_e) {
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
}
|
|
}
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
static int _m_WriteIntsWriteLenBytes(RealStatePtr L)
|
{
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
LuaGameNetPackBase gen_to_be_invoked = (LuaGameNetPackBase)translator.FastGetCSObj(L, 1);
|
|
|
|
{
|
uint[] _values = (uint[])translator.GetObject(L, 2, typeof(uint[]));
|
LuaGameNetSystem.NetDataType _type;translator.Get(L, 3, out _type);
|
|
gen_to_be_invoked.WriteIntsWriteLenBytes( _values, _type );
|
|
|
|
return 0;
|
}
|
|
} catch(System.Exception gen_e) {
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
}
|
|
}
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
static int _m_Send(RealStatePtr L)
|
{
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
LuaGameNetPackBase gen_to_be_invoked = (LuaGameNetPackBase)translator.FastGetCSObj(L, 1);
|
|
|
|
{
|
|
gen_to_be_invoked.Send( );
|
|
|
|
return 0;
|
}
|
|
} catch(System.Exception gen_e) {
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
}
|
|
}
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
static int _m_TransUintBytes(RealStatePtr L)
|
{
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
LuaGameNetPackBase gen_to_be_invoked = (LuaGameNetPackBase)translator.FastGetCSObj(L, 1);
|
|
|
|
{
|
byte[] _value = LuaAPI.lua_tobytes(L, 2);
|
LuaGameNetSystem.NetDataType _type;translator.Get(L, 3, out _type);
|
|
uint gen_ret = gen_to_be_invoked.TransUintBytes( _value, _type );
|
LuaAPI.xlua_pushuint(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_TransIntBytes(RealStatePtr L)
|
{
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
LuaGameNetPackBase gen_to_be_invoked = (LuaGameNetPackBase)translator.FastGetCSObj(L, 1);
|
|
|
|
{
|
byte[] _value = LuaAPI.lua_tobytes(L, 2);
|
LuaGameNetSystem.NetDataType _type;translator.Get(L, 3, out _type);
|
|
int gen_ret = gen_to_be_invoked.TransIntBytes( _value, _type );
|
LuaAPI.xlua_pushinteger(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_TransUshortBytes(RealStatePtr L)
|
{
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
LuaGameNetPackBase gen_to_be_invoked = (LuaGameNetPackBase)translator.FastGetCSObj(L, 1);
|
|
|
|
{
|
byte[] _value = LuaAPI.lua_tobytes(L, 2);
|
LuaGameNetSystem.NetDataType _type;translator.Get(L, 3, out _type);
|
|
ushort gen_ret = gen_to_be_invoked.TransUshortBytes( _value, _type );
|
LuaAPI.xlua_pushinteger(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_TransByteBytes(RealStatePtr L)
|
{
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
LuaGameNetPackBase gen_to_be_invoked = (LuaGameNetPackBase)translator.FastGetCSObj(L, 1);
|
|
|
|
{
|
byte[] _value = LuaAPI.lua_tobytes(L, 2);
|
LuaGameNetSystem.NetDataType _type;translator.Get(L, 3, out _type);
|
|
byte gen_ret = gen_to_be_invoked.TransByteBytes( _value, _type );
|
LuaAPI.xlua_pushinteger(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_TransStringBytes(RealStatePtr L)
|
{
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
LuaGameNetPackBase gen_to_be_invoked = (LuaGameNetPackBase)translator.FastGetCSObj(L, 1);
|
|
|
|
{
|
byte[] _value = LuaAPI.lua_tobytes(L, 2);
|
LuaGameNetSystem.NetDataType _type;translator.Get(L, 3, out _type);
|
int _length = LuaAPI.xlua_tointeger(L, 4);
|
|
string gen_ret = gen_to_be_invoked.TransStringBytes( _value, _type, _length );
|
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_TransVShortsBytes(RealStatePtr L)
|
{
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
LuaGameNetPackBase gen_to_be_invoked = (LuaGameNetPackBase)translator.FastGetCSObj(L, 1);
|
|
|
|
{
|
byte[] _value = LuaAPI.lua_tobytes(L, 2);
|
LuaGameNetSystem.NetDataType _type;translator.Get(L, 3, out _type);
|
int _length = LuaAPI.xlua_tointeger(L, 4);
|
|
uint[] gen_ret = gen_to_be_invoked.TransVShortsBytes( _value, _type, _length );
|
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_cmd(RealStatePtr L)
|
{
|
try {
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
LuaGameNetPackBase gen_to_be_invoked = (LuaGameNetPackBase)translator.FastGetCSObj(L, 1);
|
LuaAPI.xlua_pushinteger(L, gen_to_be_invoked.cmd);
|
} catch(System.Exception gen_e) {
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
}
|
return 1;
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
static int _s_set_cmd(RealStatePtr L)
|
{
|
try {
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
LuaGameNetPackBase gen_to_be_invoked = (LuaGameNetPackBase)translator.FastGetCSObj(L, 1);
|
gen_to_be_invoked.cmd = (ushort)LuaAPI.xlua_tointeger(L, 2);
|
|
} catch(System.Exception gen_e) {
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
}
|
return 0;
|
}
|
|
|
|
|
|
}
|
}
|