MCPcopy Create free account
hub / github.com/EQEmu/EQEmu / command_instance

Function command_instance

zone/gm_commands/instance.cpp:3–307  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1#include "../client.h"
2
3void command_instance(Client *c, const Seperator *sep)
4{
5 int arguments = sep->argnum;
6 if (!arguments) {
7 c->Message(
8 Chat::White,
9 "Usage: #instance create [Zone ID|Zone Short Name] [Version] [Duration]"
10 );
11 c->Message(
12 Chat::White,
13 "Usage: #instance destroy [Instance ID]"
14 );
15 c->Message(
16 Chat::White,
17 "Usage: #instance add [Instance ID] [Name]"
18 );
19 c->Message(
20 Chat::White,
21 "Usage: #instance remove [Instance ID] [Name]"
22 );
23 c->Message(
24 Chat::White,
25 "Usage: #instance list [Name]"
26 );
27 return;
28 }
29
30 Client* target = c;
31 if (c->GetTarget() && c->GetTarget()->IsClient()) {
32 target = c->GetTarget()->CastToClient();
33 }
34
35 bool is_add = !strcasecmp(sep->arg[1], "add");
36 bool is_create = !strcasecmp(sep->arg[1], "create");
37 bool is_destroy = !strcasecmp(sep->arg[1], "destroy");
38 bool is_help = !strcasecmp(sep->arg[1], "help");
39 bool is_list = !strcasecmp(sep->arg[1], "list");
40 bool is_remove = !strcasecmp(sep->arg[1], "remove");
41 if (
42 !is_add &&
43 !is_create &&
44 !is_destroy &&
45 !is_help &&
46 !is_list &&
47 !is_remove
48 ) {
49 c->Message(
50 Chat::White,
51 "Usage: #instance create [Zone ID|Zone Short Name] [Version] [Duration]"
52 );
53 c->Message(
54 Chat::White,
55 "Usage: #instance destroy [Instance ID]"
56 );
57 c->Message(
58 Chat::White,
59 "Usage: #instance add [Instance ID] [Name]"
60 );

Callers

nothing calls this directly

Calls 15

ZoneIDFunction · 0.85
ZoneNameFunction · 0.85
ZoneLongNameFunction · 0.85
GetCharacterIDMethod · 0.80
CheckInstanceExistsMethod · 0.80
GetInstanceZoneIDMethod · 0.80
AddClientToInstanceMethod · 0.80
GetTargetDescriptionMethod · 0.80
GetUnusedInstanceIDMethod · 0.80
DeleteInstanceMethod · 0.80
ListAllInstancesMethod · 0.80

Tested by

no test coverage detected