Skip to content

Commit 1571df8

Browse files
committed
code and notes cleanup
1 parent 8a76715 commit 1571df8

File tree

3 files changed

+15
-36
lines changed

3 files changed

+15
-36
lines changed

NOTES.txt

Lines changed: 12 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,20 @@
11

2-
TODO:
3-
X add web socket client to game
4-
X add web socket server to server
5-
X POC communication
6-
X decide how to model the game state
7-
X move game-client websocket handling to scene manager
8-
X implement game-client handling of game-server messages
9-
X fix bugs
10-
X poc syncing game state for players to see each others positions
11-
X refactor golang game-server to properly manage multiple websocket
12-
connections
13-
X add shared resource mutex to python server global game state updates
14-
X refactor golang server to use channels instead of mutexes
15-
X fix go-server bug where newly connected clients aren't initialized with
16-
the server game state properly (player value was nil in some cases)
17-
2+
Message Schema:
3+
{
4+
messageType: <string>,
5+
payload_key <string>: payload_value <any>
6+
}
187

198
Game State Schema:
209
{
21-
players: [
22-
{
23-
id: <UUID_str>
24-
position: {
25-
x: <float>,
26-
y: <float>
27-
}
28-
}, ...
29-
]
10+
players: [<Player>, ...]
3011
}
3112

32-
33-
Message Schema:
13+
Player Schema:
3414
{
35-
messageType: <string>,
36-
payload_key <string>: payload_value <any>
15+
id: <UUID_str>,
16+
position: {
17+
x: <float>,
18+
y: <float>
19+
}
3720
}

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
POC for a Unity game client and game server with websockets!
44

55
There are 2 implementations of the game server. One in Python and one in
6-
Golang. Their APIs are identical.
6+
Golang. The APIs for both servers are identical.
77

88

99
### Requirements
@@ -65,4 +65,6 @@ The entire game-server's code resides in:
6565
The game-client's websocket management resides in:
6666
`UnityWebSocketClient/Assets/Scripts/SceneManagerScript.cs`
6767

68+
The Golang game server's architecture is inspired by [this](https://github.com/gorilla/websocket/tree/master/examples/chat) chat example.
69+
6870
Enjoy!

UnityWebSocketClient/Assets/Scripts/ClientWsMessages.cs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,3 @@ public ClientMessagePlayerUpdate(Player playerModel)
2727
}
2828

2929
}
30-
31-
[Serializable]
32-
public class ClientMessageGetGameState
33-
{
34-
public string messageType = "CLIENT_MESSAGE_TYPE_GET_GAME_STATE";
35-
}

0 commit comments

Comments
 (0)