Example #1
0
    static int Send(IntPtr L)
    {
        try
        {
            int count = LuaDLL.lua_gettop(L);

            if (count == 2)
            {
                GameFramework.SocketClient obj = (GameFramework.SocketClient)ToLua.CheckObject <GameFramework.SocketClient>(L, 1);
                byte[] arg0 = ToLua.CheckByteBuffer(L, 2);
                obj.Send(arg0);
                return(0);
            }
            else if (count == 3)
            {
                GameFramework.SocketClient obj = (GameFramework.SocketClient)ToLua.CheckObject <GameFramework.SocketClient>(L, 1);
                byte[] arg0 = ToLua.CheckByteBuffer(L, 2);
                int    arg1 = (int)LuaDLL.luaL_checknumber(L, 3);
                int    o    = obj.Send(arg0, arg1);
                LuaDLL.lua_pushinteger(L, o);
                return(1);
            }
            else
            {
                return(LuaDLL.luaL_throw(L, "invalid arguments to method: GameFramework.SocketClient.Send"));
            }
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e));
        }
    }
Example #2
0
    static int _CreateGameFramework_SocketClient(IntPtr L)
    {
        try
        {
            int count = LuaDLL.lua_gettop(L);

            if (count == 0)
            {
                GameFramework.SocketClient obj = new GameFramework.SocketClient();
                ToLua.PushObject(L, obj);
                return(1);
            }
            else if (count == 1)
            {
                int arg0 = (int)LuaDLL.luaL_checknumber(L, 1);
                GameFramework.SocketClient obj = new GameFramework.SocketClient(arg0);
                ToLua.PushObject(L, obj);
                return(1);
            }
            else
            {
                return(LuaDLL.luaL_throw(L, "invalid arguments to ctor method: GameFramework.SocketClient.New"));
            }
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e));
        }
    }
Example #3
0
    static int Connect(IntPtr L)
    {
        try
        {
            int count = LuaDLL.lua_gettop(L);

            if (count == 1)
            {
                GameFramework.SocketClient obj = (GameFramework.SocketClient)ToLua.CheckObject <GameFramework.SocketClient>(L, 1);
                obj.Connect();
                return(0);
            }
            else if (count == 3)
            {
                GameFramework.SocketClient obj = (GameFramework.SocketClient)ToLua.CheckObject <GameFramework.SocketClient>(L, 1);
                string arg0 = ToLua.CheckString(L, 2);
                int    arg1 = (int)LuaDLL.luaL_checknumber(L, 3);
                obj.Connect(arg0, arg1);
                return(0);
            }
            else
            {
                return(LuaDLL.luaL_throw(L, "invalid arguments to method: GameFramework.SocketClient.Connect"));
            }
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e));
        }
    }
Example #4
0
 static int Clear(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 1);
         GameFramework.SocketClient obj = (GameFramework.SocketClient)ToLua.CheckObject <GameFramework.SocketClient>(L, 1);
         obj.Clear();
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }