public override void EncodeData(IPacket packet) { packet.Encode <Point>(Position); packet.Encode <short>(Foothold); base.EncodeData(packet); }
public override void EncodeData(IPacket packet) { packet.Encode <string>(_text); packet.Encode <int>(_def); packet.Encode <int>(_min); packet.Encode <int>(_max); }
public override void EncodeData(IPacket packet) { packet.Encode <Point>(Position); packet.Encode <Point>(VPosition); base.EncodeData(packet); }
public void EncodeItems(IPacket packet, DbChar flags = DbChar.All) { packet.Encode <byte>((byte)_trunk.SlotMax); packet.Encode <long>((long)flags); if (flags.HasFlag(DbChar.Money)) { packet.Encode <int>(_trunk.Money); } new Dictionary <DbChar, ItemInventoryType> { [DbChar.ItemSlotEquip] = ItemInventoryType.Equip, [DbChar.ItemSlotConsume] = ItemInventoryType.Consume, [DbChar.ItemSlotInstall] = ItemInventoryType.Install, [DbChar.ItemSlotEtc] = ItemInventoryType.Etc, [DbChar.ItemSlotCash] = ItemInventoryType.Cash } .Where(kv => flags.HasFlag(kv.Key)) .ForEach(kv => { var items = User.AccountData.Trunk.Items.Values .Where(i => (ItemInventoryType)(i.TemplateID / 1000000) == kv.Value) .ToList(); packet.Encode <byte>((byte)items.Count); items.ForEach(i => i.Encode(packet)); }); }
public static void Encode(this ItemSlotPet i, IPacket p) { p.Encode <byte>(3); i.EncodeBase(p); p.EncodeFixedString(i.PetName, 13); p.Encode <byte>(i.Level); p.Encode <short>(i.Tameness); p.Encode <byte>(i.Repleteness); if (i.DateDead == null) { p.Encode <long>(0); } else { p.Encode <DateTime>(i.DateDead.Value); } p.Encode <short>(i.PetAttribute); p.Encode <short>(i.PetSkill); p.Encode <int>(i.RemainLife); p.Encode <short>(i.Attribute); }
public override void EncodeData(IPacket packet) { packet.Encode <string>(_text); packet.Encode <string>(_def); packet.Encode <short>(_cols); packet.Encode <short>(_rows); }
public override void EncodeData(IPacket packet) { packet.Encode <string>(_text); packet.Encode <string>(_def); packet.Encode <short>(_lenMin); packet.Encode <short>(_lenMax); }
public static void Encode(this CoupleRecord c, IPacket p) { p.Encode <int>(c.PairCharacterID); p.EncodeFixedString(c.PairCharacterName, 13); p.Encode <long>(c.SN); p.Encode <long>(c.PairSN); }
protected override void EncodeData(IPacket packet) { packet.Encode <byte>(1); packet.Encode <bool>(Failed); packet.Encode <int>(Money); packet.Encode <short>(PremiumIPMesoBonus); }
public void Encode(IPacket packet) { packet.Encode <byte>((byte)Type); packet.Encode <byte>((byte)_inventory); packet.Encode <short>(_slot); EncodeData(packet); }
public static void Encode(this FriendRecord f, IPacket p) { p.Encode <int>(f.PairCharacterID); p.EncodeFixedString(f.PairCharacterName, 13); p.Encode <long>(f.SN); p.Encode <long>(f.PairSN); p.Encode <int>(f.FriendItemID); }
public void Encode(IPacket packet) { packet.Encode <short>(Option); packet.Encode <int>(TemplateID); packet.Encode <int>(DateExpire.HasValue ? (int)(DateExpire.Value - DateTime.Now).TotalMilliseconds : int.MaxValue); }
public void Encode(IPacket packet) { packet.Encode <Point>(Position); packet.Encode <Point>(VPosition); packet.Encode <byte>((byte)_fragments.Count); _fragments.ForEach(f => f.Encode(packet)); }
protected override void EncodeData(IPacket packet) { packet.Encode <int>(_skillTemplateID); packet.Encode <byte>(0); packet.Encode <byte>(_skillLevel); _additional?.Invoke(packet); }
public static void EncodeExtendSP(this Character c, IPacket p) { p.Encode <byte>((byte)c.ExtendSP.Count); c.ExtendSP.ForEach(kv => { p.Encode <byte>(kv.Key); p.Encode <byte>(kv.Value); }); }
protected override void EncodeData(IPacket packet) { packet.Encode <byte>((byte)_entries.Count); _entries.ForEach(e => { packet.Encode <int>(e.Item1); packet.Encode <int>(e.Item2); }); }
public void Encode(IPacket packet) { packet.Encode <byte>(0); // SpeakerTypeID packet.Encode <int>(Speaker.TemplateID); packet.Encode <byte>((byte)Type); packet.Encode <byte>((byte)Speaker.ParamType); EncodeData(packet); }
protected override void EncodeData(IPacket packet) { if (Speaker.Param.HasFlag(ScriptMessageParam.NPCReplacedByNPC)) { packet.Encode <int>(Speaker.TemplateID); } packet.Encode <string>(_text); packet.Encode <bool>(_prev); packet.Encode <bool>(_next); }
public override void EncodeData(IPacket packet) { if (Speaker.ParamType.HasFlag(SpeakerParamType.NPCReplacedByNPC)) { packet.Encode <int>(Speaker.TemplateID); } packet.Encode <string>(_text); packet.Encode <bool>(_prev); packet.Encode <bool>(_next); }
public static void EncodeBase(this ItemSlot i, IPacket p) { p.Encode <int>(i.TemplateID); p.Encode <bool>(i.CashItemSN.HasValue); if (i.CashItemSN.HasValue) { p.Encode <long>(i.CashItemSN.Value); } p.Encode <DateTime>(i.DateExpire ?? ItemConstants.Permanent); }
public void Encode(IPacket packet) { packet.Encode <short>((short)_records.Count); _records.ForEach(kv => { packet.Encode <int>(kv.Key); packet.Encode <int>(kv.Value.Level); packet.Encode <int>(kv.Value.MasterLevel); packet.Encode <DateTime>(kv.Value.DateExpire ?? ItemConstants.Permanent); }); }
public override void EncodeData(IPacket packet) { packet.Encode <Point>(Position); packet.Encode <Point>(VPosition); packet.Encode <short>(Foothold); if (Attribute == MovePathAttribute.FallDown) { packet.Encode <short>(FallStartFoothold); } packet.Encode <Point>(Offset); base.EncodeData(packet); }
public static void Encode(this ItemSlotBundle i, IPacket p) { p.Encode <byte>(2); i.EncodeBase(p); p.Encode <short>(i.Number); p.Encode <string>(i.Title); p.Encode <short>(i.Attribute); if (ItemConstants.IsRechargeableItem(i.TemplateID)) { p.Encode <long>(0); } }
public static void EncodeForRemote(IPacket packet, ICollection <TemporaryStatEntry> stats) { EncodeMask(packet, stats); var dictionary = stats.ToDictionary(s => s.Type, s => s); dictionary.GetValueOrDefault(TemporaryStatType.Speed)?.EncodeRemote(packet, 1); dictionary.GetValueOrDefault(TemporaryStatType.ComboCounter)?.EncodeRemote(packet, 1); dictionary.GetValueOrDefault(TemporaryStatType.WeaponCharge)?.EncodeRemote(packet, 4); dictionary.GetValueOrDefault(TemporaryStatType.Stun)?.EncodeRemote(packet, 4); dictionary.GetValueOrDefault(TemporaryStatType.Darkness)?.EncodeRemote(packet, 4); dictionary.GetValueOrDefault(TemporaryStatType.Seal)?.EncodeRemote(packet, 4); dictionary.GetValueOrDefault(TemporaryStatType.Weakness)?.EncodeRemote(packet, 4); dictionary.GetValueOrDefault(TemporaryStatType.Curse)?.EncodeRemote(packet, 4); dictionary.GetValueOrDefault(TemporaryStatType.Poison)?.EncodeRemote(packet, 2); dictionary.GetValueOrDefault(TemporaryStatType.Poison)?.EncodeRemote(packet, 4); dictionary.GetValueOrDefault(TemporaryStatType.ShadowPartner)?.EncodeRemote(packet, 4); dictionary.GetValueOrDefault(TemporaryStatType.Morph)?.EncodeRemote(packet, 2); dictionary.GetValueOrDefault(TemporaryStatType.Ghost)?.EncodeRemote(packet, 2); dictionary.GetValueOrDefault(TemporaryStatType.Attract)?.EncodeRemote(packet, 4); dictionary.GetValueOrDefault(TemporaryStatType.SpiritJavelin)?.EncodeRemote(packet, 4); dictionary.GetValueOrDefault(TemporaryStatType.BanMap)?.EncodeRemote(packet, 4); dictionary.GetValueOrDefault(TemporaryStatType.Barrier)?.EncodeRemote(packet, 4); dictionary.GetValueOrDefault(TemporaryStatType.DojangShield)?.EncodeRemote(packet, 4); dictionary.GetValueOrDefault(TemporaryStatType.ReverseInput)?.EncodeRemote(packet, 4); dictionary.GetValueOrDefault(TemporaryStatType.RespectPImmune)?.EncodeRemote(packet, 4); dictionary.GetValueOrDefault(TemporaryStatType.RespectMImmune)?.EncodeRemote(packet, 4); dictionary.GetValueOrDefault(TemporaryStatType.DefenseAtt)?.EncodeRemote(packet, 4); dictionary.GetValueOrDefault(TemporaryStatType.DefenseState)?.EncodeRemote(packet, 4); dictionary.GetValueOrDefault(TemporaryStatType.RepeatEffect)?.EncodeRemote(packet, 4); dictionary.GetValueOrDefault(TemporaryStatType.StopPortion)?.EncodeRemote(packet, 4); dictionary.GetValueOrDefault(TemporaryStatType.StopMotion)?.EncodeRemote(packet, 4); dictionary.GetValueOrDefault(TemporaryStatType.Fear)?.EncodeRemote(packet, 4); dictionary.GetValueOrDefault(TemporaryStatType.MagicShield)?.EncodeRemote(packet, 4); dictionary.GetValueOrDefault(TemporaryStatType.Frozen)?.EncodeRemote(packet, 4); dictionary.GetValueOrDefault(TemporaryStatType.SuddenDeath)?.EncodeRemote(packet, 4); dictionary.GetValueOrDefault(TemporaryStatType.FinalCut)?.EncodeRemote(packet, 4); dictionary.GetValueOrDefault(TemporaryStatType.Cyclone)?.EncodeRemote(packet, 1); dictionary.GetValueOrDefault(TemporaryStatType.Mechanic)?.EncodeRemote(packet, 4); dictionary.GetValueOrDefault(TemporaryStatType.DarkAura)?.EncodeRemote(packet, 4); dictionary.GetValueOrDefault(TemporaryStatType.BlueAura)?.EncodeRemote(packet, 4); dictionary.GetValueOrDefault(TemporaryStatType.YellowAura)?.EncodeRemote(packet, 4); packet.Encode <byte>(0); // nDefenseAtt packet.Encode <byte>(0); // nDefenseState // TODO: TwoState }
public void Encode(IPacket packet) { var operations = _inventories.Values.SelectMany(v => v.Operations).ToList(); packet.Encode<byte>((byte) operations.Count); operations.ForEach(o => o.Encode(packet)); }
public void SendPacket(IPacket packet) { try { packet.Encode(); MemoryStream packetBlock = new MemoryStream(); Int32 packetLen = sizeof(Int32) + (Int32)packet.GetStream().Length; Byte[] packetHeader = BitConverter.GetBytes(packetLen); PacketObfuscation.EncodeHeader(ref packetHeader, (int)packetHeader.Length); packetBlock.Write(packetHeader, 0, (Int32)packetHeader.Length); Byte[] packetData = packet.GetStream().ToArray(); PacketObfuscation.EncodeData(ref packetData, (int)packetData.Length); packetBlock.Write(packetData, 0, (Int32)packetData.Length); Byte[] packetBytes = packetBlock.ToArray(); _Stream.Write(packetBytes, 0, (int)packetBlock.Length); _Stream.Flush(); } catch (Exception e) { if (IsConnected()) { MessageBox.Show("잘못된 처리: " + e.ToString(), "error", MessageBoxButtons.OK); Application.Exit(); } } }
public void EncodeRemote(IPacket packet, int size) { switch (size) { case 1: packet.Encode <byte>((byte)Option); break; case 2: packet.Encode <short>(Option); break; case 4: packet.Encode <int>(Option); break; } }
public static void SendPacket(IWebSocketConnection connection, IPacket packet) { lock (_sync) { var msg = packet.Encode(); connection.Send(msg); } }
public static void EncodeRemote(this IDictionary <TemporaryStatType, TemporaryStat> stats, IPacket packet) { stats.EncodeMask(packet); TemporaryStatOrder.EncodingOrderRemote.ForEach(kv => { if (!stats.ContainsKey(kv.Key)) { return; } kv.Value.Invoke(stats[kv.Key], packet); }); packet.Encode <byte>(0); // nDefenseAtt packet.Encode <byte>(0); // nDefenseState EncodeTwoState(stats, packet); }
public void EncodeData(IPacket packet) { packet.Encode <int>(Item.TemplateID); packet.Encode <string>(Item.PetName); packet.Encode <long>(Item.CashItemSN ?? 0); packet.Encode <Point>(Position); packet.Encode <byte>(MoveAction); packet.Encode <short>(Foothold); packet.Encode <bool>(NameTag); packet.Encode <bool>(ChatBalloon); }