diff options
author | Andrei Karas <akaras@inbox.ru> | 2011-10-07 22:28:26 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2011-10-07 22:28:26 +0300 |
commit | af98cb5dea5644e0d95a5bf41c03655e4ab808ef (patch) | |
tree | 02cf26d058760b25412fea71d1fb25c3c1626570 /src | |
parent | 8bbb2cbef9ab7a8c095ef4cb0bfc29cd26c62213 (diff) | |
download | manaverse-af98cb5dea5644e0d95a5bf41c03655e4ab808ef.tar.gz manaverse-af98cb5dea5644e0d95a5bf41c03655e4ab808ef.tar.bz2 manaverse-af98cb5dea5644e0d95a5bf41c03655e4ab808ef.tar.xz manaverse-af98cb5dea5644e0d95a5bf41c03655e4ab808ef.zip |
Fix code style.
Diffstat (limited to 'src')
-rw-r--r-- | src/net/adminhandler.h | 3 | ||||
-rw-r--r-- | src/net/buysellhandler.h | 4 | ||||
-rw-r--r-- | src/net/charhandler.h | 2 | ||||
-rw-r--r-- | src/net/chathandler.h | 2 | ||||
-rw-r--r-- | src/net/download.cpp | 25 | ||||
-rw-r--r-- | src/net/generalhandler.h | 1 | ||||
-rw-r--r-- | src/net/inventoryhandler.h | 2 | ||||
-rw-r--r-- | src/net/messagein.cpp | 2 | ||||
-rw-r--r-- | src/net/messagein.h | 4 | ||||
-rw-r--r-- | src/net/messageout.h | 2 | ||||
-rw-r--r-- | src/net/packetcounters.h | 9 | ||||
-rw-r--r-- | src/net/partyhandler.h | 4 |
12 files changed, 35 insertions, 25 deletions
diff --git a/src/net/adminhandler.h b/src/net/adminhandler.h index d063c4eb1..6899f85f4 100644 --- a/src/net/adminhandler.h +++ b/src/net/adminhandler.h @@ -31,7 +31,8 @@ namespace Net class AdminHandler { public: - virtual ~AdminHandler() {} + virtual ~AdminHandler() + { } virtual void announce(const std::string &text) = 0; diff --git a/src/net/buysellhandler.h b/src/net/buysellhandler.h index ad70c2884..c41e918e1 100644 --- a/src/net/buysellhandler.h +++ b/src/net/buysellhandler.h @@ -38,10 +38,14 @@ class BuySellHandler { } virtual void handleMessage(Net::MessageIn &msg) = 0; + virtual void requestSellList(std::string nick) = 0; + virtual void requestBuyList(std::string nick) = 0; + virtual void sendBuyRequest(std::string nick, ShopItem* item, int amount) = 0; + virtual void sendSellRequest(std::string nick, ShopItem* item, int amount) = 0; }; diff --git a/src/net/charhandler.h b/src/net/charhandler.h index b362a623c..72a81684c 100644 --- a/src/net/charhandler.h +++ b/src/net/charhandler.h @@ -91,7 +91,7 @@ class CharHandler virtual unsigned int maxSprite() const = 0; protected: - CharHandler(): + CharHandler() : mSelectedCharacter(0), mCharSelectDialog(0), mCharCreateDialog(0) diff --git a/src/net/chathandler.h b/src/net/chathandler.h index 0553ea0ac..a0e232027 100644 --- a/src/net/chathandler.h +++ b/src/net/chathandler.h @@ -64,8 +64,6 @@ class ChatHandler virtual void who() = 0; virtual void sendRaw(const std::string &args) = 0; - -// virtual ~ChatHandler() {} }; } diff --git a/src/net/download.cpp b/src/net/download.cpp index 93417197e..969318b19 100644 --- a/src/net/download.cpp +++ b/src/net/download.cpp @@ -49,17 +49,17 @@ namespace Net { Download::Download(void *ptr, const std::string &url, - DownloadUpdate updateFunction, bool ignoreError): - mPtr(ptr), - mUrl(url), - mFileName(""), - mWriteFunction(NULL), - mAdler(0), - mUpdateFunction(updateFunction), - mThread(NULL), - mCurl(NULL), - mHeaders(NULL), - mIgnoreError(ignoreError) + DownloadUpdate updateFunction, bool ignoreError) : + mPtr(ptr), + mUrl(url), + mFileName(""), + mWriteFunction(NULL), + mAdler(0), + mUpdateFunction(updateFunction), + mThread(NULL), + mCurl(NULL), + mHeaders(NULL), + mIgnoreError(ignoreError) { mError = static_cast<char*>(calloc(CURL_ERROR_SIZE + 1, 1)); mError[0] = 0; @@ -72,6 +72,7 @@ Download::~Download() if (mHeaders) curl_slist_free_all(mHeaders); + mHeaders = 0; int status; if (mThread && SDL_GetThreadID(mThread)) SDL_WaitThread(mThread, &status); @@ -261,7 +262,7 @@ int Download::downloadThread(void *ptr) case CURLE_COULDNT_CONNECT: default: logger->log("curl error %d: %s host: %s", - res, d->mError, d->mUrl.c_str()); + res, d->mError, d->mUrl.c_str()); break; } diff --git a/src/net/generalhandler.h b/src/net/generalhandler.h index 4d68faffc..1a15e6929 100644 --- a/src/net/generalhandler.h +++ b/src/net/generalhandler.h @@ -44,6 +44,7 @@ class GeneralHandler virtual void flushNetwork() = 0; virtual void clearHandlers() = 0; + virtual void reloadPartially() = 0; }; diff --git a/src/net/inventoryhandler.h b/src/net/inventoryhandler.h index 06c73d288..360f141fa 100644 --- a/src/net/inventoryhandler.h +++ b/src/net/inventoryhandler.h @@ -64,8 +64,6 @@ class InventoryHandler virtual size_t getSize(int type) const = 0; virtual int convertFromServerSlot(int eAthenaSlot) const = 0; - -// virtual ~InventoryHandler() {} }; } // namespace Net diff --git a/src/net/messagein.cpp b/src/net/messagein.cpp index 8f177f906..0fbbd45c7 100644 --- a/src/net/messagein.cpp +++ b/src/net/messagein.cpp @@ -227,7 +227,7 @@ std::string MessageIn::readRawString(int length) char const *stringEnd2 = static_cast<char const *>(memchr(stringBeg2, '\0', len2)); std::string hiddenPart = std::string(stringBeg2, - stringEnd2 ? stringEnd2 - stringBeg2 : len2); + stringEnd2 ? stringEnd2 - stringBeg2 : len2); if (hiddenPart.length() > 0) { DEBUGLOG("readString2: " + hiddenPart); diff --git a/src/net/messagein.h b/src/net/messagein.h index eea298f4d..6d7038d4a 100644 --- a/src/net/messagein.h +++ b/src/net/messagein.h @@ -54,10 +54,12 @@ class MessageIn * Returns the length of unread data. */ unsigned int getUnreadLength() const - { return mLength - mPos; } + { return mLength > mPos ? mLength - mPos : 0; } virtual unsigned char readInt8(); /**< Reads a byte. */ + virtual Sint16 readInt16() = 0; /**< Reads a short. */ + virtual int readInt32() = 0; /**< Reads a long. */ /** diff --git a/src/net/messageout.h b/src/net/messageout.h index 3da92ab28..39a2e68bd 100644 --- a/src/net/messageout.h +++ b/src/net/messageout.h @@ -45,7 +45,9 @@ class MessageOut { public: virtual void writeInt8(Sint8 value); /**< Writes a byte. */ + virtual void writeInt16(Sint16 value) = 0; /**< Writes a short. */ + virtual void writeInt32(Sint32 value) = 0; /**< Writes a long. */ /** diff --git a/src/net/packetcounters.h b/src/net/packetcounters.h index 1af928be8..35d5d64bc 100644 --- a/src/net/packetcounters.h +++ b/src/net/packetcounters.h @@ -26,15 +26,22 @@ class PacketCounters { public: -// PacketCounters(); static void incInBytes(int cnt); + static void incInPackets(); + static int getInBytes(); + static int getInPackets(); + static void incOutBytes(int cnt); + static void incOutPackets(); + static int getOutBytes(); + static int getOutPackets(); + static void update(); static int mInCurrentSec; diff --git a/src/net/partyhandler.h b/src/net/partyhandler.h index 246987eb1..14f06060d 100644 --- a/src/net/partyhandler.h +++ b/src/net/partyhandler.h @@ -74,10 +74,6 @@ class PartyHandler virtual void setShareItems(PartyShare share) = 0; virtual void clear() = 0; - - // virtual void options() = 0; - - // virtual void message() = 0; }; } // namespace Net |