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

            if (count == 0)
            {
                VisowFrameWork.ByteBuffer obj = new VisowFrameWork.ByteBuffer();
                ToLua.PushObject(L, obj);
                return(1);
            }
            else if (count == 1)
            {
                byte[] arg0 = ToLua.CheckByteBuffer(L, 1);
                VisowFrameWork.ByteBuffer obj = new VisowFrameWork.ByteBuffer(arg0);
                ToLua.PushObject(L, obj);
                return(1);
            }
            else
            {
                return(LuaDLL.luaL_throw(L, "invalid arguments to ctor method: VisowFrameWork.ByteBuffer.New"));
            }
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e));
        }
    }
Example #2
0
    static int SendMessage(IntPtr L)
    {
        try
        {
            int count = LuaDLL.lua_gettop(L);

            if (count == 2 && TypeChecker.CheckTypes <string>(L, 2))
            {
                VisowFrameWork.NetWorkManager obj = (VisowFrameWork.NetWorkManager)ToLua.CheckObject <VisowFrameWork.NetWorkManager>(L, 1);
                string arg0 = ToLua.ToString(L, 2);
                obj.SendMessage(arg0);
                return(0);
            }
            else if (count == 2 && TypeChecker.CheckTypes <VisowFrameWork.ByteBuffer>(L, 2))
            {
                VisowFrameWork.NetWorkManager obj  = (VisowFrameWork.NetWorkManager)ToLua.CheckObject <VisowFrameWork.NetWorkManager>(L, 1);
                VisowFrameWork.ByteBuffer     arg0 = (VisowFrameWork.ByteBuffer)ToLua.ToObject(L, 2);
                obj.SendMessage(arg0);
                return(0);
            }
            else if (count == 3 && TypeChecker.CheckTypes <UnityEngine.SendMessageOptions>(L, 3))
            {
                VisowFrameWork.NetWorkManager obj = (VisowFrameWork.NetWorkManager)ToLua.CheckObject <VisowFrameWork.NetWorkManager>(L, 1);
                string arg0 = ToLua.CheckString(L, 2);
                UnityEngine.SendMessageOptions arg1 = (UnityEngine.SendMessageOptions)ToLua.ToObject(L, 3);
                obj.SendMessage(arg0, arg1);
                return(0);
            }
            else if (count == 3 && TypeChecker.CheckTypes <object>(L, 3))
            {
                VisowFrameWork.NetWorkManager obj = (VisowFrameWork.NetWorkManager)ToLua.CheckObject <VisowFrameWork.NetWorkManager>(L, 1);
                string arg0 = ToLua.CheckString(L, 2);
                object arg1 = ToLua.ToVarObject(L, 3);
                obj.SendMessage(arg0, arg1);
                return(0);
            }
            else if (count == 4)
            {
                VisowFrameWork.NetWorkManager obj = (VisowFrameWork.NetWorkManager)ToLua.CheckObject <VisowFrameWork.NetWorkManager>(L, 1);
                string arg0 = ToLua.CheckString(L, 2);
                object arg1 = ToLua.ToVarObject(L, 3);
                UnityEngine.SendMessageOptions arg2 = (UnityEngine.SendMessageOptions)ToLua.CheckObject(L, 4, typeof(UnityEngine.SendMessageOptions));
                obj.SendMessage(arg0, arg1, arg2);
                return(0);
            }
            else
            {
                return(LuaDLL.luaL_throw(L, "invalid arguments to method: VisowFrameWork.NetWorkManager.SendMessage"));
            }
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e));
        }
    }
Example #3
0
 static int Close(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 1);
         VisowFrameWork.ByteBuffer obj = (VisowFrameWork.ByteBuffer)ToLua.CheckObject <VisowFrameWork.ByteBuffer>(L, 1);
         obj.Close();
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
Example #4
0
 static int WriteByte(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 2);
         VisowFrameWork.ByteBuffer obj = (VisowFrameWork.ByteBuffer)ToLua.CheckObject <VisowFrameWork.ByteBuffer>(L, 1);
         byte arg0 = (byte)LuaDLL.luaL_checknumber(L, 2);
         obj.WriteByte(arg0);
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
Example #5
0
 static int ToBytes(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 1);
         VisowFrameWork.ByteBuffer obj = (VisowFrameWork.ByteBuffer)ToLua.CheckObject <VisowFrameWork.ByteBuffer>(L, 1);
         byte[] o = obj.ToBytes();
         ToLua.Push(L, o);
         return(1);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
Example #6
0
 static int ReadBuffer(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 1);
         VisowFrameWork.ByteBuffer  obj = (VisowFrameWork.ByteBuffer)ToLua.CheckObject <VisowFrameWork.ByteBuffer>(L, 1);
         LuaInterface.LuaByteBuffer o   = obj.ReadBuffer();
         ToLua.Push(L, o);
         return(1);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
Example #7
0
 static int ReadString(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 1);
         VisowFrameWork.ByteBuffer obj = (VisowFrameWork.ByteBuffer)ToLua.CheckObject <VisowFrameWork.ByteBuffer>(L, 1);
         string o = obj.ReadString();
         LuaDLL.lua_pushstring(L, o);
         return(1);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
Example #8
0
 static int WriteBuffer(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 2);
         VisowFrameWork.ByteBuffer obj  = (VisowFrameWork.ByteBuffer)ToLua.CheckObject <VisowFrameWork.ByteBuffer>(L, 1);
         LuaByteBuffer             arg0 = new LuaByteBuffer(ToLua.CheckByteBuffer(L, 2));
         obj.WriteBuffer(arg0);
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
Example #9
0
 static int WriteLong(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 2);
         VisowFrameWork.ByteBuffer obj = (VisowFrameWork.ByteBuffer)ToLua.CheckObject <VisowFrameWork.ByteBuffer>(L, 1);
         long arg0 = LuaDLL.tolua_checkint64(L, 2);
         obj.WriteLong(arg0);
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
Example #10
0
 static int AddEvent(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 2);
         int arg0 = (int)LuaDLL.luaL_checknumber(L, 1);
         VisowFrameWork.ByteBuffer arg1 = (VisowFrameWork.ByteBuffer)ToLua.CheckObject <VisowFrameWork.ByteBuffer>(L, 2);
         VisowFrameWork.NetWorkManager.AddEvent(arg0, arg1);
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }