Add #dz lockouts remove command

This allows clearing a character's lockouts

Adds client RemoveAllExpeditionLockouts methods and exposes to lua api
This commit is contained in:
hg
2020-05-09 19:17:00 -04:00
parent b116730885
commit ef77b28b3f
12 changed files with 133 additions and 15 deletions
+24
View File
@@ -1530,6 +1530,20 @@ void Expedition::SendWorldGetOnlineMembers()
worldserver.SendPacket(pack.get());
}
void Expedition::RemoveAllCharacterLockouts(std::string character_name, std::string expedition_name)
{
uint32_t pack_size = sizeof(ServerExpeditionCharacterName_Struct);
auto pack = std::unique_ptr<ServerPacket>(new ServerPacket(ServerOP_ExpeditionRemoveCharLockouts, pack_size));
auto buf = reinterpret_cast<ServerExpeditionCharacterName_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));
}
worldserver.SendPacket(pack.get());
}
void Expedition::HandleWorldMessage(ServerPacket* pack)
{
switch (pack->opcode)
@@ -1719,6 +1733,16 @@ void Expedition::HandleWorldMessage(ServerPacket* pack)
}
break;
}
case ServerOP_ExpeditionRemoveCharLockouts:
{
auto buf = reinterpret_cast<ServerExpeditionCharacterName_Struct*>(pack->pBuffer);
Client* client = entity_list.GetClientByName(buf->character_name);
if (client)
{
client->RemoveAllExpeditionLockouts(buf->expedition_name);
}
break;
}
}
}