summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBjørn Lindeijer <bjorn@lindeijer.nl>2008-04-20 18:56:15 +0000
committerBjørn Lindeijer <bjorn@lindeijer.nl>2008-04-20 18:56:15 +0000
commit300c953376ea93e9ba8e3ba2b97173dcecd11239 (patch)
tree5fc5d3eab59e44efe6944aef97635450f9d20cf3 /src
parentc4dc68d8a2ebf9723b1cd83c5db6196b3eb58396 (diff)
downloadmanaserv-300c953376ea93e9ba8e3ba2b97173dcecd11239.tar.gz
manaserv-300c953376ea93e9ba8e3ba2b97173dcecd11239.tar.bz2
manaserv-300c953376ea93e9ba8e3ba2b97173dcecd11239.tar.xz
manaserv-300c953376ea93e9ba8e3ba2b97173dcecd11239.zip
Fixed some compiler errors/warnings.
Diffstat (limited to 'src')
-rw-r--r--src/account-server/dalstorage.cpp3
-rw-r--r--src/chat-server/guild.cpp8
-rw-r--r--src/chat-server/guild.hpp2
-rw-r--r--src/chat-server/guildmanager.cpp2
-rw-r--r--src/chat-server/guildmanager.hpp2
-rw-r--r--src/chat-server/party.cpp5
-rw-r--r--src/chat-server/party.hpp2
-rw-r--r--src/defines.h2
-rw-r--r--src/game-server/character.cpp5
-rw-r--r--src/game-server/character.hpp6
-rw-r--r--src/game-server/map.cpp1
-rw-r--r--src/net/connectionhandler.cpp8
-rw-r--r--src/scripting/lua.cpp2
13 files changed, 32 insertions, 16 deletions
diff --git a/src/account-server/dalstorage.cpp b/src/account-server/dalstorage.cpp
index c97aa487..02b095dd 100644
--- a/src/account-server/dalstorage.cpp
+++ b/src/account-server/dalstorage.cpp
@@ -177,7 +177,8 @@ Account *DALStorage::getAccountBySQL(std::string const &query)
int level = toUint(accountInfo(0, 4));
// Check if the user is permanently banned, or temporarily banned.
- if (level == AL_BANNED || time(NULL) <= toUint(accountInfo(0, 5)))
+ if (level == AL_BANNED
+ || time(NULL) <= (int) toUint(accountInfo(0, 5)))
{
account->setLevel(AL_BANNED);
// It is, so skip character loading.
diff --git a/src/chat-server/guild.cpp b/src/chat-server/guild.cpp
index 1939d1d4..9da0f9a8 100644
--- a/src/chat-server/guild.cpp
+++ b/src/chat-server/guild.cpp
@@ -17,10 +17,13 @@
* with The Mana World; if not, write to the Free Software Foundation, Inc.,
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id: guild.cpp 3549 2007-08-30 16:20:33Z gmelquio $
+ * $Id$
*/
+
#include "guild.hpp"
+#include <algorithm>
+
Guild::Guild(const std::string &name) :
mName(name)
@@ -59,6 +62,7 @@ void Guild::addInvited(const std::string &playerName)
const std::string& Guild::getMember(int i) const
{
+ const static std::string empty = "";
int x = 0;
for (GuildMembers::const_iterator itr = mMembers.begin();
itr != mMembers.end();
@@ -69,7 +73,7 @@ const std::string& Guild::getMember(int i) const
return (*itr);
}
}
- return NULL;
+ return empty;
}
bool Guild::checkInGuild(const std::string &playerName)
diff --git a/src/chat-server/guild.hpp b/src/chat-server/guild.hpp
index 42033a0e..7b453e9e 100644
--- a/src/chat-server/guild.hpp
+++ b/src/chat-server/guild.hpp
@@ -17,7 +17,7 @@
* with The Mana World; if not, write to the Free Software Foundation, Inc.,
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id: guild.hpp 3549 2007-08-30 16:20:33Z gmelquio $
+ * $Id$
*/
#ifndef _TMWSERV_CHATSERVER_GUILD_H_
diff --git a/src/chat-server/guildmanager.cpp b/src/chat-server/guildmanager.cpp
index 12965f1c..18d888ca 100644
--- a/src/chat-server/guildmanager.cpp
+++ b/src/chat-server/guildmanager.cpp
@@ -17,7 +17,7 @@
* with The Mana World; if not, write to the Free Software Foundation, Inc.,
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id: guildmanager.cpp 3549 2007-08-30 16:20:33Z gmelquio $
+ * $Id$
*/
#include "guildmanager.hpp"
diff --git a/src/chat-server/guildmanager.hpp b/src/chat-server/guildmanager.hpp
index 810b26c8..96f324b0 100644
--- a/src/chat-server/guildmanager.hpp
+++ b/src/chat-server/guildmanager.hpp
@@ -17,7 +17,7 @@
* with The Mana World; if not, write to the Free Software Foundation, Inc.,
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id: guildmanager.hpp 3549 2007-08-30 16:20:33Z gmelquio $
+ * $Id$
*/
#ifndef TMW_CHATSERVER_GUILDMANAGER_H
#define TMW_CHATSERVER_GUILDMANAGER_H
diff --git a/src/chat-server/party.cpp b/src/chat-server/party.cpp
index 650903b6..f9c9b174 100644
--- a/src/chat-server/party.cpp
+++ b/src/chat-server/party.cpp
@@ -18,14 +18,15 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id: $
+ * $Id$
*/
#include "party.hpp"
+#include <algorithm>
+
Party::Party()
{
-
}
void Party::addUser(const std::string &name)
diff --git a/src/chat-server/party.hpp b/src/chat-server/party.hpp
index 31b39840..e865f1ce 100644
--- a/src/chat-server/party.hpp
+++ b/src/chat-server/party.hpp
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id: $
+ * $Id$
*/
#ifndef _TMWSERV_PARTY_H_
diff --git a/src/defines.h b/src/defines.h
index 50a854a6..2ccfa86e 100644
--- a/src/defines.h
+++ b/src/defines.h
@@ -33,7 +33,7 @@ enum
AL_BANNED = 0, /**< This user is currently banned. */
AL_NORMAL = 10, /**< User has regular rights. */
AL_GM = 50, /**< User can perform a subset of administrator tasks. */
- AL_ADMIN = 99, /**< User can perform administrator tasks. */
+ AL_ADMIN = 99 /**< User can perform administrator tasks. */
};
enum
diff --git a/src/game-server/character.cpp b/src/game-server/character.cpp
index d4abd9f4..e21de7c9 100644
--- a/src/game-server/character.cpp
+++ b/src/game-server/character.cpp
@@ -43,6 +43,11 @@
#include "utils/logger.h"
+// These values should maybe be obtained from the config file
+const float Character::EXPCURVE_EXPONENT = 3.0f;
+const float Character::EXPCURVE_FACTOR = 10.0f;
+const float Character::LEVEL_SKILL_PRECEDENCE_FACTOR = 0.75f;
+
Character::Character(MessageIn &msg):
Being(OBJECT_CHARACTER, 65535),
mClient(NULL), mTransactionHandler(NULL), mDatabaseID(-1),
diff --git a/src/game-server/character.hpp b/src/game-server/character.hpp
index 62bec49d..393a18d7 100644
--- a/src/game-server/character.hpp
+++ b/src/game-server/character.hpp
@@ -283,9 +283,9 @@ class Character : public Being
Character(Character const &);
Character &operator=(Character const &);
- static const float EXPCURVE_EXPONENT = 3.0f; // should maybe be obtained
- static const float EXPCURVE_FACTOR = 10.0f; // from the config file
- static const float LEVEL_SKILL_PRECEDENCE_FACTOR = 0.75f; // I am taking suggestions for a better name
+ static const float EXPCURVE_EXPONENT;
+ static const float EXPCURVE_FACTOR;
+ static const float LEVEL_SKILL_PRECEDENCE_FACTOR; // I am taking suggestions for a better name
static const int CHARPOINTS_PER_LEVELUP = 5;
static const int CORRECTIONPOINTS_PER_LEVELUP = 2;
static const int CORRECTIONPOINTS_MAX = 10;
diff --git a/src/game-server/map.cpp b/src/game-server/map.cpp
index ceb48b04..8f6dacc7 100644
--- a/src/game-server/map.cpp
+++ b/src/game-server/map.cpp
@@ -24,6 +24,7 @@
#include <algorithm>
#include <queue>
#include <cassert>
+#include <cstring>
#include "game-server/map.hpp"
diff --git a/src/net/connectionhandler.cpp b/src/net/connectionhandler.cpp
index 3411c91e..9729d208 100644
--- a/src/net/connectionhandler.cpp
+++ b/src/net/connectionhandler.cpp
@@ -93,7 +93,8 @@ void ConnectionHandler::process(enet_uint32 timeout)
case ENET_EVENT_TYPE_RECEIVE:
{
- NetComputer *comp = (NetComputer*) event.peer->data;
+ NetComputer *comp =
+ static_cast<NetComputer*>(event.peer->data);
// If the scripting subsystem didn't hook the message
// it will be handled by the default message handler.
@@ -116,8 +117,11 @@ void ConnectionHandler::process(enet_uint32 timeout)
case ENET_EVENT_TYPE_DISCONNECT:
{
- NetComputer *comp = (NetComputer *)event.peer->data;
+ NetComputer *comp =
+ static_cast<NetComputer*>(event.peer->data);
+
LOG_INFO("" << *comp << " disconnected.");
+
// Reset the peer's client information.
computerDisconnected(comp);
clients.erase(std::find(clients.begin(), clients.end(), comp));
diff --git a/src/scripting/lua.cpp b/src/scripting/lua.cpp
index b96aac47..46463dfc 100644
--- a/src/scripting/lua.cpp
+++ b/src/scripting/lua.cpp
@@ -482,7 +482,7 @@ static int LuaMonster_Create(lua_State *s)
lua_pushlightuserdata(s, q);
return 1;
-};
+}
/**
* Called when the server has recovered the value of a quest variable.