public override void Serialize(LittleEndianWriter writer) { writer.WriteInt(blueMax); // blueMax writer.WriteInt(purpleMax); // purpleMax foreach (var id in blueTeam) { writer.WriteLong(id); } for (var i = 0; i < blueMax - (blueTeam.Length); ++i) { writer.WriteLong(0); } writer.Fill(0, 144); foreach (var id in purpleTeam) { writer.WriteLong(id); } for (var i = 0; i < purpleMax - (purpleTeam.Length); ++i) { writer.WriteLong(0); } writer.Fill(0, 144); writer.WriteInt(blueTeam.Length); writer.WriteInt(purpleTeam.Length); }
public override void Serialize(LittleEndianWriter writer) { writer.WriteUInt(TargetNetId); writer.WriteInt((int)floatingTextType); writer.WriteInt(param); writer.WriteFixedStringLast(message, 128); }
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.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 Pack(LittleEndianWriter writer) { writer.WriteByte((byte)Cmd); writer.WriteUInt(netId); writer.WriteInt(syncId); Serialize(writer); }
public override void Serialize(LittleEndianWriter writer) { base.Serialize(writer); writer.WriteMovementDataType(MovementData.Type); writer.WriteInt(MovementSyncID); writer.WriteMovementData(MovementData); }
private static Task HandleHeartbeat(MaestroClient client) { LittleEndianWriter writer = new LittleEndianWriter(); writer.WriteInt((int)16); writer.WriteInt((int)1); writer.WriteInt((int)MessageTypeEnum.HEARTBEAT); writer.WriteInt((int)0); var heatBeatData = writer.Data; writer.Dispose(); logger.Write("Heartbeat sended."); client.Stream.Write(heatBeatData, 0, heatBeatData.Length); return(Task.CompletedTask); }
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.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.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.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(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.WriteInt(syncId); foreach (var waypoint in waypoints) { waypoint.Serialize(writer); } }
public override void Serialize(LittleEndianWriter writer) { writer.WriteByte((byte)announceEnum); if (sourceNetId != 0) { writer.WriteLong((long)sourceNetId); writer.WriteInt(assitsNetIds.Length); foreach (var a in assitsNetIds) { writer.WriteUInt((uint)a); } for (int i = 0; i < 12 - assitsNetIds.Length; i++) { writer.WriteInt((int)0); } } }
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) { 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(unk1); writer.WriteLong(userId); writer.WriteFloat(loaded); writer.WriteFloat(ping); writer.WriteShort(unk2); writer.WriteShort(unk3); writer.WriteByte(unk4); }
public override void Serialize(LittleEndianWriter writer) { writer.WriteUInt(netId); writer.WriteInt(playerId); writer.WriteByte(40); // net node id? writer.WriteByte(0); // botskilllevel if (team == TeamId.BLUE) { writer.WriteByte(1); } else { writer.WriteByte(0); } writer.WriteByte(0); // is bot writer.WriteByte(0); // spawn pos index writer.WriteInt(skinId); foreach (var b in Encoding.Default.GetBytes(name)) { writer.WriteByte((byte)b); } writer.Fill(0, 128 - name.Length); foreach (var b in Encoding.Default.GetBytes(championType)) { writer.WriteByte((byte)b); } writer.Fill(0, 40 - championType.Length); writer.WriteFloat(0.0f); writer.WriteFloat(0.0f); writer.WriteInt(0); writer.WriteByte(0); }
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.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 }
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.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); }
public override void Serialize(LittleEndianWriter writer) { writer.WriteInt(casterPositionSyncId); byte bitfield = 0; if (unknown1) { bitfield |= 1; } writer.WriteByte(bitfield); castInfo.Serialize(writer); }
public override void Serialize(LittleEndianWriter writer) { writer.WriteInt(0); writer.WriteLong(gameId); var data = Encoding.UTF8.GetBytes(name); foreach (var d in data) { writer.WriteByte((byte)d); } writer.Fill(0, 128 - data.Length); }
private void Serialize2(LittleEndianWriter writer) { writer.WriteByte((byte)1); // number of particles writer.WriteUInt("Ezreal".HashString()); writer.WriteUInt("ezreal_bow.troy".HashString()); writer.WriteInt(0x00000020); // flags ? writer.WriteShort((short)0); // Unk writer.WriteUInt("L_HAND".HashString()); writer.WriteByte((byte)1); // number of targets ? writer.WriteUInt(netId); writer.WriteUInt(39439); // Particle net id ? writer.WriteUInt(netId); writer.WriteUInt(netId); writer.WriteInt(0); // unk for (var i = 0; i < 3; ++i) { var ownerHeight = 0; var particleHeight = 0; var higherValue = Math.Max(ownerHeight, particleHeight); writer.WriteShort((short)1); writer.WriteInt(higherValue); writer.WriteShort((short)1); } writer.WriteUInt((uint)0); // unk writer.WriteUInt((uint)0); // unk writer.WriteUInt((uint)0); // unk writer.WriteUInt((uint)0); // unk writer.WriteFloat(1.0f); // Particle size }
/// <summary> /// Writes this <see cref="MOBFile"/> into a <see cref="Stream"/> /// </summary> /// <param name="stream">The <see cref="Stream"/> to write to</param> public void Write(Stream stream) { using (LittleEndianWriter bw = new LittleEndianWriter(stream)) { bw.WriteBytes(Encoding.ASCII.GetBytes("OPAM")); bw.WriteUInt((uint)2); bw.WriteInt(this.Objects.Count); bw.WriteUInt((uint)0); foreach (MOBObject mobObject in this.Objects) { mobObject.Write(bw); } } }
public override void Serialize(LittleEndianWriter writer) { int count = movements.Count; if (count > 0x7FFF) { throw new IOException("Too many movementdata!"); } writer.WriteInt(syncId); writer.WriteShort((short)count); foreach (var data in movements) { data.Write(writer); } }
public override void Serialize(LittleEndianWriter writer) { writer.WriteUInt(netId); writer.WriteByte((byte)netNodeId); position.Serialize(writer); groupPosition.Serialize(writer); faceDirectionPosition.Serialize(writer); writer.WriteString(name, 64); writer.WriteString(skinName, 64); writer.WriteString(uniqueName, 64); writer.WriteString(spawnAnimationName, 64); writer.WriteUInt((uint)teamId); writer.WriteInt(damageBonus); writer.WriteInt(healthBonus); writer.WriteUInt((uint)roamState); writer.WriteInt(groupNumber); writer.WriteInt(buffSide); writer.WriteInt(revealEvent); writer.WriteInt(initialLevel); writer.WriteFloat(spawnDuration); writer.WriteFloat(spawnTime); writer.WriteByte(BehaviorTree); writer.WriteFixedStringLast(AIScript, 32); }
} //42-46 public void Serialize(LittleEndianWriter writer2) { byte[] buffer; using (var stream = new MemoryStream()) { using (var writer = new LittleEndianWriter(stream)) { writer.WriteUInt(SpellHash); writer.WriteUInt(SpellNetID); writer.WriteByte(SpellLevel); writer.WriteFloat(AttackSpeedModifier); writer.WriteUInt(CasterNetID); writer.WriteUInt(SpellChainOwnerNetID); writer.WriteUInt(PackageHash); writer.WriteUInt(MissileNetID); TargetPosition.Serialize(writer); TargetPositionEnd.Serialize(writer); int targetCount = Targets.Count; if (targetCount > 32) { throw new IOException("CastInfo targets > 32!!!"); } writer.WriteByte((byte)targetCount); foreach (var target in Targets) { writer.WriteUInt(target.Item1); writer.WriteByte((byte)target.Item2); } writer.WriteFloat(DesignerCastTime); writer.WriteFloat(ExtraCastTime); writer.WriteFloat(DesignerTotalTime); writer.WriteFloat(Cooldown); writer.WriteFloat(StartCastTime); byte bitfield = 0; if (IsAutoAttack) { bitfield |= 1; } if (IsSecondAutoAttack) { bitfield |= 2; } if (IsForceCastingOrChannel) { bitfield |= 4; } if (IsOverrideCastPosition) { bitfield |= 8; } if (IsClickCasted) { bitfield |= 16; } writer.WriteByte(bitfield); writer.WriteByte(SpellSlot); writer.WriteFloat(ManaCost); SpellCastLaunchPosition.Serialize(writer); writer.WriteInt(AmmoUsed); writer.WriteFloat(AmmoRechargeTime); } buffer = new byte[stream.Length]; var data = stream.GetBuffer(); Buffer.BlockCopy(data, 0, buffer, 0, buffer.Length); } writer2.WriteUShort((ushort)(buffer.Length + 2)); writer2.WriteBytes(buffer); }