-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathProtocolDocs.txt
58 lines (49 loc) · 1.78 KB
/
ProtocolDocs.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
-- PROTOCOL DOCUMENTATION --
Reference for the usage of all client-server communication functions.
- loginAttempt
src: client
dest: single client
args: string
desc: The client sends a username string to the server, & the server checks it for validity. Will respond with either 'loginDenied' or 'loginAccepted' depending on the received info.
- loginDenied
src: server
dest: single client
args: string
desc: The server responds with a string, telling the client how the player object is invalid. The client displays this to the user.
- loginAccepted
src: server
dest: single client
args: playerobject
desc: The server responds with an updated player object, containing the player's position and other relevant info.
- updatePlayer
src: client
dest: server
args: playerobject
desc: The client sends the player object to the server, indicating that an update happened. The server then broadcasts this to other clients.
- updateAllPlayers
src: server
dest: all clients
args: [playerobject array]
desc: Broadcasts an updated array of players for the client to display. Does not include the target client.
TODO: Move player array management to serverside
TODO: Determine which players to send based on distance from target player.
- forceUpdatePlayer
src: server
dest: single client
args: playerobject
desc: The server forcibly resets a client's player, typically after suspected cheating or similarly improbable circumstances.
- chatMessage
src: client
dest: server
args: string
desc: Sends a chat message to the server.
- updateChat
src: server
dest: all clients
args: [string array]
desc: Sends the current chat array to all connected clients.
- boop
src: client, server
dest: server, single client
args: string
desc: A client sends a 'boop' to a provided player ID, whom the server is tasked with forwarding the boop to.