mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-13 10:31:29 +00:00
Add #dz lockouts remove by event name
This commit is contained in:
parent
9164073d14
commit
9b82cf57e4
@ -2065,9 +2065,10 @@ struct ServerExpeditionSetting_Struct {
|
||||
uint8 enabled;
|
||||
};
|
||||
|
||||
struct ServerExpeditionCharacterName_Struct {
|
||||
struct ServerExpeditionCharacterLockout_Struct {
|
||||
char character_name[64];
|
||||
char expedition_name[128];
|
||||
char event_name[256];
|
||||
};
|
||||
|
||||
struct ServerExpeditionCharacterID_Struct {
|
||||
|
||||
@ -437,7 +437,7 @@ void ExpeditionMessage::HandleZoneMessage(ServerPacket* pack)
|
||||
}
|
||||
case ServerOP_ExpeditionRemoveCharLockouts:
|
||||
{
|
||||
auto buf = reinterpret_cast<ServerExpeditionCharacterName_Struct*>(pack->pBuffer);
|
||||
auto buf = reinterpret_cast<ServerExpeditionCharacterLockout_Struct*>(pack->pBuffer);
|
||||
client_list.SendPacket(buf->character_name, pack);
|
||||
break;
|
||||
}
|
||||
|
||||
@ -6932,11 +6932,19 @@ void command_dz(Client* c, const Seperator* sep)
|
||||
{
|
||||
if (strcasecmp(sep->arg[2], "remove") == 0 && sep->arg[3][0] != '\0')
|
||||
{
|
||||
c->Message(Chat::White, fmt::format(
|
||||
"Removing [{}] lockouts on [{}].", sep->arg[4][0] ? sep->arg[4] : "all", sep->arg[3]
|
||||
).c_str());
|
||||
|
||||
Expedition::RemoveAllCharacterLockouts(sep->arg[3], sep->arg[4]);
|
||||
if (sep->arg[5][0] == '\0')
|
||||
{
|
||||
c->Message(Chat::White, fmt::format(
|
||||
"Removing [{}] lockouts on [{}].", sep->arg[4][0] ? sep->arg[4] : "all", sep->arg[3]
|
||||
).c_str());
|
||||
}
|
||||
else
|
||||
{
|
||||
c->Message(Chat::White, fmt::format(
|
||||
"Removing [{}]:[{}] lockout on [{}].", sep->arg[4], sep->arg[5], sep->arg[3]
|
||||
).c_str());
|
||||
}
|
||||
Expedition::RemoveCharacterLockouts(sep->arg[3], sep->arg[4], sep->arg[5]);
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -6948,6 +6956,7 @@ void command_dz(Client* c, const Seperator* sep)
|
||||
c->Message(Chat::White, "#dz list [all] - list dynamic zone instances from database -- 'all' includes expired");
|
||||
c->Message(Chat::White, "#dz lockouts remove <char_name> - delete all of character's expedition lockouts");
|
||||
c->Message(Chat::White, "#dz lockouts remove <char_name> \"<expedition_name>\" - delete lockouts by expedition");
|
||||
c->Message(Chat::White, "#dz lockouts remove <char_name> \"<expedition_name>\" \"<event_name>\" - delete lockout by expedition event");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -1556,17 +1556,15 @@ void Expedition::SendWorldGetOnlineMembers()
|
||||
worldserver.SendPacket(pack.get());
|
||||
}
|
||||
|
||||
void Expedition::RemoveAllCharacterLockouts(std::string character_name, std::string expedition_name)
|
||||
void Expedition::RemoveCharacterLockouts(
|
||||
std::string character_name, std::string expedition_name, std::string event_name)
|
||||
{
|
||||
uint32_t pack_size = sizeof(ServerExpeditionCharacterName_Struct);
|
||||
uint32_t pack_size = sizeof(ServerExpeditionCharacterLockout_Struct);
|
||||
auto pack = std::unique_ptr<ServerPacket>(new ServerPacket(ServerOP_ExpeditionRemoveCharLockouts, pack_size));
|
||||
auto buf = reinterpret_cast<ServerExpeditionCharacterName_Struct*>(pack->pBuffer);
|
||||
auto buf = reinterpret_cast<ServerExpeditionCharacterLockout_Struct*>(pack->pBuffer);
|
||||
strn0cpy(buf->character_name, character_name.c_str(), sizeof(buf->character_name));
|
||||
buf->expedition_name[0] = '\0';
|
||||
if (!expedition_name.empty())
|
||||
{
|
||||
strn0cpy(buf->expedition_name, expedition_name.c_str(), sizeof(buf->expedition_name));
|
||||
}
|
||||
strn0cpy(buf->expedition_name, expedition_name.c_str(), sizeof(buf->expedition_name));
|
||||
strn0cpy(buf->event_name, event_name.c_str(), sizeof(buf->event_name));
|
||||
worldserver.SendPacket(pack.get());
|
||||
}
|
||||
|
||||
@ -1788,11 +1786,18 @@ void Expedition::HandleWorldMessage(ServerPacket* pack)
|
||||
}
|
||||
case ServerOP_ExpeditionRemoveCharLockouts:
|
||||
{
|
||||
auto buf = reinterpret_cast<ServerExpeditionCharacterName_Struct*>(pack->pBuffer);
|
||||
auto buf = reinterpret_cast<ServerExpeditionCharacterLockout_Struct*>(pack->pBuffer);
|
||||
Client* client = entity_list.GetClientByName(buf->character_name);
|
||||
if (client)
|
||||
{
|
||||
client->RemoveAllExpeditionLockouts(buf->expedition_name);
|
||||
if (buf->event_name[0] != '\0')
|
||||
{
|
||||
client->RemoveExpeditionLockout(buf->expedition_name, buf->event_name, true);
|
||||
}
|
||||
else
|
||||
{
|
||||
client->RemoveAllExpeditionLockouts(buf->expedition_name);
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
@ -84,7 +84,7 @@ public:
|
||||
static Expedition* FindCachedExpeditionByCharacterName(const std::string& char_name);
|
||||
static Expedition* FindCachedExpeditionByID(uint32_t expedition_id);
|
||||
static Expedition* FindExpeditionByInstanceID(uint32_t instance_id);
|
||||
static void RemoveAllCharacterLockouts(std::string character_name, std::string expedition_name = {});
|
||||
static void RemoveCharacterLockouts(std::string character_name, std::string expedition_name = {}, std::string event_name = {});
|
||||
static void HandleWorldMessage(ServerPacket* pack);
|
||||
|
||||
uint32_t GetID() const { return m_id; }
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user