diff options
-rw-r--r-- | ChangeLog | 73 | ||||
-rw-r--r-- | src/account-server/dalstorage.cpp | 3 | ||||
-rw-r--r-- | src/chat-server/guild.cpp | 8 | ||||
-rw-r--r-- | src/chat-server/guild.hpp | 2 | ||||
-rw-r--r-- | src/chat-server/guildmanager.cpp | 2 | ||||
-rw-r--r-- | src/chat-server/guildmanager.hpp | 2 | ||||
-rw-r--r-- | src/chat-server/party.cpp | 5 | ||||
-rw-r--r-- | src/chat-server/party.hpp | 2 | ||||
-rw-r--r-- | src/defines.h | 2 | ||||
-rw-r--r-- | src/game-server/character.cpp | 5 | ||||
-rw-r--r-- | src/game-server/character.hpp | 6 | ||||
-rw-r--r-- | src/game-server/map.cpp | 1 | ||||
-rw-r--r-- | src/net/connectionhandler.cpp | 8 | ||||
-rw-r--r-- | src/scripting/lua.cpp | 2 |
14 files changed, 76 insertions, 45 deletions
@@ -1,4 +1,13 @@ +2008-04-20 Bjørn Lindeijer <bjorn@lindeijer.nl> + + * src/account-server/dalstorage.cpp, src/scripting/lua.cpp, + src/chat-server/party.cpp, src/chat-server/guild.cpp, src/defines.h, + src/net/connectionhandler.cpp, src/game-server/map.cpp, + src/game-server/character.cpp, src/game-server/character.hpp: Fixed + some compiler errors/warnings. + 2008-04-20 Dennis Friis <peavey@placid.dk> + * src/utils/zlib.cpp: Fix a possible memleak in inflateMemory if the stream fails to uncompress cleanly. @@ -729,9 +738,10 @@ 2007-07-28 Guillaume Melquiond <guillaume.melquiond@gmail.com> * src/account-server/storage.hpp, src/account-server/dalstorage.cpp, - src/account-server/dalstorage.hpp: Stored channel IDs as unsigned data. + src/account-server/dalstorage.hpp: Stored channel IDs as unsigned + data. * src/src/account-server/dalstoragesql.hpp, - src/chat-server/chatchannel.hpp: Assumed channels withpassword are + src/chat-server/chatchannel.hpp: Assumed channels with password are private. * src/chat-server/chatclient.hpp, src/chat-server/chatchannel.cpp: Added to client the channels it is connected to. @@ -747,9 +757,10 @@ object, and used generic integer in signatures. * src/defines.h, src/game-server/state.cpp: Added being speed to protocol. - * src/game-server/spawnarea.cpp, src/game-server/accountconnection.cpp: - Halved speed of maggots. Reduced speed of characters, so that they do - not travel much more than one tile per data round-trip. + * src/game-server/spawnarea.cpp, + src/game-server/accountconnection.cpp: Halved speed of maggots. + Reduced speed of characters, so that they donot travel much more than + one tile per data round-trip. 2007-07-25 Bjørn Lindeijer <bjorn@lindeijer.nl> @@ -761,6 +772,7 @@ src/account-server/serverhandler.cpp, src/account-server/dalstorage.cpp: Removed a host of unnecessary methods from ChatChannelManager. + * AUTHORS: Added David Athay. 2007-07-23 Guillaume Melquiond <guillaume.melquiond@gmail.com> @@ -768,7 +780,8 @@ monster identifiers. * src/resourcemanager.cpp: Enabled symlinks to data directory. * src/game-server/accountconnection.cpp, - src/game-server/gamehandler.hpp, src/game-server/accountconnection.hpp, + src/game-server/gamehandler.hpp, + src/game-server/accountconnection.hpp, src/account-server/serverhandler.cpp: Commented out unused guild code. It should not have been handled by the game server anyway. * src/game-server/mapcomposite.hpp: Removed slow member, if it were to @@ -832,8 +845,8 @@ 2007-07-08 Guillaume Melquiond <guillaume.melquiond@gmail.com> * src/game-server/being.cpp: Lowered messages to debug level. - * src/game-server/deathlistener.hpp: Made members non-abstract, so that - inheritors do not have to define them when they do not use them. + * src/game-server/deathlistener.hpp: Made members non-abstract, so + that inheritors do not have to define them when they do not use them. * data/monsters.xml: Added sample monster database. * src/game-server/monstermanager.cpp, src/game-server/main-game.cpp, src/game-server/monstermanager.hpp: Added manager for monster species. @@ -864,9 +877,10 @@ src/game-server/itemmanager.cpp, src/game-server/itemmanager.hpp, src/game-server/mapmanager.cpp, src/game-server/mapmanager.hpp, src/game-server/state.cpp, src/game-server/state.hpp, - src/game-server/accountconnection.cpp, src/game-server/gamehandler.cpp: - Changed singleton managers from classes to namespace interfaces. - Removed global pointers. Moved private members to implementation files. + src/game-server/accountconnection.cpp, + src/game-server/gamehandler.cpp: Changed singleton managers from + classes to namespace interfaces. Removed global pointers. Moved + private members to implementation files. * src/game-server/state.cpp, src/game-server/being.cpp, src/game-server/movingobject.cpp, src/game-server/movingobject.hpp: Fixed teleportation hack caused by caching of pathfinder results. @@ -879,12 +893,12 @@ 2007-07-02 Guillaume Melquiond <guillaume.melquiond@gmail.com> - * src/account-server/storage.cpp, src/account-server/storage.hpp: Moved - trivial accessors to header file. Removed C-like prototypes and harmful - exception specifications. - * src/account-server/dalstorage.cpp, src/account-server/dalstorage.hpp: - Factored duplicate query code. Removed C-like prototypes and harmful - exception specifications. + * src/account-server/storage.cpp, src/account-server/storage.hpp: + Moved trivial accessors to header file. Removed C-like prototypes and + harmful exception specifications. + * src/account-server/dalstorage.cpp, + src/account-server/dalstorage.hpp: Factored duplicate query code. + Removed C-like prototypes and harmful exception specifications. * src/account-server/dalstorage.cpp: Added support for loading inventory from database. Fixed mysqlism for multi-insertion. @@ -899,8 +913,8 @@ src/game-server/accountconnection.cpp: Removed multiple inheritance mechanism for serialization. Replaced it by a less cumbersome template interface. - * src/common/inventorydata.hpp: Set inventory structures in a directory - common to both servers. + * src/common/inventorydata.hpp: Set inventory structures in a + directory common to both servers. * src/account-server/dalstorage.cpp: Commented out unused code. * src/Makefile.am: Taken new files into account. * src/account-server/characterdata.cpp, src/game-server/character.cpp, @@ -910,13 +924,14 @@ fine. * src/game-server/state.cpp: Added assertions to detect insertion and removal of objects at updating time. - * src/game-server/accountconnection.cpp, src/game-server/character.cpp, - src/defines.h, src/account-server/characterdata.hpp, + * src/game-server/accountconnection.cpp, + src/game-server/character.cpp, src/defines.h, + src/account-server/characterdata.hpp, src/account-server/characterdata.cpp, src/serialize/characterdata.hpp: Removed automatic (de)serialization of ID, so that it can be properly used, and of name, so that it does not waste bandwidth. - * src/account-server/serverhandler.cpp: Reverted to the scheme based on - character ID, so that runtime character data are persistent again. + * src/account-server/serverhandler.cpp: Reverted to the scheme based + on character ID, so that runtime character data are persistent again. * src/account-server/dalstoragesql.hpp, src/account-server/dalstorage.cpp: Added support for storing inventory in database. @@ -936,16 +951,16 @@ loss of hit points. * src/game-server/character.cpp: Characters hit circle size is now initialized properly. - * src/game-server/map.cpp, src/game-server/map.hpp, + * src/game-server/map.cpp, src/game-server/map.hpp, src/game-server/mapcomposite.cpp, src/game-server/mapcomposite.hpp, - src/game-server/mapreader.cpp, src/state.cpp: Pathfinding now takes - the tiles that are occupied by beings into account. Map::find_path() + src/game-server/mapreader.cpp, src/state.cpp: Pathfinding now takes + the tiles that are occupied by beings into account. Map::find_path() now has an optional argument that sets the maximum path cost. - * src/game-server/monster.cpp, src/game-server/monster.hpp, - src/game-server/spawnarea.cpp, src/game-server/thing.hpp: Implemented + * src/game-server/monster.cpp, src/game-server/monster.hpp, + src/game-server/spawnarea.cpp, src/game-server/thing.hpp: Implemented monster attacking and provisoric monster AI. Monster now chase and attack players that hurt them. - * src/game-server/spawnarea.cpp: Monsters are no longer spawned on + * src/game-server/spawnarea.cpp: Monsters are no longer spawned on unwalkable tiles. 2007-06-28 Guillaume Melquiond <guillaume.melquiond@gmail.com> 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. |