Skip to content

Commit 0c6891b

Browse files
committed
docs(network): update protocol structure
1 parent 137405a commit 0c6891b

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

GUIDELINES.md

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -49,17 +49,21 @@ to make some year-specific implementations from the plugin accessible in the sdk
4949
Currently there are two interfaces, [IGamePlugin](sdk/src/server-api/sc/api/plugins/IGamePlugin.java) and [XStreamProvider]( sdk/src/server-api/sc/networking/XStreamProvider.kt), which are implemented in the plugin and then loaded through a ServiceLoader.
5050
The information which implementations to use resides in [resources/META-INF/services](plugin/src/resources/META-INF/services).
5151

52-
## Protocol Message Classes
52+
## Networking Protocol Classes
5353

54-
### [sdk/server-api/sc.protocol](sdk/src/server-api/sc/protocol)
54+
[ProtocolPacket](sdk/src/server-api/sc/protocol/ProtocolPacket.kt) is the common interface
55+
for everything that is to be sent via the XML Protocol.
5556

56-
(*Request) Ask for an action or information
57-
(? extends [AdminLobbyRequest](sdk/src/server-api/sc/protocol/requests/ILobbyRequest.kt)) Requires authentication
57+
Data sent to a specific room has to implement [RoomMessage](sdk/src/server-api/sc/protocol/RoomMessage.kt)
58+
and is then wrapped in a [RoomPacket](sdk/src/server-api/sc/protocol/RoomPacket.kt).
5859

59-
#### [Responses](sdk/src/server-api/sc/protocol/responses)
60+
### [Requests](sdk/src/server-api/sc/protocol/requests)
61+
- are all suffixed with `Request`
62+
- ask for an action or information
63+
- any request that extends [AdminLobbyRequest](sdk/src/server-api/sc/protocol/requests/ILobbyRequest.kt)
64+
requires authentication beforehand
6065

61-
If it extends `ProtocolMessage` directly, it is wrapped in a [RoomPacket](sdk/src/server-api/sc/protocol/responses/RoomPacket.kt)
62-
and sent to a specific room, otherwise it has to extend `ILobbyRequest` and is sent to LobbyListeners.
66+
#### [Responses](sdk/src/server-api/sc/protocol/responses)
6367

6468
(*Response) Response to a request
6569
(*Event) Update to all observers

0 commit comments

Comments
 (0)