summaryrefslogtreecommitdiff
path: root/src/net/manaserv
diff options
context:
space:
mode:
Diffstat (limited to 'src/net/manaserv')
-rw-r--r--src/net/manaserv/charhandler.cpp4
-rw-r--r--src/net/manaserv/chathandler.cpp8
-rw-r--r--src/net/manaserv/generalhandler.cpp10
-rw-r--r--src/net/manaserv/guildhandler.cpp4
-rw-r--r--src/net/manaserv/guildhandler.h2
-rw-r--r--src/net/manaserv/loginhandler.cpp2
-rw-r--r--src/net/manaserv/partyhandler.h2
7 files changed, 11 insertions, 21 deletions
diff --git a/src/net/manaserv/charhandler.cpp b/src/net/manaserv/charhandler.cpp
index 4665a70d..61e44506 100644
--- a/src/net/manaserv/charhandler.cpp
+++ b/src/net/manaserv/charhandler.cpp
@@ -132,7 +132,7 @@ void CharHandler::handleCharacterCreateResponse(MessageIn &msg)
if (errMsg != ERRMSG_OK)
{
// Character creation failed
- std::string errorMessage = "";
+ std::string errorMessage;
switch (errMsg)
{
case ERRMSG_NO_LOGIN:
@@ -213,7 +213,7 @@ void CharHandler::handleCharacterDeleteResponse(MessageIn &msg)
else
{
// Character deletion failed
- std::string errorMessage = "";
+ std::string errorMessage;
switch (errMsg)
{
case ERRMSG_NO_LOGIN:
diff --git a/src/net/manaserv/chathandler.cpp b/src/net/manaserv/chathandler.cpp
index 6d0b6b4e..ce21eb2f 100644
--- a/src/net/manaserv/chathandler.cpp
+++ b/src/net/manaserv/chathandler.cpp
@@ -195,7 +195,7 @@ void ChatHandler::handleEnterChannelResponse(MessageIn &msg)
while (msg.getUnreadLength())
{
user = msg.readString();
- if (user == "")
+ if (user.empty())
return;
userModes = msg.readString();
if (userModes.find('o') != std::string::npos)
@@ -218,7 +218,7 @@ void ChatHandler::handleListChannelsResponse(MessageIn &msg)
while (msg.getUnreadLength())
{
std::string channelName = msg.readString();
- if (channelName == "")
+ if (channelName.empty())
return;
std::ostringstream numUsers;
numUsers << msg.readInt16();
@@ -286,7 +286,7 @@ void ChatHandler::handleListChannelUsersResponse(MessageIn &msg)
while (msg.getUnreadLength())
{
userNick = msg.readString();
- if (userNick == "")
+ if (userNick.empty())
{
break;
}
@@ -360,7 +360,7 @@ void ChatHandler::handleWhoResponse(MessageIn &msg)
while (msg.getUnreadLength())
{
userNick = msg.readString();
- if (userNick == "")
+ if (userNick.empty())
{
break;
}
diff --git a/src/net/manaserv/generalhandler.cpp b/src/net/manaserv/generalhandler.cpp
index aa62dff1..0692ee82 100644
--- a/src/net/manaserv/generalhandler.cpp
+++ b/src/net/manaserv/generalhandler.cpp
@@ -23,12 +23,8 @@
#include "client.h"
-#include "gui/changeemaildialog.h"
-#include "gui/charselectdialog.h"
#include "gui/inventorywindow.h"
-#include "gui/register.h"
#include "gui/skilldialog.h"
-#include "gui/specialswindow.h"
#include "net/manaserv/adminhandler.h"
#include "net/manaserv/beinghandler.h"
@@ -51,10 +47,6 @@
#include "resources/attributes.h"
-#include "utils/gettext.h"
-
-#include <list>
-
extern Net::GeneralHandler *generalHandler;
extern ManaServ::LoginHandler *loginHandler;
@@ -64,7 +56,7 @@ namespace ManaServ {
Connection *accountServerConnection = nullptr;
Connection *chatServerConnection = nullptr;
Connection *gameServerConnection = nullptr;
-std::string netToken = "";
+std::string netToken;
ServerInfo gameServer;
ServerInfo chatServer;
diff --git a/src/net/manaserv/guildhandler.cpp b/src/net/manaserv/guildhandler.cpp
index be2a5ec8..398e9c62 100644
--- a/src/net/manaserv/guildhandler.cpp
+++ b/src/net/manaserv/guildhandler.cpp
@@ -42,8 +42,6 @@
#include "utils/gettext.h"
#include "utils/stringutils.h"
-#include <iostream>
-
extern Net::GuildHandler *guildHandler;
namespace ManaServ {
@@ -143,7 +141,7 @@ void GuildHandler::handleMessage(MessageIn &msg)
{
name = msg.readString();
online = msg.readInt8();
- if (name != "")
+ if (!name.empty())
{
member = guild->addMember(name);
member->setOnline(online);
diff --git a/src/net/manaserv/guildhandler.h b/src/net/manaserv/guildhandler.h
index b14bb203..8fbb15d1 100644
--- a/src/net/manaserv/guildhandler.h
+++ b/src/net/manaserv/guildhandler.h
@@ -47,7 +47,7 @@ public:
void leave(int guildId) override;
- void kick(GuildMember *member, std::string reason = "") override;
+ void kick(GuildMember *member, std::string reason = std::string()) override;
void chat(int guildId, const std::string &text) override;
diff --git a/src/net/manaserv/loginhandler.cpp b/src/net/manaserv/loginhandler.cpp
index 416e9422..e10c8a9e 100644
--- a/src/net/manaserv/loginhandler.cpp
+++ b/src/net/manaserv/loginhandler.cpp
@@ -414,7 +414,7 @@ void LoginHandler::loginAccountContinue()
msg.writeString(sha256(sha256(sha256(mLoginData->username + mTmpPassword)) + mLoginData->randomSeed));
accountServerConnection->send(msg);
- mTmpPassword = "";
+ mTmpPassword.clear();
}
void LoginHandler::logout()
diff --git a/src/net/manaserv/partyhandler.h b/src/net/manaserv/partyhandler.h
index ed8a1f25..1462ead8 100644
--- a/src/net/manaserv/partyhandler.h
+++ b/src/net/manaserv/partyhandler.h
@@ -39,7 +39,7 @@ public:
void handleMessage(MessageIn &msg) override;
- void create(const std::string &name = "") override;
+ void create(const std::string &name = std::string()) override;
void join(int partyId) override;