namespace Supercell.Laser.Logic.Battle.Input { using Supercell.Laser.Titan.DataStream; using Supercell.Laser.Logic.Data.Helper; using Supercell.Laser.Titan.Debug; public class ClientInput { public ClientInput() { ; } public int Index; public int Type; public int EmoteIndex; public int X, Y; public bool AutoAttack; public int AutoAttackTarget; // global id public long OwnerSessionId; public void Decode(BitStream stream) { Index = stream.ReadPositiveInt(15); Type = stream.ReadPositiveInt(4); X = stream.ReadInt(15); Y = stream.ReadInt(15); AutoAttack = stream.ReadBoolean(); stream.ReadBoolean(); // Debugger.Print( //$"[INPUT DECODE] Index={Index} Type={Type} X={X} Y={Y}"); if (Type == 9) { EmoteIndex = stream.ReadPositiveInt(3); } if (Type == 11) { stream.ReadPositiveVIntMax255(); } if (Type == 15) { EmoteIndex = stream.ReadPositiveIntMax511() - 6; stream.ReadPositiveIntMax511(); } if (AutoAttack) { if (stream.ReadBoolean()) { int instanceId = stream.ReadPositiveInt(14); AutoAttackTarget = GlobalId.CreateGlobalId(1, instanceId); } } } } }