mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-16 22:58:34 +00:00
[Commands] Cleanup #reloadzps Command. (#2129)
* [Commands] Cleanup #reloadzps Command. - Cleanup messages and logic. - Make reloading of zone points global instead of zone specific. * Further cleanup. - Add zone->GetZoneDescription(). - Add mob->GetTargetDescription(mob). * Final cleanup. * Typo.
This commit is contained in:
@@ -100,29 +100,19 @@ void command_instance(Client *c, const Seperator *sep)
|
||||
uint32 zone_id = database.ZoneIDFromInstanceID(instance_id);
|
||||
uint32 version = database.VersionFromInstanceID(instance_id);
|
||||
uint32 current_id = database.GetInstanceID(zone_id, character_id, version);
|
||||
if (!current_id) {
|
||||
std::string target_string = (
|
||||
c == target ?
|
||||
"yourself" :
|
||||
fmt::format(
|
||||
"{} ({})",
|
||||
character_name,
|
||||
character_id
|
||||
)
|
||||
);
|
||||
|
||||
if (!current_id) {
|
||||
c->Message(
|
||||
Chat::White,
|
||||
(
|
||||
database.AddClientToInstance(instance_id, character_id) ?
|
||||
fmt::format(
|
||||
"Added {} to Instance ID {}.",
|
||||
target_string,
|
||||
c->GetTargetDescription(target),
|
||||
instance_id
|
||||
) :
|
||||
fmt::format(
|
||||
"Failed to add {} to Instance ID {}.",
|
||||
target_string,
|
||||
c->GetTargetDescription(target),
|
||||
instance_id
|
||||
)
|
||||
).c_str()
|
||||
@@ -297,28 +287,18 @@ void command_instance(Client *c, const Seperator *sep)
|
||||
return;
|
||||
}
|
||||
|
||||
std::string target_string = (
|
||||
c->CharacterID() == character_id ?
|
||||
"yourself" :
|
||||
fmt::format(
|
||||
"{} ({})",
|
||||
character_name,
|
||||
character_id
|
||||
)
|
||||
);
|
||||
|
||||
c->Message(
|
||||
Chat::White,
|
||||
(
|
||||
database.RemoveClientFromInstance(instance_id, character_id) ?
|
||||
fmt::format(
|
||||
"Removed {} from Instance ID {}.",
|
||||
target_string,
|
||||
c->GetTargetDescription(target),
|
||||
instance_id
|
||||
) :
|
||||
fmt::format(
|
||||
"Failed to remove {} from Instance ID {}.",
|
||||
target_string,
|
||||
c->GetTargetDescription(target),
|
||||
instance_id
|
||||
)
|
||||
).c_str()
|
||||
|
||||
Reference in New Issue
Block a user