feat: implement basic tower placement
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user