mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-17 03:08:26 +00:00
[Commands] Cleanup #zonebootup and #zoneshutdown Commands (#3729)
# Notes - Cleanup messages and logic.
This commit is contained in:
+10
-10
@@ -578,25 +578,25 @@ void ConsoleZoneShutdown(
|
||||
strcpy(&tmpname[1], connection->UserName().c_str());
|
||||
|
||||
auto pack = new ServerPacket;
|
||||
pack->size = sizeof(ServerZoneStateChange_struct);
|
||||
pack->size = sizeof(ServerZoneStateChange_Struct);
|
||||
pack->pBuffer = new uchar[pack->size];
|
||||
memset(pack->pBuffer, 0, sizeof(ServerZoneStateChange_struct));
|
||||
ServerZoneStateChange_struct *s = (ServerZoneStateChange_struct *) pack->pBuffer;
|
||||
memset(pack->pBuffer, 0, sizeof(ServerZoneStateChange_Struct));
|
||||
auto *s = (ServerZoneStateChange_Struct *) pack->pBuffer;
|
||||
pack->opcode = ServerOP_ZoneShutdown;
|
||||
strcpy(s->adminname, tmpname);
|
||||
strcpy(s->admin_name, tmpname);
|
||||
if (Strings::IsNumber(args[0])) {
|
||||
s->ZoneServerID = Strings::ToInt(args[0]);
|
||||
s->zone_server_id = Strings::ToInt(args[0]);
|
||||
}
|
||||
else {
|
||||
s->zoneid = ZoneID(args[0].c_str());
|
||||
s->zone_id = ZoneID(args[0].c_str());
|
||||
}
|
||||
|
||||
ZoneServer *zs = 0;
|
||||
if (s->ZoneServerID != 0) {
|
||||
zs = zoneserver_list.FindByID(s->ZoneServerID);
|
||||
if (s->zone_server_id != 0) {
|
||||
zs = zoneserver_list.FindByID(s->zone_server_id);
|
||||
}
|
||||
else if (s->zoneid != 0) {
|
||||
zs = zoneserver_list.FindByName(ZoneName(s->zoneid));
|
||||
else if (s->zone_id != 0) {
|
||||
zs = zoneserver_list.FindByName(ZoneName(s->zone_id));
|
||||
}
|
||||
else {
|
||||
connection->SendLine("Error: ZoneShutdown: neither ID nor name specified");
|
||||
|
||||
Reference in New Issue
Block a user