|
Zappy Server
C++ game server: world, rules, scheduler, network
|
#include <GuiNotifier.hpp>
Inheritance diagram for GuiNotifier:
Collaboration diagram for GuiNotifier:Public Member Functions | |
| GuiNotifier (ClientManager &clients) | |
| void | addGui (int connectionId) |
| void | removeGui (int connectionId) |
| void | send (int connectionId, const std::string &msg) |
| void | broadcast (const std::string &msg) |
| void | onPlayerAdded (int playerId, int x, int y, Orientation orientation, int level, const std::string &teamName) override |
| Player spawned (egg hatched or initial connection). -> pnw. | |
| void | onPlayerMoved (int playerId, int nx, int ny, Orientation newOrientation) override |
| Player changed tile and/or facing. -> ppo. | |
| void | onPlayerInventoryChanged (int playerId, int x, int y, Resources inventory) override |
| Player's carried resources changed. -> pin. | |
| void | onPlayerRemoved (int playerId) override |
| Player left (death or disconnect). -> pdi. | |
| void | onPlayerEjected (int playerId) override |
| Player got pushed off its tile by an eject. -> pex. | |
| void | onBroadcast (int playerId, const std::string &message) override |
| Player shouted a broadcast message. -> pbc. | |
| void | onResourceTaken (int playerId, ResourceType resourceType, int tileX, int tileY, Resources resources) override |
| Player picked a resource up off the tile. -> pgt (+ bct/pin) | |
| void | onResourceDropped (int playerId, ResourceType resourceType, int tileX, int tileY, Resources resources) override |
| Player dropped a resource onto the tile. -> pdr (+ bct/pin) | |
| void | onEggLaid (int eggId, int playerId, int x, int y) override |
| A player laid an egg via Fork. -> enw. | |
| void | onInitialEggSpawned (int eggId, const std::string &teamName, int x, int y) override |
| An initial team egg placed at game start (custom). -> sse. | |
| void | onEggHatched (int eggId) override |
| An egg hatched into a connectable slot. -> ebo. | |
| void | onEggDied (int eggId) override |
| An egg was destroyed (e.g. crushed by an eject). -> edi. | |
| void | onIncantationStart (int x, int y, int level, const std::vector< int > &participantIds) override |
Incantation began on a tile. participantIds = players involved. -> pic. | |
| void | onIncantationEnd (int x, int y, bool success) override |
Incantation finished, success = leveled up or not. -> pie. | |
| void | onPlayerLevelUp (int playerId, int newLevel) override |
| Player reached a new level. -> plv. | |
| void | onGameEnd (const std::string &winningTeam) override |
| A team won (6 players at max level). -> seg. | |
| void | onTileChanged (int x, int y, Resources resources) override |
| A tile's resource contents changed (e.g. respawn). -> bct. | |
Public Member Functions inherited from IWorldObserver | |
| virtual | ~IWorldObserver ()=default |
Private Attributes | |
| ClientManager & | _clients |
| std::vector< int > | _guiIds |
Definition at line 9 of file GuiNotifier.hpp.
|
explicit |
Definition at line 7 of file GuiNotifier.cpp.
| void GuiNotifier::addGui | ( | int | connectionId | ) |
Definition at line 9 of file GuiNotifier.cpp.
References _guiIds.
Referenced by HandshakeHandler::_promoteToGui().
Here is the caller graph for this function:| void GuiNotifier::broadcast | ( | const std::string & | msg | ) |
Definition at line 21 of file GuiNotifier.cpp.
References _clients, _guiIds, and ClientManager::send().
Referenced by Server::_handleGameOver(), CommandDispatcher::_handleSst(), onBroadcast(), onEggDied(), onEggHatched(), onEggLaid(), onGameEnd(), onIncantationEnd(), onIncantationStart(), onInitialEggSpawned(), onPlayerAdded(), onPlayerEjected(), onPlayerInventoryChanged(), onPlayerLevelUp(), onPlayerMoved(), onPlayerRemoved(), onResourceDropped(), onResourceTaken(), and onTileChanged().
Here is the call graph for this function:
Here is the caller graph for this function:
|
overridevirtual |
Player shouted a broadcast message. -> pbc.
Implements IWorldObserver.
Definition at line 46 of file GuiNotifier.cpp.
References broadcast(), and Serializer::pbc().
Here is the call graph for this function:
|
overridevirtual |
An egg was destroyed (e.g. crushed by an eject). -> edi.
Implements IWorldObserver.
Definition at line 78 of file GuiNotifier.cpp.
References broadcast(), and Serializer::edi().
Here is the call graph for this function:
|
overridevirtual |
An egg hatched into a connectable slot. -> ebo.
Implements IWorldObserver.
Definition at line 76 of file GuiNotifier.cpp.
References broadcast(), and Serializer::ebo().
Here is the call graph for this function:
|
overridevirtual |
A player laid an egg via Fork. -> enw.
Implements IWorldObserver.
Definition at line 65 of file GuiNotifier.cpp.
References broadcast(), Serializer::enw(), and Serializer::pfk().
Here is the call graph for this function:
|
overridevirtual |
A team won (6 players at max level). -> seg.
Implements IWorldObserver.
Definition at line 96 of file GuiNotifier.cpp.
References broadcast(), and Serializer::seg().
Here is the call graph for this function:
|
overridevirtual |
Incantation finished, success = leveled up or not. -> pie.
Implements IWorldObserver.
Definition at line 86 of file GuiNotifier.cpp.
References broadcast(), and Serializer::pie().
Here is the call graph for this function:
|
overridevirtual |
Incantation began on a tile. participantIds = players involved. -> pic.
Implements IWorldObserver.
Definition at line 80 of file GuiNotifier.cpp.
References broadcast(), and Serializer::pic().
Here is the call graph for this function:
|
overridevirtual |
An initial team egg placed at game start (custom). -> sse.
Implements IWorldObserver.
Definition at line 71 of file GuiNotifier.cpp.
References broadcast(), and Serializer::sse().
Here is the call graph for this function:
|
overridevirtual |
Player spawned (egg hatched or initial connection). -> pnw.
Implements IWorldObserver.
Definition at line 26 of file GuiNotifier.cpp.
References broadcast(), and Serializer::pnw().
Here is the call graph for this function:
|
overridevirtual |
Player got pushed off its tile by an eject. -> pex.
Implements IWorldObserver.
Definition at line 44 of file GuiNotifier.cpp.
References broadcast(), and Serializer::pex().
Here is the call graph for this function:
|
overridevirtual |
Player's carried resources changed. -> pin.
Implements IWorldObserver.
Definition at line 37 of file GuiNotifier.cpp.
References broadcast(), and Serializer::pin().
Here is the call graph for this function:
|
overridevirtual |
Player reached a new level. -> plv.
Implements IWorldObserver.
Definition at line 91 of file GuiNotifier.cpp.
References broadcast(), and Serializer::plv().
Here is the call graph for this function:
|
overridevirtual |
Player changed tile and/or facing. -> ppo.
Implements IWorldObserver.
Definition at line 32 of file GuiNotifier.cpp.
References broadcast(), and Serializer::ppo().
Here is the call graph for this function:
|
overridevirtual |
Player left (death or disconnect). -> pdi.
Implements IWorldObserver.
Definition at line 42 of file GuiNotifier.cpp.
References broadcast(), and Serializer::pdi().
Here is the call graph for this function:
|
overridevirtual |
Player dropped a resource onto the tile. -> pdr (+ bct/pin)
Implements IWorldObserver.
Definition at line 58 of file GuiNotifier.cpp.
References Serializer::bct(), broadcast(), and Serializer::pdr().
Here is the call graph for this function:
|
overridevirtual |
Player picked a resource up off the tile. -> pgt (+ bct/pin)
Implements IWorldObserver.
Definition at line 51 of file GuiNotifier.cpp.
References Serializer::bct(), broadcast(), and Serializer::pgt().
Here is the call graph for this function:
|
overridevirtual |
A tile's resource contents changed (e.g. respawn). -> bct.
Implements IWorldObserver.
Definition at line 101 of file GuiNotifier.cpp.
References Serializer::bct(), and broadcast().
Here is the call graph for this function:| void GuiNotifier::removeGui | ( | int | connectionId | ) |
Definition at line 11 of file GuiNotifier.cpp.
References _guiIds.
Referenced by CommandDispatcher::onDisconnect().
Here is the caller graph for this function:| void GuiNotifier::send | ( | int | connectionId, |
| const std::string & | msg | ||
| ) |
Definition at line 16 of file GuiNotifier.cpp.
References _clients, and ClientManager::send().
Referenced by HandshakeHandler::_promoteToGui().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Definition at line 42 of file GuiNotifier.hpp.
Referenced by broadcast(), and send().
|
private |
Definition at line 43 of file GuiNotifier.hpp.
Referenced by addGui(), broadcast(), and removeGui().