-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
77 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# Communication | ||
|
||
The following diagram shows the protocol communication used between client and server: | ||
|
||
Notes: | ||
- Orange arrows show UDP messages, | ||
- Purple arrows show preferred UDP messages. | ||
- Default color arrows show TCP messages. | ||
|
||
<p align="center"> | ||
<img src="http://www.plantuml.com/plantuml/proxy?cache=no&src=https://raw.githubusercontent.com/lemunozm/asciiarena/master/docs/design/diagrams/messages.puml"/> | ||
</p> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
@startuml | ||
|
||
' Orange color represents an UDP message | ||
' Purple color represents a prefered UDP message | ||
' Default color represents TCP message | ||
|
||
title Client - Server communication protocol | ||
|
||
participant Client | ||
participant Server | ||
|
||
== Initialization == | ||
Client -> Server : Version | ||
Client <-- Server : Version | ||
|
||
== Server information subscription == | ||
Client -> Server : SubscribeServerInfo | ||
Client <-- Server : ServerInfo | ||
group Any change in the server: e.g: a player login/logout | ||
Client <<- Server : DynamicServerInfo | ||
end | ||
|
||
== Login/Logout == | ||
Client -> Server : Login | ||
Client <-- Server : LoginStatus | ||
group If logged successful: | ||
loop while not received UdpConnected, max 10 | ||
Client -[#orange]> Server : ConnectUdp | ||
Client <[#orange]-- Server : UdpConnected | ||
end | ||
group If received UdpConnected: | ||
Client -> Server : TrustUdp | ||
end | ||
end | ||
... | ||
Client -> Server : Logout | ||
|
||
== Game/Arena system == | ||
Client <- Server : StartGame | ||
loop there is not a game winner | ||
Client <- Server : PrepareArena | ||
... | ||
Client <- Server : StartArena | ||
note over Client, Server | ||
Arena round | ||
end note | ||
Client <- Server : EndArena | ||
end | ||
|
||
== Arena round == | ||
loop each frame until there is an arena winner | ||
group any of the following player actions: | ||
Client ->> Server : MovePlayer | ||
Client ->> Server : CastSkill | ||
end | ||
Client <[#purple]- Server : Step | ||
end | ||
|
||
@enduml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters