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 )
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)
Change History (8)
by , 8 years ago
Attachment: | commands.txt added |
---|
follow-up: 3 comment:1 by , 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 , 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.
comment:3 by , 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 is23527
. - By adding an
if (msg.entity == 23527) warn("DESTROYED");
to a new functionArmour.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 , 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 , 6 years ago
Description: | modified (diff) |
---|---|
Milestone: | Backlog → Alpha 23 |
Warning occurs thrice on turn 2656.