Closed spratt closed 11 years ago
It keeps failing after trade check on valid trades.
Having trouble reproducing.
I'll see if I can isolate the problem further, but it's not clear why most trades work fine and others fail.
Any repro on this?
Nope, looks solid now.
Found it. Note that I was trying to build the second stage of my wonder, I had 2 clay, I was trading for a third, and the validator didn't think it was a valid action.
Relevant log messages:
140186 [AWT-EventQueue-0] INFO com.steamedpears.comp3004.views.TradesView - adding to right trades: 1 c
...
140186 [AWT-EventQueue-0] DEBUG com.steamedpears.comp3004.models.players.Player - Player 0 validating move PlayerCommand[BUILD Loom_2_3]
140186 [AWT-EventQueue-0] DEBUG com.steamedpears.comp3004.models.players.Player - validating number/types of moves
140186 [AWT-EventQueue-0] DEBUG com.steamedpears.comp3004.models.players.Player - validating player can make the trades they are trying to make
140186 [AWT-EventQueue-0] DEBUG com.steamedpears.comp3004.models.players.Player - validating player can build out wonder with this card
140186 [AWT-EventQueue-0] DEBUG com.steamedpears.comp3004.models.players.Player - validating player has card
140187 [AWT-EventQueue-0] DEBUG com.steamedpears.comp3004.models.players.Player - validation failed after specific command check
Code's not broken. Underlying JSON is wrong:
"image":"Halikarnassos_b",
"stages":[
{
"cost":{
"o":2
},
"baseAssets":{
"victory":2,
"discard":1
}
},
{
"cost":{
"s":2
},
"baseAssets":{
"victory":1,
"discard":1
}
},
{
"cost":{
"l":1,
"o":2
},
"baseAssets":{
"discard":1
}
}
],
Want me to fix it, then?
Just did.
Trade fails when buying Caravansery_2_3
Relevant log file:
70870 [AWT-EventQueue-0] INFO com.steamedpears.comp3004.views.TradesView - adding to left trades: 1 w
...
70870 [AWT-EventQueue-0] DEBUG com.steamedpears.comp3004.models.players.Player - Player 0 validating move PlayerCommand[PLAY Caravansery_2_3]
70870 [AWT-EventQueue-0] DEBUG com.steamedpears.comp3004.models.players.Player - validating number/types of moves
70871 [AWT-EventQueue-0] DEBUG com.steamedpears.comp3004.models.players.Player - validating failed after gold cost check
70871 [AWT-EventQueue-0] DEBUG com.steamedpears.comp3004.models.players.Player - validation failed after trade check
70871 [AWT-EventQueue-0] DEBUG com.steamedpears.comp3004.models.players.Player - validation failed after specific command check
I am an idiot.
I had a combo brick/ore asset. My neighbor had a brick. I started the trade for the brick. But I couldn't build a building that took 2 brick.