- [96b26bb9] lobby: block creation of matches with invalid player counts (#1060)
- [453f530c] types: Use correct socket.io options typing
- [3692199, 1e57a9c] Update dependencies: socket.io and koa-body
- [453f530c] types: Use correct socket.io options typing
- [7e55d118, 75428111, 4fa2c4f1, 52450607] Update dependencies: engine.io, nanoid, ajv, and node-fetch
- [6756419a] Include
testing/package.json
in npm files
- [636ce8f6] Add testing utility for mocking the randomness API
- [39e1f187] Bump
rfc6902
dependency to address prototype pollution vulnerability
- [279a822f] flow: Pass correct
ctx
toonMove
hooks
- [220823bb] Update gameover metadata when
undefined
(#1023) - [df6b7c40] include
chatMessages
property in React client types (#1022)
- [fa7544f5] api: Update query string types and handle array queries
- [4813fa15, 0f6076b5, 06b4172d, 54c0b4c0] Update dependencies
- [7b151798] Expose
getFilterPlayerView
frominternal
package
- [20817aa3] transport: More accurately type
TransportOpts
- [604d12e6] lobby: use first available
playerID
when joining a match (#1013) - [510a082a] transport: Consolidate transport interface (#1002)
- [d30d5776] Expose
createMatch
utility
-
[4165d45d] Deprecate
moveLimit
in favour ofminMoves
/maxMoves
(#985)Migration:
- Replace
turn.moveLimit
with bothturn.minMoves
andturn.maxMoves
. - Replace
moveLimit
insetStage
andsetActivePlayers
withmaxMoves
.
- Replace
- [ad78eded] ai: Run AI iterations using
setImmediate
for improved performance (#999) - [feb08a12] lobby: Clean up & update refresh polling interval properly (#996)
- [a240bbee] client: Fix React Native support
- [8b871ab5] server: Support custom Lobby API middleware (#992)
- [06bc7479] debug: Improve AI panel accessibility
- [d2b611d7] debug: Stop panel intercepting clicks in transparent parts
- [62f97e54] Allow plugins to use events in
fnWrap
- [d54af1f4] events: Don’t use const enum for better backwards compatibility
- Dependency changes only
- [8267e36c] events: Add stack traces to events plugin errors
- [f97a08d8] Improve events errors & expose method types to plugin
fnWrap
(#980)- See the Events guide for details of event support in game hooks
- [95be8b90] events: Accurately type events API arguments
- [bff1d294] flow: Run
turn.endIf
aftersetActivePlayers
event
- [f0bc8b9] flow: Run
turn.endIf
hook after updating stages
- [91cf25e] Events Plugin: Don’t leak stage events across turns & allow self-ending turns/phases (#957)
- [afee0b7, 1e435c2, 1078b13] Allow plugins to declare an action invalid (#963, #970)
- [262d867] Server: Decouple player view calculation from Master (#966)
- [dcaca7f] types: Remove
turn.moves
fromGame
type - [b753094, 2aa9db5] Update dependencies (#965, #968)
- [be63602] Update development dependencies (#969)
- [4efec1a] Update linter tooling & refactor errors (#967)
Please see notes for v0.45.0. This release extends CORS security restrictions to the Lobby API (0.45.0 only applied the origins
config to the socket.io server).
- [2b1d013] server: Update to latest
@types/cors
to provide better origins configuration defaults
Previously boardgame.io servers allowed CORS requests from all origins by default. After updating socket.io in 0.45.0, an origins
option must now be provided when creating the server to enable cross-origin requests:
const { Server } = require('boardgame.io/server');
Server({
origins: ['https://www.mygame.com'],
// ...
});
See the Server reference page for more details.
- [2eca252] Improve error handling (work in progress) (PR #940, Issue #723)
- [cceb0f2] package: Add funding field
- [1d20e7e] client: Correct signature type for
sendChatMessage
- [a7c8776] debug panel: Handle all possible argument types in the log pane
- [abc516b] Add an option to use JSON patches for state updates (#920)
- [0bab885] Support spying on logs after framework is loaded (#918)
- [a57fe19] Export additional game API types (#927)
- [01c522c] Throw error in development if non-serializable state is used in a move (#896)
- [ccc9ada] Add details to exceptions raised in LobbyClient (#898)
- [ae790e8] dependencies: bump immer from 7.0.8 to 8.0.1 (#895)
- [6f9bc27] dependencies: Run
npm audit fix
- [3d614b8] server: Improve security of socket.io transport layer (#894)
- [dc96b26] master: Disallow
onSync
match creation if game requiressetupData
(#890)
- [b14ea29] client: Always include
chatMessages
andsendChatMessage
on client instances
- [0ad1d6d] [c178a41] Add in-game chat support (#871, #879)
- [3918cc9] Add plugin to allow adding custom metadata to logs (#865)
- [243388d] Centralise lobby API and master authentication logic (#853)
- [e515573] Handle random plugin redacted state on multiplayer clients (#885)
- [3b8ac79] Prevent
TypeError: state.deltalog is not iterable
(#888) - [2cc6104] Support latest Safari & Firefox when running examples
- [6ba5536] Add localStorage support to Local master (#691)
- [257a735] Track players connection status (#839)
- [d071e98] Add game method to validate setup data (#831)
- [ace1144] local: Use shared local master with bots (#838)
- [9fcbed7] client: Correctly type state returned by client to subscribers
Push another release to fix NPM weirdness.
- [c8c648e] Add global manager to track client & debug panel instances (#816)
- [af43561] Add log entries for undo/redo actions (#825)
- [2595399] Improve undo/redo (#823)
- [3d2131e] master: Use
createMatch
for implicit match creation (#821) - [f74f953] Improve match term consistency (#806)
- [f5d3a97] debug: Improve debug panel accessibility (#827)
- [0040a5d] reducer: Restore plugin state on undo/redo
- [4f2ffc4] debug: Include plugin data in log rewind gamestate override
- [197a9bb] reducer: Fix stateID increment & build deltalog on server only (#817)
- [600caa8] debug: Use local reducer in Log rewind
- [3c2aadd] client: Don’t run playerView locally on multiplayer clients (#819)
- [abd9695] fix: Simplify local transport typing
- [9a2a609] fix: improve socketio.ts typings (#811)
- [0f8882a] core: Fix EndPhase deltalog (#812)
- [4bd283c] fix: FlatFile.listGames filter (#802)
- [0062e55] client: Improve client types (#801)
See PR #709 on GitHub for a full list and migration guide.
- [43c7fbb] Add plain JS lobby client (#728)
- [adb251d] [6fcf695] Use “match” instead of “game”/“room” in Lobby API (#704, #765)
- [88b0ee7] debug: Display live object view in debug panel (#781, #790)
- [3984ee7] debug: Events shortcuts, stages support & minor fixes (#791)
- [3c8777b] server: Timestamp metadata and match filtering in the Lobby API (#740)
- [a0c34fd] server: Expose API router (#698)
- [2586022] debug: Keep debug panel above other page elements (#780)
- [f32dc76] api: Expose gameover metadata in lobby endpoints (#666)
- [fa865da] fixes build in rushjs monorepo context (#550)
- [84e93b4] build: Exclude svelte from Rollup’s external module list (#767)
- [72ed591] fix: Tidy up type provision (#764)
- [271aecd] fix: Fix client types & move BoardProps to React package (#752)
- [c115087] game: add disableUndo flag to game config (#742)
- [a6698e6] debug: Fix save & restore in Debug panel (#746)
- [2b1bd19] ai: Convert to Typescript (#734)
- [872b58b] client: Make argument optional in Local transport (#731)
- [0088cb5] fix: Re-sync client on reconnect, fixes #713 (#727)
- [0ca1cef] lobby: use previous game config as defaults in playAgain (#719)
- [60b32e5] Add support for socket.io-adapter implementations (#706)
- [eb236df] db: FlatFile per-file request queues enhancement (#705)
- [ef97441] debug: Save all state to localStorage, not just G and ctx (#716)
- [4d45ff1] client: Fix restore in debug controls (#712)
- [d728425] core: Fix undo/redo if the move changed the stage (#701)
- [3a622f1] Use Promise chaining to enforce read/write queue (#699)
- [cfeaf67] plugins: Let moves return INVALID_MOVE after mutating G (#688)
- [b2d6b06] server: Lobby API improvements (#675)
- [dc668ec] server: Expose SocketIO transport & convert to TS (#658)
- [1483a08] fix UX issues in move debugger (#640)
- [814621b] Make package.json scripts work on Windows (#657)
- [cf96955] Add option to exclude games from public listing (#653)
- [2e5b902] core: Support moves that don’t contribute to numMoves (#646)
- [e4fc7bd] master: Update metadata with gameover value on game end (#645)
- [05eacb8] Enable adding additional metadata to players in Lobby (#642)
- [d2f668b] Fix plugins in hooks triggered by moves (#656)
- [334f8d6] [Documentation] Remove references to removed MongoDB adapter (#659)
- [a4c4c7c] Test warning is logged when using deprecated
/rename
API endpoint. (#655) - [6aff09c] Add playAgain endpoint to Lobby documentation (#652)
- [9f4acfe] Add link to Azure Storage database connector (#651)
- [78113aa] Add mosaic to notable_projects.md (#649)
- [c51b277] expose log as a prop in the React client (#641)
- [3569408] Add option to run server over HTTPS (#631)
- [c56d9b9] Adding playerID to Ctx (#627)
- [882a25d] export only the client in the browser-minified package
- [3d1c07c] server: Proxy server module with package.json (#622)
- [bd44678] Fix passing params to db adapter (#621)
- [44d0d4f] fix bad merge that undid boardgameio#614
- [c5211c2] Typescript enhancements (#612)
- [eb1e060] make plugins available in turn order functions
- [0688f4d] Include credentials in undo/redo actions (#595)
- [f34f46b] core: Don’t error if turn.order.next returns undefined (#614)
- [78729eb] core: More Typescript conversion (#597)
- [3a41cf7] plugins: Make player plugin a factory function (#604)
- [1877268] plugins: More Typescript & pass playerID to Enhance (#598)
- [5696dc4] server: Correctly wait for server.listen event (#589)
- [167690c] add plugin types to ctx interface (#579)
- [618618e] db: Make listGames options optional (#585)
- [f3c62a3] db: Make log handling explicit in StorageAPI.setState (#581)
- [c7dad76] add the ability for plugins to define their own actions
- [9a21fee] Remove namespacing in gameIDs on client side (#583)
- [c507cf0] Typescript improvements (#578)
- [ca3cc0f] avoid document reference error in some versions of Node
- [ca52b01] export some types in the NPM
- [6a091de] retrieve initial state using a separate code path
- [62f58d2] add createGame to StorageAPI
- [21c3ef4] make listGames take an opts argument
- [bff685d] rename remove to wipe
- [d4de9e2] move log out of game state
- [045a8f5] rename list to listGames
- [7b70cab] remove MongoDB
- [0fb67fe] remove Firebase
- [c96e228] separate metadata and state in storage API
- [a624c9e] update @babel/preset-env
- [c1dba9f] update prettier
- [60c6d88] update rollup-plugin-terser
- [6378659] npm run audit
The Plugin API is revamped. This also includes changing the way
PluginPlayer
works. Please take a look at the
documentation. Feel free to comment on the public Gitter
channel if you have use-cases that are not covered by the rewrite
or need help migrating.
- [aede3b6] check that document exists before mounting debug panel
- [ec7f0ad] master: Remove credentials from action payloads after use (#556)
- [a080ce3] fix: #552 (#553)
- [79ebcc3] remove graceful-fs patch
- [9370366] remove some unused Svelte props
- [8c120d2] trigger bot if it needs to play at game start
- [aed5cd1] don't run bot once game is over
- [7c65046] fix redacted move example
- [66021f7] fix bug causing AI section to not activate
- [fd34df9] plugins: Fix PluginPlayer setup (#543)
The ai
section has been moved from the Client
to the game config:
const game = {
moves: { ... },
...
ai: { ... }
}
- [0eff1c6] make the lobby assign bots to remaining players when there is only one human player
- [ef8df65] add ability for Local multiplayer mode to run bots
- [b974260] Improve Lobby API: room instances (#542)
- [afdb79e] refactor: Harmonise Master’s auth signature with authenticateCredentials (#539)
- [61a45ee] rename optimistic to client and document it
- [4d33faa] server: Lobby server improvements (#532)
- [08404e2] change MCTS visualization to table format
- [2d931e9] server: Use namespaced ID to delete persisted game data (#531)
- [9ce176c] client: Scope global CSS selectors in Debug panel (#527)
- [ef4f24d] Fix events in hooks triggered by a move (#525)
- [a2c64f8] increment turn before calling turn.onBegin
- [26a73e4] fix error in AI panel
- [e7d47ee] export Debug Panel in boardgame.io/debug
- [cae05fd] Replace
player
withcurrentPlayer
option insetActivePlayers
(#523) - [2a7435a] rename step to play
- [05572ca] add progress bar to AI panel
- [ad08b8a] Increment current player at start of phase in TurnOrder.DEFAULT (#521)
- [3cd5667] speed up bot async mode by running 25 iterations per chunk
- [f19f1de] add async mode to MCTS bot
- [7d22a47] make bot play functions async
- [4efddb4] lobby auto refresh + leave game ready to play (#510)
- [a8b7028] add sliders to adjust iterations and playoutDepth of MCTS bot
- [1687ff8] Add pass event (#492)
- [5fb3c4c] allow switching between MCTS and Random bots in AI panel
- [9d74966] allow setting bot options from Debug Panel
- [bbfa304] add AI tab
- [ba9dca8] add server.js to files section
- [457b29d] call notifySubscribers in update{Player,Game}ID
- [b4edd55] Add server to proxy-dirs and clean scripts to fix #518 (#519)
- [6c0a9b7] allow switching playerID from Debug Panel
The main feature in this release is that the Debug Panel is now baked into the Vanilla JS client. This means that non-React users will have access to it as well!
It is guarded by process.env.NODE_ENV !== 'production', which means that most bundlers will strip it out in a production build.
The other big change is that the NPM package now contains both CJS and ES builds for every subpackage. This should have no user visible impact, but might break some non-standard bundler configurations.
- [e9351dc] log a message when INVALID_MOVE is returned
- [2f86d92] rename mount/unmount to start/stop
- [1ad87d0] remove INFO log in production, but not ERROR logs
- [83810ea] guard Debug Panel with process.env.NODE_ENV
- [156cf07] generate CJS and ES version of main package
- [881278a] Migrate Debug Panel + Log + MCTS Visualizer to Svelte (#498)
- [49f5a52] allow multiple client subscriptions
- [3206548] don't invoke callback on subscribe in multiplayer mode unless client is already connected
- [9596fa4] only notify the latest subscriber during client.subscribe
- [5a13f00] fix bug in the way the transport notifies client subscribers of connection changes
- [c77ba53] handle multiple subscriptions correctly
- [b045de3] use Parcel instead of Webpack in examples
- [18d9be5] Allowing support for both numbers and functions for MCTS bot iterations and playoutDepth (#475)
- [901c746] feat: Apply
value
argument last insetActivePlayers
(#489)
- [bed18ce] reintroduce InitializeGame in boardgame.io/core
- [6eb4ebd] rewrite one of the snippets in Svelte
- [86e65fe] fix: Move player to “next” stage on
endStage
(#484)
Huge release with a more streamlined API and the much awaited feature: Stages!
Check out this migration guide.
- [6762219] refactor: Change moveLimit syntax in setActivePlayers (#481)
- [64971ee] Disallow game names with spaces (#474)
- [d43d239] short form syntax for literal value in setActivePlayers
- [462f452] allow all players to call events
- [2409729] enable all events by default
- [1261475] remove UI toolkit
- [b2f5160] feat: Add
endStage
andsetStage
events (#458) - [ca61bf6] feat: Support move limits in
setActivePlayers
(#452) - [ec15ad2] TurnOrder.RESET
- [d251f4a] set phase to null instead of empty string
- [9c6f55d] set currentPlayer to null instead of empty string
- [da2f0ea] add stages
- [d5e2b55] start turn at 1
- [35a34a0] nest turns inside phases
- [cff284b] convert startingPhase into boolean option
- [b9ce7f1] move event disablers inside separate section in config
- [61eb8d8] rename movesPerTurn to moveLimit
- [3a97a16] make optimistic an option in long-form move syntax
- [10ef457] retire Game(). call it internally instead.
- [3d46a4a] rename endGameIf to endIf
- [33ac684] retire flow section
- [d75fe44] move undoableMoves into boolean inside long form move syntax
- [8924e84] move redactedMoves into a boolean option in the long form move syntax
- [4b202ee] long form move syntax
- [f00e736] rename some hooks
- [19ca21f] move onTurnBegin/onTurnEnd/endTurnIf/movesPerTurn into turn object
- [53b7ac7] convert turnOrder into a turn object
- [fa58e5b] retire allowedMoves
- [7a411c9] introduce namespaced moves that are defined within phases
- [a0d5f36] Surface game metadata and player nicknames in client / react props (#436)
- [221b0d5] add benchmark
- [fd70ed5] No payload is not an authentic player (#430)
- [9cff03e] Create play again endpoint (#428)
- [0a75e4b] fix: Fix join/leave a room when playerID is 0 (#425)
- [2b98fb6] change custom client transport to a constructor (#417)
- [89faece] Rename playerCredentials to credentials for /leave endpoint, update src/lobby/connection.js accordingly (#416)
- [25c2263] Fix #345; restrict undo/redo to currentPlayer (#408)
- [6de7b64] Add /rename endpoint for lobby (#414)
- [febb1c0] Check if required parameters are passed to API (#407)
- [a6145a5] upgrade koa and koa-body
- [5ad5c3f] Remove some secrets from client in multiplayer game (#400)
- [3e50dca] Get specific instance of a room by its ID (#405)
- [4964e3f] Creating lobby API config and making the UUID customizable (#396)
- [efece0c] Auto-add trailing slash to server only if needed (#403)
- [f289379] Rename gameInstances to rooms (#402)
- [1d5586c] export FlatFile in server.js
- [eda9728] update undo to reflect current ctx (#393)
- [e46f195] add turn and phase to log entries
- [3982150] synchronous mode for game master
- [8732d9f] Add adminClient option for Firebase storage (#386)
- [8ed812e] handle default number of players bigger than 2 for 1st game of the list (#392)
- [ec7dde5] Don't leak undefined ctx properties from turnOrder.actionPlayers (#382)
- [3bde0ca] Adding step props to the Board (#376)
- [4c3056c] Making step accept a Promise from bot.play() (#375)
- [94b1d65] Add flatfile database with node-persist (#372)
- [f6e70fd] Add custom renderer parameter to lobby + clean up code (#353)
- [01a7e79] 3D Grid and Token (#352)
- [1f33d43] Serve API and Game Server on same port with option to split (#343)
- [87d1e5b] Changed default Firebase return value to undefined (#361)
- [d7d6b44] Fix lobby example (#351)
- [a285fbf] Allow https urls to be passed to lobby (#350)
- [4a796dc] remove three from minified rollup bundle
- [a32d3d5] Generic lobby (#294)
- [fb19e9b] move examples into a create-react-app package (#335)
- [1f71bbd] Upgrade Babel 7 (#332)
- [3334d38] fix race condition in game instantiation inside onSync
- [f544511] Allow result of onPhaseBegin to influence turn order (#341)
- [e1c1f6b] fail integration test if any subcommand fails
- [6cf81e8] create initial game state outside reducer
- [8d08381] add a loading component for multiplayer clients
- [d20d26c] make master write to proper namepspaced keys
- [7188222] add plugin.onPhaseBegin
- [c1b4a03] add playerSetup option to PluginPlayer
- [5d74c95] fix immer plugin order
- [ff749e3] add addTo / removeFrom to plugin API
- [9df8145] split plugin.setup into setupG and setupCtx
- [d2d44f9] rename plugin.wrapper to plugin.fnWrap
- [ca5da32] Passing arbitrary data to game setup (#315)
- [d1bd1d1] Plugin API
- [10de6f8] Turn order active player changes (#320)
- [58cbd1e] Redact Log Events (#268)
- [ed165a8] Add a server sync status field (#307)
- [b8ec845] package refactor
- [2b5920f] Add Immer to other events (#327)
- [873e1f5] server: fix name of property 'credentials' in server API handler for 'leave' (#326)
We now support an alternative style for moves that allows modifying G
directly.
The old style is still supported.
- [6bdfb11] add immer
undefined
is no longer used to indicate invalid moves. Use the new INVALID_MOVE
constant to accomplish this.
import { INVALID_MOVE } from 'boardgame.io/core';
const TicTacToe = Game({
moves: {
clickCell: (G, ctx, id) => {
if (G.cells[id] !== null) {
return INVALID_MOVE;
}
G.cells[id] = ctx.currentPlayer;
},
},
});
- [2d02558] add TurnOrder.CUSTOM and TurnOrder.CUSTOM_FROM
- [8699350] Prohibit second log event during Update (#303)
This is a pretty exciting release with lots of goodies but with some breaking changes, so make sure to read the section at the end with tips on migration. The main theme in this release is the reworking of Phases and Turn Orders to support more complex game types and other common patterns like the ability to quickly pop into a phase and back.
- [b7abc57] more turn orders
- [5fb663a] allow calling setActionPlayers via TurnOrder objects
- [53473ef] change semantics of enabling/disabling events
- [992416a] change format of args to endPhase and endTurn
- [0568857] change phases syntax
- [96def53] add MONGO_DATABASE env variable (#290)
- The syntax for phases has changed:
// old
phases: [
{ name: 'A', ...opts },
{ name: 'B', ...opts },
]
// new
phases: {
'A': { ...opts },
'B': { ...opts },
}
- There is no implicit ordering of phases. You can specify an
explicit order via
next
(optional). Note that this allows you to create more complex graphs of phases compared to the previous linear approach.
phases: {
'A': { next: 'B' },
'B': { next: 'A' },
}
Take a look at phases.md to see how endPhase
determines which phase to move to.
- A phase called
default
is always created. This is the phase that the game begins in. This is also the phase that the game reverts to in case it detects an infinite loop ofendPhase
events caused by a cycle.
You can have the game start in a phase different from default
using startingPhase
:
flow: {
startingPhase: 'A',
phases: {
A: {},
B: {},
}
}
- The format of the argument to
endPhase
or the return value ofendPhaseIf
is now an object of type{ next: 'phase name' }
// old
endPhase('new phase')
endPhaseIf: () => 'new phase'
// new
endPhase({ next: 'new phase' })
endPhaseIf: () => ({ next: 'new phase' })
- The format of the argument to
endTurn
or the return value ofendTurnIf
is now an object of type{ next: playerID }
// old
endTurn(playerID)
endTurnIf: () => playerID
// new
endTurn({ next: playerID })
endTurnIf: () => ({ next: playerID })
-
The semantics of enabling / disabling events has changed a bit: see https://boardgame.io/#/events for more details.
-
TurnOrder objects now support
setActionPlayers
args. Instead of returningactionPlayers
infirst
/next
, add anactionPlayers
section instead.
// old
{
first: (G, ctx) => {
playOrderPos: 0,
actionPlayers: [...ctx.playOrder],
}
next: (G, ctx) => {
playOrderPos: ctx.playOrderPos + 1,
actionPlayers: [...ctx.playOrder],
},
}
// new
{
first: (G, ctx) => 0,
next: (G, ctx) => ctx.playOrderPos + 1,
actionPlayers: { all: true },
}
- [d50015d] turn order simulator
- [58e135b] fix bug that was causing ctx.events to be undefined
- [ea3754b] player needs to be in actionPlayers in order to call events
- [a352d1e] decouple once and allOthers
- [aa5f2cf] added the useNewUrlParser option to the Mongo connect() (#285)
- [e8f165a] server: add new API endpoints 'list' and 'leave' (#276)
- [8ff4745] drag-n-drop for cards and decks
- [a558092] return state as first argument to client.subscribe callback
- [965f9b7] Allow to set payload onto a log event (#267)
- [2efdbc1] utils for working with hexagonal boards (#271)
- [137dd7c] allow overriding client-side transport
- [63311ac] local game master
- [0b7a0a0] add allOthers option to setActionPlayers (#269)
- [d1a1a8a] shouldEndPhase can see the results of onTurnEnd
- [b4874a6] call the client subscribe callback after LogMiddleware has run
- [9b9d735] reset deltalog properly
- Fixed babelHelpers error in npm.
Broken, do not use (complains about babelHelpers missing).
- [ebf7e73] fix bug that was preventing playerID from being overriden by the debug ui
- [09b523e] require mongo and firebase only if used
- [fe8a9d0] Added ability to specify server protocol (#247)
- [43dcaac] write turn / phase stats in ctx.stats
- [bd8208a] fabricate playerID in singleplayer mode
- [b4e3e09] { all: true } option for setActionPlayers
- [5d3a34d] { once: true } option for setActionPlayers
- [75a274c] rename changeActionPlayers to setActionPlayers
- [4ec3a61] end phase when a turn order runs out
- [cb6111b] retire the string constant 'any'
- [36fc47f] basic support for objective-based AI
- [d1f0a3e] improved rendering of turns and phases in the log
- [0bc31d6] better MCTS visualization
- [14a5ad7] update redux to 4.0.0
- [84f07c6] Do not fabricate playerID for playerView
- [c4a11a7] ignore events from all but currentPlayer
- [6a8b657] move mongodb and firebase deps to devDependencies
- [239f8dd] Use parse/stringify from flatted lib to support circular structures (fixes #222) (#240)
- [edd1df0] Differentiate automatic game events in the log
- [570f40e] don't render AI metadata if visualize is not specified
- [a8431c7] set default RNG seed once per game, not game type
- [5090429] API: check secret before handling the request (#231)
- [1a24791] attach events API early so that it can be used on the first onTurnBegin
- [acb9d8c] enable events API in initial onTurnBegin/onPhaseBegin
changeActionPlayers
is nowsetActionPlayers
. It also supports more advanced options.- Returning
undefined
from aTurnOrder
results in the phase ending, not settingcurrentPlayer
toany
. - Only the
currentPlayer
can call events (endTurn
,endPhase
etc.).
- [6194986] remove async/await from client code
- [7a61f09] make Random API present in first onTurnBegin and onPhaseBegin
- [f26328c] add ai.js to rollup config
- [7a80f66] make changeActionPlayers an opt-in event
- [40cd4b8] Add config update on phase change Fixes #211 (#212)
- [bb39ca7] fix bug that was causing isActive to return false
- [81ed088] ensure endTurn is called only once after a move
- [ca9f6ca] disable move if playerID is null
- [55715c9] Fix undefined ctx in onPhaseBegin
- [387d413] Debug UI CSS improvements
- [2105f46] call endTurnIf inside endPhase
- [9b0324c] allow setting the next player via endTurn
- [f76f97e] correct isMultiplayer
- [278b369] Fix bug that was ending phase incorrectly (#176)
- [dc31a66] expose allowedMoves in ctx
- [da4711a] make allowedMoves both global and phase-specific
- [9324c58] Allowed moves as function (#164)
- [5e49448] convert multiplayer move whitelist to blacklist
- [27705d5] pass Events API correctly inside events.update
- [87e77c1] correctly detach APIs from ctx in startTurn
- [2ee244e] Reset Game (#155)
- [9cd3fdf] allow to modify actionPlayers via Events (#157)
- [767362f] endGame event
- [78634ee] Events API
- [a240e45] undoableMoves implementation (#149)
- [c12e911] Process only known moves (#151)
- [7fcdbfe] Custom turn order (#130)
- [748f36f] UI: add mouse hover action props to grid, hex, and token (#153)
- [f664237] Add notion of actionPlayers (#145)
- [43ba0ff] allow optional redux enhancer (#139)
- [dd6c110] Run endPhase event (analogue to endTurn) when game ends (#144)
- [8969433] Fix bug that was causing Random code to return the same numbers.
- The
Random
API is different. There is no longer aRandom
package that you need to import. The API is attached to thectx
parameter that is passed to the moves. Take a look at http://boardgame.io/#/random for more details.
- [06d78e2] Enable SSR
- [ed09f51] Allow calling Random during setup
- [c50d5ea] fix log rendering of phases
- [eec8896] undo/redo
- MongoDB connector
boardgame.io/server
no longer has a default export, but returnsServer
andMongo
.
// v0.19
const Server = require('boardgame.io/server').Server;
// v0.18
const Server = require('boardgame.io/server');
[0c894bd] add react.js to rollup config
- [4b90e84] decouple client from React
This adds a new package boardgame.io/react
. Migrate all your
calls from:
import { Client } from 'boardgame.io/client'
to:
import { Client } from 'boardgame.io/react'
boardgame.io/client
exposes a raw JS client that isn't tied
to any particular UI framework.
-
Random API:
-
[f510b69] onTurnBegin (#109)
- [6a010c8] Debug UI: fixes related to errors in arguments (#123)
- [0572210] Exposing Client connection status to board. (#97)
- [c2ea197] make db interface async (#86)
- [9e507ce] exclude dependencies from package
- [a768f1f] remove entries from clientInfo and roomInfo on disconnect
- [11e215e] fix bug that was using the wrong playerID when calculating playerView
- [0758c7e] cascade endPhase
- [cc7d44f] retire triggers and introduce onMove instead
- [17e88ce] convert events whitelist to boolean options
- [e315b9e] add ui to NPM package
- [5b34c5d] remove pass event and make it a standard move
- [f3da742] make playerID available in ctx
- [cb09d9a] make turnOrder a globally configurable option
- [a482469] ability to specify socket server
- [2ab3dfc] end turn automatically when game ends
- [c65580d] Fix bug introduced in af3a7b5.
- [af3a7b5] Only process move reducers (on the client) and nothing else when in multiplayer mode.
Buggy fix (fixed in 0.16.7).
- [2721ad4] Allow overriding
db
implementation in Server.
PlayerView.STRIP_SECRETS
endPhaseIf
is called after each move (in addition to at the end of a turn).gameID
is namespaced on the server so that there are no clashes across game types.
props.game
is nowprops.events
(to avoid confusing it with thegame
object).
// OLD
onClick() {
this.props.game.endTurn();
}
// NEW
onClick() {
this.props.events.endTurn();
}
- Multiple game types per server!
Server
now accepts an arraygames
, and no longer takesgame
andnumPlayers
.
const app = Server({
games: [ TicTacToe, Chess ]
};
- [a61ceca]: Log turn ends correctly (even when triggered automatically by
endTurnIf
)
- [9ce42b2]: Change color in
GameLog
based on the player that made the move.
- [23d9726]: Fix bug that was causing
log
to be erased afterflow.processMove
.
boardgame.io/game
is nowboardgame.io/core
, and does not have a default export.boardgame.io/client
no longer has a default export.
// v0.16
import { Game } from 'boardgame.io/core'
import { Client } from 'boardgame.io/client'
// v0.15
import Game from 'boardgame.io/game'
import Client from 'boardgame.io/client'
victory
is nowendGameIf
, and goes inside aflow
section.- The semantics of
endGameIf
are subtly different. The game ends if the function returns anything at all. ctx.winner
is nowctx.gameover
, and contains the return value ofendGameIf
.props.endTurn
is nowprops.game.endTurn
.