Zappy Server
C++ game server: world, rules, scheduler, network
Loading...
Searching...
No Matches
Serializer.hpp File Reference
#include <string>
#include <vector>
#include "core/data/Orientation.hpp"
#include "core/data/Resources.hpp"
+ Include dependency graph for Serializer.hpp:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  Serializer
 Generates all 24 server-to-GUI wire strings.
 

Functions

std::string Serializer::msz (int x, int y)
 Map size. Wire: msz X Y\n
 
std::string Serializer::bct (int x, int y, const Resources &r)
 Tile content (resources on it). Wire: bct X Y q q q q q q q\n
 
std::string Serializer::tna (const std::string &teamName)
 Team name (one per team). Wire: tna NAME\n
 
std::string Serializer::pnw (int id, int x, int y, Orientation o, int level, const std::string &team)
 New player connected. Wire: pnw #N X Y O L NAME\n (L = level)
 
std::string Serializer::ppo (int id, int x, int y, Orientation o)
 Player position. Wire: ppo #N X Y O\n
 
std::string Serializer::plv (int id, int level)
 Player level. Wire: plv #N L\n
 
std::string Serializer::pin (int id, int x, int y, const Resources &r)
 Player inventory. Wire: pin #N X Y q q q q q q q\n
 
std::string Serializer::pex (int id)
 Player expelled (got ejected). Wire: pex #N\n
 
std::string Serializer::pbc (int id, const std::string &msg)
 Player broadcast. Wire: pbc #N MESSAGE\n
 
std::string Serializer::pic (int x, int y, int level, const std::vector< int > &ids)
 
std::string Serializer::pie (int x, int y, bool success)
 
std::string Serializer::pfk (int id)
 Player lays an egg (fork). Wire: pfk #N\n
 
std::string Serializer::pdr (int id, int resourceIndex)
 Player drops resource resourceIndex (0..6). Wire: pdr #N i\n
 
std::string Serializer::pgt (int id, int resourceIndex)
 Player takes resource resourceIndex (0..6). Wire: pgt #N i\n
 
std::string Serializer::pdi (int id)
 Player death. Wire: pdi #N\n
 
std::string Serializer::enw (int eggId, int playerId, int x, int y)
 Egg laid by a player. Wire: enw #E #N X Y\n (E = egg, N = parent)
 
std::string Serializer::sse (int eggId, const std::string &teamName, int x, int y)
 
std::string Serializer::ebo (int eggId)
 Egg hatched, player connects from it. Wire: ebo #E\n
 
std::string Serializer::edi (int eggId)
 Egg died. Wire: edi #E\n
 
std::string Serializer::sgt (int freq)
 Reply to "sgt": current time unit frequency. Wire: sgt F\n
 
std::string Serializer::sst (int freq)
 Reply to "sst": frequency was changed to F. Wire: sst F\n
 
std::string Serializer::stu (int seconds, long long ticks)
 
std::string Serializer::gwt (const std::string &team, int seconds, long long ticks)
 
std::string Serializer::seg (const std::string &team)
 End of game, team won. Wire: seg NAME\n
 
std::string Serializer::smg (const std::string &msg)
 Server message to all GUIs. Wire: smg MESSAGE\n
 
std::string Serializer::suc ()
 Unknown command from GUI (sent on unparseable line). Wire: suc\n
 
std::string Serializer::sbp ()
 Bad command parameter from GUI. Wire: sbp\n