From 1c19fb5173c59b8dd7de10af93347bc9d9279e7e Mon Sep 17 00:00:00 2001 From: Thorbjørn Lindeijer Date: Wed, 17 Apr 2024 09:19:52 +0200 Subject: Simplify TmwAthena::MessageOut Since for tmwAthena we're writing messages directly into the output buffer, the MessageOut implementation does not need any members. Also used SDL_SwapLE16 and SDL_SwapLE32 for convenience. --- src/net/tmwa/messageout.h | 27 +++------------------------ 1 file changed, 3 insertions(+), 24 deletions(-) (limited to 'src/net/tmwa/messageout.h') diff --git a/src/net/tmwa/messageout.h b/src/net/tmwa/messageout.h index 4f1faa9d..b60644de 100644 --- a/src/net/tmwa/messageout.h +++ b/src/net/tmwa/messageout.h @@ -27,8 +27,6 @@ namespace TmwAthena { -class Network; - /** * Used for building an outgoing message to eAthena. * @@ -66,31 +64,12 @@ class MessageOut void writeCoordinates(uint16_t x, uint16_t y, uint8_t direction); - /** - * Returns the content of the message. - */ - char *getData() const { return mData; } - - /** - * Returns the length of the data. - */ - unsigned int getDataSize() const { return mDataSize; } - private: /** - * Expand the packet data to be able to hold more data. - * - * NOTE: For performance enhancements this method could allocate extra - * memory in advance instead of expanding size every time more data is - * added. + * Expand the packet data to be able to hold more data. Returns a + * pointer to the start of the new data. */ - void expand(size_t size); - - Network *mNetwork; - - char *mData; /**< Data building up. */ - unsigned int mDataSize = 0; /**< Size of data. */ - unsigned int mPos = 0; /**< Position in the data. */ + static char *expand(size_t size); }; } // namespace TmwAthena -- cgit v1.2.3-70-g09d2