Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    nicolasca
    @nicolasca
    Thanks for the share
    Nicolo John Davis
    @nicolodavis
    Released 0.35.1.
    One change that you will notice is that the Debug Panel contains an AI tab.
    You can adjust the bot parameters (iterations etc.) right from there.
    Chris Swithinbank
    @delucis
    :+1:
    Quinn Jones
    @quinnkazuojones
    What’s the appropriate method if I want to fetch from an API everytime a game instance is started?
    Quinn Jones
    @quinnkazuojones
    in setup()?
    Nicolo John Davis
    @nicolodavis
    What are you trying to fetch?
    Quinn Jones
    @quinnkazuojones
    card information from Magic the gathering API, that i would use to display on cards
    nicolasca
    @nicolasca
    @nicolodavis Cool for the release, thanks for your work.
    Nicolo John Davis
    @nicolodavis
    @quinnkazuojones Card information feels like static data that shouldn't be part of your game state.
    Your game state should just contain card ID's that you move around various data structures.
    The framework doesn't have good support for static data yet.
    Ideally this should be attached to the game object and is then made available to moves (while not ever being sent over the network or stored in the DB).
    For now, you can probably just make the card information available in a global variable that your game moves are able to reference.
    Nicolo John Davis
    @nicolodavis
    You have to just be aware that if you're setting up a multiplayer game, this information needs to be available on both server and client.
    Quinn Jones
    @quinnkazuojones
    thank you!!!!
    nicolasca
    @nicolasca
    I have a little trouble after updgrade to 0.35.1 when I run my server.js . I've got the error
    Error: Cannot find module './reducer-346fc670.js'. Any idea ?
    nicolasca
    @nicolasca
    Looks like this causes trouble var reducer = require('./reducer-2b585701.js'); in cjs/core.js
    Nicolo John Davis
    @nicolodavis
    Ah let me look into this. The integration test doesn't test the server so this error probably slipped through.
    MoFried
    @MoFried
    Hello,
    I'm following the multiplayer guide.
    When I execute "node -r esm src/server.js"
    I get this error: "Cannot read property 'processMove' of undefined"
    Also, boardgame.io/multiplayer does not exist, so I'm mimicking the code in CodeSandbox instead.
    Any help would be appreciated. :)
    Nicolo John Davis
    @nicolodavis
    There is a bug with the way the server component is exported in 0.35.1.
    This should be fixed in the coming week.
    nicolasca
    @nicolasca
    Alright, thank you !
    I also looked the new stuff in this version. Will it be possible to use the SocketIO in the client but with the use of the Lobby React component ?
    I mean for now I don't init the Client by myself, I use the Lobby React component to set the game and board.
    nicolasca
    @nicolasca
    Okey ignore the question, I saw the answer in lobby/react.js
    nicolasca
    @nicolasca
    I face a problem with my deployment in production. I wanted to have the client and the server in 2 different Docker containers with the docker-compose.yml.
    But I realize that both would need the same Game object, and it looks strange to me.
    Do I need to copy this object from my react project to my server folder during the deployment phase ?
    Maybe the question is not so clear, it's because it's a bit unclear for me. I feel I need to provide the Game object both in client and server, and I don't really know how to manage for prod environment.
    Nicolo John Davis
    @nicolodavis
    @MoFried Can you try the multiplayer guide again?
    I've updated the CodeSandbox links.
    @nicolasca I can't seem to find the problem in server.js that you are describing.
    For example, try downloading the code here and see if you are able to run the server component.
    (it works for me)
    nicolasca
    @nicolasca
    Yes it's working. In dev environment there is no problem. I run the webapp in one terminal, and the server in another (with node -r esm src/server.js). The problem is when I try to deploy in prod.
    In server.js I need to reference the Game object . But because my webapp runs in another container, it doesnt find it. I tried to find examples in the issues in Github. I could only find nginx conf. I don't know if someone already tried to have client and server in 2 different containers (maybe this is unecessary)
    I know the question is not specific to the lib itself, it's a deploy question. I ask just in case someone already faced it. If I can't find out, I will run both in a single container.
    Nicolo John Davis
    @nicolodavis
    What's preventing you from exposing the game object in both containers?
    The game object can be exposed via a JS file that you copy to both containers.
    nicolasca
    @nicolasca
    Nothing prevents me to do this. I didn't know if it could be a correct practice or not.
    nicolasca
    @nicolasca
    Anyway thanks for the aswers
    Julien Roullé
    @julienroulle
    @nicolodavis I am having the same problem as @MoFried
    TypeError: Cannot read property 'processMove' of undefined when trying a post request to /game/tictactoe/create
    My boargame.io version is 0.35.1
    Ok my bad, no problem anymore with the route /game/tic-tac-toe/create
    Julien Roullé
    @julienroulle
    But I can't manage to join a game using PostMan
    Anyone can tell me what's wrong in my request please?
    POST on http://localhost:8000/games/tic-tac-toe/Inja0m8Dq/join?playerID=0&playerName=Toto
    I receive playerID is required
    Julien Roullé
    @julienroulle
    Whatever i try this I get the same message
    Colin Kierans
    @Vindexus
    I believe you need to send those in the POST body, not as query parameters. I think something like
    curl --header "Content-Type: application/json" \ --request POST \ --data '{"playerID":"0","playerName":"Toto"}' \ http://localhost:8000/games/tic-tac-toe/Inja0m8Dq/join
    MoFried
    @MoFried
    @nicolodavis The multiplayer works now! Thanks! :)
    Julien Roullé
    @julienroulle
    @Vindexus thank you, that was my mistake!