public void SendData() { using (var packet = new InterPacket(InterHeader.ASSIGNED)) { packet.WriteStringLen(ConnectionStringbuilder.CreateEntityString(Settings.Instance.Entity)); packet.WriteByte(ID); packet.WriteStringLen(String.Format("{0}-{1}", Settings.Instance.GameServiceURI, ID)); packet.WriteUShort((ushort)(Settings.Instance.ZoneBasePort + ID)); packet.WriteInt(Maps.Count); foreach (var m in Maps) { packet.WriteUShort(m.ID); packet.WriteStringLen(m.ShortName); packet.WriteStringLen(m.FullName); packet.WriteInt(m.RegenX); packet.WriteInt(m.RegenY); packet.WriteByte(m.Kingdom); packet.WriteUShort(m.ViewRange); } this.SendPacket(packet); } }
public static void TryAssiging(LoginConnector lc) { using (var p = new InterPacket(InterHeader.ASSIGN)) { p.WriteByte(Settings.Instance.ID); p.WriteStringLen(Settings.Instance.WorldName); p.WriteStringLen(Settings.Instance.IP); p.WriteUShort(Settings.Instance.Port); lc.SendPacket(p); } }
public static void SendZoneStarted(byte zoneid, string ip, ushort port, List<MapInfo> maps) { using (var packet = new InterPacket(InterHeader.ZONEOPENED)) { packet.WriteByte(zoneid); packet.WriteStringLen(ip); packet.WriteUShort(port); packet.WriteInt(maps.Count); foreach (var m in maps) { packet.WriteUShort(m.ID); packet.WriteStringLen(m.ShortName); packet.WriteStringLen(m.FullName); packet.WriteInt(m.RegenX); packet.WriteInt(m.RegenY); packet.WriteByte(m.Kingdom); packet.WriteUShort(m.ViewRange); } foreach (var c in Program.Zones.Values) { if (c.ID != zoneid) c.SendPacket(packet); } } }
public static void SendZoneList(ZoneConnection zc) { using (var packet = new InterPacket(InterHeader.ZONELIST)) { packet.Write(Program.Zones.Values.Count); foreach (var z in Program.Zones.Values) { packet.Write(z.ID); packet.Write(z.IP); packet.Write(z.Port); packet.WriteInt(z.Maps.Count); foreach (var m in z.Maps) { packet.WriteUShort(m.ID); packet.WriteStringLen(m.ShortName); packet.WriteStringLen(m.FullName); packet.WriteInt(m.RegenX); packet.WriteInt(m.RegenY); packet.WriteByte(m.Kingdom); packet.WriteUShort(m.ViewRange); } } zc.SendPacket(packet); } }
public void SendTransferClientFromZone(int accountID, string userName, string charName, ushort randid, byte admin, string hostIP) { using (var packet = new InterPacket(InterHeader.CLIENTTRANSFER)) { packet.WriteByte(1); packet.WriteInt(accountID); packet.WriteStringLen(userName); packet.WriteStringLen(charName); packet.WriteUShort(randid); packet.WriteByte(admin); packet.WriteStringLen(hostIP); this.SendPacket(packet); } }
public static void TransferClient(byte zoneID, int accountID, string userName, string charName, ushort randid, byte admin, string hostIP) { using (var packet = new InterPacket(InterHeader.CLIENTTRANSFERZONE)) { packet.WriteByte(zoneID); packet.WriteInt(accountID); packet.WriteStringLen(userName); packet.WriteStringLen(charName); packet.WriteUShort(randid); packet.WriteByte(admin); packet.WriteStringLen(hostIP); WorldConnector.Instance.SendPacket(packet); } }