Go Server is a 2-Player Websockets Go Judging Server.
Go Server is a 2-Player Websockets Go Judging Server. This project is made for the Spring 2020 Machine Intelligence Course (CMPN402) in Computer Engineering Program at Cairo University Faculty of Engineering.
The server uses Websockets protocol version 13 as defined by RFC6455 (https://tools.ietf.org/html/rfc6455)
Communication Details can found in this document.
You can download a binary version for Windows from Releases.
WARNING: When running the server, place it in a folder where it has permission to create folders and write files. This permission is needed to save logs and checkpoints.
yarn install
.yarn production
(See Parceljs for more options).yarn start
.yarn console:client [name] [address=ws://localhost:8080]
.yarn console:server
.yarn console:silly-agent
.yarn console:go
.yarn dist
.yarn test
.yarn watch:main
and yarn watch:renderer
each in a separate terminal.Server configuration is found in server.config.json
, which contains the following configurations:
host
: can be 127.0.0.1
if the server and the client are on the same machine (useful for debugging) and must be 0.0.0.0
if the clients will run on a seperate machine (NOTE: you can get your machine’s ip on the local network using ipconfig
).port
: defines the port to which the server will listen.ping interval
: defines the time interval for the ping/pong handshake in the heartbeat system (Format: MM:ss.s
).Game configuration is found in game.config.json
, which contains the configuration described in the Communication Protocol Document. You can edit the game configuration file and the server will automatically detect the changes without restarting.
After running the server, run 2 clients then choose the clients to join the game from the requests list. After picking the players, press Play. If there is a saved checkpoint, you can press Clear to clear the checkpoint and return to the configuration found in game.config.json
. If you press Pause, you can continue the game later.
Run: yarn console:client [name] [address=ws://localhost:8080] [protocol]
. If the client and server are on the same device, you can use the default host (localhost
). Otherwise, you need to find the Server IP by running ipconfig
on the host machine. protocol
is an optional argument to determine the protocol version requested by the client. The supported protocols are: v1
(default) and v2
.
The client can play their turn using on of the following commands:
pass
resign
place <point>
where:point
is written in the form: column
and row
.column
can be a letter from A to Z except I and row
can be a number from 1 to 25.help
and exit
.Run: yarn console:server
.
The server can manage the game using on of the following commands:
view <state | clients>
to view the game state or the clients list.state
will display the game board, scores, time, and turn.clients
will display the connected clients with their names, addresses and automatically assigned IDs. A list of selected players will also be shown.join <client-id> <color>
to add a client to the game as a player where color
is either B
or W
.leave <client-id>
to remove the client from the players’ list.disconnect <client-id>
to forcefully disconnect a client from the server.swap
to swap the colors of the players.start
to start a game from the current state.stop
to pause the game.clear
to discard the checkpoint and set the current state to match game.config.json
.help
and exit
.The project is available as open source under the terms of the MIT License.