public void SendTransferClientFromWorld(int accountID, string userName, byte admin, string hostIP, string hash) { using (var packet = new InterPacket(InterHeader.CLIENTTRANSFER)) { packet.WriteByte(0); packet.WriteInt(accountID); packet.WriteStringLen(userName); packet.WriteStringLen(hash); packet.WriteByte(admin); packet.WriteStringLen(hostIP); this.SendPacket(packet); } }
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 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); } }