Beispiel #1
0
 public void Call(Protocols.Protocol param0)
 {
     func.BeginPCall();
     func.PushObject(param0);
     func.PCall();
     func.EndPCall();
 }
    static int SendMessage(IntPtr L)
    {
        try
        {
            int count = LuaDLL.lua_gettop(L);

            if (count == 3 && TypeChecker.CheckTypes <Protocols.Protocol>(L, 3))
            {
                Protocols.NetworkController obj = (Protocols.NetworkController)ToLua.CheckObject <Protocols.NetworkController>(L, 1);
                int arg0 = (int)LuaDLL.luaL_checknumber(L, 2);
                Protocols.Protocol arg1 = (Protocols.Protocol)ToLua.ToObject(L, 3);
                obj.SendMessage(arg0, arg1);
                return(0);
            }
            else if (count == 3 && TypeChecker.CheckTypes <Protocols.ProtoBody>(L, 3))
            {
                Protocols.NetworkController obj = (Protocols.NetworkController)ToLua.CheckObject <Protocols.NetworkController>(L, 1);
                int arg0 = (int)LuaDLL.luaL_checknumber(L, 2);
                Protocols.ProtoBody arg1 = (Protocols.ProtoBody)ToLua.ToObject(L, 3);
                obj.SendMessage(arg0, arg1);
                return(0);
            }
            else if (count == 3 && TypeChecker.CheckTypes <System.IO.Stream>(L, 3))
            {
                Protocols.NetworkController obj = (Protocols.NetworkController)ToLua.CheckObject <Protocols.NetworkController>(L, 1);
                int arg0 = (int)LuaDLL.luaL_checknumber(L, 2);
                System.IO.Stream arg1 = (System.IO.Stream)ToLua.ToObject(L, 3);
                obj.SendMessage(arg0, arg1);
                return(0);
            }
            else if (count == 4)
            {
                Protocols.NetworkController obj = (Protocols.NetworkController)ToLua.CheckObject <Protocols.NetworkController>(L, 1);
                int    arg0 = (int)LuaDLL.luaL_checknumber(L, 2);
                ushort arg1 = (ushort)LuaDLL.luaL_checknumber(L, 3);
                byte[] arg2 = ToLua.CheckByteBuffer(L, 4);
                obj.SendMessage(arg0, arg1, arg2);
                return(0);
            }
            else
            {
                return(LuaDLL.luaL_throw(L, "invalid arguments to method: Protocols.NetworkController.SendMessage"));
            }
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e));
        }
    }
Beispiel #3
0
 static int GetSource(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 1);
         Protocols.Protocol obj = (Protocols.Protocol)ToLua.CheckObject <Protocols.Protocol>(L, 1);
         uint o = obj.GetSource();
         LuaDLL.lua_pushnumber(L, o);
         return(1);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
Beispiel #4
0
 static int GetID(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 1);
         Protocols.Protocol obj = (Protocols.Protocol)ToLua.CheckObject <Protocols.Protocol>(L, 1);
         Protocols.ProtoID  o   = obj.GetID();
         ToLua.PushObject(L, o);
         return(1);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
Beispiel #5
0
 static int ToString(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 1);
         Protocols.Protocol obj = (Protocols.Protocol)ToLua.CheckObject <Protocols.Protocol>(L, 1);
         string             o   = obj.ToString();
         LuaDLL.lua_pushstring(L, o);
         return(1);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
Beispiel #6
0
 static int SetBody(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 2);
         Protocols.Protocol  obj  = (Protocols.Protocol)ToLua.CheckObject <Protocols.Protocol>(L, 1);
         Protocols.ProtoBody arg0 = (Protocols.ProtoBody)ToLua.CheckObject <Protocols.ProtoBody>(L, 2);
         obj.SetBody(arg0);
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
Beispiel #7
0
 static int SetSessionID(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 2);
         Protocols.Protocol obj = (Protocols.Protocol)ToLua.CheckObject <Protocols.Protocol>(L, 1);
         uint arg0 = (uint)LuaDLL.luaL_checknumber(L, 2);
         obj.SetSessionID(arg0);
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
Beispiel #8
0
 static int SetRoleID(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 2);
         Protocols.Protocol obj = (Protocols.Protocol)ToLua.CheckObject <Protocols.Protocol>(L, 1);
         ulong arg0             = LuaDLL.tolua_checkuint64(L, 2);
         obj.SetRoleID(arg0);
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
Beispiel #9
0
 static int GetRoleID(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 1);
         Protocols.Protocol obj = (Protocols.Protocol)ToLua.CheckObject <Protocols.Protocol>(L, 1);
         ulong o = obj.GetRoleID();
         LuaDLL.tolua_pushuint64(L, o);
         return(1);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
Beispiel #10
0
 static int Deserialize(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 2);
         Protocols.Protocol obj  = (Protocols.Protocol)ToLua.CheckObject <Protocols.Protocol>(L, 1);
         System.IO.Stream   arg0 = (System.IO.Stream)ToLua.CheckObject <System.IO.Stream>(L, 2);
         int o = obj.Deserialize(arg0);
         LuaDLL.lua_pushinteger(L, o);
         return(1);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
 static int GetMessage(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 2);
         Protocols.NetworkController obj = (Protocols.NetworkController)ToLua.CheckObject <Protocols.NetworkController>(L, 1);
         int arg0             = (int)LuaDLL.luaL_checknumber(L, 2);
         Protocols.Protocol o = obj.GetMessage(arg0);
         ToLua.PushObject(L, o);
         return(1);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
Beispiel #12
0
    static int _CreateProtocols_Protocol(IntPtr L)
    {
        try
        {
            int count = LuaDLL.lua_gettop(L);

            if (count == 0)
            {
                Protocols.Protocol obj = new Protocols.Protocol();
                ToLua.PushObject(L, obj);
                return(1);
            }
            else if (count == 1)
            {
                Protocols.ProtoBody arg0 = (Protocols.ProtoBody)ToLua.CheckObject <Protocols.ProtoBody>(L, 1);
                Protocols.Protocol  obj  = new Protocols.Protocol(arg0);
                ToLua.PushObject(L, obj);
                return(1);
            }
            else if (count == 2)
            {
                Protocols.ProtoID   arg0 = (Protocols.ProtoID)ToLua.CheckObject <Protocols.ProtoID>(L, 1);
                Protocols.ProtoBody arg1 = (Protocols.ProtoBody)ToLua.CheckObject <Protocols.ProtoBody>(L, 2);
                Protocols.Protocol  obj  = new Protocols.Protocol(arg0, arg1);
                ToLua.PushObject(L, obj);
                return(1);
            }
            else
            {
                return(LuaDLL.luaL_throw(L, "invalid arguments to ctor method: Protocols.Protocol.New"));
            }
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e));
        }
    }