コード例 #1
0
        /// <summary>
        /// 发送SOCKET消息
        /// </summary>
        public void SendMessage(ushort v_iMsgType, ushort v_iMsgId, LuaByteBuffer v_oLuaByteBuffer)
        {
            //byte[] buffer = new byte[v_oLuaByteBuffer.Length + 6];
            ByteBuffer bf = new ByteBuffer();

            bf.WriteShort(v_iMsgType);
            bf.WriteShort(v_iMsgId);
            bf.WriteBuffer(v_oLuaByteBuffer);
            SocketClient.SendMessage(bf);
        }
コード例 #2
0
 static int WriteBuffer(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 2);
         LuaFramework.ByteBuffer obj  = (LuaFramework.ByteBuffer)ToLua.CheckObject <LuaFramework.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));
     }
 }