Skip to content

Commit

Permalink
Merge branch 'master' into ux
Browse files Browse the repository at this point in the history
  • Loading branch information
delucis committed May 2, 2020
2 parents 28cc9b0 + dc668ec commit d999038
Show file tree
Hide file tree
Showing 31 changed files with 1,317 additions and 468 deletions.
17 changes: 15 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,12 @@
</p>

<p align="center">
<strong>Full Documentation: <a href="https://boardgame.io/documentation/#/">link</a></strong>
<strong><a href="https://boardgame.io/documentation/#/">Read the Documentation</a></strong>

</p>

<p align="center">
<strong>boardgame.io</strong> is an engine for creating turn-based games using JavaScript.
</p>

Write simple functions that describe how the game state changes
Expand Down Expand Up @@ -39,6 +44,12 @@ networking or storage code.
$ npm install --save boardgame.io
```

### Documentation

Read our [Full Documentation](https://boardgame.io/documentation/) to learn how to
use boardgame.io, and join the [community on gitter](https://gitter.im/boardgame-io/General)
to ask your questions!

### Running examples in this repository

```
Expand All @@ -47,6 +58,8 @@ $ npm run build
$ npm start
```

The examples can be found in the [examples](examples/) folder.

## Changelog

See [changelog](docs/documentation/CHANGELOG.md).
Expand All @@ -58,4 +71,4 @@ to find things that you could contribute to.

## License

MIT
[MIT](LICENSE)
26 changes: 26 additions & 0 deletions docs/documentation/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,29 @@
## 0.39.10

#### Features

* [[cf96955](https://github.com/nicolodavis/boardgame.io/commit/cf96955)] Add option to exclude games from public listing (#653)
* [[2e5b902](https://github.com/nicolodavis/boardgame.io/commit/2e5b902)] feat(core): Support moves that don’t contribute to numMoves (#646)
* [[e4fc7bd](https://github.com/nicolodavis/boardgame.io/commit/e4fc7bd)] feat(master): Update metadata with gameover value on game end (#645)
* [[05eacb8](https://github.com/nicolodavis/boardgame.io/commit/05eacb8)] Enable adding additional metadata to players in Lobby (#642)

#### Bugfixes

* [[d2f668b](https://github.com/nicolodavis/boardgame.io/commit/d2f668b)] Fix plugins in hooks triggered by moves (#656)
* [[334f8d6](https://github.com/nicolodavis/boardgame.io/commit/334f8d6)] [Documentation] Remove references to removed MongoDB adapter (#659)
* [[a4c4c7c](https://github.com/nicolodavis/boardgame.io/commit/a4c4c7c)] Test warning is logged when using deprecated `/rename` API endpoint. (#655)
* [[6aff09c](https://github.com/nicolodavis/boardgame.io/commit/6aff09c)] Add playAgain endpoint to Lobby documentation (#652)
* [[9f4acfe](https://github.com/nicolodavis/boardgame.io/commit/9f4acfe)] Add link to Azure Storage database connector (#651)
* [[78113aa](https://github.com/nicolodavis/boardgame.io/commit/78113aa)] Add mosaic to notable_projects.md (#649)
* [[c51b277](https://github.com/nicolodavis/boardgame.io/commit/c51b277)] expose log as a prop in the React client (#641)

## 0.39.9

#### Bugfixes

* [[b4bd8b7](https://github.com/nicolodavis/boardgame.io/commit/b4bd8b7)] fix(package): update npm files field for new server bundle (#639)
* [[0552efb](https://github.com/nicolodavis/boardgame.io/commit/0552efb)] add src/ to NPM

## v0.39.8

#### Bugfixes
Expand Down
1 change: 1 addition & 0 deletions docs/documentation/api/Game.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
undoable: false, // prevents undoing the move.
redact: true, // prevents the move arguments from showing up in the log.
client: false, // prevents the move from running on the client.
noLimit: true, // prevents the move counting towards a player’s number of moves.
},
},

Expand Down
38 changes: 30 additions & 8 deletions docs/documentation/api/Lobby.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,14 @@ Options are:

Creates a new authenticated room for a game named `name`.

Accepts two parameters:
Accepts three parameters:

`numPlayers` (required): the number of players.

`setupData` (optional): custom object that is passed to the game `setup` function.

`unlisted` (optional): if set to `true`, the room will be excluded from the public list of room instances.

Returns `roomID`, which is the ID of the newly created game instance.

#### Joining a game
Expand All @@ -74,19 +76,21 @@ Accepts two JSON body parameters, all required:

Returns `playerCredentials` which is the token this player will require to authenticate their actions in the future.

#### Renaming a player
#### Update a player's information

##### POST `/games/{name}/{id}/rename`
##### POST `/games/{name}/{id}/update`

Rename a user in the room instance `id` of a game named `name` previously joined by the player.
Rename and/or update additional information of a user in the room instance `id` of a game named `name` previously joined by the player.

Accepts three parameters, all required:
Accepts four parameters, requires at least one of the two optional parameters:

`playerID`: the ID used by the player in the game (0, 1...).
`playerID` (required): the ID used by the player in the game (0,1...).

`credentials`: the authentication token of the player.
`crendentials` (required): the authentication token of the player.

`newName` (optional): the new name of the player.

`newName`: the new name of the player.
`data` (optional): additional information associated to the player.

#### Leaving a room

Expand Down Expand Up @@ -131,3 +135,21 @@ Returns a room instance. Each instance has fields:
#### Client Authentication

All actions for an authenticated game require an additional payload field `credentials`, which must be the given secret associated with the player.

#### Playing again

##### POST `/games/{name}/{id}/playAgain`

`{name}` (required): the name of the game being played again.

`{id}` (required): the ID of the previous finished room.

Given a previous room, generates a room ID where users should go if they want to play again. Creates this new room if it didn't exist before.

Accepts these parameters:

`playerID` (required): the player ID of the player on the previous game.

`credentials` (required): player's credentials.

Returns `nextRoomID`, which is the ID of the newly created room that the user should go to play again.
18 changes: 1 addition & 17 deletions docs/documentation/multiplayer.md
Original file line number Diff line number Diff line change
Expand Up @@ -218,22 +218,6 @@ either by a URL path or a lobby implementation.
The default storage implementation is an in-memory map.
If you want something that's more persistent, you can use one
of the bundled connectors for various backends, or even implement
your own connector. For example, here is how you can keep your
game state in a MongoDB.

```js
const { Server, Mongo } = require('boardgame.io/server');
const { TicTacToe } = require('./game');

