
This current Directory contains 3 different programs: Client, GraphicalInterface & the main program (The server)
The Client & GraphicalInterface directories (programs) are just for testing, they are not relevant.
The Zappy server is a Game engine where you can run the Trantor World! Trantorians must survive and you can build a bot to play and get to the last elevation level.
You can just compile the project and run with the default configuration (conf.toml)
make all
./Zappy
Optionally if you want you can run the project in debug mode (this will generate aditional debug information on the server side and clients will receive more information) When DEBUG mode is on Clients will receive more information about the command they execute, if they fail and why. To run in debug mode you can generate an executable like this:
make debug
./debug_Zappy
You can change almost all the server configurations. You have the following options available:
Mandatory OPTIONS (For now disabled until later because it's not convenient to write all this info every time you want to run the server)
-c <#clients> number of players allowed per team
-n team <team2> ... teams, this is, the teams that will exist on trantor
-x <width> refers to the initial horizontal size of trantor (width > 10)
-y <height> refers to the initial vertical size of trantor (height > 10)
- Note:
Using "Team Rocket" as a default team Port 4242 for players Port 2121 for spectators (grapical interfaces should use this one) x = 20 h = 20 3 clients by default
Other OPTIONS]:
-f <file> set the configuration file (TOML format)
by default `./conf.toml` is used
-t <ms> set the time unit divider, it's 100 by default (100 frames per second)
the higher this number, the faster the world will be (ms > 0)
-T <ms> set the connection timeout, if a player doesn't join a team after ms
doesn't apply to spectators (default to 1min (60000ms)
-l <acronym> default Zappy language <must be present on the conf.file>
-P <port> set the players port to something else than 4242
-S <port> set the spectators port to something else than 2121
-h help
The configuration is managed on the configuration file (conf.toml by default)
On the configuration file you can add new languages (for now) In the future I will implement the port(s), address, single port mode; etc
CMD Request | CMD Response | Details | Example |
---|---|---|---|
msz |
msz X Y\n |
Map Size, returns the map sizeX widthY height |
|
bct X Y |
bct X Y q q q q q q q\n |
Box Content Tile, returns all the resources of a tile in order Params: X tile 'x' coordinateY tile 'y' coordinateResources ( q q q q q q q ):Each q represents the amount of a resource, the list is orderedSee Moreq q q q q q q │ │ │ │ │ │ └ Thystame [7]│ │ │ │ │ └── Phiras [6]│ │ │ │ └──── Mendiane [5]│ │ │ └────── Sibur [4]│ │ └──────── Deraumère [3]│ └────────── Linemate [2]└──────────── Food [1]Errors: When '[x, y]' is not found on the map: Tile [x y] is not in the map |
|
mct |
bct X Y q q q q q q q\n \n (for each tile) |
Map Content Tiles, executes the bct command for all the tiles in the map, followed by an empty new line (end of message) *Note:the new line mentioned is not the one from the bct command. The mct command will list all the tiles and in the end it will output a new line (empty line) |
|
tna |
tna N\n \n (for each team) |
Team names, returns all the teams namesN team's nameThe end of the list is indicated by an empty new line (end of message) |
|
- | pnw #n X Y O L N\n |
Player New, notification when a Player connects and joins a teamX x coordinateY y coordinateO orientationL levelN team's name |
|
ppo #n |
ppo #n X Y O\n |
Player Position, returns the position of player #n Params: #n player's idX x coordinateY y coordinateO orientationErrors: When the id is not found: Player not found |
|
plv #n |
plv #n L\n |
Player Level, returns the level of player #n Params: #n player's idL levelErrors: When the id is not found: Player not found |
|
pin #n |
pin #n X Y q q q q q q q\n |
Player inventory, get the inventory of player #n Params: #n player's idX x coordinateY y coordinateq amount of the resourceErrors: When the id is not found: Player not found |
|
players |
player #n X Y O L q q q q q q q "N"\n (for each player) |
Players, get all the players information, as described on the Player New and Player inventory, followed by an empty new line (end of message) Note: The team name is between "" so it can be parsed more easily |
|