You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+13-7Lines changed: 13 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -30,15 +30,22 @@ Basic Python skills are sufficient to implement clients or add new games to the
30
30
31
31
### Quick start
32
32
33
-
To try this project on your machine, start the server (`server/game_server.py`), then run two clients (`client/tictactoe_client.py`) in separate shells. The only requirement is a regular Python installation.
33
+
To try this project on your machine
34
+
35
+
1. start the server (`server/game_server.py`)
36
+
2. then run two clients (`client/tictactoe_client.py`) in separate shells
37
+
38
+
The only requirement is a regular Python installation.
34
39
35
40
### About this project
36
41
37
42
This server was developed for use in a university programming course, where students learn Python as their first programming language and work on projects in small groups. Both the framework and the API are designed so that the programming skills acquired during the first term are sufficient to implement new games and clients. However, the use of the server is not limited to educational scenarios.
38
43
39
44
## Operating the server
40
45
41
-
To run the server in a network, edit IP and port in the configuration file (`server/config.py`). TLS can also be enabled there. If you intend to run the server as a systemd service, you can use the provided unit file. Server and API are implemented in plain Python. Only modules from the standard library are used. This makes the server easy to handle.
46
+
To run the server in a network, edit IP and port in the configuration file (`server/config.py`). TLS along with other settings can also be configured there. If you intend to run the server as a systemd service, you can use the provided unit file. Server and API are implemented in plain Python. Only modules from the standard library are used. This makes the server easy to handle.
47
+
48
+
Learn more in the [Wiki](https://github.com/feberts/python-game-server/wiki).
42
49
43
50
## Implementing clients
44
51
@@ -56,16 +63,16 @@ Here is a short demo of the API usage:
56
63
```py
57
64
from game_server_api import GameServerAPI
58
65
59
-
game = GameServerAPI(server='127.0.0.1', port=4711, game='Yahtzee', players=2,
66
+
game = GameServerAPI(server='127.0.0.1', port=4711, game='TicTacToe', players=2,
60
67
session='mygame') # pass 'auto' to auto-join a session (default)
61
68
62
69
my_id = game.join() # start/join a session - each client is assigned an ID
63
70
game.move(position=5) # perform a move - the function accepts keyword arguments (**kwargs)
64
71
state = game.state() # returns a dictionary representing the game state, including
65
-
# the ID of the current player(s)
72
+
# the ID(s) of the current player(s)
66
73
```
67
74
68
-
The [API module](client/game_server_api.py) itself is documented in detail. You can also take a look at the demo clients and the [wiki](https://github.com/feberts/python-game-server/wiki).
75
+
The [API module](client/game_server_api.py) itself is documented in detail. You should also take a look at the demo clients and the [Wiki](https://github.com/feberts/python-game-server/wiki).
69
76
70
77
## Adding new games
71
78
@@ -86,11 +93,10 @@ An observer will receive the same data as the observed player does when retrievi
86
93
87
94
- The observer mode can be used to split up the work in a team. One client could be implemented for the user interaction and another one to display the game board.
88
95
- In a similar way, it can be used as a substitute for multithreading, which is usually not taught in a beginner programming course. Suppose you want to implement a chat client that displays incoming messages continuously while allowing the user to write a new message at the same time. To achieve this, two threads of execution could be used. Alternatively, the observer mode can be used to implement separate clients for input and output.
89
-
- It could also be used to visualize the performance of a reinforcement learning agent.
90
96
91
97
## Contributing
92
98
93
-
Contributions are welcome. Feel free to create a pull request or open an issue.
99
+
Contributions are welcome. Feel free to create a pull request, open an issue or use the Discussions section.
0 commit comments