/// <summary> /// 0: Port /// </summary> /// <param name="w"></param> /// <param name="datas"></param> public void Pack(Writer w, params object[] datas) { var p = new Packet(new PacketHeader {ID = ID}); p.Writer.Write((ushort) datas[0]); p.Write(w); }
public void Write(Writer w) { UpdateHeader(); w.Write(Header); w.Write(_stream.ToArray()); }
/// <summary> /// 0: MasterServerDatas List /// </summary> /// <param name="w"></param> /// <param name="datas"></param> public void Pack(Writer w, params object[] datas) { var list = (List<MasterServerDatas>) datas[0]; var p = new Packet(new PacketHeader {ID = ID}); p.Writer.Write(list.Count); foreach (var masterServerDatase in list) { p.Writer.Write(masterServerDatase.IP); p.Writer.Write(masterServerDatase.Port); p.Writer.Write(masterServerDatase.Map); p.Writer.Write(masterServerDatase.MaxPlayer); p.Writer.Write(masterServerDatase.ConnectedPlayer); } p.Write(w); }