feat: implement basic tower placement

This commit is contained in:
2021-09-19 13:43:45 +02:00
parent bcde4278ab
commit 52a143769e
17 changed files with 318 additions and 52 deletions

View File

@@ -38,6 +38,7 @@ void ServerConnexion::registerHandlers(){
GetDispatcher()->RegisterHandler(protocol::PacketType::KeepAlive, this);
GetDispatcher()->RegisterHandler(protocol::PacketType::SelectTeam, this);
GetDispatcher()->RegisterHandler(protocol::PacketType::Disconnect, this);
GetDispatcher()->RegisterHandler(protocol::PacketType::PlaceTower, this);
}
bool ServerConnexion::updateSocket(){
@@ -143,6 +144,11 @@ void ServerConnexion::initConnection(){
}
}
void ServerConnexion::HandlePacket(protocol::PlaceTowerPacket* packet){
// process packet
protocol::WorldAddTowerPacket addTowerPacket(packet->getTowerX(), packet->getTowerY(), packet->getTowerType(), m_ID);
m_Server->broadcastPacket(&addTowerPacket);
}
ServerConnexion::~ServerConnexion(){
if (GetDispatcher() != nullptr)