mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-31 04:56:20 +00:00
[Commands] Cleanup #chat Command. (#2581)
- Cleanup messages and logic.
This commit is contained in:
@@ -5,11 +5,16 @@ extern WorldServer worldserver;
|
||||
|
||||
void command_chat(Client *c, const Seperator *sep)
|
||||
{
|
||||
if (sep->arg[2][0] == 0) {
|
||||
c->Message(Chat::White, "Usage: #chat [channum] [message]");
|
||||
auto arguments = sep->argnum;
|
||||
if (arguments < 2 || !sep->IsNumber(1)) {
|
||||
c->Message(Chat::White, "Usage: #chat [Channel ID] [Message]");
|
||||
return;
|
||||
}
|
||||
else if (!worldserver.SendChannelMessage(0, 0, (uint8) atoi(sep->arg[1]), 0, 0, 100, sep->argplus[2])) {
|
||||
c->Message(Chat::White, "Error: World server disconnected");
|
||||
|
||||
auto channel_id = static_cast<uint8>(std::stoul(sep->arg[1]));
|
||||
std::string message = sep->argplus[2];
|
||||
if (!worldserver.SendChannelMessage(0, 0, channel_id, 0, 0, 100, message.c_str())) {
|
||||
c->Message(Chat::White, "World server is disconnected.");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user