remove unused code and callbacktimers in testmap (#620)

This commit is contained in:
Aaron Kimbrell 2022-07-08 22:25:44 -05:00 committed by GitHub
parent 3865a186a7
commit dddc33607b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1519,36 +1519,12 @@ void SlashCommandHandler::HandleChatCommand(const std::u16string& command, Entit
const auto objid = entity->GetObjectID();
if (force || CheckIfAccessibleZone(reqZone)) { // to prevent tomfoolery
bool darwin = true; //Putting this on true, as I'm sick of having to wait 3-4 seconds on a transfer while trying to quickly moderate properties
Character* character = entity->GetCharacter();
if (character) {
std::string lowerName = character->GetName();
std::transform(lowerName.begin(), lowerName.end(), lowerName.begin(), ::tolower);
// feel free to add your name to the list
if (lowerName.find("max") != std::string::npos || lowerName.find("darwin") != std::string::npos || lowerName.find("gie") != std::string::npos) {
darwin = true;
}
}
ZoneInstanceManager::Instance()->RequestZoneTransfer(Game::server, reqZone, cloneId, false, [objid](bool mythranShift, uint32_t zoneID, uint32_t zoneInstance, uint32_t zoneClone, std::string serverIP, uint16_t serverPort) {
if (!darwin) {
GameMessages::SendPlayAnimation(entity, u"lup-teleport");
GameMessages::SendSetStunned(objid, PUSH, user->GetSystemAddress(),
LWOOBJID_EMPTY, true, true, true, true, true, true, true, true
);
}
ZoneInstanceManager::Instance()->RequestZoneTransfer(Game::server, reqZone, cloneId, false, [objid, darwin](bool mythranShift, uint32_t zoneID, uint32_t zoneInstance, uint32_t zoneClone, std::string serverIP, uint16_t serverPort) {
auto* entity = EntityManager::Instance()->GetEntity(objid);
if (!entity) return;
if (entity == nullptr) {
return;
}
float transferTime = 3.32999992370605f;
if (darwin) transferTime = 0.0f;
entity->AddCallbackTimer(transferTime, [=] {
const auto sysAddr = entity->GetSystemAddress();
ChatPackets::SendSystemMessage(sysAddr, u"Transfering map...");
@ -1564,7 +1540,6 @@ void SlashCommandHandler::HandleChatCommand(const std::u16string& command, Entit
entity->GetCharacter()->SaveXMLToDatabase();
WorldPackets::SendTransferToWorld(sysAddr, serverIP, serverPort, mythranShift);
});
return;
});
} else {