summaryrefslogtreecommitdiff
path: root/src/net
diff options
context:
space:
mode:
Diffstat (limited to 'src/net')
-rw-r--r--src/net/download.cpp2
-rw-r--r--src/net/ea/gamehandler.cpp5
-rw-r--r--src/net/ea/inventoryhandler.cpp8
-rw-r--r--src/net/manaserv/connection.cpp5
-rw-r--r--src/net/manaserv/loginhandler.cpp8
-rw-r--r--src/net/serverinfo.h22
6 files changed, 25 insertions, 25 deletions
diff --git a/src/net/download.cpp b/src/net/download.cpp
index 1acb4b59b..a4eb31603 100644
--- a/src/net/download.cpp
+++ b/src/net/download.cpp
@@ -64,9 +64,9 @@ Download::Download(void *ptr, const std::string &url,
mThread(nullptr),
mCurl(nullptr),
mHeaders(nullptr),
+ mError(static_cast<char*>(calloc(CURL_ERROR_SIZE + 1, 1))),
mIgnoreError(ignoreError)
{
- mError = static_cast<char*>(calloc(CURL_ERROR_SIZE + 1, 1));
mError[0] = 0;
mOptions.cancel = 0;
diff --git a/src/net/ea/gamehandler.cpp b/src/net/ea/gamehandler.cpp
index 71110984d..fe6c39645 100644
--- a/src/net/ea/gamehandler.cpp
+++ b/src/net/ea/gamehandler.cpp
@@ -39,10 +39,9 @@
namespace Ea
{
-GameHandler::GameHandler()
+GameHandler::GameHandler() :
+ mCharID(0)
{
- mCharID = 0;
-
listen(CHANNEL_GAME);
}
diff --git a/src/net/ea/inventoryhandler.cpp b/src/net/ea/inventoryhandler.cpp
index f28e9b396..a03ea45af 100644
--- a/src/net/ea/inventoryhandler.cpp
+++ b/src/net/ea/inventoryhandler.cpp
@@ -76,11 +76,11 @@ const Equipment::Slot EQUIP_CONVERT[] =
namespace Ea
{
-InventoryHandler::InventoryHandler()
+InventoryHandler::InventoryHandler() :
+ mStorage(nullptr),
+ mStorageWindow(nullptr),
+ mDebugInventory(true)
{
- mStorage = nullptr;
- mStorageWindow = nullptr;
- mDebugInventory = true;
}
InventoryHandler::~InventoryHandler()
diff --git a/src/net/manaserv/connection.cpp b/src/net/manaserv/connection.cpp
index 2467eb198..7ac05b484 100644
--- a/src/net/manaserv/connection.cpp
+++ b/src/net/manaserv/connection.cpp
@@ -33,9 +33,10 @@ namespace ManaServ
{
Connection::Connection(ENetHost *client):
- mConnection(0), mClient(client)
+ mPort(0),
+ mConnection(0),
+ mClient(client)
{
- mPort = 0;
connections++;
}
diff --git a/src/net/manaserv/loginhandler.cpp b/src/net/manaserv/loginhandler.cpp
index f93d8e44c..dc8f37d36 100644
--- a/src/net/manaserv/loginhandler.cpp
+++ b/src/net/manaserv/loginhandler.cpp
@@ -44,7 +44,10 @@ namespace ManaServ
extern Connection *accountServerConnection;
extern std::string netToken;
-LoginHandler::LoginHandler()
+LoginHandler::LoginHandler() :
+ mLoginData(0),
+ mMinUserNameLength(4),
+ mMaxUserNameLength(10)
{
static const Uint16 _messages[] =
{
@@ -60,9 +63,6 @@ LoginHandler::LoginHandler()
};
handledMessages = _messages;
loginHandler = this;
- mMinUserNameLength = 4;
- mMaxUserNameLength = 10;
- mLoginData = 0;
}
void LoginHandler::handleMessage(Net::MessageIn &msg)
diff --git a/src/net/serverinfo.h b/src/net/serverinfo.h
index b4bb1a2d8..d3c33d19f 100644
--- a/src/net/serverinfo.h
+++ b/src/net/serverinfo.h
@@ -51,24 +51,24 @@ public:
bool save;
- ServerInfo()
+ ServerInfo() :
+ type(TMWATHENA),
+ port(6901),
+ save(false)
{
- type = TMWATHENA;
- port = 6901;
- save = false;
version.first = 0;
}
- ServerInfo(const ServerInfo &info)
+ ServerInfo(const ServerInfo &info) :
+ type(info.type),
+ name(info.name),
+ hostname(info.hostname),
+ port(info.port),
+ description(info.description),
+ save(info.save)
{
- type = info.type;
- name = info.name;
- hostname = info.hostname;
- port = info.port;
- description = info.description;
version.first = info.version.first;
version.second = info.version.second;
- save = info.save;
}
bool isValid() const