From 38ddcb52e24f027b0feb766fb5e31c3e5d87d89e Mon Sep 17 00:00:00 2001 From: Thorbjørn Lindeijer Date: Sun, 18 Oct 2009 23:50:32 +0200 Subject: Some random cleanups --- src/account-server/accountclient.hpp | 4 ++-- src/account-server/accounthandler.cpp | 2 +- src/game-server/character.cpp | 2 +- src/game-server/main-game.cpp | 2 +- src/net/connection.hpp | 1 - src/net/connectionhandler.cpp | 2 +- src/net/connectionhandler.hpp | 2 +- src/net/netcomputer.hpp | 1 - 8 files changed, 7 insertions(+), 9 deletions(-) (limited to 'src') diff --git a/src/account-server/accountclient.hpp b/src/account-server/accountclient.hpp index 43f8c629..303627a0 100644 --- a/src/account-server/accountclient.hpp +++ b/src/account-server/accountclient.hpp @@ -29,7 +29,7 @@ class AccountHandler; -enum +enum AccountClientStatus { CLIENT_LOGIN = 0, CLIENT_CONNECTED, @@ -68,7 +68,7 @@ class AccountClient : public NetComputer Account *getAccount() const { return mAccount; } - int status; + AccountClientStatus status; private: /** Account associated with connection */ diff --git a/src/account-server/accounthandler.cpp b/src/account-server/accounthandler.cpp index b7124181..39539941 100644 --- a/src/account-server/accounthandler.cpp +++ b/src/account-server/accounthandler.cpp @@ -216,7 +216,7 @@ void AccountHandler::handleLoginMessage(AccountClient &client, MessageIn &msg) const unsigned maxClients = (unsigned) Configuration::getValue("net_maxClients", 1000); - if (getClientNumber() >= maxClients) + if (getClientCount() >= maxClients) { reply.writeByte(ERRMSG_SERVER_FULL); client.send(reply); diff --git a/src/game-server/character.cpp b/src/game-server/character.cpp index 89249022..94bd7465 100644 --- a/src/game-server/character.cpp +++ b/src/game-server/character.cpp @@ -504,7 +504,7 @@ void Character::recalculateLevel() std::map::const_iterator a; for (a = getSkillBegin(); a != getSkillEnd(); a++) { - // Only use the first 1000 skill levels in calulation + // Only use the first 1000 skill levels in calculation if (a->first < 1000) { float expGot = getExpGot(a->first); diff --git a/src/game-server/main-game.cpp b/src/game-server/main-game.cpp index 076fd05e..5933671f 100644 --- a/src/game-server/main-game.cpp +++ b/src/game-server/main-game.cpp @@ -182,7 +182,7 @@ void initialize() // Set enet to quit on exit. atexit(enet_deinitialize); - // Pre-calulate the needed trigomic function values + // Pre-calculate the needed trigomic function values utils::math::init(); // Initialize the processor utility functions diff --git a/src/net/connection.hpp b/src/net/connection.hpp index 2beeb04a..c7eb9737 100644 --- a/src/net/connection.hpp +++ b/src/net/connection.hpp @@ -27,7 +27,6 @@ class MessageIn; class MessageOut; -class BandwidthMonitor; /** * A point-to-point connection to a remote host. The remote host can use a diff --git a/src/net/connectionhandler.cpp b/src/net/connectionhandler.cpp index 1f98b046..ef37f3d8 100644 --- a/src/net/connectionhandler.cpp +++ b/src/net/connectionhandler.cpp @@ -147,7 +147,7 @@ void ConnectionHandler::sendToEveryone(const MessageOut &msg) } } -unsigned int ConnectionHandler::getClientNumber() +unsigned int ConnectionHandler::getClientCount() const { return clients.size(); } diff --git a/src/net/connectionhandler.hpp b/src/net/connectionhandler.hpp index 8c8ecf40..0b8d3002 100644 --- a/src/net/connectionhandler.hpp +++ b/src/net/connectionhandler.hpp @@ -80,7 +80,7 @@ class ConnectionHandler /** * Return the number of connected clients. */ - unsigned int getClientNumber(); + unsigned int getClientCount() const; private: ENetAddress address; /**< Includes the port to listen to. */ diff --git a/src/net/netcomputer.hpp b/src/net/netcomputer.hpp index 10ffe5ae..1724d293 100644 --- a/src/net/netcomputer.hpp +++ b/src/net/netcomputer.hpp @@ -26,7 +26,6 @@ #include class MessageOut; -class BandwidthMonitor; /** * This class represents a known computer on the network. For example a -- cgit v1.2.3-70-g09d2