From 081bccb3444fb44621c67762219bf45be4287f71 Mon Sep 17 00:00:00 2001 From: outoftheline Date: Mon, 17 May 2021 17:10:55 +0200 Subject: [PATCH 1/9] GvG Log (Alpha) --- js/web/_i18n/de.json | 15 + js/web/_i18n/en.json | 15 + js/web/gvg/css/gvg.css | 12 +- js/web/gvg/js/gvg.js | 3326 ++-------------------------------------- 4 files changed, 162 insertions(+), 3206 deletions(-) diff --git a/js/web/_i18n/de.json b/js/web/_i18n/de.json index 251b1e783..d3f1e2aaf 100644 --- a/js/web/_i18n/de.json +++ b/js/web/_i18n/de.json @@ -292,6 +292,21 @@ "Boxes.GvGMap.Guild.Name": "Gilde", "Boxes.GvGMap.Guild.Power": "Macht", "Boxes.GvGMap.Guild.Sectors": "Sektoren", + "Boxes.GvGMap.Log": "Protokoll", + "Boxes.GvGMap.Log.defender_damaged": "VA angeschlagen", + "Boxes.GvGMap.Log.defender_defeated": "VA vernichtet", + "Boxes.GvGMap.Log.defender_deployed": "VA gestellt", + "Boxes.GvGMap.Log.defender_replaced": "VA ersetzt", + "Boxes.GvGMap.Log.headquarter_placed": "HQ platziert", + "Boxes.GvGMap.Log.NPC": "NPC", + "Boxes.GvGMap.Log.sector_conquered": "Sektor erobert", + "Boxes.GvGMap.Log.sector_independence_granted": "Freiheit gewährt", + "Boxes.GvGMap.Log.sector_slot_unlocked": "Slot freigeschaltet", + "Boxes.GvGMap.Log.siege_damaged": "BA angeschlagen", + "Boxes.GvGMap.Log.siege_defeated": "BA vernichtet", + "Boxes.GvGMap.Log.siege_deleted": "BA gelöscht", + "Boxes.GvGMap.Log.siege_deployed": "BA gestellt", + "Boxes.GvGMap.Log.UnknownGuild": "Unbekannte Gilde", "Boxes.GvGMap.Sector.Beach": "Strand", "Boxes.GvGMap.Sector.Coords": "Koordinaten", "Boxes.GvGMap.Sector.Hitpoints": "Lebenspunkte", diff --git a/js/web/_i18n/en.json b/js/web/_i18n/en.json index 43bd1216f..e7aa60563 100644 --- a/js/web/_i18n/en.json +++ b/js/web/_i18n/en.json @@ -285,6 +285,21 @@ "Boxes.GvGMap.Guild.Name": "Guild", "Boxes.GvGMap.Guild.Power": "Power", "Boxes.GvGMap.Guild.Sectors": "Sectors", + "Boxes.GvGMap.Log": "Log", + "Boxes.GvGMap.Log.defender_damaged": "Defender damaged", + "Boxes.GvGMap.Log.defender_defeated": "Defender defeated", + "Boxes.GvGMap.Log.defender_deployed": "Defender deployed", + "Boxes.GvGMap.Log.defender_replaced": "Defender replaced", + "Boxes.GvGMap.Log.headquarter_placed": "HQ placed", + "Boxes.GvGMap.Log.NPC": "NPC", + "Boxes.GvGMap.Log.sector_conquered": "Sector conquered", + "Boxes.GvGMap.Log.sector_independence_granted": "Independence granted", + "Boxes.GvGMap.Log.sector_slot_unlocked": "Slot unlocked", + "Boxes.GvGMap.Log.siege_damaged": "Siege damaged", + "Boxes.GvGMap.Log.siege_defeated": "Siege defeated", + "Boxes.GvGMap.Log.siege_deleted": "Siege deleted", + "Boxes.GvGMap.Log.siege_deployed": "Siege deployed", + "Boxes.GvGMap.Log.UnknownGuild": "Unknown Guild", "Boxes.GvGMap.Sector.Beach": "Beach", "Boxes.GvGMap.Sector.Coords": "Coords", "Boxes.GvGMap.Sector.Hitpoints": "Hitpoints", diff --git a/js/web/gvg/css/gvg.css b/js/web/gvg/css/gvg.css index dd617e5d4..28d95c4d0 100644 --- a/js/web/gvg/css/gvg.css +++ b/js/web/gvg/css/gvg.css @@ -82,6 +82,7 @@ background-color: #111213; border-right: 2px solid var(--text-dark); overflow: hidden; + position: relative; } #gvgOptions { @@ -99,7 +100,16 @@ #GvGMapActions { position: absolute; top: 10px; - right: 332px; + right: 360px; + z-index: 100; +} + +#GvGlog { + font-size: 90%; +} + +#GvGlog table.foe-table tbody tr:nth-child(odd) { + background-color: inherit; } .sectorInfo { diff --git a/js/web/gvg/js/gvg.js b/js/web/gvg/js/gvg.js index c6947c1a4..9795eefc1 100644 --- a/js/web/gvg/js/gvg.js +++ b/js/web/gvg/js/gvg.js @@ -35,20 +35,22 @@ FoEproxy.addHandler('ClanBattleService', 'getProvinceDetailed', (data, postData) GvGMap.Map.OnloadDataTime = MainParser.getCurrentDateTime(); }); -/*FoEproxy.addWsHandler('ClanBattleService', 'changeProvince', (data, postData) => { - GvGLog.addEntry(data.responseData); -});*/ - FoEproxy.addHandler('AnnouncementsService', 'fetchAllAnnouncements', (data, postData) => { GvG.HideGvgHud(); }); +FoEproxy.addWsHandler('ClanBattleService', 'changeProvince', (data, postData) => { + let entry = GvGLog.addEntry(data.responseData); + if ($('#gvgmaplog').length > 0 && entry != undefined) { + GvGLog.showEntry(entry); + } +}); + let GvG = { Actions: undefined, Init: false, initActions: () => { - console.log("GvG Init"); let Actions = JSON.parse(localStorage.getItem('GvGActions')); if (Actions == null) { @@ -205,7 +207,10 @@ let GvGMap = { HexHeight: 40, Era: "", }, - OwnGuildId: 0, + OwnGuild: { + Id: 0, + Members: [], + }, Actions: { edit: false, @@ -339,9 +344,9 @@ let GvGMap = { } GvGMap.Map.Width = (GvGMap.Map.ProvinceData.bounds.x_max - GvGMap.Map.ProvinceData.bounds.x_min)*GvGMap.Map.HexWidth+GvGMap.Map.HexWidth/2; GvGMap.Map.Height = (GvGMap.Map.ProvinceData.bounds.y_max - GvGMap.Map.ProvinceData.bounds.y_min)*GvGMap.Map.HexHeight*0.8; - console.log(GvGMap.Map.OnloadData); GvGMap.CurrentGuild = {}; - GvGMap.OwnGuildId = GvGMap.Map.OnloadData.clan_data.clan.id; + GvGMap.OwnGuild.Id = GvGMap.Map.OnloadData.clan_data.clan.id; + GvGMap.OwnGuild.Members = GvGMap.Map.OnloadData.clan_data.clan.members; }, /** @@ -354,7 +359,7 @@ let GvGMap = { HTML.Box({ id: 'GvGMap', - title: i18n('Boxes.GvGMap.Title'), + title: i18n('Boxes.GvGMap.Title')+ 'BETA!', auto_close: true, dragdrop: true, minimize: true, @@ -373,9 +378,15 @@ let GvGMap = { GvGMap.SetTabs('gvgmaplog'); let h = [], t = []; - h.push('
'+i18n('Boxes.GvGMap.Action.Edit')+''+i18n('Boxes.GvGMap.Action.Zoom')+''+i18n('Boxes.GvGMap.Action.Drag')+'
'); - h.push('
'); - //h.push('
'); + h.push('
'); + h.push('
'); + h.push(''+i18n('Boxes.GvGMap.Action.Edit')+''); + h.push(''+i18n('Boxes.GvGMap.Action.Zoom')+''); + h.push(''+i18n('Boxes.GvGMap.Action.Drag')+''); + h.push('
'); + h.push('
'); + h.push('
'); + h.push('
'); $('#GvGMapBody').html(h.join('')); @@ -384,7 +395,7 @@ let GvGMap = { GvGMap.showGuilds(); //GvGLog.testData(); - //GvGLog.show(); + GvGLog.show(); let editBtn = document.getElementById("editMap"); let dragBtn = document.getElementById("dragMap"); @@ -409,8 +420,8 @@ let GvGMap = { GvGMap.buildMap(); }, false); + GvGMap.setCurrentGuild(); // todo: is broken GvGMap.mapDragOrEdit(); - GvGMap.setCurrentGuild(); t.push('
'); t.push( GvGMap.GetTabs() ); @@ -421,7 +432,22 @@ let GvGMap = { $('#GvGMap').find('#gvgmaplog').promise().done(function() { $('.gvg-tabs').tabslet({active: 1}); $('.gvg-tabs .gvgmapguilds span').text(i18n('Boxes.GvGMap.Guild.Name')); - $('.gvg-tabs .gvgmaplog span').text('Log (soonish)'); + $('.gvg-tabs .gvgmaplog span').text(i18n('Boxes.GvGMap.Log')); + + let textFilter = document.getElementById("logFilter"); + textFilter.addEventListener('keyup', function (e) { + let search = textFilter.value.toLowerCase(); + let logEntries = document.getElementsByClassName("logEntry"); + for (i = 0; i < logEntries.length; i++) { + let text = logEntries[i].textContent.toLowerCase(); + if (!text.includes(search)) { + logEntries[i].style.display = "none"; + } + else { + logEntries[i].style.display = "table-row"; + } + } + }, false); }); }, @@ -450,7 +476,7 @@ let GvGMap = { sectors: 0, }; GvGMap.Map.Guilds.push(guildOnMap); - if ((guild.id) == GvGMap.OwnGuildId) { + if ((guild.id) == GvGMap.OwnGuild.Id) { GvGMap.CurrentGuild = guildOnMap; } }); @@ -683,3194 +709,102 @@ let GvGMap = { colorToString: (color) => { return "rgb("+color.r+","+color.g+","+color.b+")"; }, + + showGuildFlagAndName: (id) => { + guild = GvGMap.findGuildById(id); + if (id < 0) { + return i18n('Boxes.GvGMap.Log.NPC'); + } + else if (guild != undefined) { + return ' '+ guild.name; + } + return i18n('Boxes.GvGMap.Log.UnknownGuild'); + } } let GvGLog = { Entries: [], - DummyData: [ - { - "army_id": 2078642, - "hitpoints": 30, - "hitpoint_change": 10, - "type": "ClanBattle/defender_deployed", - "timestamp": 1621187759, - "player_id": 585359, - "sector_id": 4060, - "source_clan_id": 467, - "target_clan_id": 467, - "__class__": "ClanBattleArmyChange" - }, - { - "army_id": 2078646, - "hitpoints": 40, - "hitpoint_change": 10, - "type": "ClanBattle/defender_deployed", - "timestamp": 1621187764, - "player_id": 585359, - "sector_id": 4060, - "source_clan_id": 467, - "target_clan_id": 467, - "__class__": "ClanBattleArmyChange" - }, - { - "army_id": 2078649, - "hitpoints": 50, - "hitpoint_change": 10, - "type": "ClanBattle/defender_deployed", - "timestamp": 1621187768, - "player_id": 585359, - "sector_id": 4060, - "source_clan_id": 467, - "target_clan_id": 467, - "__class__": "ClanBattleArmyChange" - }, - { - "army_id": 2078651, - "hitpoints": 60, - "hitpoint_change": 10, - "type": "ClanBattle/defender_deployed", - "timestamp": 1621187771, - "player_id": 585359, - "sector_id": 4060, - "source_clan_id": 467, - "target_clan_id": 467, - "__class__": "ClanBattleArmyChange" - }, - { - "army_id": 2077944, - "hitpoints": 1, - "hitpoint_change": -10, - "type": "ClanBattle/siege_deleted", - "timestamp": 1621187772, - "player_id": 7458293, - "sector_id": 4121, - "source_clan_id": 30785, - "target_clan_id": 11484, - "__class__": "ClanBattleArmyChange" - }, - { - "army_id": 2078653, - "hitpoints": 70, - "hitpoint_change": 10, - "type": "ClanBattle/defender_deployed", - "timestamp": 1621187779, - "player_id": 585359, - "sector_id": 4060, - "source_clan_id": 467, - "target_clan_id": 467, - "__class__": "ClanBattleArmyChange" - }, - { - "army_id": 2078657, - "hitpoints": 80, - "hitpoint_change": 10, - "type": "ClanBattle/defender_deployed", - "timestamp": 1621187783, - "player_id": 585359, - "sector_id": 4060, - "source_clan_id": 467, - "target_clan_id": 467, - "__class__": "ClanBattleArmyChange" - }, - { - "army_id": 2078662, - "hitpoints": 20, - "hitpoint_change": 10, - "type": "ClanBattle/defender_deployed", - "timestamp": 1621187792, - "player_id": 7458293, - "sector_id": 4142, - "source_clan_id": 30785, - "target_clan_id": 30785, - "__class__": "ClanBattleArmyChange" - }, - { - "army_id": 2078665, - "hitpoints": 30, - "hitpoint_change": 10, - "type": "ClanBattle/defender_deployed", - "timestamp": 1621187797, - "player_id": 7458293, - "sector_id": 4142, - "source_clan_id": 30785, - "target_clan_id": 30785, - "__class__": "ClanBattleArmyChange" - }, - { - "type": "ClanBattle/sector_slot_unlocked", - "timestamp": 1621187800, - "player_id": 585359, - "sector_id": 4072, - "source_clan_id": 467, - "target_clan_id": 467, - "__class__": "ClanBattleSectorChange" - }, - { - "type": "ClanBattle/sector_slot_unlocked", - "timestamp": 1621187801, - "player_id": 585359, - "sector_id": 4072, - "source_clan_id": 467, - "target_clan_id": 467, - "__class__": "ClanBattleSectorChange" - }, - { - "type": "ClanBattle/sector_slot_unlocked", - "timestamp": 1621187802, - "player_id": 585359, - "sector_id": 4072, - "source_clan_id": 467, - "target_clan_id": 467, - "__class__": "ClanBattleSectorChange" - }, - { - "type": "ClanBattle/sector_slot_unlocked", - "timestamp": 1621187804, - "player_id": 585359, - "sector_id": 4072, - "source_clan_id": 467, - "target_clan_id": 467, - "__class__": "ClanBattleSectorChange" - }, - { - "type": "ClanBattle/sector_slot_unlocked", - "timestamp": 1621187805, - "player_id": 585359, - "sector_id": 4072, - "source_clan_id": 467, - "target_clan_id": 467, - "__class__": "ClanBattleSectorChange" - }, - { - "type": "ClanBattle/sector_slot_unlocked", - "timestamp": 1621187807, - "player_id": 585359, - "sector_id": 4072, - "source_clan_id": 467, - "target_clan_id": 467, - "__class__": "ClanBattleSectorChange" - }, - { - "army_id": 2078669, - "hitpoints": 30, - "hitpoint_change": 10, - "type": "ClanBattle/defender_deployed", - "timestamp": 1621187808, - "player_id": 585359, - "sector_id": 4072, - "source_clan_id": 467, - "target_clan_id": 467, - "__class__": "ClanBattleArmyChange" - }, - { - "type": "ClanBattle/sector_slot_unlocked", - "timestamp": 1621187811, - "player_id": 587212, - "sector_id": 3991, - "source_clan_id": 1654, - "target_clan_id": 1654, - "__class__": "ClanBattleSectorChange" - }, - { - "army_id": 2078673, - "hitpoints": 40, - "hitpoint_change": 10, - "type": "ClanBattle/defender_deployed", - "timestamp": 1621187812, - "player_id": 587212, - "sector_id": 3991, - "source_clan_id": 1654, - "target_clan_id": 1654, - "__class__": "ClanBattleArmyChange" - }, - { - "army_id": 2078678, - "hitpoints": 40, - "hitpoint_change": 10, - "type": "ClanBattle/defender_deployed", - "timestamp": 1621187820, - "player_id": 585359, - "sector_id": 4072, - "source_clan_id": 467, - "target_clan_id": 467, - "__class__": "ClanBattleArmyChange" - }, - { - "army_id": 2078680, - "hitpoints": 20, - "hitpoint_change": 10, - "type": "ClanBattle/defender_deployed", - "timestamp": 1621187821, - "player_id": 587212, - "sector_id": 4011, - "source_clan_id": 1654, - "target_clan_id": 1654, - "__class__": "ClanBattleArmyChange" - }, - { - "army_id": 2078682, - "hitpoints": 50, - "hitpoint_change": 10, - "type": "ClanBattle/defender_deployed", - "timestamp": 1621187824, - "player_id": 585359, - "sector_id": 4072, - "source_clan_id": 467, - "target_clan_id": 467, - "__class__": "ClanBattleArmyChange" - }, - { - "army_id": 2078684, - "hitpoints": 60, - "hitpoint_change": 10, - "type": "ClanBattle/defender_deployed", - "timestamp": 1621187828, - "player_id": 585359, - "sector_id": 4072, - "source_clan_id": 467, - "target_clan_id": 467, - "__class__": "ClanBattleArmyChange" - }, - { - "type": "ClanBattle/sector_slot_unlocked", - "timestamp": 1621187829, - "player_id": 587212, - "sector_id": 4011, - "source_clan_id": 1654, - "target_clan_id": 1654, - "__class__": "ClanBattleSectorChange" - }, - { - "army_id": 2078685, - "hitpoints": 30, - "hitpoint_change": 10, - "type": "ClanBattle/defender_deployed", - "timestamp": 1621187830, - "player_id": 587212, - "sector_id": 4011, - "source_clan_id": 1654, - "target_clan_id": 1654, - "__class__": "ClanBattleArmyChange" - }, - { - "army_id": 2078686, - "hitpoints": 70, - "hitpoint_change": 10, - "type": "ClanBattle/defender_deployed", - "timestamp": 1621187832, - "player_id": 585359, - "sector_id": 4072, - "source_clan_id": 467, - "target_clan_id": 467, - "__class__": "ClanBattleArmyChange" - }, - { - "type": "ClanBattle/sector_slot_unlocked", - "timestamp": 1621187835, - "player_id": 717487, - "sector_id": 4090, - "source_clan_id": 467, - "target_clan_id": 467, - "__class__": "ClanBattleSectorChange" - }, - { - "army_id": 2078688, - "hitpoints": 80, - "hitpoint_change": 10, - "type": "ClanBattle/defender_deployed", - "timestamp": 1621187836, - "player_id": 585359, - "sector_id": 4072, - "source_clan_id": 467, - "target_clan_id": 467, - "__class__": "ClanBattleArmyChange" - }, - { - "army_id": 2078689, - "hitpoints": 30, - "hitpoint_change": 10, - "type": "ClanBattle/defender_deployed", - "timestamp": 1621187836, - "player_id": 717487, - "sector_id": 4090, - "source_clan_id": 467, - "target_clan_id": 467, - "__class__": "ClanBattleArmyChange" - }, - { - "type": "ClanBattle/sector_slot_unlocked", - "timestamp": 1621187842, - "player_id": 717487, - "sector_id": 4090, - "source_clan_id": 467, - "target_clan_id": 467, - "__class__": "ClanBattleSectorChange" - }, - { - "army_id": 2078691, - "hitpoints": 40, - "hitpoint_change": 10, - "type": "ClanBattle/defender_deployed", - "timestamp": 1621187844, - "player_id": 717487, - "sector_id": 4090, - "source_clan_id": 467, - "target_clan_id": 467, - "__class__": "ClanBattleArmyChange" - }, - { - "type": "ClanBattle/sector_slot_unlocked", - "timestamp": 1621187846, - "player_id": 587212, - "sector_id": 3994, - "source_clan_id": 1654, - "target_clan_id": 1654, - "__class__": "ClanBattleSectorChange" - }, - { - "army_id": 2078693, - "hitpoints": 50, - "hitpoint_change": 10, - "type": "ClanBattle/defender_deployed", - "timestamp": 1621187847, - "player_id": 587212, - "sector_id": 3994, - "source_clan_id": 1654, - "target_clan_id": 1654, - "__class__": "ClanBattleArmyChange" - }, - { - "army_id": 2078694, - "hitpoints": 20, - "hitpoint_change": 10, - "type": "ClanBattle/defender_deployed", - "timestamp": 1621187848, - "player_id": 8770396, - "sector_id": 3961, - "source_clan_id": 20227, - "target_clan_id": 20227, - "__class__": "ClanBattleArmyChange" - }, - { - "type": "ClanBattle/sector_slot_unlocked", - "timestamp": 1621187852, - "player_id": 587212, - "sector_id": 3994, - "source_clan_id": 1654, - "target_clan_id": 1654, - "__class__": "ClanBattleSectorChange" - }, - { - "type": "ClanBattle/sector_slot_unlocked", - "timestamp": 1621187853, - "player_id": 10071404, - "sector_id": 3961, - "source_clan_id": 20227, - "target_clan_id": 20227, - "__class__": "ClanBattleSectorChange" - }, - { - "army_id": 2078698, - "hitpoints": 60, - "hitpoint_change": 10, - "type": "ClanBattle/defender_deployed", - "timestamp": 1621187853, - "player_id": 587212, - "sector_id": 3994, - "source_clan_id": 1654, - "target_clan_id": 1654, - "__class__": "ClanBattleArmyChange" - }, - { - "army_id": 2078699, - "hitpoints": 30, - "hitpoint_change": 10, - "type": "ClanBattle/defender_deployed", - "timestamp": 1621187855, - "player_id": 10071404, - "sector_id": 3961, - "source_clan_id": 20227, - "target_clan_id": 20227, - "__class__": "ClanBattleArmyChange" - }, - { - "type": "ClanBattle/sector_slot_unlocked", - "timestamp": 1621187855, - "player_id": 717487, - "sector_id": 4090, - "source_clan_id": 467, - "target_clan_id": 467, - "__class__": "ClanBattleSectorChange" - }, - { - "army_id": 2078700, - "hitpoints": 50, - "hitpoint_change": 10, - "type": "ClanBattle/defender_deployed", - "timestamp": 1621187856, - "player_id": 717487, - "sector_id": 4090, - "source_clan_id": 467, - "target_clan_id": 467, - "__class__": "ClanBattleArmyChange" - }, - { - "army_id": 2078703, - "hitpoints": 20, - "hitpoint_change": 10, - "type": "ClanBattle/defender_deployed", - "timestamp": 1621187865, - "player_id": 10083035, - "sector_id": 3958, - "source_clan_id": 20227, - "target_clan_id": 20227, - "__class__": "ClanBattleArmyChange" - }, - { - "type": "ClanBattle/sector_slot_unlocked", - "timestamp": 1621187865, - "player_id": 717487, - "sector_id": 4090, - "source_clan_id": 467, - "target_clan_id": 467, - "__class__": "ClanBattleSectorChange" - }, - { - "army_id": 2078704, - "hitpoints": 20, - "hitpoint_change": 10, - "type": "ClanBattle/defender_deployed", - "timestamp": 1621187865, - "player_id": 587212, - "sector_id": 3952, - "source_clan_id": 1654, - "target_clan_id": 1654, - "__class__": "ClanBattleArmyChange" - }, - { - "army_id": 2078705, - "hitpoints": 60, - "hitpoint_change": 10, - "type": "ClanBattle/defender_deployed", - "timestamp": 1621187865, - "player_id": 717487, - "sector_id": 4090, - "source_clan_id": 467, - "target_clan_id": 467, - "__class__": "ClanBattleArmyChange" - }, - { - "army_id": 2078706, - "hitpoints": 20, - "hitpoint_change": 10, - "type": "ClanBattle/defender_deployed", - "timestamp": 1621187866, - "player_id": 8770396, - "sector_id": 3960, - "source_clan_id": 20227, - "target_clan_id": 20227, - "__class__": "ClanBattleArmyChange" - }, - { - "type": "ClanBattle/sector_slot_unlocked", - "timestamp": 1621187871, - "player_id": 717487, - "sector_id": 4090, - "source_clan_id": 467, - "target_clan_id": 467, - "__class__": "ClanBattleSectorChange" - }, - { - "type": "ClanBattle/sector_slot_unlocked", - "timestamp": 1621187872, - "player_id": 717487, - "sector_id": 4090, - "source_clan_id": 467, - "target_clan_id": 467, - "__class__": "ClanBattleSectorChange" - }, - { - "type": "ClanBattle/sector_slot_unlocked", - "timestamp": 1621187872, - "player_id": 587212, - "sector_id": 3952, - "source_clan_id": 1654, - "target_clan_id": 1654, - "__class__": "ClanBattleSectorChange" - }, - { - "army_id": 2078707, - "hitpoints": 30, - "hitpoint_change": 10, - "type": "ClanBattle/defender_deployed", - "timestamp": 1621187873, - "player_id": 587212, - "sector_id": 3952, - "source_clan_id": 1654, - "target_clan_id": 1654, - "__class__": "ClanBattleArmyChange" - }, - { - "army_id": 2078709, - "hitpoints": 70, - "hitpoint_change": 10, - "type": "ClanBattle/defender_deployed", - "timestamp": 1621187877, - "player_id": 717487, - "sector_id": 4090, - "source_clan_id": 467, - "target_clan_id": 467, - "__class__": "ClanBattleArmyChange" - }, - { - "type": "ClanBattle/sector_independence_granted", - "timestamp": 1621187884, - "player_id": 587212, - "sector_id": 3938, - "source_clan_id": 1654, - "target_clan_id": -27, - "__class__": "ClanBattleSectorChange" - }, - { - "army_id": 2078712, - "hitpoints": 80, - "hitpoint_change": 10, - "type": "ClanBattle/defender_deployed", - "timestamp": 1621187887, - "player_id": 717487, - "sector_id": 4090, - "source_clan_id": 467, - "target_clan_id": 467, - "__class__": "ClanBattleArmyChange" - }, - { - "army_id": 2078714, - "hitpoints": 10, - "hitpoint_change": 10, - "type": "ClanBattle/siege_deployed", - "timestamp": 1621187889, - "player_id": 4529031, - "sector_id": 3938, - "source_clan_id": 20227, - "target_clan_id": -27, - "__class__": "ClanBattleArmyChange" - }, - { - "army_id": 2078714, - "hitpoints": 9, - "hitpoint_change": -1, - "type": "ClanBattle/siege_damaged", - "timestamp": 1621187891, - "player_id": 807568, - "sector_id": 3938, - "source_clan_id": 9323, - "target_clan_id": 20227, - "__class__": "ClanBattleArmyChange" - }, - { - "army_id": 2078714, - "hitpoints": 9, - "hitpoint_change": -1, - "type": "ClanBattle/siege_damaged", - "timestamp": 1621187892, - "player_id": 511977, - "sector_id": 3938, - "source_clan_id": 9323, - "target_clan_id": 20227, - "__class__": "ClanBattleArmyChange" - }, - { - "army_id": 2078714, - "hitpoints": 9, - "hitpoint_change": -1, - "type": "ClanBattle/siege_damaged", - "timestamp": 1621187892, - "player_id": 800794, - "sector_id": 3938, - "source_clan_id": 9323, - "target_clan_id": 20227, - "__class__": "ClanBattleArmyChange" - }, - { - "army_id": 2077929, - "hitpoints": 9, - "hitpoint_change": -1, - "type": "ClanBattle/defender_damaged", - "timestamp": 1621187893, - "player_id": 4529031, - "sector_id": 3938, - "source_clan_id": 20227, - "target_clan_id": -27, - "__class__": "ClanBattleArmyChange" - }, - { - "army_id": 2078714, - "hitpoints": 8, - "hitpoint_change": -1, - "type": "ClanBattle/siege_damaged", - "timestamp": 1621187893, - "player_id": 511977, - "sector_id": 3938, - "source_clan_id": 9323, - "target_clan_id": 20227, - "__class__": "ClanBattleArmyChange" - }, - { - "army_id": 2078714, - "type": "ClanBattle/siege_low_hp", - "timestamp": 1621187893, - "player_id": 511977, - "sector_id": 3938, - "source_clan_id": 9323, - "target_clan_id": 20227, - "__class__": "ClanBattleArmyChange" - }, - { - "army_id": 2078714, - "hitpoints": 8, - "hitpoint_change": -1, - "type": "ClanBattle/siege_damaged", - "timestamp": 1621187893, - "player_id": 807568, - "sector_id": 3938, - "source_clan_id": 9323, - "target_clan_id": 20227, - "__class__": "ClanBattleArmyChange" - }, - { - "army_id": 2078714, - "hitpoints": 8, - "hitpoint_change": -1, - "type": "ClanBattle/siege_damaged", - "timestamp": 1621187894, - "player_id": 511977, - "sector_id": 3938, - "source_clan_id": 9323, - "target_clan_id": 20227, - "__class__": "ClanBattleArmyChange" - }, - { - "army_id": 2078714, - "hitpoints": 8, - "hitpoint_change": -1, - "type": "ClanBattle/siege_damaged", - "timestamp": 1621187894, - "player_id": 800794, - "sector_id": 3938, - "source_clan_id": 9323, - "target_clan_id": 20227, - "__class__": "ClanBattleArmyChange" - }, - { - "army_id": 2078714, - "hitpoints": 8, - "hitpoint_change": -1, - "type": "ClanBattle/siege_damaged", - "timestamp": 1621187895, - "player_id": 511977, - "sector_id": 3938, - "source_clan_id": 9323, - "target_clan_id": 20227, - "__class__": "ClanBattleArmyChange" - }, - { - "army_id": 2078714, - "hitpoints": 8, - "hitpoint_change": -1, - "type": "ClanBattle/siege_damaged", - "timestamp": 1621187895, - "player_id": 807568, - "sector_id": 3938, - "source_clan_id": 9323, - "target_clan_id": 20227, - "__class__": "ClanBattleArmyChange" - }, - { - "army_id": 2077929, - "hitpoints": 8, - "hitpoint_change": -1, - "type": "ClanBattle/defender_damaged", - "timestamp": 1621187895, - "player_id": 4529031, - "sector_id": 3938, - "source_clan_id": 20227, - "target_clan_id": -27, - "__class__": "ClanBattleArmyChange" - }, - { - "army_id": 2078714, - "hitpoints": 8, - "hitpoint_change": -1, - "type": "ClanBattle/siege_defeated", - "timestamp": 1621187896, - "player_id": 511977, - "sector_id": 3938, - "source_clan_id": 9323, - "target_clan_id": 20227, - "__class__": "ClanBattleArmyChange" - }, - { - "type": "ClanBattle/sector_independence_granted", - "timestamp": 1621187904, - "player_id": 6807803, - "sector_id": 4149, - "source_clan_id": 11484, - "target_clan_id": -27, - "__class__": "ClanBattleSectorChange" - }, - { - "army_id": 2078720, - "hitpoints": 8, - "hitpoint_change": 10, - "type": "ClanBattle/siege_deployed", - "timestamp": 1621187907, - "player_id": 4529031, - "sector_id": 3938, - "source_clan_id": 20227, - "target_clan_id": -27, - "__class__": "ClanBattleArmyChange" - }, - { - "army_id": 2078720, - "hitpoints": 7, - "hitpoint_change": -1, - "type": "ClanBattle/siege_damaged", - "timestamp": 1621187908, - "player_id": 511977, - "sector_id": 3938, - "source_clan_id": 9323, - "target_clan_id": 20227, - "__class__": "ClanBattleArmyChange" - }, - { - "army_id": 2078720, - "hitpoints": 7, - "hitpoint_change": -1, - "type": "ClanBattle/siege_damaged", - "timestamp": 1621187909, - "player_id": 807568, - "sector_id": 3938, - "source_clan_id": 9323, - "target_clan_id": 20227, - "__class__": "ClanBattleArmyChange" - }, - { - "army_id": 2077929, - "hitpoints": 7, - "hitpoint_change": -1, - "type": "ClanBattle/defender_damaged", - "timestamp": 1621187909, - "player_id": 7317165, - "sector_id": 3938, - "source_clan_id": 20227, - "target_clan_id": -27, - "__class__": "ClanBattleArmyChange" - }, - { - "army_id": 2078720, - "hitpoints": 6, - "hitpoint_change": -1, - "type": "ClanBattle/siege_damaged", - "timestamp": 1621187909, - "player_id": 800794, - "sector_id": 3938, - "source_clan_id": 9323, - "target_clan_id": 20227, - "__class__": "ClanBattleArmyChange" - }, - { - "type": "ClanBattle/sector_slot_unlocked", - "timestamp": 1621187909, - "player_id": 587212, - "sector_id": 3968, - "source_clan_id": 1654, - "target_clan_id": 1654, - "__class__": "ClanBattleSectorChange" - }, - { - "army_id": 2078720, - "hitpoints": 6, - "hitpoint_change": -1, - "type": "ClanBattle/siege_damaged", - "timestamp": 1621187909, - "player_id": 511977, - "sector_id": 3938, - "source_clan_id": 9323, - "target_clan_id": 20227, - "__class__": "ClanBattleArmyChange" - }, - { - "army_id": 2078720, - "type": "ClanBattle/siege_low_hp", - "timestamp": 1621187909, - "player_id": 511977, - "sector_id": 3938, - "source_clan_id": 9323, - "target_clan_id": 20227, - "__class__": "ClanBattleArmyChange" - }, - { - "army_id": 2078721, - "hitpoints": 30, - "hitpoint_change": 10, - "type": "ClanBattle/defender_deployed", - "timestamp": 1621187910, - "player_id": 587212, - "sector_id": 3968, - "source_clan_id": 1654, - "target_clan_id": 1654, - "__class__": "ClanBattleArmyChange" - }, - { - "army_id": 2078720, - "hitpoints": 6, - "hitpoint_change": -1, - "type": "ClanBattle/siege_damaged", - "timestamp": 1621187910, - "player_id": 511977, - "sector_id": 3938, - "source_clan_id": 9323, - "target_clan_id": 20227, - "__class__": "ClanBattleArmyChange" - }, - { - "army_id": 2078720, - "hitpoints": 6, - "hitpoint_change": -1, - "type": "ClanBattle/siege_damaged", - "timestamp": 1621187910, - "player_id": 807568, - "sector_id": 3938, - "source_clan_id": 9323, - "target_clan_id": 20227, - "__class__": "ClanBattleArmyChange" - }, - { - "army_id": 2078720, - "hitpoints": 6, - "hitpoint_change": -1, - "type": "ClanBattle/siege_damaged", - "timestamp": 1621187911, - "player_id": 513225, - "sector_id": 3938, - "source_clan_id": 9323, - "target_clan_id": 20227, - "__class__": "ClanBattleArmyChange" - }, - { - "army_id": 2077929, - "hitpoints": 6, - "hitpoint_change": -1, - "type": "ClanBattle/defender_damaged", - "timestamp": 1621187911, - "player_id": 4529031, - "sector_id": 3938, - "source_clan_id": 20227, - "target_clan_id": -27, - "__class__": "ClanBattleArmyChange" - }, - { - "army_id": 2077929, - "type": "ClanBattle/defender_low_hp", - "timestamp": 1621187911, - "player_id": 4529031, - "sector_id": 3938, - "source_clan_id": 20227, - "target_clan_id": -27, - "__class__": "ClanBattleArmyChange" - }, - { - "army_id": 2078720, - "hitpoints": 5, - "hitpoint_change": -1, - "type": "ClanBattle/siege_damaged", - "timestamp": 1621187911, - "player_id": 511977, - "sector_id": 3938, - "source_clan_id": 9323, - "target_clan_id": 20227, - "__class__": "ClanBattleArmyChange" - }, - { - "army_id": 2077929, - "hitpoints": 5, - "hitpoint_change": -1, - "type": "ClanBattle/defender_damaged", - "timestamp": 1621187911, - "player_id": 6183084, - "sector_id": 3938, - "source_clan_id": 20227, - "target_clan_id": -27, - "__class__": "ClanBattleArmyChange" - }, - { - "army_id": 2078720, - "hitpoints": 4, - "hitpoint_change": -1, - "type": "ClanBattle/siege_damaged", - "timestamp": 1621187911, - "player_id": 800794, - "sector_id": 3938, - "source_clan_id": 9323, - "target_clan_id": 20227, - "__class__": "ClanBattleArmyChange" - }, - { - "army_id": 2078720, - "hitpoints": 5, - "hitpoint_change": -1, - "type": "ClanBattle/siege_defeated", - "timestamp": 1621187912, - "player_id": 511977, - "sector_id": 3938, - "source_clan_id": 9323, - "target_clan_id": 20227, - "__class__": "ClanBattleArmyChange" - }, - { - "army_id": 2078726, - "hitpoints": 5, - "hitpoint_change": 10, - "type": "ClanBattle/siege_deployed", - "timestamp": 1621187922, - "player_id": 4529031, - "sector_id": 3938, - "source_clan_id": 20227, - "target_clan_id": -27, - "__class__": "ClanBattleArmyChange" - }, - { - "type": "ClanBattle/sector_slot_unlocked", - "timestamp": 1621187923, - "player_id": 587212, - "sector_id": 3994, - "source_clan_id": 1654, - "target_clan_id": 1654, - "__class__": "ClanBattleSectorChange" - }, - { - "army_id": 2078726, - "hitpoints": 4, - "hitpoint_change": -1, - "type": "ClanBattle/siege_damaged", - "timestamp": 1621187923, - "player_id": 511977, - "sector_id": 3938, - "source_clan_id": 9323, - "target_clan_id": 20227, - "__class__": "ClanBattleArmyChange" - }, - { - "army_id": 2077929, - "hitpoints": 4, - "hitpoint_change": -1, - "type": "ClanBattle/defender_damaged", - "timestamp": 1621187924, - "player_id": 7317165, - "sector_id": 3938, - "source_clan_id": 20227, - "target_clan_id": -27, - "__class__": "ClanBattleArmyChange" - }, - { - "army_id": 2078727, - "hitpoints": 70, - "hitpoint_change": 10, - "type": "ClanBattle/defender_deployed", - "timestamp": 1621187924, - "player_id": 587212, - "sector_id": 3994, - "source_clan_id": 1654, - "target_clan_id": 1654, - "__class__": "ClanBattleArmyChange" - }, - { - "army_id": 2078726, - "hitpoints": 3, - "hitpoint_change": -1, - "type": "ClanBattle/siege_damaged", - "timestamp": 1621187924, - "player_id": 511977, - "sector_id": 3938, - "source_clan_id": 9323, - "target_clan_id": 20227, - "__class__": "ClanBattleArmyChange" - }, - { - "army_id": 2078726, - "hitpoints": 3, - "hitpoint_change": -1, - "type": "ClanBattle/siege_damaged", - "timestamp": 1621187924, - "player_id": 807568, - "sector_id": 3938, - "source_clan_id": 9323, - "target_clan_id": 20227, - "__class__": "ClanBattleArmyChange" - }, - { - "army_id": 2078726, - "type": "ClanBattle/siege_low_hp", - "timestamp": 1621187925, - "player_id": 511977, - "sector_id": 3938, - "source_clan_id": 9323, - "target_clan_id": 20227, - "__class__": "ClanBattleArmyChange" - }, - { - "army_id": 2078726, - "hitpoints": 3, - "hitpoint_change": -1, - "type": "ClanBattle/siege_damaged", - "timestamp": 1621187925, - "player_id": 511977, - "sector_id": 3938, - "source_clan_id": 9323, - "target_clan_id": 20227, - "__class__": "ClanBattleArmyChange" - }, - { - "army_id": 2077929, - "hitpoints": 3, - "hitpoint_change": -1, - "type": "ClanBattle/defender_damaged", - "timestamp": 1621187925, - "player_id": 6183084, - "sector_id": 3938, - "source_clan_id": 20227, - "target_clan_id": -27, - "__class__": "ClanBattleArmyChange" - }, - { - "army_id": 2078726, - "hitpoints": 2, - "hitpoint_change": -1, - "type": "ClanBattle/siege_damaged", - "timestamp": 1621187926, - "player_id": 807568, - "sector_id": 3938, - "source_clan_id": 9323, - "target_clan_id": 20227, - "__class__": "ClanBattleArmyChange" - }, - { - "army_id": 2077929, - "hitpoints": 2, - "hitpoint_change": -1, - "type": "ClanBattle/defender_damaged", - "timestamp": 1621187926, - "player_id": 4529031, - "sector_id": 3938, - "source_clan_id": 20227, - "target_clan_id": -27, - "__class__": "ClanBattleArmyChange" - }, - { - "army_id": 2078726, - "hitpoints": 1, - "hitpoint_change": -1, - "type": "ClanBattle/siege_damaged", - "timestamp": 1621187926, - "player_id": 511977, - "sector_id": 3938, - "source_clan_id": 9323, - "target_clan_id": 20227, - "__class__": "ClanBattleArmyChange" - }, - { - "army_id": 2078726, - "hitpoints": 1, - "hitpoint_change": -1, - "type": "ClanBattle/siege_damaged", - "timestamp": 1621187927, - "player_id": 800794, - "sector_id": 3938, - "source_clan_id": 9323, - "target_clan_id": 20227, - "__class__": "ClanBattleArmyChange" - }, - { - "army_id": 2078726, - "hitpoints": 1, - "hitpoint_change": -1, - "type": "ClanBattle/siege_damaged", - "timestamp": 1621187928, - "player_id": 807568, - "sector_id": 3938, - "source_clan_id": 9323, - "target_clan_id": 20227, - "__class__": "ClanBattleArmyChange" - }, - { - "army_id": 2078726, - "hitpoints": 1, - "hitpoint_change": -1, - "type": "ClanBattle/siege_damaged", - "timestamp": 1621187928, - "player_id": 511977, - "sector_id": 3938, - "source_clan_id": 9323, - "target_clan_id": 20227, - "__class__": "ClanBattleArmyChange" - }, - { - "army_id": 2078726, - "hitpoints": 2, - "hitpoint_change": -1, - "type": "ClanBattle/siege_defeated", - "timestamp": 1621187929, - "player_id": 511977, - "sector_id": 3938, - "source_clan_id": 9323, - "target_clan_id": 20227, - "__class__": "ClanBattleArmyChange" - }, - { - "type": "ClanBattle/sector_slot_unlocked", - "timestamp": 1621187933, - "player_id": 587212, - "sector_id": 3994, - "source_clan_id": 1654, - "target_clan_id": 1654, - "__class__": "ClanBattleSectorChange" - }, - { - "army_id": 2078733, - "hitpoints": 80, - "hitpoint_change": 10, - "type": "ClanBattle/defender_deployed", - "timestamp": 1621187934, - "player_id": 587212, - "sector_id": 3994, - "source_clan_id": 1654, - "target_clan_id": 1654, - "__class__": "ClanBattleArmyChange" - }, - { - "army_id": 2078738, - "hitpoints": 20, - "hitpoint_change": 10, - "type": "ClanBattle/defender_deployed", - "timestamp": 1621187949, - "player_id": 587212, - "sector_id": 4009, - "source_clan_id": 1654, - "target_clan_id": 1654, - "__class__": "ClanBattleArmyChange" - }, - { - "type": "ClanBattle/sector_slot_unlocked", - "timestamp": 1621187955, - "player_id": 587212, - "sector_id": 4009, - "source_clan_id": 1654, - "target_clan_id": 1654, - "__class__": "ClanBattleSectorChange" - }, - { - "army_id": 2078743, - "hitpoints": 30, - "hitpoint_change": 10, - "type": "ClanBattle/defender_deployed", - "timestamp": 1621187955, - "player_id": 587212, - "sector_id": 4009, - "source_clan_id": 1654, - "target_clan_id": 1654, - "__class__": "ClanBattleArmyChange" - }, - { - "army_id": 2078749, - "hitpoints": 10, - "type": "ClanBattle/defender_replaced", - "timestamp": 1621187968, - "player_id": 8770396, - "sector_id": 3974, - "source_clan_id": 20227, - "target_clan_id": 20227, - "__class__": "ClanBattleArmyChange" - }, - { - "army_id": 2078751, - "hitpoints": 20, - "hitpoint_change": 10, - "type": "ClanBattle/defender_deployed", - "timestamp": 1621187969, - "player_id": 587212, - "sector_id": 3951, - "source_clan_id": 1654, - "target_clan_id": 1654, - "__class__": "ClanBattleArmyChange" - }, - { - "type": "ClanBattle/sector_independence_granted", - "timestamp": 1621187981, - "player_id": 8432453, - "sector_id": 4138, - "source_clan_id": 28563, - "target_clan_id": -27, - "__class__": "ClanBattleSectorChange" - }, - { - "building": { - "next_relocate": 1621188000, - "__class__": "ClanBattleHeadquarter" - }, - "type": "ClanBattle/headquarter_placed", - "timestamp": 1621187981, - "player_id": 6807803, - "sector_id": 4109, - "source_clan_id": 11484, - "target_clan_id": 11484, - "__class__": "ClanBattleBuildingChange" - }, - { - "type": "ClanBattle/sector_independence_granted", - "timestamp": 1621187983, - "player_id": 2024164, - "sector_id": 4135, - "source_clan_id": 28563, - "target_clan_id": -27, - "__class__": "ClanBattleSectorChange" - }, - { - "type": "ClanBattle/sector_independence_granted", - "timestamp": 1621187984, - "player_id": 8432453, - "sector_id": 4126, - "source_clan_id": 28563, - "target_clan_id": -27, - "__class__": "ClanBattleSectorChange" - }, - { - "type": "ClanBattle/sector_independence_granted", - "timestamp": 1621187986, - "player_id": 2024164, - "sector_id": 4124, - "source_clan_id": 28563, - "target_clan_id": -27, - "__class__": "ClanBattleSectorChange" - }, - { - "type": "ClanBattle/sector_independence_granted", - "timestamp": 1621187987, - "player_id": 8432453, - "sector_id": 4125, - "source_clan_id": 28563, - "target_clan_id": -27, - "__class__": "ClanBattleSectorChange" - }, - { - "type": "ClanBattle/sector_independence_granted", - "timestamp": 1621187995, - "player_id": 10071404, - "sector_id": 3927, - "source_clan_id": 20227, - "target_clan_id": -27, - "__class__": "ClanBattleSectorChange" - }, - { - "army_id": 2078768, - "hitpoints": 2, - "hitpoint_change": 10, - "type": "ClanBattle/siege_deployed", - "timestamp": 1621187996, - "player_id": 4529031, - "sector_id": 3938, - "source_clan_id": 20227, - "target_clan_id": -27, - "__class__": "ClanBattleArmyChange" - }, - { - "type": "ClanBattle/sector_independence_granted", - "timestamp": 1621187997, - "player_id": 7317165, - "sector_id": 3956, - "source_clan_id": 20227, - "target_clan_id": -27, - "__class__": "ClanBattleSectorChange" - }, - { - "type": "ClanBattle/sector_independence_granted", - "timestamp": 1621187998, - "player_id": 8770396, - "sector_id": 3974, - "source_clan_id": 20227, - "target_clan_id": -27, - "__class__": "ClanBattleSectorChange" - }, - { - "army_id": 2078770, - "hitpoints": 10, - "hitpoint_change": 10, - "type": "ClanBattle/siege_deployed", - "timestamp": 1621187999, - "player_id": 807568, - "sector_id": 3927, - "source_clan_id": 9323, - "target_clan_id": -27, - "__class__": "ClanBattleArmyChange" - }, - { - "army_id": 2077929, - "hitpoints": 1, - "hitpoint_change": -1, - "type": "ClanBattle/defender_damaged", - "timestamp": 1621188012, - "player_id": 4529031, - "sector_id": 3938, - "source_clan_id": 20227, - "target_clan_id": -27, - "__class__": "ClanBattleArmyChange" - }, - { - "army_id": 2078773, - "hitpoints": 10, - "hitpoint_change": 10, - "type": "ClanBattle/siege_deployed", - "timestamp": 1621188013, - "player_id": 807568, - "sector_id": 3956, - "source_clan_id": 9323, - "target_clan_id": -27, - "__class__": "ClanBattleArmyChange" - }, - { - "army_id": 2078775, - "hitpoints": 10, - "hitpoint_change": 10, - "type": "ClanBattle/siege_deployed", - "timestamp": 1621188013, - "player_id": 511977, - "sector_id": 4065, - "source_clan_id": 9323, - "target_clan_id": 6998, - "__class__": "ClanBattleArmyChange" - }, - { - "army_id": 2078777, - "hitpoints": 10, - "hitpoint_change": 10, - "type": "ClanBattle/siege_deployed", - "timestamp": 1621188013, - "player_id": 800794, - "sector_id": 4066, - "source_clan_id": 9323, - "target_clan_id": 27272, - "__class__": "ClanBattleArmyChange" - }, - { - "army_id": 2078779, - "hitpoints": 10, - "hitpoint_change": 10, - "type": "ClanBattle/siege_deployed", - "timestamp": 1621188013, - "player_id": 8770396, - "sector_id": 3974, - "source_clan_id": 20227, - "target_clan_id": -27, - "__class__": "ClanBattleArmyChange" - }, - { - "army_id": 2078780, - "hitpoints": 10, - "hitpoint_change": 10, - "type": "ClanBattle/siege_deployed", - "timestamp": 1621188013, - "player_id": 2024164, - "sector_id": 4135, - "source_clan_id": 28563, - "target_clan_id": -27, - "__class__": "ClanBattleArmyChange" - }, - { - "army_id": 2077929, - "hitpoints": 2, - "hitpoint_change": -1, - "type": "ClanBattle/defender_defeated", - "timestamp": 1621188014, - "player_id": 4529031, - "sector_id": 3938, - "source_clan_id": 20227, - "target_clan_id": -27, - "__class__": "ClanBattleArmyChange" - }, - { - "type": "ClanBattle/sector_conquered", - "timestamp": 1621188014, - "player_id": 4529031, - "sector_id": 3938, - "source_clan_id": 20227, - "target_clan_id": -27, - "__class__": "ClanBattleSectorChange" - }, - { - "army_id": 2078773, - "hitpoints": 9, - "hitpoint_change": -1, - "type": "ClanBattle/siege_damaged", - "timestamp": 1621188015, - "player_id": 7317165, - "sector_id": 3956, - "source_clan_id": 20227, - "target_clan_id": 9323, - "__class__": "ClanBattleArmyChange" - }, - { - "army_id": 2078770, - "hitpoints": 9, - "hitpoint_change": -1, - "type": "ClanBattle/siege_damaged", - "timestamp": 1621188015, - "player_id": 10083035, - "sector_id": 3927, - "source_clan_id": 20227, - "target_clan_id": 9323, - "__class__": "ClanBattleArmyChange" - }, - { - "army_id": 2078800, - "hitpoints": 10, - "hitpoint_change": 10, - "type": "ClanBattle/siege_deployed", - "timestamp": 1621188015, - "player_id": 8432453, - "sector_id": 4126, - "source_clan_id": 28563, - "target_clan_id": -27, - "__class__": "ClanBattleArmyChange" - }, - { - "army_id": 2078181, - "hitpoints": 9, - "hitpoint_change": -1, - "type": "ClanBattle/defender_damaged", - "timestamp": 1621188015, - "player_id": 807568, - "sector_id": 3956, - "source_clan_id": 9323, - "target_clan_id": -27, - "__class__": "ClanBattleArmyChange" - }, - { - "army_id": 2077586, - "hitpoints": 9, - "hitpoint_change": -1, - "type": "ClanBattle/defender_damaged", - "timestamp": 1621188016, - "player_id": 511977, - "sector_id": 4065, - "source_clan_id": 9323, - "target_clan_id": 6998, - "__class__": "ClanBattleArmyChange" - }, - { - "army_id": 2078004, - "hitpoints": 9, - "hitpoint_change": -1, - "type": "ClanBattle/defender_damaged", - "timestamp": 1621188016, - "player_id": 800794, - "sector_id": 4066, - "source_clan_id": 9323, - "target_clan_id": 27272, - "__class__": "ClanBattleArmyChange" - }, - { - "army_id": 2078773, - "hitpoints": 8, - "hitpoint_change": -1, - "type": "ClanBattle/siege_damaged", - "timestamp": 1621188016, - "player_id": 6183084, - "sector_id": 3956, - "source_clan_id": 20227, - "target_clan_id": 9323, - "__class__": "ClanBattleArmyChange" - }, - { - "army_id": 2078808, - "hitpoints": 10, - "hitpoint_change": 10, - "type": "ClanBattle/siege_deployed", - "timestamp": 1621188016, - "player_id": 423722, - "sector_id": 4019, - "source_clan_id": 9133, - "target_clan_id": 29538, - "__class__": "ClanBattleArmyChange" - }, - { - "army_id": 2078181, - "hitpoints": 8, - "hitpoint_change": -1, - "type": "ClanBattle/defender_damaged", - "timestamp": 1621188016, - "player_id": 513225, - "sector_id": 3956, - "source_clan_id": 9323, - "target_clan_id": -27, - "__class__": "ClanBattleArmyChange" - }, - { - "army_id": 2078810, - "hitpoints": 10, - "hitpoint_change": 10, - "type": "ClanBattle/siege_deployed", - "timestamp": 1621188017, - "player_id": 5687524, - "sector_id": 4098, - "source_clan_id": 11484, - "target_clan_id": 467, - "__class__": "ClanBattleArmyChange" - }, - { - "army_id": 2078773, - "hitpoints": 7, - "hitpoint_change": -1, - "type": "ClanBattle/siege_damaged", - "timestamp": 1621188017, - "player_id": 7317165, - "sector_id": 3956, - "source_clan_id": 20227, - "target_clan_id": 9323, - "__class__": "ClanBattleArmyChange" - }, - { - "army_id": 2078749, - "hitpoints": 9, - "hitpoint_change": -1, - "type": "ClanBattle/defender_damaged", - "timestamp": 1621188017, - "player_id": 4529031, - "sector_id": 3974, - "source_clan_id": 20227, - "target_clan_id": -27, - "__class__": "ClanBattleArmyChange" - }, - { - "army_id": 2078811, - "hitpoints": 20, - "hitpoint_change": 10, - "type": "ClanBattle/siege_deployed", - "timestamp": 1621188017, - "player_id": 512828, - "sector_id": 4018, - "source_clan_id": 9133, - "target_clan_id": 30549, - "__class__": "ClanBattleArmyChange" - }, - { - "army_id": 2078813, - "hitpoints": 10, - "hitpoint_change": 10, - "type": "ClanBattle/siege_deployed", - "timestamp": 1621188017, - "player_id": 803214, - "sector_id": 4122, - "source_clan_id": 11484, - "target_clan_id": 30785, - "__class__": "ClanBattleArmyChange" - }, - { - "army_id": 2078181, - "hitpoints": 7, - "hitpoint_change": -1, - "type": "ClanBattle/defender_damaged", - "timestamp": 1621188017, - "player_id": 807568, - "sector_id": 3956, - "source_clan_id": 9323, - "target_clan_id": -27, - "__class__": "ClanBattleArmyChange" - }, - { - "army_id": 2078749, - "hitpoints": 8, - "hitpoint_change": -1, - "type": "ClanBattle/defender_damaged", - "timestamp": 1621188017, - "player_id": 8770396, - "sector_id": 3974, - "source_clan_id": 20227, - "target_clan_id": -27, - "__class__": "ClanBattleArmyChange" - }, - { - "army_id": 2078815, - "hitpoints": 30, - "hitpoint_change": 10, - "type": "ClanBattle/siege_deployed", - "timestamp": 1621188018, - "player_id": 427548, - "sector_id": 4009, - "source_clan_id": 10136, - "target_clan_id": 1654, - "__class__": "ClanBattleArmyChange" - }, - { - "army_id": 2076963, - "hitpoints": 9, - "hitpoint_change": -1, - "type": "ClanBattle/defender_damaged", - "timestamp": 1621188018, - "player_id": 2024164, - "sector_id": 4135, - "source_clan_id": 28563, - "target_clan_id": -27, - "__class__": "ClanBattleArmyChange" - }, - { - "army_id": 2078816, - "hitpoints": 80, - "hitpoint_change": 10, - "type": "ClanBattle/siege_deployed", - "timestamp": 1621188018, - "player_id": 423416, - "sector_id": 4089, - "source_clan_id": 467, - "target_clan_id": 6704, - "__class__": "ClanBattleArmyChange" - }, - { - "army_id": 2078817, - "hitpoints": 80, - "hitpoint_change": 10, - "type": "ClanBattle/siege_deployed", - "timestamp": 1621188018, - "player_id": 1613507, - "sector_id": 4060, - "source_clan_id": 29669, - "target_clan_id": 467, - "__class__": "ClanBattleArmyChange" - }, - { - "army_id": 2078004, - "hitpoints": 8, - "hitpoint_change": -1, - "type": "ClanBattle/defender_damaged", - "timestamp": 1621188018, - "player_id": 800794, - "sector_id": 4066, - "source_clan_id": 9323, - "target_clan_id": 27272, - "__class__": "ClanBattleArmyChange" - }, - { - "army_id": 2078004, - "hitpoints": 7, - "hitpoint_change": -1, - "type": "ClanBattle/defender_damaged", - "timestamp": 1621188018, - "player_id": 511977, - "sector_id": 4066, - "source_clan_id": 9323, - "target_clan_id": 27272, - "__class__": "ClanBattleArmyChange" - }, - { - "army_id": 2078770, - "hitpoints": 9, - "hitpoint_change": -1, - "type": "ClanBattle/siege_damaged", - "timestamp": 1621188018, - "player_id": 5269109, - "sector_id": 3927, - "source_clan_id": 20227, - "target_clan_id": 9323, - "__class__": "ClanBattleArmyChange" - }, - { - "army_id": 2078773, - "hitpoints": 6, - "hitpoint_change": -1, - "type": "ClanBattle/siege_damaged", - "timestamp": 1621188018, - "player_id": 7317165, - "sector_id": 3956, - "source_clan_id": 20227, - "target_clan_id": 9323, - "__class__": "ClanBattleArmyChange" - }, - { - "army_id": 2078773, - "type": "ClanBattle/siege_low_hp", - "timestamp": 1621188018, - "player_id": 7317165, - "sector_id": 3956, - "source_clan_id": 20227, - "target_clan_id": 9323, - "__class__": "ClanBattleArmyChange" - }, - { - "army_id": 2078819, - "hitpoints": 10, - "hitpoint_change": 10, - "type": "ClanBattle/siege_deployed", - "timestamp": 1621188018, - "player_id": 2960343, - "sector_id": 4037, - "source_clan_id": 9133, - "target_clan_id": 29538, - "__class__": "ClanBattleArmyChange" - }, - { - "army_id": 2078773, - "hitpoints": 6, - "hitpoint_change": -1, - "type": "ClanBattle/siege_damaged", - "timestamp": 1621188019, - "player_id": 6183084, - "sector_id": 3956, - "source_clan_id": 20227, - "target_clan_id": 9323, - "__class__": "ClanBattleArmyChange" - }, - { - "army_id": 2078822, - "hitpoints": 20, - "hitpoint_change": 10, - "type": "ClanBattle/siege_deployed", - "timestamp": 1621188019, - "player_id": 585359, - "sector_id": 4111, - "source_clan_id": 467, - "target_clan_id": 6704, - "__class__": "ClanBattleArmyChange" - }, - { - "army_id": 2078749, - "hitpoints": 7, - "hitpoint_change": -1, - "type": "ClanBattle/defender_damaged", - "timestamp": 1621188019, - "player_id": 4529031, - "sector_id": 3974, - "source_clan_id": 20227, - "target_clan_id": -27, - "__class__": "ClanBattleArmyChange" - }, - { - "army_id": 2077847, - "hitpoints": 9, - "hitpoint_change": -1, - "type": "ClanBattle/defender_damaged", - "timestamp": 1621188019, - "player_id": 1473126, - "sector_id": 4019, - "source_clan_id": 9133, - "target_clan_id": 29538, - "__class__": "ClanBattleArmyChange" - }, - { - "army_id": 2077847, - "hitpoints": 8, - "hitpoint_change": -1, - "type": "ClanBattle/defender_damaged", - "timestamp": 1621188020, - "player_id": 423722, - "sector_id": 4019, - "source_clan_id": 9133, - "target_clan_id": 29538, - "__class__": "ClanBattleArmyChange" - }, - { - "army_id": 2078004, - "hitpoints": 6, - "hitpoint_change": -1, - "type": "ClanBattle/defender_damaged", - "timestamp": 1621188020, - "player_id": 800794, - "sector_id": 4066, - "source_clan_id": 9323, - "target_clan_id": 27272, - "__class__": "ClanBattleArmyChange" - }, - { - "army_id": 2078004, - "type": "ClanBattle/defender_low_hp", - "timestamp": 1621188020, - "player_id": 800794, - "sector_id": 4066, - "source_clan_id": 9323, - "target_clan_id": 27272, - "__class__": "ClanBattleArmyChange" - }, - { - "army_id": 2078181, - "hitpoints": 6, - "hitpoint_change": -1, - "type": "ClanBattle/defender_damaged", - "timestamp": 1621188020, - "player_id": 807568, - "sector_id": 3956, - "source_clan_id": 9323, - "target_clan_id": -27, - "__class__": "ClanBattleArmyChange" - }, - { - "army_id": 2078181, - "type": "ClanBattle/defender_low_hp", - "timestamp": 1621188020, - "player_id": 807568, - "sector_id": 3956, - "source_clan_id": 9323, - "target_clan_id": -27, - "__class__": "ClanBattleArmyChange" - }, - { - "army_id": 2078181, - "hitpoints": 5, - "hitpoint_change": -1, - "type": "ClanBattle/defender_damaged", - "timestamp": 1621188020, - "player_id": 513225, - "sector_id": 3956, - "source_clan_id": 9323, - "target_clan_id": -27, - "__class__": "ClanBattleArmyChange" - }, - { - "army_id": 2078749, - "hitpoints": 6, - "hitpoint_change": -1, - "type": "ClanBattle/defender_damaged", - "timestamp": 1621188020, - "player_id": 8770396, - "sector_id": 3974, - "source_clan_id": 20227, - "target_clan_id": -27, - "__class__": "ClanBattleArmyChange" - }, - { - "army_id": 2078749, - "type": "ClanBattle/defender_low_hp", - "timestamp": 1621188020, - "player_id": 8770396, - "sector_id": 3974, - "source_clan_id": 20227, - "target_clan_id": -27, - "__class__": "ClanBattleArmyChange" - }, - { - "army_id": 2078824, - "hitpoints": 20, - "hitpoint_change": 10, - "type": "ClanBattle/siege_deployed", - "timestamp": 1621188020, - "player_id": 115968, - "sector_id": 4001, - "source_clan_id": 9133, - "target_clan_id": 30549, - "__class__": "ClanBattleArmyChange" - }, - { - "army_id": 2077553, - "hitpoints": 9, - "hitpoint_change": -1, - "type": "ClanBattle/defender_damaged", - "timestamp": 1621188020, - "player_id": 803214, - "sector_id": 4122, - "source_clan_id": 11484, - "target_clan_id": 30785, - "__class__": "ClanBattleArmyChange" - }, - { - "army_id": 2078825, - "hitpoints": 10, - "hitpoint_change": 10, - "type": "ClanBattle/siege_deployed", - "timestamp": 1621188021, - "player_id": 511977, - "sector_id": 4079, - "source_clan_id": 9323, - "target_clan_id": 6998, - "__class__": "ClanBattleArmyChange" - }, - { - "army_id": 2077553, - "hitpoints": 8, - "hitpoint_change": -1, - "type": "ClanBattle/defender_damaged", - "timestamp": 1621188021, - "player_id": 7732998, - "sector_id": 4122, - "source_clan_id": 11484, - "target_clan_id": 30785, - "__class__": "ClanBattleArmyChange" - }, - { - "army_id": 2078770, - "hitpoints": 9, - "hitpoint_change": -1, - "type": "ClanBattle/siege_damaged", - "timestamp": 1621188021, - "player_id": 10083035, - "sector_id": 3927, - "source_clan_id": 20227, - "target_clan_id": 9323, - "__class__": "ClanBattleArmyChange" - }, - { - "army_id": 2078773, - "hitpoints": 4, - "hitpoint_change": -1, - "type": "ClanBattle/siege_damaged", - "timestamp": 1621188021, - "player_id": 7317165, - "sector_id": 3956, - "source_clan_id": 20227, - "target_clan_id": 9323, - "__class__": "ClanBattleArmyChange" - }, - { - "army_id": 2078274, - "hitpoints": 19, - "hitpoint_change": -1, - "type": "ClanBattle/defender_damaged", - "timestamp": 1621188021, - "player_id": 585359, - "sector_id": 4111, - "source_clan_id": 467, - "target_clan_id": 6704, - "__class__": "ClanBattleArmyChange" - }, - { - "army_id": 2078773, - "hitpoints": 4, - "hitpoint_change": -1, - "type": "ClanBattle/siege_damaged", - "timestamp": 1621188021, - "player_id": 6183084, - "sector_id": 3956, - "source_clan_id": 20227, - "target_clan_id": 9323, - "__class__": "ClanBattleArmyChange" - }, - { - "army_id": 2078827, - "hitpoints": 10, - "hitpoint_change": 10, - "type": "ClanBattle/siege_deployed", - "timestamp": 1621188021, - "player_id": 8404356, - "sector_id": 4021, - "source_clan_id": 9133, - "target_clan_id": 29538, - "__class__": "ClanBattleArmyChange" - }, - { - "army_id": 2077553, - "hitpoints": 7, - "hitpoint_change": -1, - "type": "ClanBattle/defender_damaged", - "timestamp": 1621188021, - "player_id": 5933688, - "sector_id": 4122, - "source_clan_id": 11484, - "target_clan_id": 30785, - "__class__": "ClanBattleArmyChange" - }, - { - "army_id": 2078749, - "hitpoints": 5, - "hitpoint_change": -1, - "type": "ClanBattle/defender_damaged", - "timestamp": 1621188022, - "player_id": 4529031, - "sector_id": 3974, - "source_clan_id": 20227, - "target_clan_id": -27, - "__class__": "ClanBattleArmyChange" - }, - { - "army_id": 2078770, - "hitpoints": 9, - "hitpoint_change": -1, - "type": "ClanBattle/siege_damaged", - "timestamp": 1621188022, - "player_id": 5269109, - "sector_id": 3927, - "source_clan_id": 20227, - "target_clan_id": 9323, - "__class__": "ClanBattleArmyChange" - }, - { - "army_id": 2078770, - "type": "ClanBattle/siege_low_hp", - "timestamp": 1621188022, - "player_id": 5269109, - "sector_id": 3927, - "source_clan_id": 20227, - "target_clan_id": 9323, - "__class__": "ClanBattleArmyChange" - }, - { - "army_id": 2077729, - "hitpoints": 19, - "hitpoint_change": -1, - "type": "ClanBattle/defender_damaged", - "timestamp": 1621188022, - "player_id": 512828, - "sector_id": 4018, - "source_clan_id": 9133, - "target_clan_id": 30549, - "__class__": "ClanBattleArmyChange" - }, - { - "army_id": 2076963, - "hitpoints": 8, - "hitpoint_change": -1, - "type": "ClanBattle/defender_damaged", - "timestamp": 1621188022, - "player_id": 2024164, - "sector_id": 4135, - "source_clan_id": 28563, - "target_clan_id": -27, - "__class__": "ClanBattleArmyChange" - }, - { - "army_id": 2078770, - "hitpoints": 9, - "hitpoint_change": -1, - "type": "ClanBattle/siege_damaged", - "timestamp": 1621188022, - "player_id": 10071404, - "sector_id": 3927, - "source_clan_id": 20227, - "target_clan_id": 9323, - "__class__": "ClanBattleArmyChange" - }, - { - "army_id": 2078828, - "hitpoints": 10, - "hitpoint_change": 10, - "type": "ClanBattle/siege_deployed", - "timestamp": 1621188022, - "player_id": 6807803, - "sector_id": 4110, - "source_clan_id": 11484, - "target_clan_id": 25179, - "__class__": "ClanBattleArmyChange" - }, - { - "army_id": 2078004, - "hitpoints": 5, - "hitpoint_change": -1, - "type": "ClanBattle/defender_damaged", - "timestamp": 1621188022, - "player_id": 800794, - "sector_id": 4066, - "source_clan_id": 9323, - "target_clan_id": 27272, - "__class__": "ClanBattleArmyChange" - }, - { - "army_id": 2078749, - "hitpoints": 4, - "hitpoint_change": -1, - "type": "ClanBattle/defender_damaged", - "timestamp": 1621188022, - "player_id": 8770396, - "sector_id": 3974, - "source_clan_id": 20227, - "target_clan_id": -27, - "__class__": "ClanBattleArmyChange" - }, - { - "army_id": 2077553, - "hitpoints": 6, - "hitpoint_change": -1, - "type": "ClanBattle/defender_damaged", - "timestamp": 1621188022, - "player_id": 5933688, - "sector_id": 4122, - "source_clan_id": 11484, - "target_clan_id": 30785, - "__class__": "ClanBattleArmyChange" - }, - { - "army_id": 2077553, - "type": "ClanBattle/defender_low_hp", - "timestamp": 1621188022, - "player_id": 5933688, - "sector_id": 4122, - "source_clan_id": 11484, - "target_clan_id": 30785, - "__class__": "ClanBattleArmyChange" - }, - { - "army_id": 2077266, - "hitpoints": 29, - "hitpoint_change": -1, - "type": "ClanBattle/defender_damaged", - "timestamp": 1621188023, - "player_id": 1244937, - "sector_id": 4009, - "source_clan_id": 10136, - "target_clan_id": 1654, - "__class__": "ClanBattleArmyChange" - }, - { - "army_id": 2077847, - "hitpoints": 7, - "hitpoint_change": -1, - "type": "ClanBattle/defender_damaged", - "timestamp": 1621188023, - "player_id": 423722, - "sector_id": 4019, - "source_clan_id": 9133, - "target_clan_id": 29538, - "__class__": "ClanBattleArmyChange" - }, - { - "army_id": 2077553, - "hitpoints": 5, - "hitpoint_change": -1, - "type": "ClanBattle/defender_damaged", - "timestamp": 1621188023, - "player_id": 7457766, - "sector_id": 4122, - "source_clan_id": 11484, - "target_clan_id": 30785, - "__class__": "ClanBattleArmyChange" - }, - { - "army_id": 2078773, - "hitpoints": 4, - "hitpoint_change": -1, - "type": "ClanBattle/siege_damaged", - "timestamp": 1621188023, - "player_id": 7317165, - "sector_id": 3956, - "source_clan_id": 20227, - "target_clan_id": 9323, - "__class__": "ClanBattleArmyChange" - }, - { - "army_id": 2077553, - "hitpoints": 4, - "hitpoint_change": -1, - "type": "ClanBattle/defender_damaged", - "timestamp": 1621188023, - "player_id": 5933688, - "sector_id": 4122, - "source_clan_id": 11484, - "target_clan_id": 30785, - "__class__": "ClanBattleArmyChange" - }, - { - "army_id": 2078832, - "hitpoints": 10, - "hitpoint_change": 10, - "type": "ClanBattle/siege_deployed", - "timestamp": 1621188023, - "player_id": 587212, - "sector_id": 3993, - "source_clan_id": 1654, - "target_clan_id": 9323, - "__class__": "ClanBattleArmyChange" - }, - { - "army_id": 2077847, - "hitpoints": 6, - "hitpoint_change": -1, - "type": "ClanBattle/defender_damaged", - "timestamp": 1621188024, - "player_id": 1473126, - "sector_id": 4019, - "source_clan_id": 9133, - "target_clan_id": 29538, - "__class__": "ClanBattleArmyChange" - }, - { - "army_id": 2077847, - "type": "ClanBattle/defender_low_hp", - "timestamp": 1621188024, - "player_id": 1473126, - "sector_id": 4019, - "source_clan_id": 9133, - "target_clan_id": 29538, - "__class__": "ClanBattleArmyChange" - }, - { - "army_id": 2076945, - "hitpoints": 9, - "hitpoint_change": -1, - "type": "ClanBattle/defender_damaged", - "timestamp": 1621188024, - "player_id": 5687524, - "sector_id": 4098, - "source_clan_id": 11484, - "target_clan_id": 467, - "__class__": "ClanBattleArmyChange" - }, - { - "army_id": 2078833, - "hitpoints": 10, - "hitpoint_change": 10, - "type": "ClanBattle/siege_deployed", - "timestamp": 1621188024, - "player_id": 587053, - "sector_id": 4031, - "source_clan_id": 1654, - "target_clan_id": 9323, - "__class__": "ClanBattleArmyChange" - }, - { - "army_id": 2078181, - "hitpoints": 4, - "hitpoint_change": -1, - "type": "ClanBattle/defender_damaged", - "timestamp": 1621188024, - "player_id": 513225, - "sector_id": 3956, - "source_clan_id": 9323, - "target_clan_id": -27, - "__class__": "ClanBattleArmyChange" - }, - { - "army_id": 2077553, - "hitpoints": 3, - "hitpoint_change": -1, - "type": "ClanBattle/defender_damaged", - "timestamp": 1621188024, - "player_id": 803214, - "sector_id": 4122, - "source_clan_id": 11484, - "target_clan_id": 30785, - "__class__": "ClanBattleArmyChange" - }, - { - "army_id": 2078004, - "hitpoints": 4, - "hitpoint_change": -1, - "type": "ClanBattle/defender_damaged", - "timestamp": 1621188024, - "player_id": 800794, - "sector_id": 4066, - "source_clan_id": 9323, - "target_clan_id": 27272, - "__class__": "ClanBattleArmyChange" - }, - { - "army_id": 2076963, - "hitpoints": 7, - "hitpoint_change": -1, - "type": "ClanBattle/defender_damaged", - "timestamp": 1621188024, - "player_id": 2024164, - "sector_id": 4135, - "source_clan_id": 28563, - "target_clan_id": -27, - "__class__": "ClanBattleArmyChange" - }, - { - "army_id": 2077553, - "hitpoints": 2, - "hitpoint_change": -1, - "type": "ClanBattle/defender_damaged", - "timestamp": 1621188024, - "player_id": 5933688, - "sector_id": 4122, - "source_clan_id": 11484, - "target_clan_id": 30785, - "__class__": "ClanBattleArmyChange" - }, - { - "army_id": 2077553, - "hitpoints": 1, - "hitpoint_change": -1, - "type": "ClanBattle/defender_damaged", - "timestamp": 1621188024, - "player_id": 7732998, - "sector_id": 4122, - "source_clan_id": 11484, - "target_clan_id": 30785, - "__class__": "ClanBattleArmyChange" - }, - { - "army_id": 2078770, - "hitpoints": 9, - "hitpoint_change": -1, - "type": "ClanBattle/siege_damaged", - "timestamp": 1621188024, - "player_id": 10083035, - "sector_id": 3927, - "source_clan_id": 20227, - "target_clan_id": 9323, - "__class__": "ClanBattleArmyChange" - }, - { - "army_id": 2078749, - "hitpoints": 3, - "hitpoint_change": -1, - "type": "ClanBattle/defender_damaged", - "timestamp": 1621188024, - "player_id": 4529031, - "sector_id": 3974, - "source_clan_id": 20227, - "target_clan_id": -27, - "__class__": "ClanBattleArmyChange" - }, - { - "army_id": 2078770, - "hitpoints": 9, - "hitpoint_change": -1, - "type": "ClanBattle/siege_damaged", - "timestamp": 1621188025, - "player_id": 10071404, - "sector_id": 3927, - "source_clan_id": 20227, - "target_clan_id": 9323, - "__class__": "ClanBattleArmyChange" - }, - { - "army_id": 2078743, - "hitpoints": 28, - "hitpoint_change": -1, - "type": "ClanBattle/defender_damaged", - "timestamp": 1621188024, - "player_id": 427548, - "sector_id": 4009, - "source_clan_id": 10136, - "target_clan_id": 1654, - "__class__": "ClanBattleArmyChange" - }, - { - "army_id": 2077847, - "hitpoints": 5, - "hitpoint_change": -1, - "type": "ClanBattle/defender_damaged", - "timestamp": 1621188025, - "player_id": 423722, - "sector_id": 4019, - "source_clan_id": 9133, - "target_clan_id": 29538, - "__class__": "ClanBattleArmyChange" - }, - { - "army_id": 2078836, - "hitpoints": 10, - "hitpoint_change": 10, - "type": "ClanBattle/siege_deployed", - "timestamp": 1621188025, - "player_id": 8472982, - "sector_id": 4020, - "source_clan_id": 9133, - "target_clan_id": 29538, - "__class__": "ClanBattleArmyChange" - }, - { - "army_id": 2078135, - "hitpoints": 18, - "hitpoint_change": -1, - "type": "ClanBattle/defender_damaged", - "timestamp": 1621188025, - "player_id": 512828, - "sector_id": 4018, - "source_clan_id": 9133, - "target_clan_id": 30549, - "__class__": "ClanBattleArmyChange" - }, - { - "army_id": 2077553, - "hitpoints": 2, - "hitpoint_change": -1, - "type": "ClanBattle/defender_defeated", - "timestamp": 1621188025, - "player_id": 5933688, - "sector_id": 4122, - "source_clan_id": 11484, - "target_clan_id": 30785, - "__class__": "ClanBattleArmyChange" - }, - { - "type": "ClanBattle/sector_conquered", - "timestamp": 1621188025, - "player_id": 5933688, - "sector_id": 4122, - "source_clan_id": 11484, - "target_clan_id": 30785, - "__class__": "ClanBattleSectorChange" - }, - { - "army_id": 2078770, - "hitpoints": 9, - "hitpoint_change": -1, - "type": "ClanBattle/siege_damaged", - "timestamp": 1621188025, - "player_id": 5269109, - "sector_id": 3927, - "source_clan_id": 20227, - "target_clan_id": 9323, - "__class__": "ClanBattleArmyChange" - }, - { - "army_id": 2078837, - "hitpoints": 10, - "hitpoint_change": 10, - "type": "ClanBattle/siege_deployed", - "timestamp": 1621188025, - "player_id": 511977, - "sector_id": 4052, - "source_clan_id": 9323, - "target_clan_id": 27272, - "__class__": "ClanBattleArmyChange" - }, - { - "army_id": 2078433, - "hitpoints": 79, - "hitpoint_change": -1, - "type": "ClanBattle/defender_damaged", - "timestamp": 1621188025, - "player_id": 423416, - "sector_id": 4089, - "source_clan_id": 467, - "target_clan_id": 6704, - "__class__": "ClanBattleArmyChange" - }, - { - "army_id": 2078274, - "hitpoints": 18, - "hitpoint_change": -1, - "type": "ClanBattle/defender_damaged", - "timestamp": 1621188026, - "player_id": 820806, - "sector_id": 4111, - "source_clan_id": 467, - "target_clan_id": 6704, - "__class__": "ClanBattleArmyChange" - }, - { - "army_id": 2078773, - "hitpoints": 3, - "hitpoint_change": -1, - "type": "ClanBattle/siege_damaged", - "timestamp": 1621188026, - "player_id": 1371928, - "sector_id": 3956, - "source_clan_id": 20227, - "target_clan_id": 9323, - "__class__": "ClanBattleArmyChange" - }, - { - "army_id": 2078773, - "hitpoints": 4, - "hitpoint_change": -1, - "type": "ClanBattle/siege_defeated", - "timestamp": 1621188026, - "player_id": 6183084, - "sector_id": 3956, - "source_clan_id": 20227, - "target_clan_id": 9323, - "__class__": "ClanBattleArmyChange" - }, - { - "army_id": 2078004, - "hitpoints": 3, - "hitpoint_change": -1, - "type": "ClanBattle/defender_damaged", - "timestamp": 1621188026, - "player_id": 800794, - "sector_id": 4066, - "source_clan_id": 9323, - "target_clan_id": 27272, - "__class__": "ClanBattleArmyChange" - }, - { - "army_id": 2076963, - "hitpoints": 6, - "hitpoint_change": -1, - "type": "ClanBattle/defender_damaged", - "timestamp": 1621188026, - "player_id": 2024164, - "sector_id": 4135, - "source_clan_id": 28563, - "target_clan_id": -27, - "__class__": "ClanBattleArmyChange" - }, - { - "army_id": 2076963, - "type": "ClanBattle/defender_low_hp", - "timestamp": 1621188026, - "player_id": 2024164, - "sector_id": 4135, - "source_clan_id": 28563, - "target_clan_id": -27, - "__class__": "ClanBattleArmyChange" - }, - { - "army_id": 2078770, - "hitpoints": 9, - "hitpoint_change": -1, - "type": "ClanBattle/siege_damaged", - "timestamp": 1621188027, - "player_id": 10071404, - "sector_id": 3927, - "source_clan_id": 20227, - "target_clan_id": 9323, - "__class__": "ClanBattleArmyChange" - }, - { - "army_id": 2078749, - "hitpoints": 2, - "hitpoint_change": -1, - "type": "ClanBattle/defender_damaged", - "timestamp": 1621188027, - "player_id": 4529031, - "sector_id": 3974, - "source_clan_id": 20227, - "target_clan_id": -27, - "__class__": "ClanBattleArmyChange" - }, - { - "army_id": 2077847, - "hitpoints": 4, - "hitpoint_change": -1, - "type": "ClanBattle/defender_damaged", - "timestamp": 1621188027, - "player_id": 423722, - "sector_id": 4019, - "source_clan_id": 9133, - "target_clan_id": 29538, - "__class__": "ClanBattleArmyChange" - }, - { - "army_id": 2077847, - "hitpoints": 3, - "hitpoint_change": -1, - "type": "ClanBattle/defender_damaged", - "timestamp": 1621188027, - "player_id": 1473126, - "sector_id": 4019, - "source_clan_id": 9133, - "target_clan_id": 29538, - "__class__": "ClanBattleArmyChange" - }, - { - "army_id": 2078839, - "hitpoints": 4, - "hitpoint_change": 10, - "type": "ClanBattle/siege_deployed", - "timestamp": 1621188027, - "player_id": 807568, - "sector_id": 3956, - "source_clan_id": 9323, - "target_clan_id": -27, - "__class__": "ClanBattleArmyChange" - }, - { - "army_id": 2078749, - "hitpoints": 1, - "hitpoint_change": -1, - "type": "ClanBattle/defender_damaged", - "timestamp": 1621188027, - "player_id": 8770396, - "sector_id": 3974, - "source_clan_id": 20227, - "target_clan_id": -27, - "__class__": "ClanBattleArmyChange" - }, - { - "army_id": 2078840, - "hitpoints": 10, - "hitpoint_change": 10, - "type": "ClanBattle/siege_deployed", - "timestamp": 1621188028, - "player_id": 8432453, - "sector_id": 4138, - "source_clan_id": 28563, - "target_clan_id": -27, - "__class__": "ClanBattleArmyChange" - }, - { - "army_id": 2077729, - "hitpoints": 17, - "hitpoint_change": -1, - "type": "ClanBattle/defender_damaged", - "timestamp": 1621188028, - "player_id": 512828, - "sector_id": 4018, - "source_clan_id": 9133, - "target_clan_id": 30549, - "__class__": "ClanBattleArmyChange" - }, - { - "army_id": 2076944, - "hitpoints": 9, - "hitpoint_change": -1, - "type": "ClanBattle/defender_damaged", - "timestamp": 1621188028, - "player_id": 587053, - "sector_id": 4031, - "source_clan_id": 1654, - "target_clan_id": 9323, - "__class__": "ClanBattleArmyChange" - }, - { - "army_id": 2076945, - "hitpoints": 8, - "hitpoint_change": -1, - "type": "ClanBattle/defender_damaged", - "timestamp": 1621188028, - "player_id": 5687524, - "sector_id": 4098, - "source_clan_id": 11484, - "target_clan_id": 467, - "__class__": "ClanBattleArmyChange" - }, - { - "army_id": 2078743, - "hitpoints": 27, - "hitpoint_change": -1, - "type": "ClanBattle/defender_damaged", - "timestamp": 1621188028, - "player_id": 1244937, - "sector_id": 4009, - "source_clan_id": 10136, - "target_clan_id": 1654, - "__class__": "ClanBattleArmyChange" - }, - { - "army_id": 2077832, - "hitpoints": 9, - "hitpoint_change": -1, - "type": "ClanBattle/defender_damaged", - "timestamp": 1621188028, - "player_id": 8404356, - "sector_id": 4020, - "source_clan_id": 9133, - "target_clan_id": 29538, - "__class__": "ClanBattleArmyChange" - }, - { - "army_id": 2078657, - "hitpoints": 79, - "hitpoint_change": -1, - "type": "ClanBattle/defender_damaged", - "timestamp": 1621188028, - "player_id": 1613507, - "sector_id": 4060, - "source_clan_id": 29669, - "target_clan_id": 467, - "__class__": "ClanBattleArmyChange" - }, - { - "army_id": 2078770, - "hitpoints": 10, - "hitpoint_change": -1, - "type": "ClanBattle/siege_defeated", - "timestamp": 1621188028, - "player_id": 5269109, - "sector_id": 3927, - "source_clan_id": 20227, - "target_clan_id": 9323, - "__class__": "ClanBattleArmyChange" - }, - { - "army_id": 2076963, - "hitpoints": 5, - "hitpoint_change": -1, - "type": "ClanBattle/defender_damaged", - "timestamp": 1621188028, - "player_id": 2024164, - "sector_id": 4135, - "source_clan_id": 28563, - "target_clan_id": -27, - "__class__": "ClanBattleArmyChange" - }, - { - "army_id": 2078136, - "hitpoints": 19, - "hitpoint_change": -1, - "type": "ClanBattle/defender_damaged", - "timestamp": 1621188028, - "player_id": 115968, - "sector_id": 4001, - "source_clan_id": 9133, - "target_clan_id": 30549, - "__class__": "ClanBattleArmyChange" - }, - { - "army_id": 2078438, - "hitpoints": 78, - "hitpoint_change": -1, - "type": "ClanBattle/defender_damaged", - "timestamp": 1621188029, - "player_id": 423416, - "sector_id": 4089, - "source_clan_id": 467, - "target_clan_id": 6704, - "__class__": "ClanBattleArmyChange" - }, - { - "army_id": 2078004, - "hitpoints": 2, - "hitpoint_change": -1, - "type": "ClanBattle/defender_damaged", - "timestamp": 1621188029, - "player_id": 800794, - "sector_id": 4066, - "source_clan_id": 9323, - "target_clan_id": 27272, - "__class__": "ClanBattleArmyChange" - }, - { - "army_id": 2078274, - "hitpoints": 17, - "hitpoint_change": -1, - "type": "ClanBattle/defender_damaged", - "timestamp": 1621188029, - "player_id": 820806, - "sector_id": 4111, - "source_clan_id": 467, - "target_clan_id": 6704, - "__class__": "ClanBattleArmyChange" - }, - { - "army_id": 2078839, - "hitpoints": 3, - "hitpoint_change": -1, - "type": "ClanBattle/siege_damaged", - "timestamp": 1621188029, - "player_id": 6183084, - "sector_id": 3956, - "source_clan_id": 20227, - "target_clan_id": 9323, - "__class__": "ClanBattleArmyChange" - }, - { - "army_id": 2077266, - "hitpoints": 26, - "hitpoint_change": -1, - "type": "ClanBattle/defender_damaged", - "timestamp": 1621188029, - "player_id": 427548, - "sector_id": 4009, - "source_clan_id": 10136, - "target_clan_id": 1654, - "__class__": "ClanBattleArmyChange" - }, - { - "army_id": 2076874, - "hitpoints": 9, - "hitpoint_change": -1, - "type": "ClanBattle/defender_damaged", - "timestamp": 1621188029, - "player_id": 7732998, - "sector_id": 4110, - "source_clan_id": 11484, - "target_clan_id": 25179, - "__class__": "ClanBattleArmyChange" - }, - { - "army_id": 2076874, - "hitpoints": 8, - "hitpoint_change": -1, - "type": "ClanBattle/defender_damaged", - "timestamp": 1621188029, - "player_id": 803214, - "sector_id": 4110, - "source_clan_id": 11484, - "target_clan_id": 25179, - "__class__": "ClanBattleArmyChange" - }, - { - "army_id": 2078842, - "hitpoints": 10, - "hitpoint_change": 10, - "type": "ClanBattle/siege_deployed", - "timestamp": 1621188030, - "player_id": 7458293, - "sector_id": 4149, - "source_clan_id": 30785, - "target_clan_id": -27, - "__class__": "ClanBattleArmyChange" - }, - { - "army_id": 2078749, - "hitpoints": 2, - "hitpoint_change": -1, - "type": "ClanBattle/defender_defeated", - "timestamp": 1621188030, - "player_id": 8770396, - "sector_id": 3974, - "source_clan_id": 20227, - "target_clan_id": -27, - "__class__": "ClanBattleArmyChange" - }, - { - "type": "ClanBattle/sector_conquered", - "timestamp": 1621188030, - "player_id": 8770396, - "sector_id": 3974, - "source_clan_id": 20227, - "target_clan_id": -27, - "__class__": "ClanBattleSectorChange" - }, - { - "army_id": 2076945, - "hitpoints": 7, - "hitpoint_change": -1, - "type": "ClanBattle/defender_damaged", - "timestamp": 1621188030, - "player_id": 7457766, - "sector_id": 4098, - "source_clan_id": 11484, - "target_clan_id": 467, - "__class__": "ClanBattleArmyChange" - }, - { - "army_id": 2077831, - "hitpoints": 9, - "hitpoint_change": -1, - "type": "ClanBattle/defender_damaged", - "timestamp": 1621188030, - "player_id": 2960343, - "sector_id": 4037, - "source_clan_id": 9133, - "target_clan_id": 29538, - "__class__": "ClanBattleArmyChange" - }, - { - "army_id": 2077847, - "hitpoints": 2, - "hitpoint_change": -1, - "type": "ClanBattle/defender_damaged", - "timestamp": 1621188030, - "player_id": 423722, - "sector_id": 4019, - "source_clan_id": 9133, - "target_clan_id": 29538, - "__class__": "ClanBattleArmyChange" - }, - { - "army_id": 2077729, - "hitpoints": 16, - "hitpoint_change": -1, - "type": "ClanBattle/defender_damaged", - "timestamp": 1621188030, - "player_id": 512828, - "sector_id": 4018, - "source_clan_id": 9133, - "target_clan_id": 30549, - "__class__": "ClanBattleArmyChange" - }, - { - "army_id": 2078181, - "hitpoints": 3, - "hitpoint_change": -1, - "type": "ClanBattle/defender_damaged", - "timestamp": 1621188030, - "player_id": 807568, - "sector_id": 3956, - "source_clan_id": 9323, - "target_clan_id": -27, - "__class__": "ClanBattleArmyChange" - }, - { - "army_id": 2078846, - "hitpoints": 10, - "hitpoint_change": 10, - "type": "ClanBattle/siege_deployed", - "timestamp": 1621188031, - "player_id": 10083035, - "sector_id": 3927, - "source_clan_id": 20227, - "target_clan_id": -27, - "__class__": "ClanBattleArmyChange" - }, - { - "army_id": 2078839, - "hitpoints": 2, - "hitpoint_change": -1, - "type": "ClanBattle/siege_damaged", - "timestamp": 1621188031, - "player_id": 1371928, - "sector_id": 3956, - "source_clan_id": 20227, - "target_clan_id": 9323, - "__class__": "ClanBattleArmyChange" - }, - { - "army_id": 2076944, - "hitpoints": 8, - "hitpoint_change": -1, - "type": "ClanBattle/defender_damaged", - "timestamp": 1621188031, - "player_id": 587053, - "sector_id": 4031, - "source_clan_id": 1654, - "target_clan_id": 9323, - "__class__": "ClanBattleArmyChange" - }, - { - "army_id": 2076963, - "hitpoints": 4, - "hitpoint_change": -1, - "type": "ClanBattle/defender_damaged", - "timestamp": 1621188031, - "player_id": 2024164, - "sector_id": 4135, - "source_clan_id": 28563, - "target_clan_id": -27, - "__class__": "ClanBattleArmyChange" - }, - { - "army_id": 2077832, - "hitpoints": 8, - "hitpoint_change": -1, - "type": "ClanBattle/defender_damaged", - "timestamp": 1621188031, - "player_id": 8472982, - "sector_id": 4020, - "source_clan_id": 9133, - "target_clan_id": 29538, - "__class__": "ClanBattleArmyChange" - }, - { - "army_id": 2076945, - "hitpoints": 6, - "hitpoint_change": -1, - "type": "ClanBattle/defender_damaged", - "timestamp": 1621188031, - "player_id": 5687524, - "sector_id": 4098, - "source_clan_id": 11484, - "target_clan_id": 467, - "__class__": "ClanBattleArmyChange" - }, - { - "army_id": 2076945, - "type": "ClanBattle/defender_low_hp", - "timestamp": 1621188031, - "player_id": 5687524, - "sector_id": 4098, - "source_clan_id": 11484, - "target_clan_id": 467, - "__class__": "ClanBattleArmyChange" - }, - { - "army_id": 2077847, - "hitpoints": 1, - "hitpoint_change": -1, - "type": "ClanBattle/defender_damaged", - "timestamp": 1621188031, - "player_id": 1473126, - "sector_id": 4019, - "source_clan_id": 9133, - "target_clan_id": 29538, - "__class__": "ClanBattleArmyChange" - }, - { - "army_id": 2078839, - "hitpoints": 2, - "hitpoint_change": -1, - "type": "ClanBattle/siege_damaged", - "timestamp": 1621188032, - "player_id": 6183084, - "sector_id": 3956, - "source_clan_id": 20227, - "target_clan_id": 9323, - "__class__": "ClanBattleArmyChange" - }, - { - "army_id": 2077201, - "hitpoints": 9, - "hitpoint_change": -1, - "type": "ClanBattle/defender_damaged", - "timestamp": 1621188032, - "player_id": 587212, - "sector_id": 3993, - "source_clan_id": 1654, - "target_clan_id": 9323, - "__class__": "ClanBattleArmyChange" - }, - { - "army_id": 2078274, - "hitpoints": 16, - "hitpoint_change": -1, - "type": "ClanBattle/defender_damaged", - "timestamp": 1621188032, - "player_id": 585359, - "sector_id": 4111, - "source_clan_id": 467, - "target_clan_id": 6704, - "__class__": "ClanBattleArmyChange" - }, - { - "army_id": 2078274, - "type": "ClanBattle/defender_low_hp", - "timestamp": 1621188032, - "player_id": 585359, - "sector_id": 4111, - "source_clan_id": 467, - "target_clan_id": 6704, - "__class__": "ClanBattleArmyChange" - }, - { - "army_id": 2078611, - "hitpoints": 9, - "hitpoint_change": -1, - "type": "ClanBattle/defender_damaged", - "timestamp": 1621188032, - "player_id": 10071404, - "sector_id": 3927, - "source_clan_id": 20227, - "target_clan_id": -27, - "__class__": "ClanBattleArmyChange" - }, - { - "army_id": 2076874, - "hitpoints": 7, - "hitpoint_change": -1, - "type": "ClanBattle/defender_damaged", - "timestamp": 1621188032, - "player_id": 5933688, - "sector_id": 4110, - "source_clan_id": 11484, - "target_clan_id": 25179, - "__class__": "ClanBattleArmyChange" - }, - { - "army_id": 2076929, - "hitpoints": 9, - "hitpoint_change": -1, - "type": "ClanBattle/defender_damaged", - "timestamp": 1621188032, - "player_id": 7458293, - "sector_id": 4149, - "source_clan_id": 30785, - "target_clan_id": -27, - "__class__": "ClanBattleArmyChange" - }, - { - "army_id": 2078181, - "hitpoints": 2, - "hitpoint_change": -1, - "type": "ClanBattle/defender_damaged", - "timestamp": 1621188032, - "player_id": 807568, - "sector_id": 3956, - "source_clan_id": 9323, - "target_clan_id": -27, - "__class__": "ClanBattleArmyChange" - }, - { - "army_id": 2078004, - "hitpoints": 1, - "hitpoint_change": -1, - "type": "ClanBattle/defender_damaged", - "timestamp": 1621188032, - "player_id": 800794, - "sector_id": 4066, - "source_clan_id": 9323, - "target_clan_id": 27272, - "__class__": "ClanBattleArmyChange" - }, - { - "army_id": 2076874, - "hitpoints": 6, - "hitpoint_change": -1, - "type": "ClanBattle/defender_damaged", - "timestamp": 1621188032, - "player_id": 803214, - "sector_id": 4110, - "source_clan_id": 11484, - "target_clan_id": 25179, - "__class__": "ClanBattleArmyChange" - }, - { - "army_id": 2076874, - "type": "ClanBattle/defender_low_hp", - "timestamp": 1621188032, - "player_id": 803214, - "sector_id": 4110, - "source_clan_id": 11484, - "target_clan_id": 25179, - "__class__": "ClanBattleArmyChange" - }, - { - "army_id": 2077831, - "hitpoints": 8, - "hitpoint_change": -1, - "type": "ClanBattle/defender_damaged", - "timestamp": 1621188032, - "player_id": 8404356, - "sector_id": 4037, - "source_clan_id": 9133, - "target_clan_id": 29538, - "__class__": "ClanBattleArmyChange" - }, - { - "army_id": 2078839, - "hitpoints": 1, - "hitpoint_change": -1, - "type": "ClanBattle/siege_damaged", - "timestamp": 1621188032, - "player_id": 8770396, - "sector_id": 3956, - "source_clan_id": 20227, - "target_clan_id": 9323, - "__class__": "ClanBattleArmyChange" - }, - { - "army_id": 2078839, - "type": "ClanBattle/siege_low_hp", - "timestamp": 1621188032, - "player_id": 8770396, - "sector_id": 3956, - "source_clan_id": 20227, - "target_clan_id": 9323, - "__class__": "ClanBattleArmyChange" - }, - ], + DummyData: [], + + testData: () => { + GvGLog.DummyData.forEach(function (data) { + GvGLog.addEntry(data); + }); + }, addEntry: (response) => { if (response != undefined) { let type = response.type.replace('ClanBattle/',''); - if (response.__class__ == "ClanBattleArmyChange" && type != "defender_low_hp" && type != "siege_low_hp") { - entry = { - type: type, - timestamp: response.timestamp, - sectorId: response.sector_id, - sourceClan: response.source_clan_id, - targetClan: response.target_clan_id, - hitpoints: response.hitpoints + let entry = { + class: response.__class__, + sectorId: response.sector_id, + timestamp: response.timestamp, + type: type, + sourceClan: response.source_clan_id, + targetClan: response.target_clan_id, + details: {}, + }; + if (response.__class__ == "ClanBattleArmyChange") { + entry.details = { + hitpoints: response.hitpoints, + playerId: (response.source_clan_id == GvGMap.OwnGuild.Id) ? response.player_id : 0 + } + } + else if (response.__class__ == "ClanBattleSectorChange") { // sector_independence_granted, sector_conquered, sector_slot_unlocked + entry.details = { + playerId: (response.source_clan_id == GvGMap.OwnGuild.Id) ? response.player_id : 0 + } + } + else if (response.__class__ == "ClanBattleBuildingChange") { // headquarter_placed + entry.details = { + nextRelocate: response.building.next_relocate } } - if (entry != null) + if (entry.details != {} && type != "defender_low_hp" && type != "siege_low_hp") { GvGLog.Entries.push(entry); - //GvGLog.Entries.push(response); + return entry; + } } + return undefined; }, - testData: () => { - let entry = null; - GvGLog.DummyData.forEach(function (data) { - let type = data.type.replace('ClanBattle/',''); - if (data.__class__ == "ClanBattleArmyChange" && type != "defender_low_hp" && type != "siege_low_hp") { - entry = { - type: type, - timestamp: data.timestamp, - sectorId: data.sector_id, - sourceClan: data.source_clan_id, - targetClan: data.target_clan_id, - hitpoints: data.hitpoints - } - } - if (entry != null) - GvGLog.Entries.push(entry); + showEntry: (entry) => { + let tr = GvGLog.buildEntry(entry); + $('#GvGMap').find('#gvgmaplog').promise().done(function() { + $('#GvGlog').append(tr); }); }, + buildEntry: (entry) => { + let t = []; + let sector = MapSector.findById(entry.sectorId); + if (sector != undefined) { // if sector is on map + let sectorCoords = MapSector.coords(sector); + t.push(''); + t.push(''+sectorCoords+'
'+moment.unix(entry.timestamp).format('HH:mm:ss')+''); + t.push(''); + if (entry.sourceClan != entry.targetClan && entry.targetClan != undefined && entry.sourceClan != undefined) + t.push(GvGMap.showGuildFlagAndName(entry.sourceClan) +' → '+ GvGMap.showGuildFlagAndName(entry.targetClan)); + else if (entry.sourceClan != undefined) + t.push(GvGMap.showGuildFlagAndName(entry.sourceClan)); + t.push('
'+i18n('Boxes.GvGMap.Log.'+entry.type)); + if (entry.details.playerId != undefined) { + if (entry.details.playerId > 0) { + let memberName = GvGMap.OwnGuild.Members.find(x => x.player_id === entry.details.playerId).name; + t.push(', '+memberName); + } + } + //t.push(', HP: '+entry.hitpoints); + t.push(''); + t.push(''); + } + return t.join(''); + }, + show: () => { let t = []; - + t.push(''); t.push(''); t.push(''); t.push(''); @@ -3878,33 +812,17 @@ let GvGLog = { t.push(''); GvGLog.Entries.forEach(function(entry) { - let sector = MapSector.findById(entry.sectorId); - if (sector != undefined) { // if sector is on map - let sectorCoords = MapSector.coords(sector); - let targetClan = (GvGMap.findGuildById(entry.targetClan) != undefined) ? GvGMap.findGuildById(entry.targetClan).name : "NPC"; - let sourceClan = (GvGMap.findGuildById(entry.sourceClan) != undefined) ? GvGMap.findGuildById(entry.sourceClan).name : "Unbekannte Gilde"; - t.push(''); - t.push(''); - t.push(''); - t.push(''); - } + let tr = GvGLog.buildEntry(entry); + t.push(tr); }); t.push('
Sector
'+sectorCoords+'
'+moment.unix(entry.timestamp).format('HH:mm:ss')+'
'); - if (entry.sourceClan != entry.targetClan && entry.targetClan != undefined && entry.sourceClan != undefined) - t.push(sourceClan +' → '+ targetClan); - else if (sourceClan != undefined) - t.push(sourceClan); - t.push('
'+entry.type); - //t.push(', HP: '+entry.hitpoints); - t.push('
'); GvGMap.SetTabContent('gvgmaplog', t.join('')); - } + }, } let MapSector = { create: (x, y, info) => { - //console.log(info.sector_id, info.terrain); let sector = { id: info.sector_id, position: { @@ -3948,11 +866,9 @@ let MapSector = { let color = {}; if (sector.terrain == "beach") { color = {"r":233,"g":233,"b":114-(parseInt(sector.power)+1)*10}; - console.log('beach', color); } else if (sector.terrain == "plain") { color = {"r":126-(parseInt(sector.power)+1)*10,"g":222-(parseInt(sector.power)+1)*10,"b":110-(parseInt(sector.power)+1)*10}; - console.log('plain', color); } else { if (sector.terrain == "rocks") From d1285fd4d3e0c06975e92424f02fed75067ca851 Mon Sep 17 00:00:00 2001 From: outoftheline Date: Mon, 17 May 2021 18:19:09 +0200 Subject: [PATCH 2/9] GvG Map Edit Bugfixes Added "no Guild" Button Removed Building Information on redraw --- js/web/_i18n/de.json | 2 +- js/web/_i18n/en.json | 2 +- js/web/gvg/css/gvg.css | 15 +++++++ js/web/gvg/js/gvg.js | 97 ++++++++++++++++++++---------------------- 4 files changed, 62 insertions(+), 54 deletions(-) diff --git a/js/web/_i18n/de.json b/js/web/_i18n/de.json index d3f1e2aaf..6191b0579 100644 --- a/js/web/_i18n/de.json +++ b/js/web/_i18n/de.json @@ -701,7 +701,7 @@ "Eras.8": "Industriezeitalter", "Eras.9": "Jahrhundertwende", "Global.BoxTitle": "FoE Helfer", - "GvG.Independences.Tooltip": "Anzahl der Sektorfreigaben und selbst gestellten Belagerungen seit der letzten Abrechnung.", + "GvG.Independences.Tooltip": "Anzahl der Sektorfreigaben seit der letzten Abrechnung.", "GvG.Independences.Tooltip.Warning": "Kann ungenau sein, wenn du an mehreren Desktop-Geräten spielst.", "HiddenRewards.Positions.cityRoadBig": "zweispurige Strasse", "HiddenRewards.Positions.cityRoadSmall": "einspurige Strasse", diff --git a/js/web/_i18n/en.json b/js/web/_i18n/en.json index e7aa60563..572bd8bf5 100644 --- a/js/web/_i18n/en.json +++ b/js/web/_i18n/en.json @@ -694,7 +694,7 @@ "Eras.8": "Industrial Age", "Eras.9": "Progressive Era", "Global.BoxTitle": "FoE Helper", - "GvG.Independences.Tooltip": "Amount of Independences granted and sieges you placed yourself since last calculation.", + "GvG.Independences.Tooltip": "Amount of Independences granted since last calculation.", "GvG.Independences.Tooltip.Warning": "Can be inaccurate, if you play on multiple desktop devices.", "HiddenRewards.Positions.cityRoadBig": "2-lane Road", "HiddenRewards.Positions.cityRoadSmall": "Single-lane Road", diff --git a/js/web/gvg/css/gvg.css b/js/web/gvg/css/gvg.css index 28d95c4d0..8c08293fb 100644 --- a/js/web/gvg/css/gvg.css +++ b/js/web/gvg/css/gvg.css @@ -104,6 +104,20 @@ z-index: 100; } +#noGuild.btn-inset { + background: linear-gradient(to top, rgb(183,112,55) 0%,rgb(176,96,38) 1%,rgb(145,72,30) 30%,rgb(130,62,24) 99%,rgb(176,104,50) 100%); + padding: 0.2rem; +} + +#noGuild::before { + background: #fff; + content: ''; + width: 18px; + height: 18px; + display: inline-block; + border-radius: 10px; +} + #GvGlog { font-size: 90%; } @@ -122,6 +136,7 @@ background-color: #210b02; width: 200px; font-size: 90%; + z-index: 101; } .sectorInfo .guildflag { diff --git a/js/web/gvg/js/gvg.js b/js/web/gvg/js/gvg.js index 9795eefc1..69466e4a3 100644 --- a/js/web/gvg/js/gvg.js +++ b/js/web/gvg/js/gvg.js @@ -82,7 +82,7 @@ let GvG = { }); $('body').append(div).promise().done(function() { - div.append('
'+GvG.Actions.Independences+'/4
'+GvG.Actions.Sieges+'
'+GvG.Actions.Defenders+'
') + div.append('
'+GvG.Actions.Independences+'/4
') .attr('title', i18n('GvG.Independences.Tooltip') + '
' + i18n('GvG.Independences.Tooltip.Warning') + '') .tooltip( { @@ -97,8 +97,6 @@ let GvG = { } else { $('#gvg-hud .independences').text(GvG.Actions.Independences+'/4'); - $('#gvg-hud .sieges').text(GvG.Actions.Sieges); - $('#gvg-hud .defenders').text(GvG.Actions.Defenders); } }, @@ -211,7 +209,6 @@ let GvGMap = { Id: 0, Members: [], }, - Actions: { edit: false, drag: true @@ -220,7 +217,6 @@ let GvGMap = { id: 0 }, PowerValues: [], - Colors: { "blank": [{"r":240,"g":240,"b":240}], "b": [ @@ -289,7 +285,6 @@ let GvGMap = { /** * Merkt sich alle Tabs - * * @param id */ SetTabs: (id)=> { @@ -298,7 +293,6 @@ let GvGMap = { /** * Gibt alle gemerkten Tabs aus - * * @returns {string} */ GetTabs: ()=> { @@ -307,7 +301,6 @@ let GvGMap = { /** * Speichert BoxContent zwischen - * * @param id * @param content */ @@ -320,14 +313,13 @@ let GvGMap = { /** * Setzt alle gespeicherten Tabellen zusammen - * * @returns {string} */ GetTabContent: ()=> { return GvGMap.TabsContent.join(''); }, - initMap: (hexWidth, hexHeight) => { + initMap: (hexWidth, hexHeight, initial = true) => { GvGMap.Canvas = document.getElementById("gvg-map"); GvGMap.CanvasCTX = GvGMap.Canvas.getContext('2d'); GvGMap.Map.Guilds = []; @@ -350,7 +342,7 @@ let GvGMap = { }, /** - * Build GvG Map + * Show GvG Map */ showMap: () => { if ($('#gvg-map').length == 0) { @@ -359,7 +351,7 @@ let GvGMap = { HTML.Box({ id: 'GvGMap', - title: i18n('Boxes.GvGMap.Title')+ 'BETA!', + title: i18n('Boxes.GvGMap.Title')+ ' BETA!', auto_close: true, dragdrop: true, minimize: true, @@ -370,7 +362,10 @@ let GvGMap = { } }, - buildMap: (mapSize = 'small') => { + /** + * Build GvG Map + */ + buildMap: (mapSize = 'small', initial = true) => { GvGMap.Tabs = []; GvGMap.TabsContent = []; @@ -381,6 +376,7 @@ let GvGMap = { h.push('
'); h.push('
'); h.push(''+i18n('Boxes.GvGMap.Action.Edit')+''); + h.push(''); h.push(''+i18n('Boxes.GvGMap.Action.Zoom')+''); h.push(''+i18n('Boxes.GvGMap.Action.Drag')+''); h.push('
'); @@ -390,37 +386,40 @@ let GvGMap = { $('#GvGMapBody').html(h.join('')); - GvGMap.populateCanvas(mapSize); + GvGMap.populateCanvas(mapSize, initial); GvGMap.drawInfo(); GvGMap.showGuilds(); - //GvGLog.testData(); GvGLog.show(); let editBtn = document.getElementById("editMap"); let dragBtn = document.getElementById("dragMap"); let zoomBtn = document.getElementById("zoomMap"); + let noGuildBtn = document.getElementById("noGuild"); editBtn.addEventListener('click', function (e) { GvGMap.Actions.edit = true; GvGMap.Actions.drag = false; dragBtn.classList.remove('btn-default-active'); editBtn.classList.add('btn-default-active'); + noGuildBtn.style.display = 'block'; }, false); dragBtn.addEventListener('click', function (e) { GvGMap.Actions.edit = false; GvGMap.Actions.drag = true; editBtn.classList.remove('btn-default-active'); dragBtn.classList.add('btn-default-active'); + noGuildBtn.style.display = 'none'; }, false); zoomBtn.addEventListener('click', function (e) { if (GvGMap.Size == 'small') - GvGMap.buildMap('big'); + GvGMap.buildMap('big', false); else - GvGMap.buildMap(); + GvGMap.buildMap('small', false); + }, false); + noGuildBtn.addEventListener('click', function (e) { + GvGMap.CurrentGuild = { id: 0 }; }, false); - - GvGMap.setCurrentGuild(); // todo: is broken GvGMap.mapDragOrEdit(); t.push('
'); @@ -429,6 +428,16 @@ let GvGMap = { t.push('
'); $('#gvgOptions').html(t.join('')); + + $('#GvGGuilds tr').click(function (e) { + let id = $(this).attr('id').replace('id-', '')/1; + $('#GvGGuilds tr').removeClass('active'); + $(this).addClass('active'); + + GvGMap.CurrentGuild = GvGMap.Map.Guilds.find(x => x.id === id); + console.log(GvGMap.CurrentGuild); + }); + $('#GvGMap').find('#gvgmaplog').promise().done(function() { $('.gvg-tabs').tabslet({active: 1}); $('.gvg-tabs .gvgmapguilds span').text(i18n('Boxes.GvGMap.Guild.Name')); @@ -451,11 +460,11 @@ let GvGMap = { }); }, - populateCanvas: (mapSize) => { + populateCanvas: (mapSize, initial) => { if (mapSize != 'small') - GvGMap.initMap(90,72); + GvGMap.initMap(90,72,initial); else - GvGMap.initMap(50,40); + GvGMap.initMap(50,40,initial); $(GvGMap.Canvas).attr({ 'id': 'gvg-map', @@ -515,16 +524,6 @@ let GvGMap = { GvGMap.CanvasCTX.fillText('Data fetched: '+ moment(GvGMap.Map.OnloadDataTime).format('D.M.YY - HH:mm:ss'), 10, 45); }, - setCurrentGuild: () => { - $('#GvGGuilds tr').click(function (e) { - let id = $(this).attr('id').replace('id-', '')/1; - $('#GvGGuilds tr').removeClass('active'); - $(this).addClass('active'); - - GvGMap.CurrentGuild = GvGMap.Map.Guilds.find(x => x.id === id); - }); - }, - findGuildById: (id) => { return GvGMap.Map.Guilds.find(x => x.id === id); }, @@ -579,14 +578,15 @@ let GvGMap = { if (GvGMap.Actions.drag) { GvGMap.showSector(sector); } - else { + else { // edit let prevOwner = sector.owner; sector.owner = GvGMap.CurrentGuild; - console.log(sector.owner); - if (sector.owner.id <= 0) + if (sector.owner.id <= 0) { + console.log('hallo'); sector.owner.color = MapSector.setColorByTerrain(sector); + } if (sector.terrain == "plain" || sector.terrain == "beach") { - MapSector.draw(sector); + MapSector.draw(sector, true); } GvGMap.recalcGuildProvinces(prevOwner, sector.owner, sector); } @@ -865,10 +865,10 @@ let MapSector = { setColorByTerrain: (sector) => { let color = {}; if (sector.terrain == "beach") { - color = {"r":233,"g":233,"b":114-(parseInt(sector.power)+1)*10}; + color = {"r":233,"g":233,"b":114-(parseInt(sector.powerMultiplicator)+1)*10}; } else if (sector.terrain == "plain") { - color = {"r":126-(parseInt(sector.power)+1)*10,"g":222-(parseInt(sector.power)+1)*10,"b":110-(parseInt(sector.power)+1)*10}; + color = {"r":126-(parseInt(sector.powerMultiplicator)+1)*10,"g":222-(parseInt(sector.powerMultiplicator)+1)*10,"b":110-(parseInt(sector.powerMultiplicator)+1)*10}; } else { if (sector.terrain == "rocks") @@ -882,7 +882,7 @@ let MapSector = { /** * Draws a sector on the map + flag and HQ/status if it has an owner */ - draw: (sector) => { + draw: (sector, redraw = false) => { MapSector.drawHex(sector); MapSector.drawHexText(sector); if (sector.owner.id > 0) { @@ -907,11 +907,12 @@ let MapSector = { } img.onload = function () { - if (sector.headquarter) - GvGMap.CanvasCTX.drawImage(img, imgPositions.hqX, imgPositions.hqY, GvGMap.Map.HexWidth, GvGMap.Map.HexHeight, sector.position.x, sector.position.y, GvGMap.Map.HexWidth, GvGMap.Map.HexHeight); - if (sector.isProtected) - GvGMap.CanvasCTX.drawImage(img, imgPositions.shieldX, imgPositions.shieldY, GvGMap.Map.HexWidth, GvGMap.Map.HexHeight, sector.position.x, sector.position.y, GvGMap.Map.HexWidth, GvGMap.Map.HexHeight); - + if (!redraw) { + if (sector.headquarter) + GvGMap.CanvasCTX.drawImage(img, imgPositions.hqX, imgPositions.hqY, GvGMap.Map.HexWidth, GvGMap.Map.HexHeight, sector.position.x, sector.position.y, GvGMap.Map.HexWidth, GvGMap.Map.HexHeight); + if (sector.isProtected) + GvGMap.CanvasCTX.drawImage(img, imgPositions.shieldX, imgPositions.shieldY, GvGMap.Map.HexWidth, GvGMap.Map.HexHeight, sector.position.x, sector.position.y, GvGMap.Map.HexWidth, GvGMap.Map.HexHeight); + } if (GvGMap.Size != 'small') { GvGMap.CanvasCTX.drawImage(img, flag.x, flag.y, GvGMap.Map.HexWidth, GvGMap.Map.HexHeight, sector.position.x, sector.position.y, GvGMap.Map.HexWidth, GvGMap.Map.HexHeight); } @@ -922,14 +923,6 @@ let MapSector = { } }, - /** - * Redraw - */ - redraw: (sector) => { - MapSector.drawHex(sector); - MapSector.drawHexText(sector); - }, - /** * Draws Sector hexagon in its owners color */ From ed6ce102e940cae93af38b106e812a5809e48970 Mon Sep 17 00:00:00 2001 From: outoftheline Date: Mon, 17 May 2021 18:32:08 +0200 Subject: [PATCH 3/9] GvG Log Entry Order switched (newest first) --- js/web/gvg/js/gvg.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/js/web/gvg/js/gvg.js b/js/web/gvg/js/gvg.js index 69466e4a3..cb84e469b 100644 --- a/js/web/gvg/js/gvg.js +++ b/js/web/gvg/js/gvg.js @@ -762,7 +762,7 @@ let GvGLog = { } } if (entry.details != {} && type != "defender_low_hp" && type != "siege_low_hp") { - GvGLog.Entries.push(entry); + GvGLog.Entries.unshift(entry); return entry; } } @@ -772,7 +772,7 @@ let GvGLog = { showEntry: (entry) => { let tr = GvGLog.buildEntry(entry); $('#GvGMap').find('#gvgmaplog').promise().done(function() { - $('#GvGlog').append(tr); + $('#GvGlog').prepend(tr); }); }, From 75d137d3784cd3dc6f47d7aecddf99d846b2e2ca Mon Sep 17 00:00:00 2001 From: outoftheline Date: Mon, 17 May 2021 20:57:14 +0200 Subject: [PATCH 4/9] GvG Map Color Fix --- js/web/gvg/js/gvg.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/js/web/gvg/js/gvg.js b/js/web/gvg/js/gvg.js index cb84e469b..156f58e9f 100644 --- a/js/web/gvg/js/gvg.js +++ b/js/web/gvg/js/gvg.js @@ -582,7 +582,6 @@ let GvGMap = { let prevOwner = sector.owner; sector.owner = GvGMap.CurrentGuild; if (sector.owner.id <= 0) { - console.log('hallo'); sector.owner.color = MapSector.setColorByTerrain(sector); } if (sector.terrain == "plain" || sector.terrain == "beach") { @@ -734,7 +733,7 @@ let GvGLog = { }, addEntry: (response) => { - if (response != undefined) { + if (response != undefined && response.type != undefined) { let type = response.type.replace('ClanBattle/',''); let entry = { class: response.__class__, @@ -761,7 +760,7 @@ let GvGLog = { nextRelocate: response.building.next_relocate } } - if (entry.details != {} && type != "defender_low_hp" && type != "siege_low_hp") { + if (entry.details != {} && type != "defender_low_hp" && type != "siege_low_hp" && type != "sector_fog_changed") { GvGLog.Entries.unshift(entry); return entry; } @@ -863,12 +862,13 @@ let MapSector = { }, setColorByTerrain: (sector) => { + let powerMultiplicator = sector.powerMultiplicator || 1; let color = {}; if (sector.terrain == "beach") { - color = {"r":233,"g":233,"b":114-(parseInt(sector.powerMultiplicator)+1)*10}; + color = {"r":233,"g":233,"b":114-(parseInt(powerMultiplicator)+1)*10}; } else if (sector.terrain == "plain") { - color = {"r":126-(parseInt(sector.powerMultiplicator)+1)*10,"g":222-(parseInt(sector.powerMultiplicator)+1)*10,"b":110-(parseInt(sector.powerMultiplicator)+1)*10}; + color = {"r":126-(parseInt(powerMultiplicator)+1)*10,"g":222-(parseInt(powerMultiplicator)+1)*10,"b":110-(parseInt(powerMultiplicator)+1)*10}; } else { if (sector.terrain == "rocks") @@ -927,6 +927,8 @@ let MapSector = { * Draws Sector hexagon in its owners color */ drawHex: (sector) => { + if (sector.owner.id <= 0) + console.log(sector.owner, sector.terrain); GvGMap.CanvasCTX.fillStyle = GvGMap.colorToString(sector.owner.color); GvGMap.CanvasCTX.beginPath(); GvGMap.CanvasCTX.moveTo(sector.position.x + GvGMap.Map.HexWidth / 2, sector.position.y); From f52346d4e66dab880b2f1b4fd62c9eff17e99884 Mon Sep 17 00:00:00 2001 From: outoftheline Date: Mon, 17 May 2021 22:40:32 +0200 Subject: [PATCH 5/9] GvG Map Sizing Change --- js/web/_i18n/de.json | 1 + js/web/_i18n/en.json | 1 + js/web/gvg/css/gvg.css | 6 +++--- js/web/gvg/js/gvg.js | 9 +++++---- 4 files changed, 10 insertions(+), 7 deletions(-) diff --git a/js/web/_i18n/de.json b/js/web/_i18n/de.json index 6191b0579..39253bcb4 100644 --- a/js/web/_i18n/de.json +++ b/js/web/_i18n/de.json @@ -293,6 +293,7 @@ "Boxes.GvGMap.Guild.Power": "Macht", "Boxes.GvGMap.Guild.Sectors": "Sektoren", "Boxes.GvGMap.Log": "Protokoll", + "Boxes.GvGMap.Log.clan_defeated": "Gilde besiegt", "Boxes.GvGMap.Log.defender_damaged": "VA angeschlagen", "Boxes.GvGMap.Log.defender_defeated": "VA vernichtet", "Boxes.GvGMap.Log.defender_deployed": "VA gestellt", diff --git a/js/web/_i18n/en.json b/js/web/_i18n/en.json index 572bd8bf5..dd2f3ee5e 100644 --- a/js/web/_i18n/en.json +++ b/js/web/_i18n/en.json @@ -286,6 +286,7 @@ "Boxes.GvGMap.Guild.Power": "Power", "Boxes.GvGMap.Guild.Sectors": "Sectors", "Boxes.GvGMap.Log": "Log", + "Boxes.GvGMap.Log.clan_defeated": "Clan defeated", "Boxes.GvGMap.Log.defender_damaged": "Defender damaged", "Boxes.GvGMap.Log.defender_defeated": "Defender defeated", "Boxes.GvGMap.Log.defender_deployed": "Defender deployed", diff --git a/js/web/gvg/css/gvg.css b/js/web/gvg/css/gvg.css index 8c08293fb..76241e48f 100644 --- a/js/web/gvg/css/gvg.css +++ b/js/web/gvg/css/gvg.css @@ -73,10 +73,10 @@ height: inherit; display: flex; align-items: stretch; + overflow: hidden; } #GvGMapWrap { - width: 80%; height: inherit; overflow: auto; background-color: #111213; @@ -88,7 +88,7 @@ #gvgOptions { height: inherit; overflow: auto; - width: 350px; + min-width: 300px; } #GvGMapInfo { @@ -100,7 +100,7 @@ #GvGMapActions { position: absolute; top: 10px; - right: 360px; + right: 310px; z-index: 100; } diff --git a/js/web/gvg/js/gvg.js b/js/web/gvg/js/gvg.js index 156f58e9f..50c61e6cc 100644 --- a/js/web/gvg/js/gvg.js +++ b/js/web/gvg/js/gvg.js @@ -373,16 +373,17 @@ let GvGMap = { GvGMap.SetTabs('gvgmaplog'); let h = [], t = []; - h.push('
'); - h.push('
'); + h.push('
'); + h.push('
'); h.push(''+i18n('Boxes.GvGMap.Action.Edit')+''); h.push(''); h.push(''+i18n('Boxes.GvGMap.Action.Zoom')+''); h.push(''+i18n('Boxes.GvGMap.Action.Drag')+''); h.push('
'); - h.push('
'); - h.push('
'); + h.push('
'); + h.push(''); h.push('
'); + h.push('
'); $('#GvGMapBody').html(h.join('')); From dffef758b63568b3526453d4f5dec78bdfa47aec Mon Sep 17 00:00:00 2001 From: outoftheline Date: Mon, 17 May 2021 23:44:16 +0200 Subject: [PATCH 6/9] GvG Map - More Colors, Polishing --- js/web/gvg/css/gvg.css | 27 ++++++++++++++---- js/web/gvg/js/gvg.js | 64 ++++++++++++++++++++++++------------------ 2 files changed, 58 insertions(+), 33 deletions(-) diff --git a/js/web/gvg/css/gvg.css b/js/web/gvg/css/gvg.css index 76241e48f..62e507619 100644 --- a/js/web/gvg/css/gvg.css +++ b/js/web/gvg/css/gvg.css @@ -74,6 +74,20 @@ display: flex; align-items: stretch; overflow: hidden; + justify-content: space-between; +} + +#GvGMapContent { + height: inherit; + overflow: auto; + overflow: hidden; + position: relative; +} + +#GvGMapMeta { + position: relative; + height: 40px; + overflow: hidden; } #GvGMapWrap { @@ -89,6 +103,7 @@ height: inherit; overflow: auto; min-width: 300px; + flex-grow: 2; } #GvGMapInfo { @@ -98,10 +113,10 @@ } #GvGMapActions { - position: absolute; - top: 10px; - right: 310px; z-index: 100; + position: absolute; + left: 7px; + top: 7px; } #noGuild.btn-inset { @@ -184,11 +199,11 @@ .guildflag.flag_11, .guildflag.flag_11_G { background-position: -57px -45px; } .guildflag.flag_12 { background-position: -102px -44px; } .guildflag.flag_13 { background-position: -148px -45px; } -.guildflag.flag_14 { background-position: -193px -45px; } +.guildflag.flag_14, .guildflag.flag_14_R { background-position: -193px -45px; } .guildflag.flag_15 { background-position: -237px -45px; } .guildflag.flag_16, .guildflag.flag_16_G { background-position: -282px -45px; } -.guildflag.flag_17 { background-position: -327px -45px; } -.guildflag.flag_18 { background-position: -372px -46px; } +.guildflag.flag_17, .guildflag.flag_17_G { background-position: -327px -45px; } +.guildflag.flag_18, .guildflag.flag_18_R { background-position: -372px -46px; } .guildflag.flag_19 { background-position: -418px -45px; } .guildflag.flag_20, .guildflag.flag_20_R { background-position: -13px -81px; } diff --git a/js/web/gvg/js/gvg.js b/js/web/gvg/js/gvg.js index 50c61e6cc..3dd6eccc0 100644 --- a/js/web/gvg/js/gvg.js +++ b/js/web/gvg/js/gvg.js @@ -250,7 +250,7 @@ let GvGMap = { {"r":210,"g":61,"b":89} ], "g": [ - {"r":0,"g":220,"b":0}, + {"r":162,"g":185,"b":12}, {"r":50,"g":200,"b":70}, {"r":0,"g":180,"b":0}, {"r":50,"g":160,"b":70}, @@ -265,19 +265,20 @@ let GvGMap = { {"r":50,"g":200,"b":80} ], "premium": [ - {"r":2,"g":2,"b":2}, - {"r":36,"g":76,"b":32}, - {"r":13,"g":43,"b":70}, - {"r":14,"g":77,"b":86}, - {"r":79,"g":26,"b":126}, - {"r":100,"g":63,"b":33}, - {"r":232,"g":189,"b":64}, - {"r":35,"g":60,"b":30}, - {"r":93,"g":100,"b":104}, - {"r":80,"g":70,"b":97}, - {"r":61,"g":13,"b":13}, - {"r":56,"g":81,"b":16}, - {"r":210,"g":150,"b":21}] + [{"r":2,"g":2,"b":2},{"r":30,"g":30,"b":30},{"r":60,"g":10,"b":10},{"r":100,"g":20,"b":50}], + [{"r":36,"g":76,"b":32},{"r":36,"g":106,"b":32},{"r":10,"g":76,"b":10},{"r":0,"g":27,"b":82}], + [{"r":13,"g":43,"b":70},{"r":10,"g":10,"b":10},{"r":0,"g":0,"b":50},{"r":10,"g":10,"b":30}], + [{"r":14,"g":77,"b":86},{"r":14,"g":77,"b":86},{"r":14,"g":77,"b":86},{"r":14,"g":77,"b":86}], + [{"r":79,"g":26,"b":126},{"r":40,"g":10,"b":50},{"r":43,"g":14,"b":78},{"r":60,"g":16,"b":110}], + [{"r":100,"g":63,"b":33},{"r":80,"g":43,"b":13},{"r":120,"g":83,"b":53},{"r":50,"g":10,"b":0}], + [{"r":232,"g":189,"b":64},{"r":210,"g":150,"b":21},{"r":232,"g":189,"b":64},{"r":232,"g":189,"b":64}], + [{"r":35,"g":60,"b":30},{"r":36,"g":76,"b":32},{"r":35,"g":60,"b":30},{"r":35,"g":60,"b":30}], + [{"r":44,"g":57,"b":64},{"r":28,"g":35,"b":39},{"r":30,"g":10,"b":50},{"r":47,"g":20,"b":41}], + [{"r":80,"g":70,"b":97},{"r":80,"g":70,"b":97},{"r":80,"g":70,"b":97},{"r":80,"g":70,"b":97}], + [{"r":61,"g":13,"b":13},{"r":120,"g":40,"b":0},{"r":50,"g":10,"b":1},{"r":61,"g":13,"b":13}], + [{"r":56,"g":81,"b":16},{"r":56,"g":81,"b":16},{"r":56,"g":81,"b":16},{"r":56,"g":81,"b":16}], + [{"r":210,"g":150,"b":21},{"r":210,"g":150,"b":21},{"r":210,"g":150,"b":21},{"r":210,"g":150,"b":21}] + ] }, Tabs: [], @@ -351,7 +352,7 @@ let GvGMap = { HTML.Box({ id: 'GvGMap', - title: i18n('Boxes.GvGMap.Title')+ ' BETA!', + title: i18n('Boxes.GvGMap.Title')+ ' - BETA!', auto_close: true, dragdrop: true, minimize: true, @@ -373,16 +374,21 @@ let GvGMap = { GvGMap.SetTabs('gvgmaplog'); let h = [], t = []; - h.push('
'); - h.push('
'); - h.push(''+i18n('Boxes.GvGMap.Action.Edit')+''); - h.push(''); - h.push(''+i18n('Boxes.GvGMap.Action.Zoom')+''); - h.push(''+i18n('Boxes.GvGMap.Action.Drag')+''); - h.push('
'); - h.push('
'); - h.push(''); + h.push('
'); + h.push('
'); + h.push('
'); + h.push(''+i18n('Boxes.GvGMap.Action.Edit')+''); + h.push(''); + h.push(''+i18n('Boxes.GvGMap.Action.Zoom')+''); + h.push(''+i18n('Boxes.GvGMap.Action.Drag')+''); + h.push('
'); + h.push('
'); + h.push('
'); + h.push(''); + h.push('
'); h.push('
'); + h.push('
'); + //h.push('Toggle'); h.push('
'); $('#GvGMapBody').html(h.join('')); @@ -677,7 +683,8 @@ let GvGMap = { if (flag != null) { if (flag[0].search("premium") >= 0) { - color = GvGMap.Colors.premium[flag[flag.length-1]-1]; + //color = GvGMap.Colors.premium[flag[flag.length-1]-1]; + color = GvGMap.Colors.premium[flag[flag.length-1]-1][Math.round(guild.id/4)%4]; } else if (flag[flag.length - 1].toLowerCase() == "r") { color = GvGMap.Colors.r[Math.round(guild.id/13)%13]; @@ -755,6 +762,9 @@ let GvGLog = { entry.details = { playerId: (response.source_clan_id == GvGMap.OwnGuild.Id) ? response.player_id : 0 } + if (entry.type == "sector_slot_unlocked" && entry.sourceClan != GvGMap.OwnGuild.Id) { + entry.details = {}; + } } else if (response.__class__ == "ClanBattleBuildingChange") { // headquarter_placed entry.details = { @@ -804,7 +814,7 @@ let GvGLog = { show: () => { let t = []; - t.push(''); + t.push('
'); t.push(''); t.push(''); t.push(''); @@ -952,7 +962,7 @@ let MapSector = { if (GvGMap.Size == 'big') GvGMap.CanvasCTX.font = "12px Arial"; GvGMap.CanvasCTX.textAlign = "center"; - GvGMap.CanvasCTX.fillStyle = ((sector.owner.color.r+sector.owner.color.g+sector.owner.color.b) < 300) ? '#ddd' : '#222'; + GvGMap.CanvasCTX.fillStyle = ((sector.owner.color.r+sector.owner.color.g+sector.owner.color.b) < 350) ? '#ddd' : '#222'; GvGMap.CanvasCTX.fillText(MapSector.coords(sector), sector.position.x + GvGMap.Map.HexWidth / 2, sector.position.y + GvGMap.Map.HexHeight * 0.85); if (GvGMap.Size == 'big' && sector.terrain != "water" && sector.terrain != "rocks") GvGMap.CanvasCTX.fillText(sector.power, sector.position.x + GvGMap.Map.HexWidth / 2, sector.position.y + GvGMap.Map.HexHeight * 0.25); From d9b1cd995803d255de45ed958020a0673150840c Mon Sep 17 00:00:00 2001 From: outoftheline Date: Tue, 18 May 2021 00:19:18 +0200 Subject: [PATCH 7/9] GvG Cleanup --- js/web/gvg/js/gvg.js | 230 +++++++++++++++++++++---------------------- 1 file changed, 112 insertions(+), 118 deletions(-) diff --git a/js/web/gvg/js/gvg.js b/js/web/gvg/js/gvg.js index 3dd6eccc0..87a6e1955 100644 --- a/js/web/gvg/js/gvg.js +++ b/js/web/gvg/js/gvg.js @@ -92,7 +92,7 @@ let GvG = { html: true } ) - .append(''); + .append(''); }); } else { @@ -189,6 +189,7 @@ let GvG = { } } +// todo: dont fuck up the edit when using zoom let GvGMap = { OnloadDataTime: 0, Canvas: {}, @@ -306,7 +307,6 @@ let GvGMap = { * @param content */ SetTabContent: (id, content)=> { - // ab dem zweiten Eintrag verstecken let style = GvGMap.TabsContent.length > 0 ? ' style="display:none"' : ''; GvGMap.TabsContent.push('
' + content + '
'); @@ -327,16 +327,16 @@ let GvGMap = { GvGMap.Map.Sectors = []; GvGMap.Map.ProvinceData = GvGMap.Map.OnloadData.province_detailed; GvGMap.Map.GuildData = GvGMap.Map.OnloadData.province_detailed.clans; - GvGMap.PowerValues = GvGMap.Map.OnloadData.province_detailed.power_values; GvGMap.Map.Era = GvGMap.Map.OnloadData.province_detailed.era; + GvGMap.Map.Width = (GvGMap.Map.ProvinceData.bounds.x_max - GvGMap.Map.ProvinceData.bounds.x_min)*GvGMap.Map.HexWidth+GvGMap.Map.HexWidth/2; + GvGMap.Map.Height = (GvGMap.Map.ProvinceData.bounds.y_max - GvGMap.Map.ProvinceData.bounds.y_min)*GvGMap.Map.HexHeight*0.8; GvGMap.Map.HexWidth = hexWidth; GvGMap.Map.HexHeight = hexHeight; + GvGMap.PowerValues = GvGMap.Map.OnloadData.province_detailed.power_values; GvGMap.Size = 'small'; if (hexWidth > 50) { GvGMap.Size = 'big'; } - GvGMap.Map.Width = (GvGMap.Map.ProvinceData.bounds.x_max - GvGMap.Map.ProvinceData.bounds.x_min)*GvGMap.Map.HexWidth+GvGMap.Map.HexWidth/2; - GvGMap.Map.Height = (GvGMap.Map.ProvinceData.bounds.y_max - GvGMap.Map.ProvinceData.bounds.y_min)*GvGMap.Map.HexHeight*0.8; GvGMap.CurrentGuild = {}; GvGMap.OwnGuild.Id = GvGMap.Map.OnloadData.clan_data.clan.id; GvGMap.OwnGuild.Members = GvGMap.Map.OnloadData.clan_data.clan.members; @@ -345,7 +345,7 @@ let GvGMap = { /** * Show GvG Map */ - showMap: () => { + show: () => { if ($('#gvg-map').length == 0) { moment.locale(MainParser.Language); @@ -396,7 +396,6 @@ let GvGMap = { GvGMap.populateCanvas(mapSize, initial); GvGMap.drawInfo(); GvGMap.showGuilds(); - GvGLog.show(); let editBtn = document.getElementById("editMap"); @@ -435,14 +434,12 @@ let GvGMap = { t.push(''); $('#gvgOptions').html(t.join('')); - $('#GvGGuilds tr').click(function (e) { let id = $(this).attr('id').replace('id-', '')/1; $('#GvGGuilds tr').removeClass('active'); $(this).addClass('active'); GvGMap.CurrentGuild = GvGMap.Map.Guilds.find(x => x.id === id); - console.log(GvGMap.CurrentGuild); }); $('#GvGMap').find('#gvgmaplog').promise().done(function() { @@ -481,6 +478,11 @@ let GvGMap = { GvGMap.CanvasCTX.clearRect(0, 0, GvGMap.Map.Width, GvGMap.Map.Height); + GvGMap.addGuilds(); + GvGMap.addSectors(); + }, + + addGuilds: () => { GvGMap.Map.GuildData.forEach(function (guild) { let guildOnMap = { id: guild.id, @@ -496,7 +498,9 @@ let GvGMap = { GvGMap.CurrentGuild = guildOnMap; } }); + }, + addSectors: () => { GvGMap.Map.ProvinceData.sectors.forEach(function (sector) { if (sector.hitpoints != undefined) { let realX = (sector.position.x - GvGMap.Map.ProvinceData.bounds.x_min) * GvGMap.Map.HexWidth; @@ -699,6 +703,10 @@ let GvGMap = { return color; }, + colorToString: (color) => { + return "rgb("+color.r+","+color.g+","+color.b+")"; + }, + getFlagImageCoordinates: (flag) => { let id = flag.split("_"); @@ -713,10 +721,6 @@ let GvGMap = { return {"x": (id % 10 ) * (GvGMap.Map.HexWidth), "y": Math.floor(id / 10) * (GvGMap.Map.HexHeight)}; }, - colorToString: (color) => { - return "rgb("+color.r+","+color.g+","+color.b+")"; - }, - showGuildFlagAndName: (id) => { guild = GvGMap.findGuildById(id); if (id < 0) { @@ -729,108 +733,6 @@ let GvGMap = { } } -let GvGLog = { - Entries: [], - - DummyData: [], - - testData: () => { - GvGLog.DummyData.forEach(function (data) { - GvGLog.addEntry(data); - }); - }, - - addEntry: (response) => { - if (response != undefined && response.type != undefined) { - let type = response.type.replace('ClanBattle/',''); - let entry = { - class: response.__class__, - sectorId: response.sector_id, - timestamp: response.timestamp, - type: type, - sourceClan: response.source_clan_id, - targetClan: response.target_clan_id, - details: {}, - }; - if (response.__class__ == "ClanBattleArmyChange") { - entry.details = { - hitpoints: response.hitpoints, - playerId: (response.source_clan_id == GvGMap.OwnGuild.Id) ? response.player_id : 0 - } - } - else if (response.__class__ == "ClanBattleSectorChange") { // sector_independence_granted, sector_conquered, sector_slot_unlocked - entry.details = { - playerId: (response.source_clan_id == GvGMap.OwnGuild.Id) ? response.player_id : 0 - } - if (entry.type == "sector_slot_unlocked" && entry.sourceClan != GvGMap.OwnGuild.Id) { - entry.details = {}; - } - } - else if (response.__class__ == "ClanBattleBuildingChange") { // headquarter_placed - entry.details = { - nextRelocate: response.building.next_relocate - } - } - if (entry.details != {} && type != "defender_low_hp" && type != "siege_low_hp" && type != "sector_fog_changed") { - GvGLog.Entries.unshift(entry); - return entry; - } - } - return undefined; - }, - - showEntry: (entry) => { - let tr = GvGLog.buildEntry(entry); - $('#GvGMap').find('#gvgmaplog').promise().done(function() { - $('#GvGlog').prepend(tr); - }); - }, - - buildEntry: (entry) => { - let t = []; - let sector = MapSector.findById(entry.sectorId); - if (sector != undefined) { // if sector is on map - let sectorCoords = MapSector.coords(sector); - t.push('
'); - t.push(''); - t.push(''); - t.push(''); - } - return t.join(''); - }, - - show: () => { - let t = []; - t.push('
'); - t.push('
Sector
'+sectorCoords+'
'+moment.unix(entry.timestamp).format('HH:mm:ss')+'
'); - if (entry.sourceClan != entry.targetClan && entry.targetClan != undefined && entry.sourceClan != undefined) - t.push(GvGMap.showGuildFlagAndName(entry.sourceClan) +' → '+ GvGMap.showGuildFlagAndName(entry.targetClan)); - else if (entry.sourceClan != undefined) - t.push(GvGMap.showGuildFlagAndName(entry.sourceClan)); - t.push('
'+i18n('Boxes.GvGMap.Log.'+entry.type)); - if (entry.details.playerId != undefined) { - if (entry.details.playerId > 0) { - let memberName = GvGMap.OwnGuild.Members.find(x => x.player_id === entry.details.playerId).name; - t.push(', '+memberName); - } - } - //t.push(', HP: '+entry.hitpoints); - t.push('
'); - t.push(''); - t.push(''); - t.push(''); - t.push(''); - - GvGLog.Entries.forEach(function(entry) { - let tr = GvGLog.buildEntry(entry); - t.push(tr); - }); - t.push('
SectorInfo
'); - - GvGMap.SetTabContent('gvgmaplog', t.join('')); - }, -} - let MapSector = { create: (x, y, info) => { let sector = { @@ -938,8 +840,6 @@ let MapSector = { * Draws Sector hexagon in its owners color */ drawHex: (sector) => { - if (sector.owner.id <= 0) - console.log(sector.owner, sector.terrain); GvGMap.CanvasCTX.fillStyle = GvGMap.colorToString(sector.owner.color); GvGMap.CanvasCTX.beginPath(); GvGMap.CanvasCTX.moveTo(sector.position.x + GvGMap.Map.HexWidth / 2, sector.position.y); @@ -969,7 +869,7 @@ let MapSector = { }, /** - * Returns Sectors coordinates (with ~ if beach) + * Returns Sectors coordinates */ coords(sector) { if (sector.terrain == "beach") @@ -978,4 +878,98 @@ let MapSector = { return sector.coordinates.x + ", " + sector.coordinates.y; return ""; }, +} + +let GvGLog = { + Entries: [], + + show: () => { + let t = []; + t.push('
'); + t.push(''); + t.push(''); + t.push(''); + t.push(''); + t.push(''); + + GvGLog.Entries.forEach(function(entry) { + let tr = GvGLog.buildEntry(entry); + t.push(tr); + }); + t.push('
SectorInfo
'); + + GvGMap.SetTabContent('gvgmaplog', t.join('')); + }, + + addEntry: (response) => { + if (response != undefined && response.type != undefined) { + let type = response.type.replace('ClanBattle/',''); + let entry = { + class: response.__class__, + sectorId: response.sector_id, + timestamp: response.timestamp, + type: type, + sourceClan: response.source_clan_id, + targetClan: response.target_clan_id, + details: {}, + }; + if (response.__class__ == "ClanBattleArmyChange") { + entry.details = { + hitpoints: response.hitpoints, + playerId: (response.source_clan_id == GvGMap.OwnGuild.Id) ? response.player_id : 0 + } + } + else if (response.__class__ == "ClanBattleSectorChange") { // sector_independence_granted, sector_conquered, sector_slot_unlocked + entry.details = { + playerId: (response.source_clan_id == GvGMap.OwnGuild.Id) ? response.player_id : 0 + } + if (entry.type == "sector_slot_unlocked" && entry.sourceClan != GvGMap.OwnGuild.Id) { + entry.details = {}; + } + } + else if (response.__class__ == "ClanBattleBuildingChange") { // headquarter_placed + entry.details = { + nextRelocate: response.building.next_relocate + } + } + if (entry.details != {} && type != "defender_low_hp" && type != "siege_low_hp" && type != "sector_fog_changed") { + GvGLog.Entries.unshift(entry); + return entry; + } + } + return undefined; + }, + + buildEntry: (entry) => { + let t = []; + let sector = MapSector.findById(entry.sectorId); + if (sector != undefined) { // if sector is on map + let sectorCoords = MapSector.coords(sector); + t.push(''); + t.push(''+sectorCoords+'
'+moment.unix(entry.timestamp).format('HH:mm:ss')+''); + t.push(''); + if (entry.sourceClan != entry.targetClan && entry.targetClan != undefined && entry.sourceClan != undefined) + t.push(GvGMap.showGuildFlagAndName(entry.sourceClan) +' → '+ GvGMap.showGuildFlagAndName(entry.targetClan)); + else if (entry.sourceClan != undefined) + t.push(GvGMap.showGuildFlagAndName(entry.sourceClan)); + t.push('
'+i18n('Boxes.GvGMap.Log.'+entry.type)); + if (entry.details.playerId != undefined) { + if (entry.details.playerId > 0) { + let memberName = GvGMap.OwnGuild.Members.find(x => x.player_id === entry.details.playerId).name; + t.push(', '+memberName); + } + } + //t.push(', HP: '+entry.hitpoints); + t.push(''); + t.push(''); + } + return t.join(''); + }, + + showEntry: (entry) => { + let tr = GvGLog.buildEntry(entry); + $('#GvGMap').find('#gvgmaplog').promise().done(function() { + $('#GvGlog').prepend(tr); + }); + }, } \ No newline at end of file From 8a31f393cdfc06d0d1c80e4b4b095a0ba982b378 Mon Sep 17 00:00:00 2001 From: outoftheline Date: Tue, 18 May 2021 00:30:07 +0200 Subject: [PATCH 8/9] Revert "GvG Cleanup" This reverts commit d9b1cd995803d255de45ed958020a0673150840c. --- js/web/gvg/js/gvg.js | 230 ++++++++++++++++++++++--------------------- 1 file changed, 118 insertions(+), 112 deletions(-) diff --git a/js/web/gvg/js/gvg.js b/js/web/gvg/js/gvg.js index 87a6e1955..3dd6eccc0 100644 --- a/js/web/gvg/js/gvg.js +++ b/js/web/gvg/js/gvg.js @@ -92,7 +92,7 @@ let GvG = { html: true } ) - .append(''); + .append(''); }); } else { @@ -189,7 +189,6 @@ let GvG = { } } -// todo: dont fuck up the edit when using zoom let GvGMap = { OnloadDataTime: 0, Canvas: {}, @@ -307,6 +306,7 @@ let GvGMap = { * @param content */ SetTabContent: (id, content)=> { + // ab dem zweiten Eintrag verstecken let style = GvGMap.TabsContent.length > 0 ? ' style="display:none"' : ''; GvGMap.TabsContent.push('
' + content + '
'); @@ -327,16 +327,16 @@ let GvGMap = { GvGMap.Map.Sectors = []; GvGMap.Map.ProvinceData = GvGMap.Map.OnloadData.province_detailed; GvGMap.Map.GuildData = GvGMap.Map.OnloadData.province_detailed.clans; + GvGMap.PowerValues = GvGMap.Map.OnloadData.province_detailed.power_values; GvGMap.Map.Era = GvGMap.Map.OnloadData.province_detailed.era; - GvGMap.Map.Width = (GvGMap.Map.ProvinceData.bounds.x_max - GvGMap.Map.ProvinceData.bounds.x_min)*GvGMap.Map.HexWidth+GvGMap.Map.HexWidth/2; - GvGMap.Map.Height = (GvGMap.Map.ProvinceData.bounds.y_max - GvGMap.Map.ProvinceData.bounds.y_min)*GvGMap.Map.HexHeight*0.8; GvGMap.Map.HexWidth = hexWidth; GvGMap.Map.HexHeight = hexHeight; - GvGMap.PowerValues = GvGMap.Map.OnloadData.province_detailed.power_values; GvGMap.Size = 'small'; if (hexWidth > 50) { GvGMap.Size = 'big'; } + GvGMap.Map.Width = (GvGMap.Map.ProvinceData.bounds.x_max - GvGMap.Map.ProvinceData.bounds.x_min)*GvGMap.Map.HexWidth+GvGMap.Map.HexWidth/2; + GvGMap.Map.Height = (GvGMap.Map.ProvinceData.bounds.y_max - GvGMap.Map.ProvinceData.bounds.y_min)*GvGMap.Map.HexHeight*0.8; GvGMap.CurrentGuild = {}; GvGMap.OwnGuild.Id = GvGMap.Map.OnloadData.clan_data.clan.id; GvGMap.OwnGuild.Members = GvGMap.Map.OnloadData.clan_data.clan.members; @@ -345,7 +345,7 @@ let GvGMap = { /** * Show GvG Map */ - show: () => { + showMap: () => { if ($('#gvg-map').length == 0) { moment.locale(MainParser.Language); @@ -396,6 +396,7 @@ let GvGMap = { GvGMap.populateCanvas(mapSize, initial); GvGMap.drawInfo(); GvGMap.showGuilds(); + GvGLog.show(); let editBtn = document.getElementById("editMap"); @@ -434,12 +435,14 @@ let GvGMap = { t.push('
'); $('#gvgOptions').html(t.join('')); + $('#GvGGuilds tr').click(function (e) { let id = $(this).attr('id').replace('id-', '')/1; $('#GvGGuilds tr').removeClass('active'); $(this).addClass('active'); GvGMap.CurrentGuild = GvGMap.Map.Guilds.find(x => x.id === id); + console.log(GvGMap.CurrentGuild); }); $('#GvGMap').find('#gvgmaplog').promise().done(function() { @@ -478,11 +481,6 @@ let GvGMap = { GvGMap.CanvasCTX.clearRect(0, 0, GvGMap.Map.Width, GvGMap.Map.Height); - GvGMap.addGuilds(); - GvGMap.addSectors(); - }, - - addGuilds: () => { GvGMap.Map.GuildData.forEach(function (guild) { let guildOnMap = { id: guild.id, @@ -498,9 +496,7 @@ let GvGMap = { GvGMap.CurrentGuild = guildOnMap; } }); - }, - addSectors: () => { GvGMap.Map.ProvinceData.sectors.forEach(function (sector) { if (sector.hitpoints != undefined) { let realX = (sector.position.x - GvGMap.Map.ProvinceData.bounds.x_min) * GvGMap.Map.HexWidth; @@ -703,10 +699,6 @@ let GvGMap = { return color; }, - colorToString: (color) => { - return "rgb("+color.r+","+color.g+","+color.b+")"; - }, - getFlagImageCoordinates: (flag) => { let id = flag.split("_"); @@ -721,6 +713,10 @@ let GvGMap = { return {"x": (id % 10 ) * (GvGMap.Map.HexWidth), "y": Math.floor(id / 10) * (GvGMap.Map.HexHeight)}; }, + colorToString: (color) => { + return "rgb("+color.r+","+color.g+","+color.b+")"; + }, + showGuildFlagAndName: (id) => { guild = GvGMap.findGuildById(id); if (id < 0) { @@ -733,6 +729,108 @@ let GvGMap = { } } +let GvGLog = { + Entries: [], + + DummyData: [], + + testData: () => { + GvGLog.DummyData.forEach(function (data) { + GvGLog.addEntry(data); + }); + }, + + addEntry: (response) => { + if (response != undefined && response.type != undefined) { + let type = response.type.replace('ClanBattle/',''); + let entry = { + class: response.__class__, + sectorId: response.sector_id, + timestamp: response.timestamp, + type: type, + sourceClan: response.source_clan_id, + targetClan: response.target_clan_id, + details: {}, + }; + if (response.__class__ == "ClanBattleArmyChange") { + entry.details = { + hitpoints: response.hitpoints, + playerId: (response.source_clan_id == GvGMap.OwnGuild.Id) ? response.player_id : 0 + } + } + else if (response.__class__ == "ClanBattleSectorChange") { // sector_independence_granted, sector_conquered, sector_slot_unlocked + entry.details = { + playerId: (response.source_clan_id == GvGMap.OwnGuild.Id) ? response.player_id : 0 + } + if (entry.type == "sector_slot_unlocked" && entry.sourceClan != GvGMap.OwnGuild.Id) { + entry.details = {}; + } + } + else if (response.__class__ == "ClanBattleBuildingChange") { // headquarter_placed + entry.details = { + nextRelocate: response.building.next_relocate + } + } + if (entry.details != {} && type != "defender_low_hp" && type != "siege_low_hp" && type != "sector_fog_changed") { + GvGLog.Entries.unshift(entry); + return entry; + } + } + return undefined; + }, + + showEntry: (entry) => { + let tr = GvGLog.buildEntry(entry); + $('#GvGMap').find('#gvgmaplog').promise().done(function() { + $('#GvGlog').prepend(tr); + }); + }, + + buildEntry: (entry) => { + let t = []; + let sector = MapSector.findById(entry.sectorId); + if (sector != undefined) { // if sector is on map + let sectorCoords = MapSector.coords(sector); + t.push(''); + t.push(''+sectorCoords+'
'+moment.unix(entry.timestamp).format('HH:mm:ss')+''); + t.push(''); + if (entry.sourceClan != entry.targetClan && entry.targetClan != undefined && entry.sourceClan != undefined) + t.push(GvGMap.showGuildFlagAndName(entry.sourceClan) +' → '+ GvGMap.showGuildFlagAndName(entry.targetClan)); + else if (entry.sourceClan != undefined) + t.push(GvGMap.showGuildFlagAndName(entry.sourceClan)); + t.push('
'+i18n('Boxes.GvGMap.Log.'+entry.type)); + if (entry.details.playerId != undefined) { + if (entry.details.playerId > 0) { + let memberName = GvGMap.OwnGuild.Members.find(x => x.player_id === entry.details.playerId).name; + t.push(', '+memberName); + } + } + //t.push(', HP: '+entry.hitpoints); + t.push(''); + t.push(''); + } + return t.join(''); + }, + + show: () => { + let t = []; + t.push('
'); + t.push(''); + t.push(''); + t.push(''); + t.push(''); + t.push(''); + + GvGLog.Entries.forEach(function(entry) { + let tr = GvGLog.buildEntry(entry); + t.push(tr); + }); + t.push('
SectorInfo
'); + + GvGMap.SetTabContent('gvgmaplog', t.join('')); + }, +} + let MapSector = { create: (x, y, info) => { let sector = { @@ -840,6 +938,8 @@ let MapSector = { * Draws Sector hexagon in its owners color */ drawHex: (sector) => { + if (sector.owner.id <= 0) + console.log(sector.owner, sector.terrain); GvGMap.CanvasCTX.fillStyle = GvGMap.colorToString(sector.owner.color); GvGMap.CanvasCTX.beginPath(); GvGMap.CanvasCTX.moveTo(sector.position.x + GvGMap.Map.HexWidth / 2, sector.position.y); @@ -869,7 +969,7 @@ let MapSector = { }, /** - * Returns Sectors coordinates + * Returns Sectors coordinates (with ~ if beach) */ coords(sector) { if (sector.terrain == "beach") @@ -878,98 +978,4 @@ let MapSector = { return sector.coordinates.x + ", " + sector.coordinates.y; return ""; }, -} - -let GvGLog = { - Entries: [], - - show: () => { - let t = []; - t.push('
'); - t.push(''); - t.push(''); - t.push(''); - t.push(''); - t.push(''); - - GvGLog.Entries.forEach(function(entry) { - let tr = GvGLog.buildEntry(entry); - t.push(tr); - }); - t.push('
SectorInfo
'); - - GvGMap.SetTabContent('gvgmaplog', t.join('')); - }, - - addEntry: (response) => { - if (response != undefined && response.type != undefined) { - let type = response.type.replace('ClanBattle/',''); - let entry = { - class: response.__class__, - sectorId: response.sector_id, - timestamp: response.timestamp, - type: type, - sourceClan: response.source_clan_id, - targetClan: response.target_clan_id, - details: {}, - }; - if (response.__class__ == "ClanBattleArmyChange") { - entry.details = { - hitpoints: response.hitpoints, - playerId: (response.source_clan_id == GvGMap.OwnGuild.Id) ? response.player_id : 0 - } - } - else if (response.__class__ == "ClanBattleSectorChange") { // sector_independence_granted, sector_conquered, sector_slot_unlocked - entry.details = { - playerId: (response.source_clan_id == GvGMap.OwnGuild.Id) ? response.player_id : 0 - } - if (entry.type == "sector_slot_unlocked" && entry.sourceClan != GvGMap.OwnGuild.Id) { - entry.details = {}; - } - } - else if (response.__class__ == "ClanBattleBuildingChange") { // headquarter_placed - entry.details = { - nextRelocate: response.building.next_relocate - } - } - if (entry.details != {} && type != "defender_low_hp" && type != "siege_low_hp" && type != "sector_fog_changed") { - GvGLog.Entries.unshift(entry); - return entry; - } - } - return undefined; - }, - - buildEntry: (entry) => { - let t = []; - let sector = MapSector.findById(entry.sectorId); - if (sector != undefined) { // if sector is on map - let sectorCoords = MapSector.coords(sector); - t.push(''); - t.push(''+sectorCoords+'
'+moment.unix(entry.timestamp).format('HH:mm:ss')+''); - t.push(''); - if (entry.sourceClan != entry.targetClan && entry.targetClan != undefined && entry.sourceClan != undefined) - t.push(GvGMap.showGuildFlagAndName(entry.sourceClan) +' → '+ GvGMap.showGuildFlagAndName(entry.targetClan)); - else if (entry.sourceClan != undefined) - t.push(GvGMap.showGuildFlagAndName(entry.sourceClan)); - t.push('
'+i18n('Boxes.GvGMap.Log.'+entry.type)); - if (entry.details.playerId != undefined) { - if (entry.details.playerId > 0) { - let memberName = GvGMap.OwnGuild.Members.find(x => x.player_id === entry.details.playerId).name; - t.push(', '+memberName); - } - } - //t.push(', HP: '+entry.hitpoints); - t.push(''); - t.push(''); - } - return t.join(''); - }, - - showEntry: (entry) => { - let tr = GvGLog.buildEntry(entry); - $('#GvGMap').find('#gvgmaplog').promise().done(function() { - $('#GvGlog').prepend(tr); - }); - }, } \ No newline at end of file From 3fa6b0d52b0b3d057582ed66d47ed47686160e0b Mon Sep 17 00:00:00 2001 From: Weblate Date: Mon, 17 May 2021 23:42:56 +0000 Subject: [PATCH 9/9] Currently translated at 96.3% (882 of 915 strings) Translation: FoE Helper/Extension Translate-URL: http://i18n.foe-helper.com/projects/foe-helper/extension/sv/ --- js/web/_i18n/sv.json | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/js/web/_i18n/sv.json b/js/web/_i18n/sv.json index 8c9e5aa25..69d00a120 100644 --- a/js/web/_i18n/sv.json +++ b/js/web/_i18n/sv.json @@ -88,7 +88,7 @@ "Boxes.Calculator.HelpLink": "https://foe-helper.com/docs/en/cost-calculator/", "Boxes.Calculator.LGNotConnected": "Byggnaden är inte väg-ansluten.", "Boxes.Calculator.LGNotOpen": "Denna MB's nästa nivå är LÅST.", - "Boxes.Calculator.LevelWarning": "VARNING! Höjer nivå på MB!", + "Boxes.Calculator.LevelWarning": "VARNING! Nivellerar detta MB!", "Boxes.Calculator.MaxLevel": "Max nivå", "Boxes.Calculator.Meds": "Medalj", "Boxes.Calculator.Profit": "Vinst", @@ -106,7 +106,7 @@ "Boxes.Calculator.TTProfit": "Belöning = __nettoreward__(netto vinst) * __arcfactor__%(Ark bonus) = __bruttoreward__
Kostnad: __costs__ - Place locked at: __safe__
Vinst = __bruttoreward__(belöning) - __costs__(kostnad) = __profit__", "Boxes.Calculator.TTProfitSelf": "Belöning = __nettoreward__(nettovinst) * __arcfactor__%(Ark bonus) = __bruttoreward__
Betalat: __paid__
Vinst = __bruttoreward__(belöning) - __paid__(betalat) = __profit__", "Boxes.Calculator.Title": "Kostnadskalkylator", - "Boxes.Calculator.Up2LevelUp": "Till nästa nivå", + "Boxes.Calculator.Up2LevelUp": "Återstående FP för nivellering", "Boxes.Campagne.AlreadyDone": " Redan erövrad! Bra gjort :)", "Boxes.Campagne.DescInStock": "Tillgängliga", "Boxes.Campagne.DescRequired": "Behov", @@ -181,6 +181,7 @@ "Boxes.FPCollector.winterEvent": "Vinterevent", "Boxes.FPCollector.winterEventGandPrice": "Vinterevent - Första pris", "Boxes.FPCollector.winterEventGrandPrice": "Vinterevent - Första pris", + "Boxes.General.Export": "Export", "Boxes.General.ExportCSV": "Exportera som CSV", "Boxes.General.ExportJSON": "Exportera som jSON", "Boxes.Gildfights.Count": "i", @@ -231,6 +232,7 @@ "Boxes.GreatBuildings.Title": "MB Investering Översikt", "Boxes.GuildMemberStat.AutoStartOnUpdate": "öppna översikt efter uppdatering", "Boxes.GuildMemberStat.Battles": "Strider", + "Boxes.GuildMemberStat.ChangeView": "Ändra vy", "Boxes.GuildMemberStat.ConfirmNo": "Nej", "Boxes.GuildMemberStat.ConfirmYes": "Ja", "Boxes.GuildMemberStat.Date": "Datum", @@ -252,7 +254,7 @@ "Boxes.GuildMemberStat.GuildMembers": "Imperium-medlemmar", "Boxes.GuildMemberStat.GuildMessages": "Antal meddelande i gillets meddelande-center", "Boxes.GuildMemberStat.GuildPower": "Imperium-makt", - "Boxes.GuildMemberStat.GuildSupportBuildings": "Stödpool byggnader", + "Boxes.GuildMemberStat.GuildSupportBuildings": "Stödpool-byggnader", "Boxes.GuildMemberStat.GuildTreasuryNotification": "Klicka på flik \"Skattkammare\" i gillets profil för att uppdatera datan.", "Boxes.GuildMemberStat.Inactivity": "Inaktivitet", "Boxes.GuildMemberStat.Instantly": "omedelbar", @@ -282,7 +284,7 @@ "Boxes.Infobox.FilterAuction": "Auktiongit st", "Boxes.Infobox.FilterGex": "IE", "Boxes.Infobox.FilterGildFights": "Imperiestrider", - "Boxes.Infobox.FilterLevel": "Ny nivå", + "Boxes.Infobox.FilterLevel": "MB", "Boxes.Infobox.FilterMessage": "Meddelanden", "Boxes.Infobox.FilterTrade": "Handel", "Boxes.Infobox.Messages.Auction": "'__player__ har precis budat __amount__ Samlarmynt.", @@ -302,12 +304,15 @@ "Boxes.Investment.DateParseErrorDesc": "Datum-värdet \"__InvalidDate__\" kunde inte tolkas", "Boxes.Investment.HiddenGB": "Dolt MB", "Boxes.Investment.InvestBar": "Investerat FP: ", + "Boxes.Investment.Overview.AdditionalColumns": "Ytterligare kolumner", + "Boxes.Investment.Overview.Blueprints": "Ritningar", "Boxes.Investment.Overview.Building": "Byggnad", "Boxes.Investment.Overview.EntryTime": "Tidpunkt", "Boxes.Investment.Overview.EntryTimeDesc": "När noterades den första depositionen?", "Boxes.Investment.Overview.HideGB": "Dölj MB från kalkylering och lista.", "Boxes.Investment.Overview.Invested": "Investerat", "Boxes.Investment.Overview.InvestedDesc": "Hur många FP har investerats", + "Boxes.Investment.Overview.Medals": "Medaljer", "Boxes.Investment.Overview.Player": "Spelare", "Boxes.Investment.Overview.Profit": "Profit", "Boxes.Investment.Overview.ProfitDesc": "profit uppnådd, gul -> Rank är inte säker, röd/grön -> Förlust/Profit säker", @@ -317,7 +322,7 @@ "Boxes.Investment.Overview.RestFPDesc": "Antal FP som återstår för att öka nivån", "Boxes.Investment.Overview.SettingsEntryTime": "visa tidpunkt", "Boxes.Investment.Overview.SettingsHiddenGB": "visa dolda MB", - "Boxes.Investment.Overview.SettingsRestFP": "visa återstående FP", + "Boxes.Investment.Overview.SettingsRestFP": "återstående FP", "Boxes.Investment.Overview.SettingsSave": "Spara", "Boxes.Investment.Overview.SettingsUnsafeCalc": "kalkylera endast säker profit/förlust", "Boxes.Investment.PlayerFound": "Nya händelser funna!", @@ -472,7 +477,7 @@ "Boxes.OwnpartCalculator.Place": "Plats", "Boxes.OwnpartCalculator.Places": "Platser", "Boxes.OwnpartCalculator.PlayerName": "Spelare", - "Boxes.OwnpartCalculator.PowerLeveling": "Kraft nivå-ökande", + "Boxes.OwnpartCalculator.PowerLeveling": "Turbo-nivellering", "Boxes.OwnpartCalculator.Preview": "Förhandsvisa", "Boxes.OwnpartCalculator.Step": "Nivå", "Boxes.OwnpartCalculator.Title": "MB kalkylator", @@ -488,7 +493,7 @@ "Boxes.PowerLeveling.P3": "Plats 3", "Boxes.PowerLeveling.P4": "Plats 4", "Boxes.PowerLeveling.P5": "Plats 5", - "Boxes.PowerLeveling.Title": "Power leveling", + "Boxes.PowerLeveling.Title": "Turbo-nivellering", "Boxes.Productions.Done": "Färdigt", "Boxes.Productions.GoodEraTotal": "Total", "Boxes.Productions.GuildGoods": "Skattkammare gods", @@ -659,6 +664,7 @@ "GvG.Independences.Tooltip.Warning": "Kan vara missvisande, om du spelar på flera olika datorer.", "HiddenRewards.Positions.cityRoadBig": "Stor väg", "HiddenRewards.Positions.cityRoadSmall": "Liten väg", + "HiddenRewards.Positions.culturalOutpost": "Skärvor - Bosättning", "HiddenRewards.Positions.guildExpedition": "Imperieexpedition", "HiddenRewards.Positions.nature": "Natur", "HiddenRewards.Positions.shore": "Strand",