#include <messageout.hpp>
Public Member Functions | |
| MessageOut () | |
| Constructor. | |
| MessageOut (int id) | |
| Constructor that takes a message ID. | |
| ~MessageOut () | |
| Destructor. | |
| void | clear () |
| Clears current message. | |
| void | writeByte (int value) |
| Writes an integer on one byte. | |
| void | writeShort (int value) |
| Writes an integer on two bytes. | |
| void | writeLong (int value) |
| Writes an integer on four bytes. | |
| void | writeCoordinates (int x, int y) |
| Writes a 3-byte block containing tile-based coordinates. | |
| void | writeString (const std::string &string, int length=-1) |
| Writes a string. | |
| char * | getData () const |
| Returns the content of the message. | |
| unsigned int | getLength () const |
| Returns the length of the data. | |
Friends | |
| std::ostream & | operator<< (std::ostream &os, const MessageOut &msg) |
| Streams message ID and length to the given output stream. | |
Definition at line 30 of file messageout.hpp.
| void MessageOut::writeByte | ( | int | value | ) |
Writes an integer on one byte.
Definition at line 79 of file messageout.cpp.
Referenced by Inventory::changeMoney(), GameHandler::deletePendingClient(), ChatHandler::deletePendingClient(), Inventory::equip(), Inventory::insert(), Inventory::move(), GameHandler::processMessage(), ServerHandler::processMessage(), Inventory::remove(), Inventory::removeFromSlot(), Inventory::sendFull(), ChatHandler::sendGuildListUpdate(), Character::sendStatus(), AccountConnection::syncChanges(), GameHandler::tokenMatched(), ChatHandler::tokenMatched(), AccountConnection::updateCharacterPoints(), AccountConnection::updateExperience(), AccountConnection::updateOnlineStatus(), and ChatHandler::warnUsersAboutPlayerEventInChat().
| void MessageOut::writeShort | ( | int | value | ) |
Writes an integer on two bytes.
Definition at line 86 of file messageout.cpp.
Referenced by AccountConnection::banCharacter(), AccountConnection::changeAccountLevel(), GameHandler::completeServerChange(), Inventory::equip(), Inventory::insert(), MessageOut(), Inventory::move(), GameHandler::processMessage(), ChatHandler::processMessage(), ServerHandler::processMessage(), Inventory::remove(), Inventory::removeFromSlot(), GameHandler::sendError(), Inventory::sendFull(), ChatHandler::sendGuildListUpdate(), ChatHandler::sendGuildRejoin(), AccountConnection::sendStatistics(), Character::sendStatus(), AccountConnection::start(), ChatHandler::warnUsersAboutPlayerEventInChat(), and writeString().
| void MessageOut::writeLong | ( | int | value | ) |
Writes an integer on four bytes.
Definition at line 94 of file messageout.cpp.
Referenced by AccountConnection::banCharacter(), AccountConnection::changeAccountLevel(), Inventory::changeMoney(), AccountConnection::getPost(), AccountConnection::playerReconnectAccount(), ServerHandler::processMessage(), AccountConnection::requestQuestVar(), AccountConnection::sendCharacterData(), Inventory::sendFull(), AccountConnection::sendPost(), AccountConnection::sendStatistics(), Character::sendStatus(), AccountConnection::sendTransaction(), AccountConnection::start(), AccountConnection::updateCharacterPoints(), AccountConnection::updateExperience(), AccountConnection::updateOnlineStatus(), and AccountConnection::updateQuestVar().
| void MessageOut::writeString | ( | const std::string & | string, | |
| int | length = -1 | |||
| ) |
Writes a string.
If a fixed length is not given (-1), it is stored as a short at the start of the string.
Definition at line 113 of file messageout.cpp.
References writeShort().
Referenced by GameHandler::completeServerChange(), AccountConnection::playerReconnectAccount(), GameHandler::processMessage(), ServerHandler::processMessage(), AccountConnection::requestQuestVar(), GameHandler::sendError(), ChatHandler::sendGuildInvite(), ChatHandler::sendGuildListUpdate(), ChatHandler::sendGuildRejoin(), AccountConnection::sendPost(), AccountConnection::sendTransaction(), AccountConnection::start(), AccountConnection::updateQuestVar(), and ChatHandler::warnUsersAboutPlayerEventInChat().
1.5.5