Esempio n. 1
0
 static public int WriteBlock(IntPtr l)
 {
     try {
         XNetLuaPacket self  = (XNetLuaPacket)LuaObject.checkSelf(l);
         byte[]        bytes = LuaDLL.lua_tobytes(l, 2);
         self.data.WriteBlock(bytes);
         LuaObject.pushValue(l, true);
         return(1);
     }
     catch (Exception e) {
         return(LuaObject.error(l, e));
     }
 }
Esempio n. 2
0
 static public int ReadBlock(IntPtr l)
 {
     try {
         XNetLuaPacket self  = (XNetLuaPacket)LuaObject.checkSelf(l);
         byte[]        bytes = self.data.ReadBlock();
         LuaObject.pushValue(l, true);
         LuaDLL.lua_pushlstring(l, bytes, bytes.Length);
         return(2);
     }
     catch (Exception e) {
         return(LuaObject.error(l, e));
     }
 }
Esempio n. 3
0
 /// <summary>
 /// Post the specified packet.
 /// </summary>
 /// <param name="packet">Packet.</param>
 public virtual void     Post(XNetLuaPacket packet)
 {
     Post(packet.Data);
 }
Esempio n. 4
0
 public virtual void     Send(XNetLuaPacket packet)
 {
     Send(packet.Data);
 }