diff options
Diffstat (limited to '')
-rw-r--r-- | server.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/server.c b/server.c index 37f57ca..bd4e980 100644 --- a/server.c +++ b/server.c @@ -359,6 +359,16 @@ static bool clientMap(const struct Client *client) { return true; } +static bool clientTele(struct Client *client, uint8_t port) { + if (port >= ARRAY_LEN(Ports)) return false; + struct Client old = *client; + client->tileX = Ports[port].tileX; + client->tileY = Ports[port].tileY; + client->cellX = CellInitX; + client->cellY = CellInitY; + return clientUpdate(client, &old); +} + int main(int argc, char *argv[]) { int error; @@ -477,6 +487,9 @@ int main(int argc, char *argv[]) { break; case ClientMap: { success = clientMap(client); } + break; case ClientTele: { + success = clientTele(client, msg.port); + } } if (!success) clientRemove(client); } |