EvEmu  0.8.4
11 September 2021
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
DungeonCommands.cpp
Go to the documentation of this file.
1 
12 #include <stdio.h>
13 #include "eve-server.h"
14 
15 #include "admin/AllCommands.h"
16 #include "admin/CommandDB.h"
17 
18 #include "system/SolarSystem.h"
19 #include "system/SystemBubble.h"
20 #include "system/SystemManager.h"
25 
26 
27 
29 {
37  if (pClient == nullptr) // should never hit,
38  throw CustomError ("SaveDungeon: Invalid Caller - Client sent NULL.");
39 
40  if (args.argCount() < 2)
41  throw CustomError ("SaveDungeon: Missing Arguments (use '.savedungeon help' for usage)");
42 
43 
44  if (args.argCount() == 2) { //
45  if (args.isNumber(1)) {
46  // not used yet
47  }
48  }
49 
50  if (strcmp(args.arg(1).c_str(), "help") == 0) {
51  // {.savedungeon help} will display the following information in notification window
52  std::ostringstream str; // for 'help' printing
53  str << ".savedungeon [groupID] [group name/description]<br>"; //55
54  int size = 55;
55  char reply[size];
56  snprintf(reply, size, str.str().c_str());
57  pClient->SendInfoModalMsg(reply);
58  return nullptr;
59  } else if (args.isNumber(1)) {
60  // not used yet
61  }
62 
63  throw CustomError ("SaveDungeon: - This command is currently incomplete.");
64 }
65 
67 {
68  /* this will print all items in current dungeon, along with it's templateID and roomID
69  *
70  */
71 
72  throw CustomError ("PrintDungeon: - This command is currently incomplete.");
73 }
74 
75 // this is outdated
77  /* this command is used to test dungeon spawn system - wip. -allan 21Feb15
78  */
79 
80  if (args.argCount() != 2)
81  throw CustomError ("Correct Usage: .spawndungeon <dungeonTemplateID>");
82 
83  if (!args.isNumber(1))
84  throw CustomError ("Argument must be a template ID.");
85 
86  // pClient->SystemMgr()->GetDungMgr()->Create(args.arg(1)); // this is missing sig data.
87 
88  throw CustomError ("SpawnDungeon: - This command is currently incomplete.");
89  return nullptr;
90 }
91 
92 // this was never completed
94  /* this command is used to test dungeon spawn system - wip. -allan 21Feb15
95  *
96  * upon execution, this command will spawn a random dungeon from db in callers solarSystem,
97  * then create a bookmark in their PnP/BM window
98  */
99  throw CustomError ("RemoveDungeon: - This command is currently incomplete.");
100  return nullptr;
101 }
const std::string & arg(size_t index) const
Definition: Seperator.h:43
PyResult Command_removedungeon(Client *pClient, CommandDB *db, PyServiceMgr *services, const Seperator &args)
void SendInfoModalMsg(const char *fmt,...)
Definition: Client.cpp:2756
Separates string to arguments.
Definition: Seperator.h:36
Advanced version of UserError that allows to send a full custom message.
Definition: PyExceptions.h:453
* args
size_t argCount() const
Definition: Seperator.h:44
PyResult Command_printdungeon(Client *pClient, CommandDB *db, PyServiceMgr *services, const Seperator &args)
#define snprintf
Definition: eve-compat.h:184
Definition: Client.h:66
PyResult Command_spawndungeon(Client *pClient, CommandDB *db, PyServiceMgr *services, const Seperator &args)
PyResult Command_savedungeon(Client *pClient, CommandDB *db, PyServiceMgr *services, const Seperator &args)
bool isNumber(size_t index) const
Definition: Seperator.h:46