From 01511ddb3a81eec835073bc4f30a6707ae552002 Mon Sep 17 00:00:00 2001 From: David Athay Date: Tue, 21 Oct 2008 13:15:29 +0000 Subject: Fixed up some of the postal system stuff for testing it. --- src/commandhandler.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/commandhandler.cpp') diff --git a/src/commandhandler.cpp b/src/commandhandler.cpp index 58b8905d..66f746f3 100644 --- a/src/commandhandler.cpp +++ b/src/commandhandler.cpp @@ -96,8 +96,21 @@ void CommandHandler::handleCommand(const std::string &command) else if (type == "post") { std::string::size_type pos = args.find(' '); + if (pos == std::string::npos) + { + chatWindow->chatLog("Please include the user and message"); + return; + } std::string recipient(args, 0, pos); + if (recipient == "") + { + chatWindow->chatLog("Invalid user"); + } std::string text(args, pos+1); + if (text == "") + { + chatWindow->chatLog("Invalid message"); + } Net::GameServer::Player::sendLetter(recipient, text); } else if (type == "check") -- cgit v1.2.3-70-g09d2