Skip to content

Commit 80b6fb6

Browse files
committed
Cleanup for more warnings
1 parent 969d369 commit 80b6fb6

File tree

1 file changed

+119
-1
lines changed

1 file changed

+119
-1
lines changed

src/AuctionatorCommands.cpp

Lines changed: 119 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,129 @@ class AuctionatorCommands : public CommandScript
1616
}
1717

1818
private:
19+
static bool HandleCommandOptionsNew(ChatHandler* handler, const std::vector<std::string>& args)
20+
{
21+
std::string command;
22+
if (!args.empty())
23+
{
24+
command = args[0];
25+
}
26+
else
27+
{
28+
command = "help";
29+
}
30+
31+
std::vector<std::string> commandParams;
32+
for (size_t i = 1; i < args.size(); ++i)
33+
{
34+
commandParams.push_back(args[i]);
35+
}
36+
37+
if (command.empty())
38+
{
39+
return true;
40+
}
41+
42+
gAuctionator->logDebug("Executing command: " + command);
43+
44+
if (command == "add")
45+
{
46+
gAuctionator->logInfo("Adding new Item for GM");
47+
if (commandParams.size() >= 3)
48+
{
49+
uint32 auctionHouseId = std::stoi(commandParams[0]);
50+
uint32 itemId = std::stoi(commandParams[1]);
51+
uint32 price = std::stoi(commandParams[2]);
52+
AddItemForBuyout(auctionHouseId, itemId, price, gAuctionator);
53+
}
54+
else
55+
{
56+
// Handle invalid command arguments
57+
}
58+
}
59+
else if (command == "auctionspercycle")
60+
61+
{
62+
std::vector<const char*> commandParamsArray;
63+
for (const std::string& param : commandParams)
64+
{
65+
commandParamsArray.push_back(param.c_str());
66+
}
67+
CommandAuctionsPerCycle(commandParamsArray.data(), handler, gAuctionator);
68+
}
69+
else if (command == "bidonown")
70+
71+
{
72+
std::vector<const char*> commandParamsArray;
73+
for (const std::string& param : commandParams)
74+
{
75+
commandParamsArray.push_back(param.c_str());
76+
}
77+
CommandBidOnOwn(commandParamsArray.data(), handler, gAuctionator);
78+
}
79+
else if (command == "bidspercycle")
80+
{
81+
std::vector<const char*> commandParamsArray;
82+
for (const std::string& param : commandParams)
83+
{
84+
commandParamsArray.push_back(param.c_str());
85+
}
86+
CommandBidsPerCycle(commandParamsArray.data(), handler, gAuctionator);
87+
}
88+
else if (command == "disable")
89+
{
90+
std::vector<const char*> commandParamsArray;
91+
for (const std::string& param : commandParams)
92+
{
93+
commandParamsArray.push_back(param.c_str());
94+
}
95+
CommandDisableSeller(commandParamsArray.data(), handler, gAuctionator);
96+
}
97+
else if (command == "enable")
98+
{
99+
std::vector<const char*> commandParamsArray;
100+
for (const std::string& param : commandParams)
101+
{
102+
commandParamsArray.push_back(param.c_str());
103+
}
104+
CommandEnableSeller(commandParamsArray.data(), handler, gAuctionator);
105+
}
106+
else if (command == "expireall")
107+
{
108+
std::vector<const char*> commandParamsArray;
109+
for (const std::string& param : commandParams)
110+
{
111+
commandParamsArray.push_back(param.c_str());
112+
}
113+
CommandExpireAll(commandParamsArray.data(), handler, gAuctionator);
114+
}
115+
else if (command == "multiplier")
116+
{
117+
std::vector<const char*> commandParamsArray;
118+
for (const std::string& param : commandParams)
119+
{
120+
commandParamsArray.push_back(param.c_str());
121+
}
122+
CommandSetMultiplier(commandParamsArray.data(), handler, gAuctionator);
123+
}
124+
else if (command == "status")
125+
{
126+
ShowStatus(handler, gAuctionator);
127+
}
128+
else if (command == "help")
129+
{
130+
ShowHelp(handler);
131+
return true;
132+
}
133+
134+
return true;
135+
}
136+
19137
ChatCommandTable GetCommands() const override
20138
{
21139
static ChatCommandTable commandTableBase =
22140
{
23-
{ "auctionator", HandleCommandOptions, SEC_GAMEMASTER, Console::Yes }
141+
{ "auctionator", HandleCommandOptionsNew, SEC_GAMEMASTER, Console::Yes }
24142
};
25143

26144
return commandTableBase;

0 commit comments

Comments
 (0)