mirror of
https://github.com/EQEmu/Server.git
synced 2026-08-30 17:58:16 +00:00
[Commands] Cleanup #refreshgroup Command. (#2119)
- Cleanup messages and logic.
This commit is contained in:
+16
-13
@@ -3205,13 +3205,15 @@ bool ZoneDatabase::SetZoneTZ(uint32 zoneid, uint32 version, uint32 tz) {
|
||||
}
|
||||
|
||||
void ZoneDatabase::RefreshGroupFromDB(Client *client){
|
||||
if(!client)
|
||||
if (!client) {
|
||||
return;
|
||||
}
|
||||
|
||||
Group *group = client->GetGroup();
|
||||
|
||||
if(!group)
|
||||
if (!group) {
|
||||
return;
|
||||
}
|
||||
|
||||
auto outapp = new EQApplicationPacket(OP_GroupUpdate, sizeof(GroupUpdate2_Struct));
|
||||
GroupUpdate2_Struct* gu = (GroupUpdate2_Struct*)outapp->pBuffer;
|
||||
@@ -3223,19 +3225,21 @@ void ZoneDatabase::RefreshGroupFromDB(Client *client){
|
||||
|
||||
int index = 0;
|
||||
|
||||
std::string query = StringFormat("SELECT name FROM group_id WHERE groupid = %d", group->GetID());
|
||||
auto query = fmt::format(
|
||||
"SELECT name FROM group_id WHERE groupid = {}",
|
||||
group->GetID()
|
||||
);
|
||||
auto results = QueryDatabase(query);
|
||||
if (!results.Success())
|
||||
{
|
||||
}
|
||||
else
|
||||
{
|
||||
for (auto row = results.begin(); row != results.end(); ++row) {
|
||||
if(index >= 6)
|
||||
continue;
|
||||
|
||||
if(strcmp(client->GetName(), row[0]) == 0)
|
||||
if (results.Success()) {
|
||||
for (auto row : results) {
|
||||
if (index >= 6) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!strcmp(client->GetName(), row[0])) {
|
||||
continue;
|
||||
}
|
||||
|
||||
strcpy(gu->membername[index], row[0]);
|
||||
index++;
|
||||
@@ -3256,7 +3260,6 @@ void ZoneDatabase::RefreshGroupFromDB(Client *client){
|
||||
group->NotifyTankTarget(client);
|
||||
group->NotifyPullerTarget(client);
|
||||
group->SendMarkedNPCsToMember(client);
|
||||
|
||||
}
|
||||
|
||||
uint8 ZoneDatabase::GroupCount(uint32 groupid) {
|
||||
|
||||
Reference in New Issue
Block a user