public DyeSelectItemPacket(IPacketStream packet) { DyeItemBag = packet.Read <byte>(); DyeItemSlot = packet.Read <byte>(); TargetItemBag = packet.Read <byte>(); TargetItemSlot = packet.Read <byte>(); }
public TradeAddItemPacket(IPacketStream packet) { Bag = packet.Read <byte>(); Slot = packet.Read <byte>(); Quantity = packet.Read <byte>(); SlotInTradeWindow = packet.Read <byte>(); }
public GMTeleportPlayerPacket(IPacketStream packet) { Name = packet.ReadString(21); X = packet.Read <float>(); Z = packet.Read <float>(); MapId = packet.Read <ushort>(); }
public ItemComposePacket(IPacketStream packet) { RuneBag = packet.Read <byte>(); RuneSlot = packet.Read <byte>(); ItemBag = packet.Read <byte>(); ItemSlot = packet.Read <byte>(); }
public MoveItemInInventoryPacket(IPacketStream packet) { CurrentBag = packet.Read <byte>(); CurrentSlot = packet.Read <byte>(); DestinationBag = packet.Read <byte>(); DestinationSlot = packet.Read <byte>(); }
public AesKeyResponsePacket(IPacketStream packet) { // First goes session id. byte[] guidBytes = new byte[16]; for (int i = 0; i < 16; i++) { guidBytes[i] = packet.Read <byte>(); } Guid = new Guid(guidBytes); // After that aes key. Key = new byte[16]; for (int i = 0; i < 16; i++) { Key[i] = packet.Read <byte>(); } // After that iv. IV = new byte[16]; for (int i = 0; i < 16; i++) { IV[i] = packet.Read <byte>(); } }
public MoveCharacterPacket(IPacketStream packet) { MovementType = (MovementType)packet.Read <byte>(); Angle = packet.Read <ushort>(); X = packet.Read <float>(); Y = packet.Read <float>(); Z = packet.Read <float>(); }
public GMNoticeFactionPacket(IPacketStream packet) { TimeInterval = packet.Read <short>(); var messageLength = packet.Read <byte>(); // Message always ends with an empty character Message = packet.ReadString(messageLength - 1); }
public AuthenticateServerPacket(IPacketStream packet) { byte id = 1; byte[] host = packet.Read <byte>(4); string name = packet.ReadString(32); int buildVersion = packet.Read <int>(); ushort maxConnections = packet.Read <ushort>(); WorldServerInfo = new WorldServerInfo(id, host, name, buildVersion, maxConnections); }
public GMNoticeWorldPacket(IPacketStream packet) { TimeInterval = packet.Read <short>(); var messageLength = packet.Read <byte>(); // Message always ends with an empty character #if EP8_V2 Message = packet.ReadString(messageLength, Encoding.Unicode); #else Message = packet.ReadString(messageLength); #endif }
public ChatNormalPacket(IPacketStream packet) { #if EP8_V2 var length0 = packet.Read <byte>(); #endif var messageLength = packet.Read <byte>(); #if (EP8_V2 || SHAIYA_US) Message = packet.ReadString(messageLength, Encoding.Unicode); #else Message = packet.ReadString(messageLength); #endif }
public static void OnAuthenticateServer(ISClient client, IPacketStream packet) { byte id = 1; byte[] host = packet.Read <byte>(4); string name = packet.ReadString(32); int buildVersion = packet.Read <int>(); ushort maxConnections = packet.Read <ushort>(); WorldServerInfo world = new WorldServerInfo(id, host, name, buildVersion, maxConnections); client.SetWordServerInfo(world); }
public ChatPartyPacket(IPacketStream packet) { #if EP8_V2 var length0 = packet.Read <byte>(); #endif var messageLength = packet.Read <byte>(); #if EP8_V2 Message = packet.ReadString(messageLength, Encoding.Unicode); #else Message = packet.ReadString(messageLength); #endif }
public ChatWhisperPacket(IPacketStream packet) { TargetName = packet.ReadString(21); #if EP8_V2 var length0 = packet.Read <byte>(); #endif var messageLength = packet.Read <byte>(); #if EP8_V2 || SHAIYA_US Message = packet.ReadString(messageLength, Encoding.Unicode); #else Message = packet.ReadString(messageLength); #endif }
public GMNoticeAdminsPacket(IPacketStream packet) { var messageLength = packet.Read <byte>(); // Message always ends with an empty character Message = packet.ReadString(messageLength - 1); }
public ChatWhisperPacket(IPacketStream packet) { TargetName = packet.ReadString(21); var messageLength = packet.Read <byte>(); Message = packet.ReadString(messageLength); }
public GMWarningPacket(IPacketStream packet) { Name = packet.ReadString(21); var messageLength = packet.Read <byte>(); Message = packet.ReadString(messageLength); }
public CreateCharacterPacket(IPacketStream packet) { Slot = packet.Read <byte>(); Race = (Race)packet.Read <byte>(); Mode = (Mode)packet.Read <byte>(); Hair = packet.Read <byte>(); Face = packet.Read <byte>(); Height = packet.Read <byte>(); Class = (CharacterProfession)packet.Read <byte>(); Gender = (Gender)packet.Read <byte>(); CharacterName = packet.ReadString((int)packet.Length - 1); }
public AesKeyRequestPacket(IPacketStream packet) { byte[] guidBytes = new byte[16]; for (int i = 0; i < 16; i++) { guidBytes[i] = packet.Read <byte>(); } Guid = new Guid(guidBytes); }
public override void Update() { lock (this) { if (_resetRequested) { Reset(); } else if (_stream != null) { try { while (_stream != null) { using (var packet = _stream.Read()) { if (packet == null) { break; } var type = (SessionMessage)packet.ReadByte(); // Statistics. Info.PutIncomingTraffic( packet.Length, type == SessionMessage.Data ? TrafficTypes.Data : TrafficTypes.Protocol); Info.PutIncomingPacketSize(packet.Length); using (var data = packet.ReadPacketizable <Packet>()) { HandleTcpData(type, data); } } } } catch (IOException ex) { // Connection failed, disconnect. Logger.TraceException("Socket connection died.", ex); Reset(); } catch (PacketException ex) { // Received invalid packet from server. Logger.WarnException("Invalid packet received from server.", ex); Reset(); } } } base.Update(); }
public GMNoticeAdminsPacket(IPacketStream packet) { var messageLength = packet.Read <byte>(); // Message always ends with an empty character #if EP8_V2 Message = packet.ReadString(messageLength, Encoding.Unicode); #else Message = packet.ReadString(messageLength); #endif }
/// <summary> /// Tries reading a single packet from this stream. To read multiple available packets, repeatedly call this method /// until it returns <c>null</c>. /// </summary> /// <returns>A read packet, if one was available.</returns> /// <exception cref="System.IO.IOException">If the underlying stream fails.</exception> public IReadablePacket Read() { using (var packet = _stream.Read()) { if (packet != null) { return(new Packet(Crypto.Decrypt(packet.ReadByteArray()), false)); } } return(null); }
public AutoStatsSettingsPacket(IPacketStream packet) { var unknown = packet.Read <uint>(); // probably character id. Str = packet.Read <byte>(); Dex = packet.Read <byte>(); Rec = packet.Read <byte>(); Int = packet.Read <byte>(); Luc = packet.Read <byte>(); Wis = packet.Read <byte>(); }
public ChangeAppearancePacket(IPacketStream packet) { Bag = packet.Read <byte>(); Slot = packet.Read <byte>(); Hair = packet.Read <byte>(); Face = packet.Read <byte>(); Size = packet.Read <byte>(); Sex = packet.Read <byte>(); }
public GemAddPacket(IPacketStream packet) { Bag = packet.Read <byte>(); Slot = packet.Read <byte>(); DestinationBag = packet.Read <byte>(); DestinationSlot = packet.Read <byte>(); HammerBag = packet.Read <byte>(); HammerSlot = packet.Read <byte>(); }
public GemRemovePossibilityPacket(IPacketStream packet) { Bag = packet.Read <byte>(); Slot = packet.Read <byte>(); ShouldRemoveSpecificGem = packet.Read <bool>(); GemPosition = packet.Read <byte>(); HammerBag = packet.Read <byte>(); HammerSlot = packet.Read <byte>(); }
public GemAddPossibilityPacket(IPacketStream packet) { GemBag = packet.Read <byte>(); GemSlot = packet.Read <byte>(); DestinationBag = packet.Read <byte>(); DestinationSlot = packet.Read <byte>(); HammerBag = packet.Read <byte>(); HammerSlot = packet.Read <byte>(); }
public UpdateStatsPacket(IPacketStream packet) { Str = packet.Read <ushort>(); Dex = packet.Read <ushort>(); Rec = packet.Read <ushort>(); Int = packet.Read <ushort>(); Wis = packet.Read <ushort>(); Luc = packet.Read <ushort>(); }
/// <summary> /// Tries reading a single packet from this stream. To read multiple available /// packets, repeatedly call this method until it returns <c>null</c>. /// </summary> /// <returns> /// A read packet, if one was available. /// </returns> /// <exception cref="System.IO.IOException">If the underlying stream fails.</exception> public IReadablePacket Read() { using (var packet = _stream.Read()) { if (packet != null) { var compressed = packet.ReadBoolean(); var data = packet.ReadByteArray(); if (compressed) { data = SimpleCompression.Decompress(data); } return(new Packet(data, false)); } } return(null); }
public SkillBarPacket(IPacketStream packet) { var count = packet.Read <byte>(); var unknown = packet.Read <int>(); QuickItems = new QuickSkillBarItem[count - 1]; for (var i = 0; i < count - 1; i++) { var bar = packet.Read <byte>(); var slot = packet.Read <byte>(); var bag = packet.Read <byte>(); var number = packet.Read <ushort>(); var unknown2 = packet.Read <int>(); // cooldown? QuickItems[i] = new QuickSkillBarItem(bar, slot, bag, number); } // There are still 5 bytes after all. But they are always the same. // These are 21, 1, 255, 0, 0. I leave it unimplemented, since i have no idea why they are needed. }