mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-31 09:06:46 +00:00
[Commands] Cleanup #refreshgroup Command. (#2119)
- Cleanup messages and logic.
This commit is contained in:
@@ -3,17 +3,58 @@
|
||||
|
||||
void command_refreshgroup(Client *c, const Seperator *sep)
|
||||
{
|
||||
if (!c) {
|
||||
auto target = c;
|
||||
if (c->GetTarget() && c->GetTarget()->IsClient()) {
|
||||
target = c->GetTarget()->CastToClient();
|
||||
}
|
||||
|
||||
Group *group = target->GetGroup();
|
||||
|
||||
if (!group) {
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"{} not in a group.",
|
||||
(
|
||||
c == target ?
|
||||
"You are" :
|
||||
fmt::format(
|
||||
"{} ({}} is",
|
||||
target->GetCleanName(),
|
||||
target->GetID()
|
||||
)
|
||||
)
|
||||
).c_str()
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
Group *g = c->GetGroup();
|
||||
database.RefreshGroupFromDB(target);
|
||||
|
||||
if (!g) {
|
||||
return;
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"Group has been refreshed for {}.",
|
||||
(
|
||||
c == target ?
|
||||
"yourself" :
|
||||
fmt::format(
|
||||
"{} ({})",
|
||||
target->GetCleanName(),
|
||||
target->GetID()
|
||||
)
|
||||
)
|
||||
).c_str()
|
||||
);
|
||||
|
||||
if (c != target) {
|
||||
target->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"Your group has been refreshed by {}.",
|
||||
c->GetCleanName()
|
||||
).c_str()
|
||||
);
|
||||
}
|
||||
|
||||
database.RefreshGroupFromDB(c);
|
||||
//g->SendUpdate(7, c);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user