public override void Serialize(LittleEndianWriter writer) { int waypointsSize = Waypoints.Length; if (waypointsSize > 0x7F) { throw new Exception("Too many paths > 0x7F!"); } byte bitfield = 0; if (Waypoints != null) { bitfield |= (byte)(waypointsSize << 1); } if (HasTeleportID) { bitfield |= 1; } writer.WriteByte(4);//bitfield); if (Waypoints != null) { writer.WriteUInt(TeleportNetID); if (HasTeleportID) { writer.WriteByte(TeleportID); } writer.WriteWaypointSpeedParams(SpeedParams); writer.WriteCompressedWaypoints(Waypoints); } }
public void Serialize(LittleEndianWriter writer) { writer.WriteUInt(ItemId); writer.WriteByte(Slot); writer.WriteByte(ItemsInSlot); writer.WriteByte(SpellCharges); }
public override void Serialize(LittleEndianWriter writer) { writer.WriteUInt(targetNetId); writer.WriteByte((byte)extraTime); // extraTime writer.WriteUInt(futureProjectileNetId); // Basic attack projectile ID, to be spawned later writer.WriteByte((byte)slot); // attackSlot writer.WriteByte((byte)0x80); // not sure what this is, but it should be correct (or maybe attacked x z y?) - 4.18 writer.WriteByte((byte)0x01); writer.WriteShort((short)MovementVector.TargetXToNormalFormat(targetPosition.X, middleOfMap)); writer.WriteByte((byte)0x80); writer.WriteByte((byte)0x01); writer.WriteShort((short)MovementVector.TargetYToNormalFormat(targetPosition.Y, middleOfMap)); // writer.WriteFloat(targetPosition.X); // writer.WriteFloat(targetPosition.Y); writer.WriteByte((byte)0xCC); writer.WriteByte((byte)0x35); writer.WriteByte((byte)0xC4); writer.WriteByte((byte)0xD1); writer.WriteFloat(sourcePosition.X); writer.WriteFloat(sourcePosition.Y); }
public override void Serialize(LittleEndianWriter writer) { writer.WriteByte(slotId); writer.WriteByte(0xF8); // 4.18 writer.WriteFloat(currentCd); writer.WriteFloat(totalCd); }
public override void Serialize(LittleEndianWriter writer) { writer.WriteShort((short)1); // Number of dashes writer.WriteByte((byte)4); // Waypoints size * 2 writer.WriteUInt((uint)sourceNetId); writer.WriteFloat((float)dashSpeed); writer.WriteFloat((float)leapHeight); writer.WriteFloat((float)unitPosition.X); writer.WriteFloat((float)unitPosition.Y); writer.WriteByte((byte)(keepFacingLastDirection ? 0x01 : 0x00)); writer.WriteUInt(targetNetId); writer.WriteFloat((float)followTargetMaxDistance); writer.WriteFloat((float)backDistance); writer.WriteFloat((float)travelTime); var waypoints = new List <Vector2> { new Vector2(unitPosition.X, unitPosition.Y), new Vector2(targetPosition.X, targetPosition.Y) }; writer.WriteBytes(MovementVector.EncodeWaypoints(waypoints.ToArray(), mapSize)); }
public override void Serialize(LittleEndianWriter writer) { writer.WriteInt((int)itemId); writer.WriteByte((byte)slot); writer.WriteByte((byte)stacks); writer.WriteByte((byte)0); //unk or stacks => short writer.WriteByte((byte)0x29); //unk (turret 0x01 and champions 0x29) }
public override void Serialize(LittleEndianWriter writer) { writer.WriteInt((int)0); writer.WriteByte((byte)0); writer.WriteUInt(sourceNetId); writer.WriteByte((byte)0); // unk writer.WriteByte((byte)7); // unk writer.WriteInt((int)0); // Flags? }
public override void Serialize(LittleEndianWriter writer) { writer.WriteFloat(position.X); writer.WriteFloat(position.Y); writer.WriteUInt(targetNetId); writer.WriteUInt(sourceNetId); writer.WriteByte((byte)pingType); writer.WriteByte(0xFB); }
public override void Serialize(LittleEndianWriter writer) { Position.Serialize(writer); writer.WriteString(MinimapIcon, 64); writer.WriteByte(CampIndex); writer.WriteByte((byte)AudioVOComponentRevealEvent); writer.WriteByte((byte)TeamSide); writer.WriteInt(TimerType); writer.WriteFloat(Expire); }
public override void Serialize(LittleEndianWriter writer) { writer.WriteInt(goldFromKill); // Gold from kill? writer.WriteByte((byte)0); writer.WriteUInt(killerNetId); writer.WriteByte((byte)0); writer.WriteByte((byte)7); writer.WriteFloat(respawnTimerMs); // Respawn timer, float }
public override void Serialize(LittleEndianWriter writer) { writer.WriteByte(partialKey[0]); writer.WriteByte(partialKey[1]); writer.WriteByte(partialKey[2]); writer.WriteInt(playerNo); writer.WriteLong(userId); writer.WriteInt(trash); writer.WriteLong(checkId); writer.WriteInt(trash2); }
public override void Serialize(LittleEndianWriter writer) { writer.WriteLong(userId); writer.WriteInt(skinId); writer.WriteInt(name.Length + 1); foreach (var b in Encoding.UTF8.GetBytes(name)) { writer.WriteByte(b); } writer.WriteByte(description); }
public override void Serialize(LittleEndianWriter writer) { writer.WriteByte(buffSlot); writer.WriteByte((byte)buffType); writer.WriteByte(count); writer.WriteBool(isHidden); writer.WriteUInt(buffNameHash); writer.WriteUInt(packageHash); writer.WriteFloat(runningTime); writer.WriteFloat(duration); writer.WriteUInt(casterNetId); }
public override void Serialize(LittleEndianWriter writer) { position.Serialize(writer); casterPosition.Serialize(writer); direction.Serialize(writer); velocity.Serialize(writer); startPoint.Serialize(writer); endPoint.Serialize(writer); unitPosition.Serialize(writer); writer.WriteFloat(timeFromCreation); writer.WriteFloat(speed); writer.WriteFloat(lifePercentage); writer.WriteFloat(timedSpeedDelta); writer.WriteFloat(timedSpeedDeltaTime); byte bitfield = 0; if (bounced) { bitfield |= 1; } writer.WriteByte(bitfield); castInfo.Serialize(writer); }
public override void Pack(LittleEndianWriter writer) { if ((short)Cmd > byte.MaxValue) // oops, riot needs ids ! { writer.WriteByte((byte)PacketCmd.PKT_S2C_Extended); writer.WriteUInt(netId); writer.WriteShort((short)Cmd); } else { writer.WriteByte((byte)Cmd); writer.WriteUInt(netId); } Serialize(writer); }
public override void Pack(LittleEndianWriter writer) { writer.WriteByte((byte)Cmd); writer.WriteUInt(netId); writer.WriteInt(syncId); Serialize(writer); }
public override void Serialize(LittleEndianWriter writer) { int itemCount = Items.Length; if (itemCount > 0xFF) { throw new IOException("More than 255 items!"); } writer.WriteByte((byte)itemCount); foreach (var item in Items) { item.Serialize(writer); } if (ShieldValues != null) { writer.WriteBool(true); ShieldValues.Serialize(writer); } else { writer.WriteBool(false); } writer.WriteInt(CharacterDataStack.Length); foreach (var data in CharacterDataStack) { data.Serialize(writer); } writer.WriteUInt(LookAtNetId); writer.WriteByte((byte)LookAtType); LookAtPosition.Serialize(writer); writer.WriteInt(BuffCount.Count); foreach (var kvp in BuffCount) { writer.WriteByte(kvp.Key); writer.WriteInt(kvp.Value); } writer.WriteBool(UnknownIsHero); }
public override void Serialize(LittleEndianWriter writer) { writer.WriteString(title, 128); writer.WriteString(text, 128); writer.WriteString(imagePath, 128); writer.WriteByte((byte)command); writer.WriteInt((int)base.netId); }
public override void Serialize(LittleEndianWriter writer) { writer.WriteInt(playerId); writer.WriteInt(botNetId); writer.WriteByte(isBotMessage); writer.WriteInt((int)channel); writer.WriteInt(unk1); writer.WriteInt(length); writer.WriteBytes(unk2); foreach (var b in Encoding.UTF8.GetBytes(content)) { writer.WriteByte((byte)b); } writer.WriteByte(0); }
public override void Serialize(LittleEndianWriter writer) { writer.WriteByte((byte)damageResult); writer.WriteShort((short)((short)damageType << 8)); writer.WriteFloat((float)value); writer.WriteUInt(targetNetId); writer.WriteUInt(sourceNetId); }
public void Serialize(LittleEndianWriter writer) { writer.WriteUInt(TargetNetId); writer.WriteSByte((sbyte)(ExtraTime + 128)); writer.WriteUInt(MissileNextId); writer.WriteByte((byte)AttackSlot); // attackSlot TargetPosition.Serialize(writer); }
public override void Serialize(LittleEndianWriter writer) { writer.WriteByte(spellSlot); byte bitfield = 0; if (isSummonerSpell) { bitfield |= 0x01; } writer.WriteByte(bitfield); writer.WriteUInt((uint)changeSpellData.ChangeSlotSpellDataType); ChangeSpellDataExtension.WriteChangeSpellData(writer, changeSpellData); changeSpellData.Serialize(writer); }
public override void Serialize(LittleEndianWriter writer) { writer.WriteInt(0); foreach (var b in Encoding.UTF8.GetBytes(message)) { writer.WriteByte(b); } writer.Fill(0, 512 - message.Length); }
public override void Serialize(LittleEndianWriter writer) { writer.WriteByte((byte)announce); writer.WriteLong((long)0); if (mapId > 0) { writer.WriteInt(1); } }
public override void Serialize(LittleEndianWriter writer) { writer.WriteInt(unk1); writer.WriteLong(userId); writer.WriteFloat(loaded); writer.WriteFloat(ping); writer.WriteShort(unk2); writer.WriteShort(unk3); writer.WriteByte(unk4); }
public void WriteHeader(LittleEndianWriter writer) { int cmd = (int)Cmd; if (cmd > 0xFFFF) { cmd = cmd >> 16; } writer.WriteByte((byte)cmd); }
public void Serialize(LittleEndianWriter writer) { writer.WriteLong(userId); writer.WriteShort(0x1E); writer.WriteInt(summonerSkill1); writer.WriteInt(summonerSkill2); writer.WriteByte(isBot); writer.WriteInt(teamId); writer.Fill(0, 64); // name is no longer here writer.Fill(0, 64); foreach (var b in Encoding.UTF8.GetBytes(rank)) { writer.WriteByte(b); } writer.Fill(0, 24 - rank.Length); writer.WriteInt(summonerIcon); writer.WriteShort(ribbon); }
public override void Serialize(LittleEndianWriter writer) { writer.WriteInt((int)teamId); writer.WriteByte((byte)0xFE); writer.WriteByte((byte)0xFF); writer.WriteByte((byte)0xFF); writer.WriteByte((byte)0xFF); writer.WriteInt((int)0); writer.WriteUInt((uint)unitNetId); // Fog Attached, when unit dies it disappears writer.WriteUInt((uint)fogNetId); //Fog NetID writer.WriteInt((int)0); writer.WriteFloat(position.X); writer.WriteFloat(position.Y); writer.WriteFloat((float)2500); writer.WriteFloat((float)88.4f); writer.WriteFloat((float)130); writer.WriteFloat((float)1.0f); writer.WriteInt((int)0); writer.WriteByte((byte)199); writer.WriteFloat(visionRadius); // vision radius }
/// <summary> /// Writes this <see cref="MOBObject"/> into a <see cref="BinaryWriter"/> /// </summary> /// <param name="writer">The <see cref="BinaryWriter"/> to write to</param> public void Write(LittleEndianWriter writer) { writer.WriteBytes(Encoding.ASCII.GetBytes(this.Name.PadRight(60, '\u0000'))); writer.WriteUShort((ushort)0); writer.WriteUShort((ushort)this.Type); this.Position.Serialize(writer); this.Rotation.Serialize(writer); this.Scale.Serialize(writer); this.ReservedVector1.Serialize(writer); this.ReservedVector2.Serialize(writer); writer.WriteByte(0); }
public override void Serialize(LittleEndianWriter writer) { writer.WriteByte(unk); writer.WriteInt(mapId); foreach (var player in players) { player.Serialize(writer); } for (var i = 0; i < 12 - players.Length; ++i) { writer.WriteLong(-1); writer.Fill(0, 173); } foreach (var b in Encoding.UTF8.GetBytes(version)) { writer.WriteByte(b); } writer.Fill(0, 256 - version.Length); string gameModeString = gameMode.ToString(); foreach (var b in Encoding.UTF8.GetBytes(gameModeString)) { writer.WriteByte(b); } writer.Fill(0, 128 - gameModeString.Length); foreach (var b in Encoding.UTF8.GetBytes(region)) { writer.WriteByte((byte)b); } writer.Fill(0, 2333); // 128 - 3 + 661 + 1546 writer.WriteInt(gameFeatures); // gameFeatures (turret range indicators, etc.) writer.Fill(0, 256); writer.WriteInt((int)0); writer.Fill(1, 19); }