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)); } }
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)); } }
/// <summary> /// Post the specified packet. /// </summary> /// <param name="packet">Packet.</param> public virtual void Post(XNetLuaPacket packet) { Post(packet.Data); }
public virtual void Send(XNetLuaPacket packet) { Send(packet.Data); }