aboutsummaryrefslogtreecommitdiff
path: root/src/server/worldserver
diff options
context:
space:
mode:
authorShauren <shauren.trinity@gmail.com>2020-09-04 13:38:24 +0200
committerShauren <shauren.trinity@gmail.com>2020-09-04 13:38:24 +0200
commitb23190393248455f04d3a06def030a1ec7efad1e (patch)
tree1ce3772314492dcdb985641269a3114813d4b4dc /src/server/worldserver
parentb20acfe701e6f5f995f2776f076d3c494c02e1aa (diff)
Core/Misc: Port all the refactors sneaked in master to 3.3.5 include cleanup port
Diffstat (limited to 'src/server/worldserver')
-rw-r--r--src/server/worldserver/CommandLine/CliRunnable.cpp8
-rw-r--r--src/server/worldserver/PrecompiledHeaders/worldPCH.h17
-rw-r--r--src/server/worldserver/RemoteAccess/RASession.cpp7
-rw-r--r--src/server/worldserver/RemoteAccess/RASession.h4
-rw-r--r--src/server/worldserver/TCSoap/TCSoap.h4
5 files changed, 28 insertions, 12 deletions
diff --git a/src/server/worldserver/CommandLine/CliRunnable.cpp b/src/server/worldserver/CommandLine/CliRunnable.cpp
index 5c3f8e25391..200f78f0957 100644
--- a/src/server/worldserver/CommandLine/CliRunnable.cpp
+++ b/src/server/worldserver/CommandLine/CliRunnable.cpp
@@ -38,10 +38,10 @@
#include <readline/readline.h>
#include <readline/history.h>
-char* command_finder(const char* text, int state)
+char* command_finder(char const* text, int state)
{
static size_t idx, len;
- const char* ret;
+ char const* ret;
std::vector<ChatCommand> const& cmd = ChatHandler::getCommandTable();
if (!state)
@@ -68,7 +68,7 @@ char* command_finder(const char* text, int state)
return nullptr;
}
-char** cli_completion(const char* text, int start, int /*end*/)
+char** cli_completion(char const* text, int start, int /*end*/)
{
char** matches = nullptr;
@@ -88,7 +88,7 @@ int cli_hook_func()
#endif
-void utf8print(void* /*arg*/, const char* str)
+void utf8print(void* /*arg*/, char const* str)
{
#if TRINITY_PLATFORM == TRINITY_PLATFORM_WINDOWS
wchar_t wtemp_buf[6000];
diff --git a/src/server/worldserver/PrecompiledHeaders/worldPCH.h b/src/server/worldserver/PrecompiledHeaders/worldPCH.h
index 6407485f70b..ae91378f782 100644
--- a/src/server/worldserver/PrecompiledHeaders/worldPCH.h
+++ b/src/server/worldserver/PrecompiledHeaders/worldPCH.h
@@ -1,3 +1,20 @@
+/*
+ * This file is part of the TrinityCore Project. See AUTHORS file for Copyright information
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
#include "Common.h"
#include "World.h"
#include "Log.h"
diff --git a/src/server/worldserver/RemoteAccess/RASession.cpp b/src/server/worldserver/RemoteAccess/RASession.cpp
index c49863d353c..4a4a22b3c75 100644
--- a/src/server/worldserver/RemoteAccess/RASession.cpp
+++ b/src/server/worldserver/RemoteAccess/RASession.cpp
@@ -39,8 +39,7 @@ void RASession::Start()
if (_socket.available() > 0)
{
// Handle subnegotiation
- char buf[1024];
- memset(buf, 0, sizeof(buf));
+ char buf[1024] = { };
_socket.read_some(boost::asio::buffer(buf));
// Send the end-of-negotiation packet
@@ -91,7 +90,7 @@ void RASession::Start()
_socket.close();
}
-int RASession::Send(const char* data)
+int RASession::Send(char const* data)
{
std::ostream os(&_writeBuffer);
os << data;
@@ -204,7 +203,7 @@ bool RASession::ProcessCommand(std::string& command)
return false;
}
-void RASession::CommandPrint(void* callbackArg, const char* text)
+void RASession::CommandPrint(void* callbackArg, char const* text)
{
if (!text || !*text)
return;
diff --git a/src/server/worldserver/RemoteAccess/RASession.h b/src/server/worldserver/RemoteAccess/RASession.h
index 594f08160ac..e775bed5e33 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(const char* data);
+ int Send(char const* 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, const char* text);
+ static void CommandPrint(void* callbackArg, char const* text);
static void CommandFinished(void* callbackArg, bool);
tcp::socket _socket;
diff --git a/src/server/worldserver/TCSoap/TCSoap.h b/src/server/worldserver/TCSoap/TCSoap.h
index 88ae3a0a0aa..e45d044983b 100644
--- a/src/server/worldserver/TCSoap/TCSoap.h
+++ b/src/server/worldserver/TCSoap/TCSoap.h
@@ -38,7 +38,7 @@ class SOAPCommand
{
}
- void appendToPrintBuffer(const char* msg)
+ void appendToPrintBuffer(char const* msg)
{
m_printBuffer += msg;
}
@@ -54,7 +54,7 @@ class SOAPCommand
return m_success;
}
- static void print(void* callbackArg, const char* msg)
+ static void print(void* callbackArg, char const* msg)
{
((SOAPCommand*)callbackArg)->appendToPrintBuffer(msg);
}