public static void Netchan_OutOfBand(int net_socket, netadr_t adr, int length, byte[] data) { SZ.Init(send, send_buf, Defines.MAX_MSGLEN); MSG.WriteInt(send, -1); SZ.Write(send, data, length); NET.SendPacket(net_socket, send.cursize, send.data, adr); }
public virtual void Clear() { sock = dropped = last_received = last_sent = 0; remote_address = new netadr_t(); qport = incoming_sequence = incoming_acknowledged = incoming_reliable_acknowledged = incoming_reliable_sequence = outgoing_sequence = reliable_sequence = last_reliable_sequence = 0; message = new sizebuf_t(); message_buf = new byte[Defines.MAX_MSGLEN - 16]; reliable_length = 0; reliable_buf = new byte[Defines.MAX_MSGLEN - 16]; }
public static void Setup(int sock, netchan_t chan, netadr_t adr, int qport) { chan.Clear(); chan.sock = sock; chan.remote_address.Set(adr); chan.qport = qport; chan.last_received = Globals.curtime; chan.incoming_sequence = 0; chan.outgoing_sequence = 1; SZ.Init(chan.message, chan.message_buf, chan.message_buf.Length); chan.message.allowoverflow = true; }
public virtual void Set(netadr_t from) { type = from.type; port = from.port; ip = from.ip; }
public static void OutOfBandPrint(int net_socket, netadr_t adr, string s) { Netchan_OutOfBand(net_socket, adr, s.Length, Lib.StringToBytes(s)); }