mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2025-04-26 16:46:31 +00:00
feat: shutdown command (#1780)
This commit is contained in:
parent
1cc1782b35
commit
b31f9670d1
@ -1444,4 +1444,13 @@ void SlashCommandHandler::Startup() {
|
|||||||
.requiredLevel = eGameMasterLevel::CIVILIAN
|
.requiredLevel = eGameMasterLevel::CIVILIAN
|
||||||
};
|
};
|
||||||
RegisterCommand(removeIgnoreCommand);
|
RegisterCommand(removeIgnoreCommand);
|
||||||
|
|
||||||
|
Command shutdownCommand{
|
||||||
|
.help = "Shuts this world down",
|
||||||
|
.info = "Shuts this world down",
|
||||||
|
.aliases = {"shutdown"},
|
||||||
|
.handle = DEVGMCommands::Shutdown,
|
||||||
|
.requiredLevel = eGameMasterLevel::DEVELOPER
|
||||||
|
};
|
||||||
|
RegisterCommand(shutdownCommand);
|
||||||
}
|
}
|
||||||
|
@ -1622,4 +1622,10 @@ namespace DEVGMCommands {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Shutdown(Entity* entity, const SystemAddress& sysAddr, const std::string args) {
|
||||||
|
auto* character = entity->GetCharacter();
|
||||||
|
if (character) LOG("Mythran (%s) has shutdown the world", character->GetName().c_str());
|
||||||
|
Game::OnSignal(-1);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
@ -73,6 +73,7 @@ namespace DEVGMCommands {
|
|||||||
void RollLoot(Entity* entity, const SystemAddress& sysAddr, const std::string args);
|
void RollLoot(Entity* entity, const SystemAddress& sysAddr, const std::string args);
|
||||||
void CastSkill(Entity* entity, const SystemAddress& sysAddr, const std::string args);
|
void CastSkill(Entity* entity, const SystemAddress& sysAddr, const std::string args);
|
||||||
void DeleteInven(Entity* entity, const SystemAddress& sysAddr, const std::string args);
|
void DeleteInven(Entity* entity, const SystemAddress& sysAddr, const std::string args);
|
||||||
|
void Shutdown(Entity* entity, const SystemAddress& sysAddr, const std::string args);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif //!DEVGMCOMMANDS_H
|
#endif //!DEVGMCOMMANDS_H
|
||||||
|
@ -12,4 +12,5 @@ namespace Game {
|
|||||||
SystemAddress chatSysAddr;
|
SystemAddress chatSysAddr;
|
||||||
EntityManager* entityManager = nullptr;
|
EntityManager* entityManager = nullptr;
|
||||||
std::string projectVersion;
|
std::string projectVersion;
|
||||||
|
Game::signal_t lastSignal = 0;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user