INVALID_MOVE
the framework rejects the whole update, so even if G
was mutated, those changes are discarded. Our eventual aim is to allow something like return InvalidMove('reason…')
and then allow the client to receive the reason message for this kind of thing, but that’s not supported yet.
export interface GameState {
cells: (string|null)[]
}
moves : {
placePiece : (G, ctx, color, x, y) => { ... }
},
turn : {
stages: {
pieceNotPlaced : {
moves : { placePiece }
},
piecePlaced : {
moves : { commit, undo }
}
}
}
Hello! When I try to build, the moves : { placePiece } line gives a placePiece not defined error (the placePiece function works fine). Am I not using stages correctly here?
npm audit
. Now in place where i used to see my game board i see just the "connecting..." string without any errors. Seems that connection socket.io server works well but for some reason board is not rendered. Do you have any idea of what could be the problem?
interface SocketIOOpts
socketOpts?
was changed from any
to ioNamespace.SocketOptions
. Unfortunately, this means I can no longer initialize my Client
with multiplayer: SocketIO({ server: server_url, socketOpts: { path: '/sub/socket.io' } })
because path
is no longer accepted. Any ideas?
Hi, its me again 😅
I am currently having a weird issue (I probably had it before, but did not realize it).
Inside my game definition I set a seed for randomization. The seed is being generated by a call to nanoid().
However I noticed that the seed will only be set once for the game, not for each match instance I create.
Therefore each match will have the exact same randomization output.
I noticed this issue from 2018 boardgameio/boardgame.io#233 - however if I interpret it correctly, this has long been resolved.
Now I am wondering what I should be doing differently. I haven't found a way to tell the server to use a new seed when a new match is being created via the lobby API.
What am I missing here? :)
AHHHH nvm. I missunderstood how the seed works. The server already generates a new seed for each match. Overriding the seed is only necessary, if I want to use a specific seed (e.g. for testing etc.)
var activePlayersValue = {};
activePlayersValue[ctx.currentPlayer] = 'pickup'; //store up the current player to put into the pickup stage.
ctx.events.endTurn();
ctx.events.setActivePlayers({ currentPlayer: Stage.NULL, value: activePlayersValue, maxMoves: (6 - cardCount) }); //let them draw back to 6?
multiplayer: Local({
bots: {
0: MCTSBot,
1: MCTSBot,
},
}),
NODE_ENV
environment variable is 'production'
. Maybe double check process.env.NODE_ENV
is set to something else during development.
Hey folks,
I am currently a bit confused on how multiplayer credentials work.
My setup looks like this:
Now as far as I understand the docs I need three things:
I assume that the authenticateCredentials function takes whatever I put into the React-Components credentials prop as its first parameter. Is that correct?
This means I would not be able to use an HttpOnly-cookie because I won't be able to access it via JS from the client, so that I can hand it to the GameClient.
Is there anything I am missing? There does not seem to be a way to access the koa app.ctx inside the authenticateCredentials function, so that I could get the cookie from there.