open-duelyst / duelyst

Duelyst is a digital collectible card game and turn-based strategy hybrid, developed by Counterplay Games.
Creative Commons Zero v1.0 Universal
3.62k stars 556 forks source link

[P0] Fix Gauntlet mode #210

Closed willroberts closed 1 year ago

willroberts commented 1 year ago

Summary

An error occurs in the SP server when two players queue for Gauntlet locally:

duelyst-sp-1      | IO          | 1666903575 [G:-NFQBUdWc3MN_TIP6rFN] initGameSession -> loaded game data for game:-NFQBUdWc3MN_TIP6rFN
duelyst-sp-1      | AI          | 1666902995 [G:-NFQBUdWc3MN_TIP6rFN] Setup AI -> aiPlayerId ai - aiDifficulty null
duelyst-sp-1      | SDK         | 1666902995 [G:-NFQBUdWc3MN_TIP6rFN].getPlayerById -> No player found with playerId:  ai
duelyst-sp-1      | IO          | 1666903575 [G:-NFQBUdWc3MN_TIP6rFN] initGameSession:: error: "Cannot read properties of undefined (reading 'getHasStartingHand')"
duelyst-sp-1      | IO          | 1666903575 [G:-NFQBUdWc3MN_TIP6rFN] initGameSession:: error stack: TypeError: Cannot read properties of undefined (reading 'getHasStartingHand')
duelyst-sp-1      |   at StarterAI.nextActionForNewGame (/app/server/ai/starter_ai.js:194:21)
duelyst-sp-1      |   at StarterAI.nextAction (/app/server/ai/starter_ai.js:180:19)
duelyst-sp-1      |   at ai_setup (/app/server/single_player.coffee:1566:37)
duelyst-sp-1      |   at /app/server/single_player.coffee:1116:5
duelyst-sp-1      |   at tryCatcher (/app/node_modules/bluebird/js/main/util.js:26:23)
duelyst-sp-1      |   at Promise._settlePromiseFromHandler (/app/node_modules/bluebird/js/main/promise.js:508:31)
duelyst-sp-1      |   at Promise._settlePromiseAt (/app/node_modules/bluebird/js/main/promise.js:584:18)
duelyst-sp-1      |   at Promise._settlePromises (/app/node_modules/bluebird/js/main/promise.js:700:14)
duelyst-sp-1      |   at Async._drainQueue (/app/node_modules/bluebird/js/main/async.js:123:16)
duelyst-sp-1      |   at Async._drainQueues (/app/node_modules/bluebird/js/main/async.js:133:10)
duelyst-sp-1      |   at Immediate.Async.drainQueues [as _onImmediate] (/app/node_modules/bluebird/js/main/async.js:15:14)
duelyst-sp-1      |   at processImmediate (node:internal/timers:471:21)

We should ensure these games get mapped to the Game server instead.

Additionally, let's remove the cost of entry for Gauntlet mode.