Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed kits from the last pull #1099

Merged
merged 1 commit into from
May 27, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 19 additions & 9 deletions js/web/_main/js/_main.js
Original file line number Diff line number Diff line change
Expand Up @@ -707,6 +707,16 @@ const FoEproxy = (function () {
MainParser.setGoodsData(data.responseData);
});

// Required by the kits
FoEproxy.addHandler('InventoryService', 'getItems', (data, postData) => {
MainParser.UpdateInventory(data.responseData);
});

// Required by the kits
FoEproxy.addHandler('InventoryService', 'getInventory', (data, postData) => {
MainParser.UpdateInventory(data.responseData.inventoryItems);
});

// --------------------------------------------------------------------------------------------------
// --------------------------------------------------------------------------------------------------
// Es wurde das LG eines Mitspielers angeklickt, bzw davor die Übersicht
Expand All @@ -715,7 +725,7 @@ const FoEproxy = (function () {
let LastKostenrechnerOpenTime = 0;
FoEproxy.addHandler('GreatBuildingsService', 'getOtherPlayerOverview', (data, postData) => {
MainParser.UpdatePlayerDict(data.responseData, 'LGOverview');

if (data.responseData[0].player.player_id === ExtPlayerID || !Settings.GetSetting('PreScanLGList')) {
return;
}
Expand Down Expand Up @@ -881,7 +891,7 @@ const FoEproxy = (function () {
FoEproxy.addHandler('OtherPlayerService', 'visitPlayer', (data, postData) => {
let OtherPlayer = data.responseData.other_player;
let IsPlunderable = (OtherPlayer.is_neighbor && !OtherPlayer.is_friend && !OtherPlayer.is_guild_member);

if (Settings.GetSetting('ShowAllPlayerAttDeff') || IsPlunderable && Settings.GetSetting('ShowNeighborsGoods')) {
Reader.OtherPlayersBuildings(data.responseData, IsPlunderable);
}
Expand Down Expand Up @@ -1906,13 +1916,13 @@ let MainParser = {
*
* @param Items
*/
// UpdateInventory: (Items) => {
// MainParser.Inventory = {};
// for (let i = 0; i < Items.length; i++) {
// let ID = Items[i]['id'];
// MainParser.Inventory[ID] = Items[i];
// }
// },
UpdateInventory: (Items) => {
MainParser.Inventory = {};
for (let i = 0; i < Items.length; i++) {
let ID = Items[i]['id'];
MainParser.Inventory[ID] = Items[i];
}
},


/**
Expand Down