public override void Decode() { if (Client.CState == 1) { using (var reader = new CoCSharpPacketReader(new MemoryStream(GetData()))) { UserID = reader.ReadInt64(); UserToken = reader.ReadString(); MajorVersion = reader.ReadInt32(); ContentVersion = reader.ReadInt32(); MinorVersion = reader.ReadInt32(); MasterHash = reader.ReadString(); Unknown1 = reader.ReadString(); OpenUDID = reader.ReadString(); MacAddress = reader.ReadString(); DeviceModel = reader.ReadString(); LocaleKey = reader.ReadInt32(); Language = reader.ReadString(); AdvertisingGUID = reader.ReadString(); OSVersion = reader.ReadString(); Unknown2 = reader.ReadByte(); Unknown3 = reader.ReadString(); AndroidDeviceID = reader.ReadString(); FacebookDistributionID = reader.ReadString(); IsAdvertisingTrackingEnabled = reader.ReadBoolean(); VendorGUID = reader.ReadString(); Seed = reader.ReadInt32(); Unknown4 = reader.ReadByte(); Unknown5 = reader.ReadString(); Unknown6 = reader.ReadString(); ClientVersion = reader.ReadString(); } } }
public CastSpellCommand(CoCSharpPacketReader br) { X = br.ReadInt32WithEndian(); Y = br.ReadInt32WithEndian(); Spell = (SpellData)br.ReadDataReference(); Unknown1 = br.ReadUInt32WithEndian(); }
public KickAllianceMemberCommand(CoCSharpPacketReader br) { m_vAvatarId = br.ReadInt64WithEndian(); br.ReadByte(); m_vMessage = br.ReadScString(); br.ReadInt32WithEndian(); }
public PlaceAttackerCommand(CoCSharpPacketReader br) { X = br.ReadInt32WithEndian(); Y = br.ReadInt32WithEndian(); Unit = (CharacterData)br.ReadDataReference(); Unknown1 = br.ReadUInt32WithEndian(); }
public SpeedUpHeroHealthCommand(CoCSharpPacketReader br) { /* * m_vBuildingId = br.ReadInt32WithEndian(); * br.ReadInt32WithEndian(); */ }
public BuyTrapCommand(CoCSharpPacketReader br) { X = br.ReadInt32WithEndian(); Y = br.ReadInt32WithEndian(); TrapId = br.ReadInt32WithEndian(); Unknown1 = br.ReadUInt32WithEndian(); }
public CancelUpgradeUnitCommand(CoCSharpPacketReader br) { /* * BuildingId = br.ReadUInt32WithEndian(); //buildingId - 0x1DCD6500; * Unknown1 = br.ReadUInt32WithEndian(); */ }
public bool TryGetPacket(out Message p) { p = null; bool result = false; if (DataStream.Count >= 5) { int length = (0x00 << 24) | (DataStream[2] << 16) | (DataStream[3] << 8) | DataStream[4]; ushort type = (ushort)((DataStream[0] << 8) | DataStream[1]); if (DataStream.Count - 7 >= length) { object obj; byte[] packet = DataStream.Take(7 + length).ToArray(); using (CoCSharpPacketReader br = new CoCSharpPacketReader(new MemoryStream(packet))) obj = MessageFactory.Read(this, br, type); if (obj != null) { p = (Message)obj; result = true; } DataStream.RemoveRange(0, 7 + length); } } return(result); }
public MoveBuildingCommand(CoCSharpPacketReader br) { X = br.ReadInt32WithEndian(); Y = br.ReadInt32WithEndian(); BuildingId = br.ReadInt32WithEndian(); //buildingId - 0x1DCD6500; Unknown1 = br.ReadUInt32WithEndian(); }
public override void Process(Level level) { try { level.Tick(); if (NumberOfCommands > 0 && NumberOfCommands < 20) { using (var br = new CoCSharpPacketReader(new MemoryStream(NestedCommands))) for (var i = 0; i < NumberOfCommands; i++) { var obj = CommandFactory.Read(br); if (obj != null) { ((Command)obj).Execute(level); } else { break; } } } } catch (Exception ex) { } }
public BuyBuildingCommand(CoCSharpPacketReader br) { X = br.ReadInt32WithEndian(); Y = br.ReadInt32WithEndian(); BuildingId = br.ReadInt32WithEndian(); Unknown1 = br.ReadUInt32WithEndian(); }
public UpgradeUnitCommand(CoCSharpPacketReader br) { BuildingId = br.ReadInt32WithEndian(); Unknown1 = br.ReadUInt32WithEndian(); UnitData = (CombatItemData)br.ReadDataReference(); Unknown2 = br.ReadUInt32WithEndian(); }
public SetActiveVillageLayoutCommand(CoCSharpPacketReader br) { br.ReadInt32(); br.ReadInt32(); br.ReadInt32(); // Not done }
public virtual void Decode(byte[] baseData) { using (var br = new CoCSharpPacketReader(new MemoryStream(baseData))) { m_vUnknown1 = br.ReadInt32WithEndian(); } }
public override void Decode() { using (var br = new CoCSharpPacketReader(new MemoryStream(GetData()))) { m_vId = br.ReadInt64WithEndian(); m_vRole = br.ReadInt32WithEndian(); } }
public SaveVillageLayoutCommand(CoCSharpPacketReader br) { br.Read(); br.ReadInt32(); br.ReadInt32(); br.ReadInt32(); // Note done yet }
public DonateAllianceUnitCommand(CoCSharpPacketReader br) { Unknown1 = br.ReadUInt32WithEndian(); PlayerId = br.ReadUInt32WithEndian(); UnitType = br.ReadUInt32WithEndian(); Unknown2 = br.ReadUInt32WithEndian(); Unknown3 = br.ReadUInt32WithEndian(); }
public static object Read(Client c, CoCSharpPacketReader br, int packetType) { if (m_vMessages.ContainsKey(packetType)) { return(Activator.CreateInstance(m_vMessages[packetType], c, br)); } return(null); }
public TrainUnitCommand(CoCSharpPacketReader br) { BuildingId = br.ReadInt32WithEndian(); Unknown1 = br.ReadUInt32WithEndian(); UnitType = br.ReadInt32WithEndian(); Count = br.ReadInt32WithEndian(); Unknown3 = br.ReadUInt32WithEndian(); br.ReadInt32WithEndian(); }
public EditVillageLayoutCommand(CoCSharpPacketReader br) { br.ReadInt32(); br.ReadInt32(); br.ReadInt32(); br.ReadInt32(); br.ReadInt32(); // Not 100% Done }
public BoostBuildingCommand(CoCSharpPacketReader br) { BuildingIds = new List <int>(); BoostedBuildingsCount = br.ReadInt32WithEndian(); for (var i = 0; i < BoostedBuildingsCount; i++) { BuildingIds.Add(br.ReadInt32WithEndian()); } }
public ToggleAttackModeCommand(CoCSharpPacketReader br) { /* * BuildingId = br.ReadUInt32WithEndian(); //buildingId - 0x1DCD6500; * Unknown1 = br.ReadByte(); * Unknown2 = br.ReadUInt32WithEndian(); * Unknown3 = br.ReadUInt32WithEndian(); */ }
public CancelUnitProductionCommand(CoCSharpPacketReader br) { BuildingId = br.ReadInt32WithEndian(); //buildingId - 0x1DCD6500; Unknown1 = br.ReadUInt32WithEndian(); UnitType = br.ReadInt32WithEndian(); Count = br.ReadInt32WithEndian(); Unknown3 = br.ReadUInt32WithEndian(); Unknown4 = br.ReadUInt32WithEndian(); }
public JoinAllianceCommand(CoCSharpPacketReader br) { br.ReadInt64(); br.ReadString(); br.ReadInt32(); br.ReadByte(); br.ReadInt32(); br.ReadInt32(); br.ReadInt32(); }
public static object Read(CoCSharpPacketReader br) { var cm = br.ReadUInt32WithEndian(); if (m_vCommands.ContainsKey(cm)) { //Console.WriteLine("[UCS] Processing " + m_vCommands[cm]); return(Activator.CreateInstance(m_vCommands[cm], br)); } //Console.WriteLine("\t The command '" + cm + "' has been ignored"); return(null); }
public static object Read(CoCSharpPacketReader br) { var cm = br.ReadUInt32WithEndian(); if (m_vCommands.ContainsKey(cm)) { _Logger.Print("[UCS] Processing " + m_vCommands[cm], Types.INFO); return(Activator.CreateInstance(m_vCommands[cm], br)); } _Logger.Print("\t The command '" + cm + "' has been ignored", Types.INFO); return(null); }
public RequestAllianceUnitsCommand(CoCSharpPacketReader br) { Unknown1 = br.ReadUInt32WithEndian(); FlagHasRequestMessage = br.ReadByte(); if (FlagHasRequestMessage == 0x01) { Message = br.ReadScString(); } else { Message = "I need reinforcements !"; } }
public UpgradeMultipleBuildingsCommand(CoCSharpPacketReader br) { m_vIsAltResource = br.ReadByte(); m_vBuildingIdList = new List <int>(); var buildingCount = br.ReadInt32WithEndian(); for (var i = 0; i < buildingCount; i++) { var buildingId = br.ReadInt32WithEndian(); m_vBuildingIdList.Add(buildingId); } br.ReadInt32WithEndian(); }
public override void Decode() { using (var br = new CoCSharpPacketReader(new MemoryStream(GetData()))) { Subtick = br.ReadUInt32WithEndian(); Checksum = br.ReadUInt32WithEndian(); NumberOfCommands = br.ReadUInt32WithEndian(); if (NumberOfCommands > 0 && NumberOfCommands < 20) { NestedCommands = br.ReadBytes(GetLength()); } } }
public override void Decode() { using (CoCSharpPacketReader br = new CoCSharpPacketReader(new MemoryStream(GetData()))) { m_vAllianceName = br.ReadString(); m_vAllianceDescription = br.ReadString(); m_vAllianceBadgeData = br.ReadInt32WithEndian(); m_vAllianceType = br.ReadInt32WithEndian(); m_vRequiredScore = br.ReadInt32WithEndian(); m_vWarFrequency = br.ReadInt32WithEndian(); m_vAllianceOrigin = br.ReadInt32WithEndian(); m_vWarLogPublic = br.ReadByte(); } }