const server = Server({
games: [TicTacToe],
db: new Mongo({
url: 'mongodb://...',
dbname: 'bgio',
}),
});

server.run(8000);
```
your own connector.

See [here](storage.md) for more details about how to customize storage.
2 changes: 2 additions & 0 deletions docs/documentation/notable_projects.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,5 @@ List of notable projects using boardgame.io. This list is not exhaustive. Feel f
- [Pong240's Boardgame](https://github.com/Pong420/Boardgame) - [play](http://play-boardgame.herokuapp.com) - A project for building board games with React and boardgame.io.

- [Territories](https://github.com/lehaSVV2009/territories) - [play](https://lehasvv2009.github.io/territories/) - Simple board game Territories.

- [Mosaic Multiplayer](https://github.com/maciejmatu/mosaic) - [play](https://playmosaic.online/) - Azul board game clone you can play online with friends.
4 changes: 4 additions & 0 deletions docs/documentation/storage.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ server.run(8000);

Instructions at https://github.com/delucis/bgio-firebase.

#### Azure Storage

Instructions at https://github.com/c-w/bgio-azure-storage.

#### Postgres

Coming soon.
Expand Down
5 changes: 4 additions & 1 deletion integration/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,13 @@
"react-dom": "^16.7.0",
"react-scripts": "^2.1.3"
},
"devDependencies": {
"cross-env": "^7.0.2"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "CI=true react-scripts test",
"test": "cross-env CI=true react-scripts test",
"eject": "react-scripts eject"
},
"eslintConfig": {
Expand Down
Loading

0 comments on commit d999038

Please sign in to comment.