public WorldSession(WorldServer server, VanillaWorld core, int connectionID, Socket connectionSocket) : base(connectionID, connectionSocket) { Server = server; Core = core; UpdatePacketBuilder = new UpdatePacketBuilder(this); // Connection Packet using (WorldPacket packet = new WorldPacket(WorldOpcodes.SMSG_AUTH_CHALLENGE)) { packet.WriteBytes(new byte[] { 0x33, 0x18, 0x34, 0xC8 }); SendPacket(packet); } }
public void SendHexPacket(WorldOpcodes opcde, string hex) { string end = hex.Replace(" ", "").Replace("\n", ""); byte[] data = Utils.HexToByteArray(end); WorldPacket packet = new WorldPacket(opcde); packet.Write(data); this.SendPacket(packet); //throw new Exception("no"); }
public void TransmitToAll(WorldPacket packet) { Sessions.ForEach(s => s.SendPacket(packet)); }