Sever acts as a "relay" of sorts (while still checking stuff is valid) All strings are UTF null terminated ("\0")
Mobs are treated by the client as differet "types" of players, types are also classes and the like (for drawing)
Action list:
-
Join.
- client:
1,johndoe,{type}
- username — player's name. We do not accept duplicate usernames on one server.
- type — ???
- server:
1,johndoe,{type},124,12
- username — player's name.
- type — ???
- x — player's starting x co-ord.
- y — player's starting y co-ord.
- client:
-
Movement.
- client:
1,johndoe,123,12
- username — player to move
- x — new desired x position; the client should have nominal edge checking, but is verified by server.
- y — new desired y position
- server:
1,johndoe,125,12
- username — player to move
- x - new x position; the server validates position and relays possible ones.
- y - new y position
- client:
-
Map request.
- client:
3
- N/A
- server:
- x_size — size of map in x
- y_size — size of map in y
- bottom layer — see layers for explanation. layer names to be spec'd.
- mid layer
- top layer
- layer:
4;2;1;4;1;4;1;2;6;0;0;0;0;0;
...- tile — int value of tile followde by
;
. - repeat.
- tile — int value of tile followde by
- client:
-
Attack.
- client:
- username — attacking player
- direction — attack direction
- server:
- client: