mirror of
https://github.com/EQEmu/Server.git
synced 2026-11-24 13:57:16 +00:00
Implement consent for group/raid/guild and add Auto Consent support
Refactors consent to be more live accurate Message sent to owner and receiver for each zone a corpse is in Corpses now store consent list instead of clients holding corpse list Consent throttling added Message strings and colors updated Removed reporting invalid consent targets
This commit is contained in:
1 parent
c82d08cf11
commit
63b8df72b2
10 files changed
+222
-176
No files matched your search
+17
-29
@@ -4643,43 +4643,16 @@ void Client::Handle_OP_Consent(const EQApplicationPacket *app)
|
||||
{
|
||||
if (app->size<64) {
|
||||
Consent_Struct* c = (Consent_Struct*)app->pBuffer;
|
||||
if (strcmp(c->name, GetName()) != 0) {
|
||||
auto pack = new ServerPacket(ServerOP_Consent, sizeof(ServerOP_Consent_Struct));
|
||||
ServerOP_Consent_Struct* scs = (ServerOP_Consent_Struct*)pack->pBuffer;
|
||||
strcpy(scs->grantname, c->name);
|
||||
strcpy(scs->ownername, GetName());
|
||||
scs->message_string_id = 0;
|
||||
scs->permission = 1;
|
||||
scs->zone_id = zone->GetZoneID();
|
||||
scs->instance_id = zone->GetInstanceID();
|
||||
//consent_list.push_back(scs->grantname);
|
||||
worldserver.SendPacket(pack);
|
||||
safe_delete(pack);
|
||||
}
|
||||
else {
|
||||
MessageString(Chat::White, CONSENT_YOURSELF);
|
||||
}
|
||||
ConsentCorpses(c->name, false);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
void Client::Handle_OP_ConsentDeny(const EQApplicationPacket *app)
|
||||
{
|
||||
if (app->size<64) {
|
||||
Consent_Struct* c = (Consent_Struct*)app->pBuffer;
|
||||
auto pack = new ServerPacket(ServerOP_Consent, sizeof(ServerOP_Consent_Struct));
|
||||
ServerOP_Consent_Struct* scs = (ServerOP_Consent_Struct*)pack->pBuffer;
|
||||
strcpy(scs->grantname, c->name);
|
||||
strcpy(scs->ownername, GetName());
|
||||
scs->message_string_id = 0;
|
||||
scs->permission = 0;
|
||||
scs->zone_id = zone->GetZoneID();
|
||||
scs->instance_id = zone->GetInstanceID();
|
||||
//consent_list.remove(scs->grantname);
|
||||
worldserver.SendPacket(pack);
|
||||
safe_delete(pack);
|
||||
ConsentCorpses(c->name, true);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
void Client::Handle_OP_Consider(const EQApplicationPacket *app)
|
||||
@@ -13315,6 +13288,21 @@ void Client::Handle_OP_SpawnAppearance(const EQApplicationPacket *app)
|
||||
entity_list.QueueClients(this, app, true);
|
||||
}
|
||||
}
|
||||
else if (sa->type == AT_GroupConsent)
|
||||
{
|
||||
m_pp.groupAutoconsent = (sa->parameter == 1);
|
||||
ConsentCorpses("Group", (sa->parameter != 1));
|
||||
}
|
||||
else if (sa->type == AT_RaidConsent)
|
||||
{
|
||||
m_pp.raidAutoconsent = (sa->parameter == 1);
|
||||
ConsentCorpses("Raid", (sa->parameter != 1));
|
||||
}
|
||||
else if (sa->type == AT_GuildConsent)
|
||||
{
|
||||
m_pp.guildAutoconsent = (sa->parameter == 1);
|
||||
ConsentCorpses("Guild", (sa->parameter != 1));
|
||||
}
|
||||
else {
|
||||
std::cout << "Unknown SpawnAppearance type: 0x" << std::hex << std::setw(4) << std::setfill('0') << sa->type << std::dec
|
||||
<< " value: 0x" << std::hex << std::setw(8) << std::setfill('0') << sa->parameter << std::dec << std::endl;
|
||||
|
||||
Reference in new issue
Block a user