added removePlayer and got rid of the Person datatype as it was stupid

This commit is contained in:
Dennis Frieberg 2020-08-30 02:28:37 +02:00
parent f475fce63d
commit 45e0697695

View file

@ -39,29 +39,6 @@ we encode UUID as Strings of the following form:
"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
Where every x represents a character between 0 and f.
#### Player
A Player is either an UnknownPlayer or a KnownPlayer. Aka `<Player>`
is a synonym for `<KnownPlayer> | <UnknownPlayer>`. As a client you
will never generate UUIDs for Player. This is always the job of the Server.
##### KnownPlayer
```
{
"playerUUID" : <UUID>
"playerName" : <Maybe String>
}
```
If `"PlayerName"` is set, the Player has a new Name. The Server will always use KnownPlayer. If
you don't know that Player you should add it.
##### UnknownPlayer
```
{
"playerUUID" : <Maybe null>
"playerName" : <String>
}
```
Remark: `<Maybe null>` allows you to optionally include this field with a `null` value. But
you might omit it.
@ -74,13 +51,13 @@ for a TickLeiste. But we still have to versions of TickLeiste.
#### KnownTickLieste
```
[(<Tick>,[<KnownPlayer>])]
[(<Tick>,[(<UUID>,<String>)])]
```
These are mainly used to communicate existing TickLeisten from the server to the client
#### UnknownTickLeiste
```
[(<Tick>,[<UnknownPlayer>])]
[(<Tick>,[<String>])]
```
These are mainly used so the client can initialize a TickLeiste.
@ -97,15 +74,17 @@ This request is used to set a player to a specific Tick.
```
{
"requestType" : "SetPlayerTickR",
"player" : <KnownPlayer>
"playerUUID" : <UUID>,
"tick" : <Tick>
}
```
### AddPlayerTickR
This request adds a new player to a Tick.
```
"requestType" : "AddPlayerTickR",
"player" : <UnknownPlayer>
"player" : <UnknownPlayer>,
"tick" : <Tick>
```
### InitializeTickLeisteR
@ -136,11 +115,20 @@ This is used to change the name of a Player without moving them.
```
{
"requestType" : "ChangeNameR",
"player" : <KnownPlayer>
"playerUUID" : <UUID>,
"playerName" : <String>
}
```
If you don't set the name in KnownPlayer no name change will occur.
### RemovePlayerR
```
{
"requestType" : "RemovePlayerR"
"playerUUID" : <UUID>
}
```
## Events
A Server might Send the following Events to a client.
@ -148,11 +136,17 @@ A Server might Send the following Events to a client.
```
{
"eventType" : "SetPlayerTickE",
"player" : <KnownPlayer>
"playerUUID" : <UUID>,
"tick" : <Tick>
}
```
### AddPlayerTickE
```
"eventType" : "AddPlayerTickE",
"playerUUID" : <UUID>,
"playerName" : <String>
```
### InitializeTickLeisteE
```
{
@ -164,8 +158,15 @@ A Server might Send the following Events to a client.
### ChangeNameE
```
{
"eventType" : "ChangeNameE"
"player" : <KnownPlayer>
"eventType" : "ChangeNameE",
"playerUUID" : <UUID>,
"playerName" : <String>
}
```
### RemovePlayerR
```
"eventType" : "RemovePlayerE",
"playerUUID" : <UUID>
}
```