Opened 8 years ago

Closed 6 years ago

#3645 closed defect (fixed)

ExchangeResources: player has no markets

Reported by: elexis Owned by: elexis
Priority: Should Have Milestone: Alpha 23
Component: UI & Simulation Keywords:
Cc: Patch:

Description (last modified by elexis)

This error is known from OOS players that try to send resources:

WARNING: ExchangeResources: player has no markets

but it happened in an svn game (r17298) too when a player lost the market.

Replay the attached commands.txt to reproduce.

Attachments (2)

commands.txt (426.7 KB ) - added by elexis 8 years ago.
Warning occurs thrice on turn 2656.
commands.2.txt (772.6 KB ) - added by elexis 8 years ago.
Message occurs on turn 3254, r18794

Download all attachments as: .zip

Change History (8)

by elexis, 8 years ago

Attachment: commands.txt added

Warning occurs thrice on turn 2656.

comment:1 by mimo, 8 years ago

While trying to understand how this could be possible, i've noticed two problems in the gui code:

  • the selection is only updated in updateSelectionDetails (called from onSimulationUpdate) while it would be better to do it at the entrance of onSimulationUpdate (for example recalculateStatusBarDisplay would be better with the updated selection)
  • in selection.js, when updating the selection, we only test if an entity has been destroyed. That was fine before capturing, but not anymore in case of multiple entities selected as this can lead to selection with entities from several owners which is not supported by the code

comment:2 by mimo, 8 years ago

r17306 has fixed the problems quoted in comment 1. But still, that is not enough to explain the bug reported in this ticket.

by elexis, 8 years ago

Attachment: commands.2.txt added

Message occurs on turn 3254, r18794

in reply to:  1 comment:3 by elexis, 8 years ago

  • In the replay above, the green players (Cesar) only market is destroyed while the player is attempting to barter resources.
  • By selecting the market in the visual replay and calling warn(uneval(g_Selection.toList())) in the JS console (F9), we see that the market id is 23527.
  • By adding an if (msg.entity == 23527) warn("DESTROYED"); to a new function Armour.prototype.OnDestroy(msg), we can find the turn when the market was destroyed in non-visual replay:
    Turn 3253 (500)...
    WARNING: DESTROYED
    Turn 3254 (500)...
    WARNING: ExchangeResources: player has no markets
    WARNING: ExchangeResources: player has no markets
    
  • By opening the commands.txt, we can find the barter commands:
    turn 3254 500
    cmd 3 {"type":"barter","sell":"food","buy":"stone","amount":500}
    cmd 3 {"type":"barter","sell":"food","buy":"stone","amount":500}
    end
    

comment:4 by elexis, 7 years ago

The warning must come from the fact that sending a command on turn N means that the command will be executed on turn N+2. So sounds like we should just remove that warning. It doesn't really help debugging or anything.

comment:5 by elexis, 6 years ago

Description: modified (diff)
Milestone: BacklogAlpha 23

comment:6 by elexis, 6 years ago

Owner: set to elexis
Resolution: fixed
Status: newclosed

In 21733:

Remove a warning about missing markets when the player has issued a barter command just before losing the market, fixes #3645.

Note: See TracTickets for help on using tickets.