예제 #1
0
    static int SendCommand(IntPtr L)
    {
        try
        {
            int count = LuaDLL.lua_gettop(L);

            if (count == 2)
            {
                CFramework.NetworkManager obj = (CFramework.NetworkManager)ToLua.CheckObject <CFramework.NetworkManager>(L, 1);
                int arg0 = (int)LuaDLL.luaL_checknumber(L, 2);
                obj.SendCommand(arg0);
                return(0);
            }
            else if (count == 3)
            {
                CFramework.NetworkManager obj = (CFramework.NetworkManager)ToLua.CheckObject <CFramework.NetworkManager>(L, 1);
                int arg0 = (int)LuaDLL.luaL_checknumber(L, 2);
                CFramework.ByteBuffer arg1 = (CFramework.ByteBuffer)ToLua.CheckObject <CFramework.ByteBuffer>(L, 3);
                obj.SendCommand(arg0, arg1);
                return(0);
            }
            else
            {
                return(LuaDLL.luaL_throw(L, "invalid arguments to method: CFramework.NetworkManager.SendCommand"));
            }
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e));
        }
    }
 static int set_Instance(IntPtr L)
 {
     try
     {
         CFramework.NetworkManager arg0 = (CFramework.NetworkManager)ToLua.CheckObject <CFramework.NetworkManager>(L, 2);
         CFramework.BaseManager <CFramework.NetworkManager> .Instance = arg0;
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
예제 #3
0
 static int Init(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 1);
         CFramework.NetworkManager obj = (CFramework.NetworkManager)ToLua.CheckObject <CFramework.NetworkManager>(L, 1);
         obj.Init();
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
예제 #4
0
 static int OnReceiveMessage(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 3);
         CFramework.NetworkManager obj = (CFramework.NetworkManager)ToLua.CheckObject <CFramework.NetworkManager>(L, 1);
         int    arg0 = (int)LuaDLL.luaL_checknumber(L, 2);
         byte[] arg1 = ToLua.CheckByteBuffer(L, 3);
         obj.OnReceiveMessage(arg0, arg1);
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
예제 #5
0
 static int RegisterPB(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 3);
         CFramework.NetworkManager obj = (CFramework.NetworkManager)ToLua.CheckObject <CFramework.NetworkManager>(L, 1);
         LuaFunction arg0 = ToLua.CheckLuaFunction(L, 2);
         LuaFunction arg1 = ToLua.CheckLuaFunction(L, 3);
         obj.RegisterPB(arg0, arg1);
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
예제 #6
0
    static int set_IsConnected(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            CFramework.NetworkManager obj = (CFramework.NetworkManager)o;
            bool arg0 = LuaDLL.luaL_checkboolean(L, 2);
            obj.IsConnected = arg0;
            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o, "attempt to index IsConnected on a nil value"));
        }
    }
예제 #7
0
    static int get_IsConnected(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            CFramework.NetworkManager obj = (CFramework.NetworkManager)o;
            bool ret = obj.IsConnected;
            LuaDLL.lua_pushboolean(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o, "attempt to index IsConnected on a nil value"));
        }
    }
예제 #8
0
 static int Connect(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 7);
         CFramework.NetworkManager obj = (CFramework.NetworkManager)ToLua.CheckObject <CFramework.NetworkManager>(L, 1);
         string      arg0 = ToLua.CheckString(L, 2);
         int         arg1 = (int)LuaDLL.luaL_checknumber(L, 3);
         LuaFunction arg2 = ToLua.CheckLuaFunction(L, 4);
         LuaFunction arg3 = ToLua.CheckLuaFunction(L, 5);
         LuaFunction arg4 = ToLua.CheckLuaFunction(L, 6);
         LuaFunction arg5 = ToLua.CheckLuaFunction(L, 7);
         obj.Connect(arg0, arg1, arg2, arg3, arg4, arg5);
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }