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

price fix #80

Merged
merged 1 commit into from
Feb 4, 2017
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
16 changes: 12 additions & 4 deletions app/actions/logic/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,18 @@ export function bidCycle() {
// Keep a manual record of our watched trades
// let trades = _.keyBy(state.bid.watchlist, 'tradeId');
dispatch(bidActions.setTrades(_.keyBy(state.bid.watchlist, 'tradeId')));
// Loop players

// Loop players for price update
for (const player of Object.values(playerList)) {
// refresh state every player
state = getState();
// Setup API - resets RPM every cycle
const settings = _.merge({}, state.settings, player.settings);
// Update prices every hour if auto update price is enabled
await dispatch(bidActions.updatePrice(player, settings));
}

// Loop players for bidding
for (const player of Object.values(playerList)) {
// refresh state every player
state = getState();
Expand Down Expand Up @@ -57,9 +68,6 @@ export function bidCycle() {
trade => Fut.getBaseId(trade.itemData.resourceId)
)));

// Update prices every hour if auto update price is enabled
await dispatch(bidActions.updatePrice(player, settings));

// Only bid if we don't already have a full trade pile and don't own too many of this player
dispatch(bidActions.setBINStatus(!!state.bid.unassigned.length));
if (
Expand Down