feat: add end game disconnect

This commit is contained in:
2021-12-13 20:05:20 +01:00
parent 2148c0050c
commit 360258e4cf
6 changed files with 30 additions and 20 deletions

View File

@@ -232,7 +232,6 @@ public:
// MobListener
virtual void OnMobDamage(Mob* target, float damage, Tower* source);
virtual void OnMobDie(Mob* mob);
virtual void OnMobCastleDamage(Mob* damager, TeamCastle* enemyCastle, float damage);
private:

View File

@@ -14,6 +14,7 @@ private:
Server* m_Server;
ServerWorld m_ServerWorld;
utils::AutoTimer m_GoldMineTimer{ 1000, std::bind(&ServerGame::updateGoldMines, this) };
utils::CooldownTimer m_EndGameCooldown{ 1000 * 10 };
public:
ServerGame(Server* server);
~ServerGame() {}

View File

@@ -21,6 +21,8 @@ public:
void spawnMobs(game::MobType type, std::uint8_t level, game::PlayerID sender, std::uint8_t count);
game::TowerPtr placeTowerAt(game::TowerType type, std::int32_t x, std::int32_t y, game::PlayerID builder);
virtual void OnMobDie(game::Mob* mob);
};
} // namespace server