forked from DaveSoftLLC/EngineZ
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Matchmaking Process.txt
75 lines (68 loc) · 1.54 KB
/
Matchmaking Process.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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
Matchmaking Process:
1. Client says either JOIN or CREATE
If JOIN:
Client:
while True:
Client sends [JOIN, ROOM_NAME]
Client receives confirmation
If confirmed:
boolean variable for confirmed
exit loop
Or if user wants to leave:
Send leaving message
exit loop
Otherwise:
Tell user to retry
if confirmed:
wait in a room function()
Otherwise:
close connection
Server:
Assume connection has already been forked to a thread
while True:
Receive Client data
If room exists:
Send confirmation to user
FORMAT: [CONFIRMED_JOIN, room_name, other_players]
exit loop
Or if user is leaving:
exit loop
Otherwise:
Send client a retry message
if confirmed:
activate server-side waiting function()
close connection
Or CREATE:
Client:
while True:
Client sends [CREATE, ROOM_NAME]
Client receives confirmation
If confirmed:
boolean variable for confirmed
exit loop
Or if user wants to leave:
Send leaving message
exit loop
Otherwise:
Tell user room already exists
if confirmed:
wait in a room function()
Otherwise:
close connection
Server:
Assume connection has already been forked to a thread
while True:
Receive Client data
If room doesnt exist:
Send confirmation to user
FORMAT: [CONFIRMED_CREATE, room_name, other_players]
exit loop
Or if user is leaving:
exit loop
Otherwise:
Send client a retry message
if confirmed:
activate server-side waiting function()
close connection
2. Wait Function
Client: