mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-31 00:46:46 +00:00
[Commands] Consolidate #lock and #unlock Commands into #serverlock. (#2193)
- Convert the two commands into one command. - Cleanup struct naming.
This commit is contained in:
@@ -1,15 +0,0 @@
|
||||
#include "../client.h"
|
||||
#include "../worldserver.h"
|
||||
|
||||
extern WorldServer worldserver;
|
||||
|
||||
void command_lock(Client *c, const Seperator *sep)
|
||||
{
|
||||
auto outpack = new ServerPacket(ServerOP_Lock, sizeof(ServerLock_Struct));
|
||||
ServerLock_Struct *lss = (ServerLock_Struct *) outpack->pBuffer;
|
||||
strcpy(lss->myname, c->GetName());
|
||||
lss->mode = 1;
|
||||
worldserver.SendPacket(outpack);
|
||||
safe_delete(outpack);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
#include "../client.h"
|
||||
#include "../worldserver.h"
|
||||
|
||||
extern WorldServer worldserver;
|
||||
|
||||
void command_serverlock(Client *c, const Seperator *sep)
|
||||
{
|
||||
if (!sep->IsNumber(1)) {
|
||||
c->Message(Chat::White, "Usage: #serverlock [0|1] - Lock or Unlock the World Server (0 = Unlocked, 1 = Locked)");
|
||||
return;
|
||||
}
|
||||
|
||||
auto is_locked = std::stoi(sep->arg[1]) ? true : false;
|
||||
|
||||
auto pack = new ServerPacket(ServerOP_Lock, sizeof(ServerLock_Struct));
|
||||
auto l = (ServerLock_Struct *) pack->pBuffer;
|
||||
strn0cpy(l->character_name, c->GetCleanName(), sizeof(l->character_name));
|
||||
l->is_locked = is_locked;
|
||||
worldserver.SendPacket(pack);
|
||||
safe_delete(pack);
|
||||
}
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
#include "../client.h"
|
||||
#include "../worldserver.h"
|
||||
|
||||
extern WorldServer worldserver;
|
||||
|
||||
void command_unlock(Client *c, const Seperator *sep)
|
||||
{
|
||||
auto outpack = new ServerPacket(ServerOP_Lock, sizeof(ServerLock_Struct));
|
||||
ServerLock_Struct *lss = (ServerLock_Struct *) outpack->pBuffer;
|
||||
strcpy(lss->myname, c->GetName());
|
||||
lss->mode = 0;
|
||||
worldserver.SendPacket(outpack);
|
||||
safe_delete(outpack);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user