[Commands] Cleanup #zonelock Command. (#1711)

* [Commands] Cleanup #zonelock Command.
- Add support for Zone IDs.
- Cleanup messages and display.
- Fix dangling pointer in ZoneLongName() helper method so name is displayed properly.

* Add account status enum.

* Typo.

* Typo.

* Convert list to constants.

* Cleanup.

* Update command.cpp

* Fix compile.
This commit is contained in:
Kinglykrab
2021-11-14 11:32:08 -05:00
committed by GitHub
parent 27f8ae3999
commit 90bcc5f03c
7 changed files with 170 additions and 56 deletions
+20
View File
@@ -85,6 +85,26 @@ std::string WorldStore::GetZoneName(uint32 zone_id)
return std::string();
}
/**
* @param zone_id
* @param error_unknown
* @return
*/
const char *WorldStore::GetZoneLongName(uint32 zone_id, bool error_unknown)
{
for (auto &z: zones) {
if (z.zoneidnumber == zone_id) {
return z.long_name.c_str();
}
}
if (error_unknown) {
return "UNKNOWN";
}
return nullptr;
}
/**
* @param zone_id
* @return