feat: add upgrade tower (non gui)

This commit is contained in:
2021-11-05 18:54:21 +01:00
parent 42f599c800
commit 56ec9e7fe2
13 changed files with 73 additions and 7 deletions

View File

@@ -40,6 +40,7 @@ void ServerConnexion::registerHandlers() {
GetDispatcher()->RegisterHandler(protocol::PacketType::Disconnect, this);
GetDispatcher()->RegisterHandler(protocol::PacketType::PlaceTower, this);
GetDispatcher()->RegisterHandler(protocol::PacketType::SendMobs, this);
GetDispatcher()->RegisterHandler(protocol::PacketType::UpgradeTower, this);
}
bool ServerConnexion::updateSocket() {
@@ -173,6 +174,12 @@ void ServerConnexion::HandlePacket(protocol::SendMobsPacket* packet) {
}
}
void ServerConnexion::HandlePacket(protocol::UpgradeTowerPacket* packet){
//TODO: verify the packet
m_Server->broadcastPacket(packet);
}
ServerConnexion::~ServerConnexion() {
if (GetDispatcher() != nullptr)
GetDispatcher()->UnregisterHandler(this);