diff options
author | Andrei Karas <akaras@inbox.ru> | 2010-01-10 17:19:24 +0200 |
---|---|---|
committer | Thorbjørn Lindeijer <thorbjorn@lindeijer.nl> | 2010-01-10 17:20:33 +0100 |
commit | f5a394a5051384a930d635da22ccafc6beb1cb84 (patch) | |
tree | d28fc14408a6bb91170e05880b4d2af6a17fcc14 /src/net | |
parent | 5757066312cab082378dbc5d8df97dea3fe40af0 (diff) | |
download | mana-f5a394a5051384a930d635da22ccafc6beb1cb84.tar.gz mana-f5a394a5051384a930d635da22ccafc6beb1cb84.tar.bz2 mana-f5a394a5051384a930d635da22ccafc6beb1cb84.tar.xz mana-f5a394a5051384a930d635da22ccafc6beb1cb84.zip |
Change code style
Diffstat (limited to 'src/net')
-rw-r--r-- | src/net/ea/beinghandler.cpp | 25 | ||||
-rw-r--r-- | src/net/ea/charserverhandler.cpp | 6 | ||||
-rw-r--r-- | src/net/ea/generalhandler.cpp | 3 | ||||
-rw-r--r-- | src/net/ea/inventoryhandler.cpp | 29 | ||||
-rw-r--r-- | src/net/ea/loginhandler.cpp | 6 | ||||
-rw-r--r-- | src/net/ea/network.cpp | 3 | ||||
-rw-r--r-- | src/net/ea/partyhandler.cpp | 6 | ||||
-rw-r--r-- | src/net/ea/playerhandler.cpp | 9 | ||||
-rw-r--r-- | src/net/ea/tradehandler.cpp | 5 | ||||
-rw-r--r-- | src/net/manaserv/chathandler.cpp | 17 | ||||
-rw-r--r-- | src/net/manaserv/effecthandler.cpp | 24 | ||||
-rw-r--r-- | src/net/manaserv/gamehandler.cpp | 3 | ||||
-rw-r--r-- | src/net/manaserv/guildhandler.cpp | 12 | ||||
-rw-r--r-- | src/net/manaserv/loginhandler.cpp | 21 | ||||
-rw-r--r-- | src/net/manaserv/network.cpp | 9 | ||||
-rw-r--r-- | src/net/manaserv/playerhandler.cpp | 6 | ||||
-rw-r--r-- | src/net/manaserv/tradehandler.cpp | 5 | ||||
-rw-r--r-- | src/net/messagein.cpp | 3 | ||||
-rw-r--r-- | src/net/net.cpp | 3 |
19 files changed, 113 insertions, 82 deletions
diff --git a/src/net/ea/beinghandler.cpp b/src/net/ea/beinghandler.cpp index cba1c984..6c943454 100644 --- a/src/net/ea/beinghandler.cpp +++ b/src/net/ea/beinghandler.cpp @@ -245,7 +245,8 @@ void BeingHandler::handleMessage(Net::MessageIn &msg) * we'll just pretend the packet didn't happen */ - if (dstBeing) { + if (dstBeing) + { dstBeing->setAction(Being::STAND); dstBeing->setTileCoords(srcX, srcY); dstBeing->setDestination(dstX, dstY); @@ -406,14 +407,18 @@ void BeingHandler::handleMessage(Net::MessageIn &msg) int id = 0; int id2 = 0; - if (msg.getId() == SMSG_BEING_CHANGE_LOOKS) { + if (msg.getId() == SMSG_BEING_CHANGE_LOOKS) + { id = msg.readInt8(); - } else { // SMSG_BEING_CHANGE_LOOKS2 + } + else + { // SMSG_BEING_CHANGE_LOOKS2 id = msg.readInt16(); id2 = msg.readInt16(); } - switch (type) { + switch (type) + { case 1: // eAthena LOOK_HAIR player->setSpriteID(Player::HAIR_SPRITE, id *-1); break; @@ -606,14 +611,17 @@ void BeingHandler::handleMessage(Net::MessageIn &msg) */ id = msg.readInt32(); - if (mSync || id != player_node->getId()) { + if (mSync || id != player_node->getId()) + { dstBeing = beingManager->findBeing(id); - if (dstBeing) { + if (dstBeing) + { Uint16 x, y; x = msg.readInt16(); y = msg.readInt16(); dstBeing->setTileCoords(x, y); - if (dstBeing->mAction == Being::WALK) { + if (dstBeing->mAction == Being::WALK) + { dstBeing->mFrame = 0; dstBeing->setAction(Being::STAND); } @@ -639,7 +647,8 @@ void BeingHandler::handleMessage(Net::MessageIn &msg) statusEffects |= ((Uint32) msg.readInt16()) << 16; msg.readInt8(); - if (dstBeing) { + if (dstBeing) + { dstBeing->setStunMode(stunMode); dstBeing->setStatusEffectBlock(0, (statusEffects >> 16) & 0xffff); dstBeing->setStatusEffectBlock(16, statusEffects & 0xffff); diff --git a/src/net/ea/charserverhandler.cpp b/src/net/ea/charserverhandler.cpp index 8dacb06f..cda839bb 100644 --- a/src/net/ea/charserverhandler.cpp +++ b/src/net/ea/charserverhandler.cpp @@ -96,7 +96,8 @@ void CharServerHandler::handleMessage(Net::MessageIn &msg) break; case SMSG_CHAR_LOGIN_ERROR: - switch (msg.readInt8()) { + switch (msg.readInt8()) + { case 0: errorMessage = _("Access denied."); break; @@ -216,9 +217,8 @@ LocalPlayer *CharServerHandler::readPlayerData(Net::MessageIn &msg, int &slot) tempPlayer->setSprite(Player::HAIR_SPRITE, hairStyle * -1, ColorDB::get(msg.readInt16())); tempPlayer->setSprite(Player::MISC2_SPRITE, msg.readInt16()); tempPlayer->setName(msg.readString(24)); - for (int i = 0; i < 6; i++) { + for (int i = 0; i < 6; i++) tempPlayer->setAttributeBase(i + STR, msg.readInt8()); - } slot = msg.readInt8(); // character slot msg.readInt8(); // unknown diff --git a/src/net/ea/generalhandler.cpp b/src/net/ea/generalhandler.cpp index 44542ddc..5c7c5036 100644 --- a/src/net/ea/generalhandler.cpp +++ b/src/net/ea/generalhandler.cpp @@ -118,7 +118,8 @@ void GeneralHandler::handleMessage(Net::MessageIn &msg) code = msg.readInt8(); logger->log("Connection problem: %i", code); - switch (code) { + switch (code) + { case 0: errorMessage = _("Authentication failed."); break; diff --git a/src/net/ea/inventoryhandler.cpp b/src/net/ea/inventoryhandler.cpp index c616464a..c7080c2d 100644 --- a/src/net/ea/inventoryhandler.cpp +++ b/src/net/ea/inventoryhandler.cpp @@ -155,17 +155,21 @@ void InventoryHandler::handleMessage(Net::MessageIn &msg) cards[0], cards[1], cards[2], cards[3]); } - if (msg.getId() == SMSG_PLAYER_INVENTORY) { + if (msg.getId() == SMSG_PLAYER_INVENTORY) + { inventory->setItem(index, itemId, amount, false); // Trick because arrows are not considered equipment - if (arrow & 0x8000) { + if (arrow & 0x8000) + { if (Item *item = inventory->getItem(index)) item->setEquipment(true); } //const Item *item = inventory->getItem(index); - } else { + } + else + { storage->setItem(index, itemId, amount, false); } } @@ -175,7 +179,8 @@ void InventoryHandler::handleMessage(Net::MessageIn &msg) msg.readInt16(); // length number = (msg.getLength() - 4) / 20; - for (int loop = 0; loop < number; loop++) { + for (int loop = 0; loop < number; loop++) + { index = msg.readInt16() - STORAGE_OFFSET; itemId = msg.readInt16(); itemType = msg.readInt8(); @@ -258,9 +263,12 @@ void InventoryHandler::handleMessage(Net::MessageIn &msg) index = msg.readInt16() - INVENTORY_OFFSET; amount = msg.readInt16(); - if (msg.readInt8() == 0) { + if (msg.readInt8() == 0) + { localChatTab->chatLog(_("Failed to use item."), BY_SERVER); - } else { + } + else + { if (Item *item = inventory->getItem(index)) item->setQuantity(amount); } @@ -354,13 +362,9 @@ void InventoryHandler::handleMessage(Net::MessageIn &msg) flag = msg.readInt8(); if (!flag) - { localChatTab->chatLog(_("Unable to equip."), BY_SERVER); - } else - { mEquips.setEquipment(getSlot(equipType), index); - } break; case SMSG_PLAYER_UNEQUIP: @@ -368,13 +372,10 @@ void InventoryHandler::handleMessage(Net::MessageIn &msg) equipType = msg.readInt16(); flag = msg.readInt8(); - if (!flag) { + if (!flag) localChatTab->chatLog(_("Unable to unequip."), BY_SERVER); - } else - { mEquips.setEquipment(getSlot(equipType), -1); - } break; case SMSG_PLAYER_ATTACK_RANGE: diff --git a/src/net/ea/loginhandler.cpp b/src/net/ea/loginhandler.cpp index e27eccf8..07caa325 100644 --- a/src/net/ea/loginhandler.cpp +++ b/src/net/ea/loginhandler.cpp @@ -73,7 +73,8 @@ void LoginHandler::handleMessage(Net::MessageIn &msg) // pass change failed else { - switch (errMsg) { + switch (errMsg) + { case 0: errorMessage = _("Account was not found. Please re-login."); break; @@ -142,7 +143,8 @@ void LoginHandler::handleMessage(Net::MessageIn &msg) code = msg.readInt8(); logger->log("Login::error code: %i", code); - switch (code) { + switch (code) + { case 0: errorMessage = _("Unregistered ID."); break; diff --git a/src/net/ea/network.cpp b/src/net/ea/network.cpp index c12e1bb9..a93d6cfd 100644 --- a/src/net/ea/network.cpp +++ b/src/net/ea/network.cpp @@ -411,7 +411,8 @@ void Network::receive() setError(_("Connection to server terminated. ") + std::string(SDLNet_GetError())); } - else { + else + { mInSize += ret; if (mToSkip) { diff --git a/src/net/ea/partyhandler.cpp b/src/net/ea/partyhandler.cpp index de17855f..af842c11 100644 --- a/src/net/ea/partyhandler.cpp +++ b/src/net/ea/partyhandler.cpp @@ -162,7 +162,8 @@ void PartyHandler::handleMessage(Net::MessageIn &msg) short exp = msg.readInt16(); short item = msg.readInt16(); - switch (exp) { + switch (exp) + { case PARTY_SHARE: if (mShareExp == PARTY_SHARE) break; @@ -185,7 +186,8 @@ void PartyHandler::handleMessage(Net::MessageIn &msg) logger->log("Unknown party exp option: %d\n", exp); } - switch (item) { + switch (item) + { case PARTY_SHARE: if (mShareItems == PARTY_SHARE) break; diff --git a/src/net/ea/playerhandler.cpp b/src/net/ea/playerhandler.cpp index 0592bb55..14907300 100644 --- a/src/net/ea/playerhandler.cpp +++ b/src/net/ea/playerhandler.cpp @@ -309,7 +309,8 @@ void PlayerHandler::handleMessage(Net::MessageIn &msg) break; case SMSG_PLAYER_STAT_UPDATE_2: - switch (msg.readInt16()) { + switch (msg.readInt16()) + { case 0x0001: player_node->setExp(msg.readInt32()); break; @@ -490,7 +491,8 @@ void PlayerHandler::handleMessage(Net::MessageIn &msg) break; case SMSG_PLAYER_STAT_UPDATE_6: - switch (msg.readInt16()) { + switch (msg.readInt16()) + { case 0x0020: statusWindow->setPointsNeeded(STR, msg.readInt8()); break; @@ -516,7 +518,8 @@ void PlayerHandler::handleMessage(Net::MessageIn &msg) { int type = msg.readInt16(); - switch (type) { + switch (type) + { case 0: localChatTab->chatLog(_("Equip arrows first."), BY_SERVER); diff --git a/src/net/ea/tradehandler.cpp b/src/net/ea/tradehandler.cpp index 2f5186df..b02bb900 100644 --- a/src/net/ea/tradehandler.cpp +++ b/src/net/ea/tradehandler.cpp @@ -161,11 +161,10 @@ void TradeHandler::handleMessage(Net::MessageIn &msg) msg.skip(8); // card (4 shorts) // TODO: handle also identified, etc - if (type == 0) { + if (type == 0) tradeWindow->setMoney(amount); - } else { + else tradeWindow->addItem(type, false, amount, false); - } } break; diff --git a/src/net/manaserv/chathandler.cpp b/src/net/manaserv/chathandler.cpp index 4efde53a..36e57278 100644 --- a/src/net/manaserv/chathandler.cpp +++ b/src/net/manaserv/chathandler.cpp @@ -127,7 +127,8 @@ void ChatHandler::handleMessage(Net::MessageIn &msg) } else { - switch (errMsg) { + switch (errMsg) + { case ERRMSG_NO_LOGIN: errorMessage = "Chatserver: Not logged in"; break; @@ -169,7 +170,7 @@ void ChatHandler::handleGameChatMessage(Net::MessageIn &msg) void ChatHandler::handleEnterChannelResponse(Net::MessageIn &msg) { - if(msg.readInt8() == ERRMSG_OK) + if (msg.readInt8() == ERRMSG_OK) { short channelId = msg.readInt16(); std::string channelName = msg.readString(); @@ -182,7 +183,7 @@ void ChatHandler::handleEnterChannelResponse(Net::MessageIn &msg) std::string user; std::string userModes; tab->chatLog(_("Players in this channel:"), BY_CHANNEL); - while(msg.getUnreadLength()) + while (msg.getUnreadLength()) { user = msg.readString(); if (user == "") @@ -205,7 +206,7 @@ void ChatHandler::handleEnterChannelResponse(Net::MessageIn &msg) void ChatHandler::handleListChannelsResponse(Net::MessageIn &msg) { localChatTab->chatLog(_("Listing channels."), BY_SERVER); - while(msg.getUnreadLength()) + while (msg.getUnreadLength()) { std::string channelName = msg.readString(); if (channelName == "") @@ -245,7 +246,7 @@ void ChatHandler::handleChatMessage(Net::MessageIn &msg) void ChatHandler::handleQuitChannelResponse(Net::MessageIn &msg) { - if(msg.readInt8() == ERRMSG_OK) + if (msg.readInt8() == ERRMSG_OK) { short channelId = msg.readInt16(); Channel *channel = channelManager->findById(channelId); @@ -260,7 +261,7 @@ void ChatHandler::handleListChannelUsersResponse(Net::MessageIn &msg) std::string userModes; Channel *channel = channelManager->findByName(channelName); channel->getTab()->chatLog(_("Players in this channel:"), BY_CHANNEL); - while(msg.getUnreadLength()) + while (msg.getUnreadLength()) { userNick = msg.readString(); if (userNick == "") @@ -283,7 +284,7 @@ void ChatHandler::handleChannelEvent(Net::MessageIn &msg) std::string line = msg.readString(); Channel *channel = channelManager->findById(channelId); - if(channel) + if (channel) { switch(eventId) { @@ -334,7 +335,7 @@ void ChatHandler::handleWhoResponse(Net::MessageIn &msg) { std::string userNick; - while(msg.getUnreadLength()) + while (msg.getUnreadLength()) { userNick = msg.readString(); if (userNick == "") diff --git a/src/net/manaserv/effecthandler.cpp b/src/net/manaserv/effecthandler.cpp index f9504ebb..39bc9cba 100644 --- a/src/net/manaserv/effecthandler.cpp +++ b/src/net/manaserv/effecthandler.cpp @@ -58,23 +58,21 @@ void EffectHandler::handleMessage(Net::MessageIn &msg) void EffectHandler::handleCreateEffectPos(Net::MessageIn &msg) { - int id = msg.readInt16(); - Uint16 x = msg.readInt16(); - Uint16 y = msg.readInt16(); - effectManager->trigger(id, x, y); + int id = msg.readInt16(); + Uint16 x = msg.readInt16(); + Uint16 y = msg.readInt16(); + effectManager->trigger(id, x, y); } void EffectHandler::handleCreateEffectBeing(Net::MessageIn &msg) { - int eid = msg.readInt16(); - int bid = msg.readInt16(); - Being* b = beingManager->findBeing(bid); - if (b) - { - effectManager->trigger(eid, b); - } else { - logger->log("Warning: CreateEffect called for unknown being #%d", bid); - } + int eid = msg.readInt16(); + int bid = msg.readInt16(); + Being* b = beingManager->findBeing(bid); + if (b) + effectManager->trigger(eid, b); + else + logger->log("Warning: CreateEffect called for unknown being #%d", bid); } } // namespace ManaServ diff --git a/src/net/manaserv/gamehandler.cpp b/src/net/manaserv/gamehandler.cpp index 8b8b9d0f..51b9d1c9 100644 --- a/src/net/manaserv/gamehandler.cpp +++ b/src/net/manaserv/gamehandler.cpp @@ -72,7 +72,8 @@ void GameHandler::handleMessage(Net::MessageIn &msg) // Logout failed else { - switch (errMsg) { + switch (errMsg) + { case ERRMSG_NO_LOGIN: errorMessage = "Gameserver: Not logged in"; break; diff --git a/src/net/manaserv/guildhandler.cpp b/src/net/manaserv/guildhandler.cpp index c87671ea..79f76320 100644 --- a/src/net/manaserv/guildhandler.cpp +++ b/src/net/manaserv/guildhandler.cpp @@ -74,7 +74,7 @@ void GuildHandler::handleMessage(Net::MessageIn &msg) case CPMSG_GUILD_CREATE_RESPONSE: { logger->log("Received CPMSG_GUILD_CREATE_RESPONSE"); - if(msg.readInt8() == ERRMSG_OK) + if (msg.readInt8() == ERRMSG_OK) { // TODO - Acknowledge guild was created localChatTab->chatLog(_("Guild created.")); @@ -89,7 +89,7 @@ void GuildHandler::handleMessage(Net::MessageIn &msg) case CPMSG_GUILD_INVITE_RESPONSE: { logger->log("Received CPMSG_GUILD_INVITE_RESPONSE"); - if(msg.readInt8() == ERRMSG_OK) + if (msg.readInt8() == ERRMSG_OK) { // TODO - Acknowledge invite was sent localChatTab->chatLog(_("Invite sent.")); @@ -99,7 +99,7 @@ void GuildHandler::handleMessage(Net::MessageIn &msg) case CPMSG_GUILD_ACCEPT_RESPONSE: { logger->log("Received CPMSG_GUILD_ACCEPT_RESPONSE"); - if(msg.readInt8() == ERRMSG_OK) + if (msg.readInt8() == ERRMSG_OK) { // TODO - Acknowledge accepted into guild joinedGuild(msg); @@ -109,7 +109,7 @@ void GuildHandler::handleMessage(Net::MessageIn &msg) case CPMSG_GUILD_GET_MEMBERS_RESPONSE: { logger->log("Received CPMSG_GUILD_GET_MEMBERS_RESPONSE"); - if(msg.readInt8() == ERRMSG_OK) + if (msg.readInt8() == ERRMSG_OK) { std::string name; bool online; @@ -124,11 +124,11 @@ void GuildHandler::handleMessage(Net::MessageIn &msg) guild->clearMembers(); - while(msg.getUnreadLength()) + while (msg.getUnreadLength()) { name = msg.readString(); online = msg.readInt8(); - if(name != "") + if (name != "") { member = new GuildMember(guildId, name); member->setOnline(online); diff --git a/src/net/manaserv/loginhandler.cpp b/src/net/manaserv/loginhandler.cpp index 34202411..91d9171b 100644 --- a/src/net/manaserv/loginhandler.cpp +++ b/src/net/manaserv/loginhandler.cpp @@ -78,7 +78,8 @@ void LoginHandler::handleMessage(Net::MessageIn &msg) // Login failed else { - switch (errMsg) { + switch (errMsg) + { case ERRMSG_INVALID_ARGUMENT: errorMessage = _("Wrong magic_token."); break; @@ -108,7 +109,8 @@ void LoginHandler::handleMessage(Net::MessageIn &msg) // pass change failed else { - switch (errMsg) { + switch (errMsg) + { case ERRMSG_INVALID_ARGUMENT: errorMessage = _("New password incorrect."); break; @@ -138,7 +140,8 @@ void LoginHandler::handleMessage(Net::MessageIn &msg) // pass change failed else { - switch (errMsg) { + switch (errMsg) + { case ERRMSG_INVALID_ARGUMENT: errorMessage = _("New email address incorrect."); break; @@ -171,7 +174,8 @@ void LoginHandler::handleMessage(Net::MessageIn &msg) // Logout failed else { - switch (errMsg) { + switch (errMsg) + { case ERRMSG_NO_LOGIN: errorMessage = "Accountserver: Not logged in"; break; @@ -194,7 +198,8 @@ void LoginHandler::handleMessage(Net::MessageIn &msg) // Unregistration failed else { - switch (errMsg) { + switch (errMsg) + { case ERRMSG_INVALID_ARGUMENT: errorMessage = "Accountserver: Wrong username or password"; @@ -249,7 +254,8 @@ void LoginHandler::handleLoginResponse(Net::MessageIn &msg) } else { - switch (errMsg) { + switch (errMsg) + { case LOGIN_INVALID_VERSION: errorMessage = _("Client version is too old."); break; @@ -285,7 +291,8 @@ void LoginHandler::handleRegisterResponse(Net::MessageIn &msg) } else { - switch (errMsg) { + switch (errMsg) + { case REGISTER_INVALID_VERSION: errorMessage = _("Client version is too old."); break; diff --git a/src/net/manaserv/network.cpp b/src/net/manaserv/network.cpp index 0ca61fc2..83d78e06 100644 --- a/src/net/manaserv/network.cpp +++ b/src/net/manaserv/network.cpp @@ -66,7 +66,8 @@ void finalize() if (!client) return; // Wasn't initialized at all - if (connections) { + if (connections) + { logger->error("Tried to shutdown the network subsystem while there " "are network connections left!"); } @@ -120,12 +121,14 @@ namespace MessageHandlerIterator iter = mMessageHandlers.find(msg.getId()); - if (iter != mMessageHandlers.end()) { + if (iter != mMessageHandlers.end()) + { //logger->log("Received packet %x (%i B)", // msg.getId(), msg.getLength()); iter->second->handleMessage(msg); } - else { + else + { logger->log("Unhandled packet %x (%i B)", msg.getId(), msg.getLength()); } diff --git a/src/net/manaserv/playerhandler.cpp b/src/net/manaserv/playerhandler.cpp index b0f299b6..671d02a3 100644 --- a/src/net/manaserv/playerhandler.cpp +++ b/src/net/manaserv/playerhandler.cpp @@ -278,7 +278,8 @@ void PlayerHandler::handleMessage(Net::MessageIn &msg) { Sint16 type = msg.readInt16(); - switch (type) { + switch (type) + { case 0: localChatTab->chatLog(_("Equip arrows first."), BY_SERVER); @@ -314,7 +315,8 @@ void PlayerHandler::handleMapChangeMessage(Net::MessageIn &msg) /* Scroll if neccessary */ if (!nearby || (abs(x - (int) playerPos.x) > MAP_TELEPORT_SCROLL_DISTANCE) - || (abs(y - (int) playerPos.y) > MAP_TELEPORT_SCROLL_DISTANCE)) { + || (abs(y - (int) playerPos.y) > MAP_TELEPORT_SCROLL_DISTANCE)) + { scrollOffsetX = x - (int) playerPos.x; scrollOffsetY = y - (int) playerPos.y; } diff --git a/src/net/manaserv/tradehandler.cpp b/src/net/manaserv/tradehandler.cpp index cbcc29dc..08fc354c 100644 --- a/src/net/manaserv/tradehandler.cpp +++ b/src/net/manaserv/tradehandler.cpp @@ -92,11 +92,10 @@ TradeHandler::TradeHandler(): void TradeHandler::setAcceptTradeRequests(bool acceptTradeRequests) { mAcceptTradeRequests = acceptTradeRequests; - if (mAcceptTradeRequests) { + if (mAcceptTradeRequests) localChatTab->chatLog(_("Accepting incoming trade requests."), BY_SERVER); - } else { + else localChatTab->chatLog(_("Ignoring incoming trade requests."), BY_SERVER); - } } void TradeHandler::handleMessage(Net::MessageIn &msg) diff --git a/src/net/messagein.cpp b/src/net/messagein.cpp index f659fcfc..5cc13192 100644 --- a/src/net/messagein.cpp +++ b/src/net/messagein.cpp @@ -139,7 +139,8 @@ std::string MessageIn::readString(int length) length = readInt16(); // Make sure the string isn't erroneous - if (length < 0 || mPos + length > mLength) { + if (length < 0 || mPos + length > mLength) + { mPos = mLength + 1; return ""; } diff --git a/src/net/net.cpp b/src/net/net.cpp index 3b380367..ade879a3 100644 --- a/src/net/net.cpp +++ b/src/net/net.cpp @@ -189,7 +189,8 @@ void connectToServer(const ServerInfo &server) getLoginHandler()->connect(); } -void unload() { +void unload() +{ GeneralHandler *handler = getGeneralHandler(); if (handler) { |