58 lines
2.1 KiB
Plaintext
58 lines
2.1 KiB
Plaintext
@startuml
|
|
'https://plantuml.com/sequence-diagram
|
|
|
|
actor "Player One" as Player1
|
|
actor "Player Two" as Player2
|
|
participant Matchmaker
|
|
participant Agones
|
|
participant "GameServer\nResource" as GameServer
|
|
box "Game Server Pod"
|
|
participant "Game Server\nProcess" as Binary
|
|
participant SDK
|
|
end box
|
|
|
|
activate GameServer
|
|
|
|
== No allocated <i>GameServers</i> ==
|
|
|
|
Player1 -> Matchmaker: Requests a game session
|
|
Matchmaker -> Agones: Create: <i>GameServerAllocation</i>
|
|
note left
|
|
<i>GameServerAllocation</i> implemented to
|
|
optionally select an already allocated <i>GameServer</i>
|
|
if one exists. At this stage, one does not, so
|
|
Agones will allocate a <i>Ready</i> <i>GameServer</i>.
|
|
end note
|
|
Agones -> GameServer: Finds a <i>Ready</i> <i>GameServer</i>,\nsets it to <i>Allocated</i> State
|
|
Matchmaker <-- Agones : <i>GameServerAllocation</i> is returned\nwith <i>GameServer</i> details\nincluding IP and port to connect to.
|
|
Player1 <-- Matchmaker : Returns <i>GameServer</i> connection information
|
|
Player1 -> Binary : Connects to game server process
|
|
Binary -> SDK : SDK.Alpha.PlayerConnect(id)
|
|
note right
|
|
Process calls <i>PlayerConnect(...)</i>
|
|
on player client connection.
|
|
end note
|
|
GameServer <-- SDK : Increments <i>Status.Players.Count</i>\nand add <i>id</i> to <i>Status.Players.Ids</i>
|
|
|
|
== Allocated <i>GameServers</i> with player(s) on them ==
|
|
|
|
Player2 -> Matchmaker: Requests a game session
|
|
Matchmaker -> Agones: Create: <i>GameServerAllocation</i>
|
|
note left
|
|
The <i>GameServerAllocation</i> will this time
|
|
find the Allocated <i>GameServer</i> that "Player One"
|
|
is currently active on.
|
|
end note
|
|
Agones -> GameServer: Finds the Allocated <i>GameServer</i>\nwith player capacity.
|
|
note right
|
|
This is the same <i>GameServer</i> that "Player One"
|
|
is currently playing on.
|
|
end note
|
|
Matchmaker <-- Agones: returns <i>Allocated GameServer</i> record
|
|
Player2 <-- Matchmaker : Returns <i>GameServer</i> connection information
|
|
Player2 -> Binary : Connects to game server process
|
|
Binary -> SDK : SDK.Alpha.PlayerConnect(id)
|
|
GameServer <-- SDK : Increments <i>Status.Players.Count</i>\nand add <i>id</i> to <i>Status.Players.Ids</i>
|
|
|
|
@enduml
|