diff options
| author | Treeston <treeston.mmoc@gmail.com> | 2020-09-12 19:42:10 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-09-12 19:42:10 +0200 |
| commit | 75f9e7396e35360f3016cc0cb21e72e20f5d96d5 (patch) | |
| tree | e738b70d54516717d2c784117fbd2b0134412ac0 /src/server/worldserver/RemoteAccess | |
| parent | 59be657ca267667b3cbeb1f34d47df0382e97f53 (diff) | |
[3.3.5] Core/ChatCommands: Show error messages from argument parsers (PR #25443)
Diffstat (limited to 'src/server/worldserver/RemoteAccess')
| -rw-r--r-- | src/server/worldserver/RemoteAccess/RASession.cpp | 6 | ||||
| -rw-r--r-- | src/server/worldserver/RemoteAccess/RASession.h | 4 |
2 files changed, 5 insertions, 5 deletions
diff --git a/src/server/worldserver/RemoteAccess/RASession.cpp b/src/server/worldserver/RemoteAccess/RASession.cpp index 6c8cb8b3468..0d9531cbe61 100644 --- a/src/server/worldserver/RemoteAccess/RASession.cpp +++ b/src/server/worldserver/RemoteAccess/RASession.cpp @@ -89,7 +89,7 @@ void RASession::Start() _socket.close(); } -int RASession::Send(char const* data) +int RASession::Send(std::string_view data) { std::ostream os(&_writeBuffer); os << data; @@ -204,9 +204,9 @@ bool RASession::ProcessCommand(std::string& command) return false; } -void RASession::CommandPrint(void* callbackArg, char const* text) +void RASession::CommandPrint(void* callbackArg, std::string_view text) { - if (!text || !*text) + if (text.empty()) return; RASession* session = static_cast<RASession*>(callbackArg); diff --git a/src/server/worldserver/RemoteAccess/RASession.h b/src/server/worldserver/RemoteAccess/RASession.h index e775bed5e33..d499727ae9d 100644 --- a/src/server/worldserver/RemoteAccess/RASession.h +++ b/src/server/worldserver/RemoteAccess/RASession.h @@ -42,13 +42,13 @@ public: unsigned short GetRemotePort() const { return _socket.remote_endpoint().port(); } private: - int Send(char const* data); + int Send(std::string_view data); std::string ReadString(); bool CheckAccessLevel(const std::string& user); bool CheckPassword(const std::string& user, const std::string& pass); bool ProcessCommand(std::string& command); - static void CommandPrint(void* callbackArg, char const* text); + static void CommandPrint(void* callbackArg, std::string_view text); static void CommandFinished(void* callbackArg, bool); tcp::socket _socket; |
