From 000c3799eb85234b9baf5ede86dd966d929112d8 Mon Sep 17 00:00:00 2001 From: Stefan Dombrowski Date: Mon, 23 Aug 2010 17:28:05 +0200 Subject: Fixing segmentation fault in partyhandler Segmentation fault happens if a player leaves your party while he is out of sight. Signed-off-by: Jared Adams --- src/net/tmwa/partyhandler.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/net') diff --git a/src/net/tmwa/partyhandler.cpp b/src/net/tmwa/partyhandler.cpp index e86d41fa..a92a27df 100644 --- a/src/net/tmwa/partyhandler.cpp +++ b/src/net/tmwa/partyhandler.cpp @@ -253,7 +253,7 @@ void PartyHandler::handleMessage(Net::MessageIn &msg) nick.c_str()), BY_SERVER); Being *b = beingManager->findBeing(id); - if (b->getType() == Being::PLAYER) + if (b && b->getType() == Being::PLAYER) static_cast(b)->setParty(NULL); taParty->removeMember(id); -- cgit v1.2.3-70-g09d2 From 38474d0c3c14cf595aed61ee1e4a69d48abbcf92 Mon Sep 17 00:00:00 2001 From: Stefan Dombrowski Date: Tue, 24 Aug 2010 17:24:14 +0200 Subject: Giving functionality to invite in socialwindow and allow enter key in textdialog Signed-off-by: Jared Adams --- src/gui/socialwindow.cpp | 3 --- src/gui/textdialog.cpp | 2 ++ src/net/tmwa/partyhandler.cpp | 16 +++++++++++----- 3 files changed, 13 insertions(+), 8 deletions(-) (limited to 'src/net') diff --git a/src/gui/socialwindow.cpp b/src/gui/socialwindow.cpp index f6e1d0aa..7a13f96b 100644 --- a/src/gui/socialwindow.cpp +++ b/src/gui/socialwindow.cpp @@ -203,9 +203,6 @@ public: { std::string name = mInviteDialog->getText(); Net::getPartyHandler()->invite(name); - - localChatTab->chatLog(strprintf(_("Invited user %s to party."), - name.c_str()), BY_SERVER); mInviteDialog = NULL; } else if (event.getId() == "~do invite") diff --git a/src/gui/textdialog.cpp b/src/gui/textdialog.cpp index 3e3aafe2..6faa1162 100644 --- a/src/gui/textdialog.cpp +++ b/src/gui/textdialog.cpp @@ -38,6 +38,8 @@ TextDialog::TextDialog(const std::string &title, const std::string &msg, mOkButton = new Button(_("OK"), "OK", this); gcn::Button *cancelButton = new Button(_("Cancel"), "CANCEL", this); + mTextField->addActionListener(this); + place(0, 0, textLabel, 4); place(0, 1, mTextField, 4); place(2, 2, mOkButton); diff --git a/src/net/tmwa/partyhandler.cpp b/src/net/tmwa/partyhandler.cpp index a92a27df..76108e9c 100644 --- a/src/net/tmwa/partyhandler.cpp +++ b/src/net/tmwa/partyhandler.cpp @@ -327,18 +327,24 @@ void PartyHandler::invite(Player *player) void PartyHandler::invite(const std::string &name) { - if (partyTab) + Being *invitee = beingManager->findBeingByName(name, Being::PLAYER); + + if (invitee) { - partyTab->chatLog(_("Inviting like this isn't supported at the moment."), - BY_SERVER); + invite((Player *)invitee); + partyTab->chatLog(strprintf(_("Invited user %s to party."), + name.c_str()), BY_SERVER); + } + else if (partyTab) + { + partyTab->chatLog(strprintf(_("Inviting failed, because you can't see " + "a player called %s."), name.c_str()), BY_SERVER); } else { localChatTab->chatLog(_("You can only inivte when you are in a party!"), BY_SERVER); } - - // TODO? } void PartyHandler::inviteResponse(const std::string &inviter, bool accept) -- cgit v1.2.3-70-g09d2 From c538f6372d9068140231749b0225a6a355009074 Mon Sep 17 00:00:00 2001 From: Stefan Dombrowski Date: Thu, 26 Aug 2010 17:54:16 +0200 Subject: Fixing segmentation fault when creating a new account This resolves http://bugs.manasource.org/view.php?id=171 Reviewed-by: Bertram. --- src/net/manaserv/loginhandler.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/net') diff --git a/src/net/manaserv/loginhandler.cpp b/src/net/manaserv/loginhandler.cpp index cb25f584..61671824 100644 --- a/src/net/manaserv/loginhandler.cpp +++ b/src/net/manaserv/loginhandler.cpp @@ -425,6 +425,8 @@ void LoginHandler::chooseServer(unsigned int server) void LoginHandler::registerAccount(LoginData *loginData) { + mLoginData = loginData; + MessageOut msg(PAMSG_REGISTER); msg.writeInt32(0); // client version -- cgit v1.2.3-70-g09d2 From ef9eec73b3cc96ebecdc061e9e956a462fdcc19f Mon Sep 17 00:00:00 2001 From: Stefan Dombrowski Date: Fri, 27 Aug 2010 19:03:18 +0200 Subject: Changing findBeingByName so that it searches case insensitive Adding error message when trying to create a party with to long name. Removing non-existing files from C::B project. Signed-off-by: Jared Adams --- mana.cbp | 2 -- src/beingmanager.cpp | 2 +- src/gui/socialwindow.cpp | 6 ++++-- src/net/tmwa/partyhandler.cpp | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) (limited to 'src/net') diff --git a/mana.cbp b/mana.cbp index 459a660c..c855a9a9 100644 --- a/mana.cbp +++ b/mana.cbp @@ -137,7 +137,6 @@ - @@ -369,7 +368,6 @@ - diff --git a/src/beingmanager.cpp b/src/beingmanager.cpp index 656b297e..931e4579 100644 --- a/src/beingmanager.cpp +++ b/src/beingmanager.cpp @@ -165,7 +165,7 @@ Being *BeingManager::findBeingByName(const std::string &name, i != i_end; ++i) { Being *being = (*i); - if (being->getName() == name && + if (!compareStrI(being->getName(),name) && (type == Being::UNKNOWN || type == being->getType())) return being; } diff --git a/src/gui/socialwindow.cpp b/src/gui/socialwindow.cpp index 3d8afa44..290fd557 100644 --- a/src/gui/socialwindow.cpp +++ b/src/gui/socialwindow.cpp @@ -498,7 +498,8 @@ void SocialWindow::action(const gcn::ActionEvent &event) if (name.size() > 16) { - // TODO : State too many characters in input. + localChatTab->chatLog(_("Creating guild failed, please choose a " + "shorter name."), BY_SERVER); return; } @@ -518,7 +519,8 @@ void SocialWindow::action(const gcn::ActionEvent &event) if (name.size() > 16) { - // TODO : State too many characters in input. + localChatTab->chatLog(_("Creating party failed, please choose a " + "shorter name."), BY_SERVER); return; } diff --git a/src/net/tmwa/partyhandler.cpp b/src/net/tmwa/partyhandler.cpp index 76108e9c..a88a27b6 100644 --- a/src/net/tmwa/partyhandler.cpp +++ b/src/net/tmwa/partyhandler.cpp @@ -333,7 +333,7 @@ void PartyHandler::invite(const std::string &name) { invite((Player *)invitee); partyTab->chatLog(strprintf(_("Invited user %s to party."), - name.c_str()), BY_SERVER); + invitee->getName().c_str()), BY_SERVER); } else if (partyTab) { -- cgit v1.2.3-70-g09d2 From 919e6bef84e3670b206f192613558274a341b976 Mon Sep 17 00:00:00 2001 From: Stefan Dombrowski Date: Sat, 28 Aug 2010 18:56:14 +0200 Subject: Fixing omitted items in equipment window Bug description: If a player has equipable items only, then the equipment backend gets not initialized. As a consequence the equipment window remains empty. This is particularly a problem for new characters. Signed-off-by: Jared Adams --- src/net/tmwa/inventoryhandler.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/net') diff --git a/src/net/tmwa/inventoryhandler.cpp b/src/net/tmwa/inventoryhandler.cpp index fd979dc6..7363c738 100644 --- a/src/net/tmwa/inventoryhandler.cpp +++ b/src/net/tmwa/inventoryhandler.cpp @@ -127,6 +127,7 @@ void InventoryHandler::handleMessage(Net::MessageIn &msg) int index, amount, itemId, equipType, arrow; int identified, cards[4], itemType; Inventory *inventory = player_node->getInventory(); + player_node->mEquipment->setBackend(&mEquips); switch (msg.getId()) { @@ -136,8 +137,6 @@ void InventoryHandler::handleMessage(Net::MessageIn &msg) { // Clear inventory - this will be a complete refresh mEquips.clear(); - player_node->mEquipment->setBackend(&mEquips); - inventory->clear(); } else -- cgit v1.2.3-70-g09d2 From c99347bf9108367c02dcbdebadec0b978a750c57 Mon Sep 17 00:00:00 2001 From: Stefan Dombrowski Date: Sat, 4 Sep 2010 23:50:20 +0200 Subject: Fixing segmentation fault if server is given on command line If server and port was given on the command line, then the server type was unknown. The command line options do work now, but only if standard ports 6901 and 9601 are used. This resolves http://bugs.manasource.org/view.php?id=177 TODO: Query the server about itself and choose the server type based on that. Reviewed-by: Jaxad0127 --- src/client.cpp | 12 +++++++----- src/net/net.cpp | 12 +++++++++++- src/net/net.h | 2 +- 3 files changed, 19 insertions(+), 7 deletions(-) (limited to 'src/net') diff --git a/src/client.cpp b/src/client.cpp index b63550e6..3946d0f9 100644 --- a/src/client.cpp +++ b/src/client.cpp @@ -604,11 +604,13 @@ int Client::exec() case STATE_CHOOSE_SERVER: logger->log("State: CHOOSE SERVER"); - // Allow changing this using a server choice dialog - // We show the dialog box only if the command-line - // options weren't set. - if (mOptions.serverName.empty() && mOptions.serverPort == 0 - && !branding.getValue("onlineServerList", "a").empty()) + // If a server was passed on the command line, or branding + // provides a server and a blank server list, we skip the + // server selection dialog. + if (mOptions.serverName.empty() || mOptions.serverPort == 0 + || !(!branding.getValue("defaultServer","").empty() && + branding.getValue("defaultPort",0) && + branding.getValue("onlineServerList", "").empty())) { // Don't allow an alpha opacity // lower than the default value diff --git a/src/net/net.cpp b/src/net/net.cpp index 5e7c989f..7e7395a6 100644 --- a/src/net/net.cpp +++ b/src/net/net.cpp @@ -22,6 +22,7 @@ #include "net/net.h" #include "main.h" +#include "log.h" #include "net/adminhandler.h" #include "net/charhandler.h" @@ -41,6 +42,8 @@ #include "net/manaserv/generalhandler.h" +#include "utils/gettext.h" + Net::AdminHandler *adminHandler = NULL; Net::CharHandler *charHandler = NULL; Net::ChatHandler *chatHandler = NULL; @@ -124,12 +127,19 @@ namespace Net { ServerInfo::Type networkType = ServerInfo::UNKNOWN; -void connectToServer(const ServerInfo &server) +void connectToServer(ServerInfo &server) { if (server.type == ServerInfo::UNKNOWN) { // TODO: Query the server about itself and choose the netcode based on // that + + if (server.port == 6901) + server.type = ServerInfo::TMWATHENA; + else if (server.port == 9601) + server.type = ServerInfo::MANASERV; + else + logger->error(_("Unknown Server Type! Exiting.")); } if (networkType == server.type && getGeneralHandler() != NULL) diff --git a/src/net/net.h b/src/net/net.h index 9d9ee10e..6029f3ba 100644 --- a/src/net/net.h +++ b/src/net/net.h @@ -67,7 +67,7 @@ ServerInfo::Type getNetworkType(); /** * Handles server detection and connection */ -void connectToServer(const ServerInfo &server); +void connectToServer(ServerInfo &server); void unload(); -- cgit v1.2.3-70-g09d2 From f82d012e96cf90556a213bf6058de43dc0a9ae7f Mon Sep 17 00:00:00 2001 From: Stefan Dombrowski Date: Sun, 5 Sep 2010 17:34:20 +0200 Subject: Fixing ghost characters in charselectdialog How to reproduce the bug: Switch the login to an account with fewer characters. Then those character slots are not empty, but show characters from the previous account. Reviewed-by: thorbjorn --- src/net/tmwa/charserverhandler.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/net') diff --git a/src/net/tmwa/charserverhandler.cpp b/src/net/tmwa/charserverhandler.cpp index 8711f031..dc9b3108 100644 --- a/src/net/tmwa/charserverhandler.cpp +++ b/src/net/tmwa/charserverhandler.cpp @@ -77,6 +77,9 @@ void CharServerHandler::handleMessage(Net::MessageIn &msg) msg.skip(2); // Length word msg.skip(20); // Unused + delete_all(mCharacters); + mCharacters.clear(); + // Derive number of characters from message length const int count = (msg.getLength() - 24) / 106; -- cgit v1.2.3-70-g09d2 From db2f9e4c7af87074f75af14a183db41e5ccdcc21 Mon Sep 17 00:00:00 2001 From: Stefan Dombrowski Date: Wed, 8 Sep 2010 16:22:28 +0200 Subject: Adding missing update for attributes in StatusWindow Reviewed-by: Thorbjorn --- src/gui/statuswindow.cpp | 13 +++++++++---- src/gui/statuswindow.h | 2 ++ src/net/tmwa/playerhandler.cpp | 4 ++++ 3 files changed, 15 insertions(+), 4 deletions(-) (limited to 'src/net') diff --git a/src/gui/statuswindow.cpp b/src/gui/statuswindow.cpp index ede85133..91f832f5 100644 --- a/src/gui/statuswindow.cpp +++ b/src/gui/statuswindow.cpp @@ -246,10 +246,7 @@ std::string StatusWindow::update(int id) mCorrectionPointsLabel->adjustSize(); } - for (Attrs::iterator it = mAttrs.begin(); it != mAttrs.end(); it++) - { - it->second->update(); - } + updateAttrs(); } else if (id == LEVEL) { @@ -272,6 +269,14 @@ std::string StatusWindow::update(int id) return ""; } +void StatusWindow::updateAttrs() +{ + for (Attrs::iterator it = mAttrs.begin(); it != mAttrs.end(); it++) + { + it->second->update(); + } +} + void StatusWindow::setPointsNeeded(int id, int needed) { Attrs::iterator it = mAttrs.find(id); diff --git a/src/gui/statuswindow.h b/src/gui/statuswindow.h index a1fc4b4b..d99368b8 100644 --- a/src/gui/statuswindow.h +++ b/src/gui/statuswindow.h @@ -59,6 +59,8 @@ class StatusWindow : public Window std::string update(int id); + void updateAttrs(); + void setPointsNeeded(int id, int needed); void addAttribute(int id, const std::string &name, bool modifiable, diff --git a/src/net/tmwa/playerhandler.cpp b/src/net/tmwa/playerhandler.cpp index 5aab94b8..16f1ee53 100644 --- a/src/net/tmwa/playerhandler.cpp +++ b/src/net/tmwa/playerhandler.cpp @@ -318,6 +318,10 @@ void PlayerHandler::handleMessage(Net::MessageIn &msg) player_node->setAction(Being::DEAD); } } + + if (statusWindow) + statusWindow->updateAttrs(); + break; case SMSG_PLAYER_STAT_UPDATE_2: -- cgit v1.2.3-70-g09d2 From 173cbf107b35fb191724e5386cf3bcf0106c80ae Mon Sep 17 00:00:00 2001 From: Stefan Dombrowski Date: Wed, 8 Sep 2010 21:56:44 +0200 Subject: Adding missing updates for buttons in InventoryWindow Reviewed-by: Thorbjorn --- src/gui/inventorywindow.cpp | 9 ++++++++- src/gui/inventorywindow.h | 7 ++++++- src/net/tmwa/inventoryhandler.cpp | 10 ++++++++++ src/net/tmwa/inventoryhandler.h | 2 ++ 4 files changed, 26 insertions(+), 2 deletions(-) (limited to 'src/net') diff --git a/src/gui/inventorywindow.cpp b/src/gui/inventorywindow.cpp index 591ebd2f..16ac5409 100644 --- a/src/gui/inventorywindow.cpp +++ b/src/gui/inventorywindow.cpp @@ -288,10 +288,18 @@ void InventoryWindow::valueChanged(const gcn::SelectionEvent &event) (item->getQuantity() - 1)); } + updateButtons(); +} + +void InventoryWindow::updateButtons() +{ + Item *item = mItems->getSelectedItem(); + if (!item || item->getQuantity() == 0) { mUseButton->setEnabled(false); mDropButton->setEnabled(false); + mSplitButton->setEnabled(false); return; } @@ -322,7 +330,6 @@ void InventoryWindow::valueChanged(const gcn::SelectionEvent &event) mSplitButton->setEnabled(false); } - void InventoryWindow::setSplitAllowed(bool allowed) { mSplitButton->setVisible(allowed); diff --git a/src/gui/inventorywindow.h b/src/gui/inventorywindow.h index f611e934..0dce0611 100644 --- a/src/gui/inventorywindow.h +++ b/src/gui/inventorywindow.h @@ -100,7 +100,12 @@ class InventoryWindow : public Window, * window has been closed. */ void close(); - + + /** + * Updates the buttons. + */ + void updateButtons(); + /** * Updates the weight bar. */ diff --git a/src/net/tmwa/inventoryhandler.cpp b/src/net/tmwa/inventoryhandler.cpp index 7363c738..f5b379b9 100644 --- a/src/net/tmwa/inventoryhandler.cpp +++ b/src/net/tmwa/inventoryhandler.cpp @@ -245,6 +245,8 @@ void InventoryHandler::handleMessage(Net::MessageIn &msg) inventory->setItem(index, itemId, amount, equipType != 0); } + + inventoryWindow->updateButtons(); } break; case SMSG_PLAYER_INVENTORY_REMOVE: @@ -255,6 +257,7 @@ void InventoryHandler::handleMessage(Net::MessageIn &msg) item->increaseQuantity(-amount); if (item->getQuantity() == 0) inventory->removeItemAt(index); + inventoryWindow->updateButtons(); } break; @@ -266,7 +269,11 @@ void InventoryHandler::handleMessage(Net::MessageIn &msg) msg.readInt8(); // type if (Item *item = inventory->getItem(index)) + { item->setQuantity(amount); + inventoryWindow->updateButtons(); + } + break; case SMSG_ITEM_USE_RESPONSE: @@ -280,7 +287,10 @@ void InventoryHandler::handleMessage(Net::MessageIn &msg) else { if (Item *item = inventory->getItem(index)) + { item->setQuantity(amount); + inventoryWindow->updateButtons(); + } } break; diff --git a/src/net/tmwa/inventoryhandler.h b/src/net/tmwa/inventoryhandler.h index 82738afe..0c4ad092 100644 --- a/src/net/tmwa/inventoryhandler.h +++ b/src/net/tmwa/inventoryhandler.h @@ -87,6 +87,8 @@ class EquipBackend : public Equipment::Backend { { item->setEquipped(true); } + + inventoryWindow->updateButtons(); } private: -- cgit v1.2.3-70-g09d2 From 29e9ff188f1d64705ce53e8196e97b5eef30a547 Mon Sep 17 00:00:00 2001 From: Stefan Dombrowski Date: Sat, 11 Sep 2010 19:27:17 +0200 Subject: Making sure the inventory window shows the correct number of used slots The SlotsBar is updated, if InventoryWindow::slotsChanged() is called. This did not happen when an item disappeared from the inventory, because of using it. Then the item quantity was just set to 0, but the SlotBar was not notified. Reviewed-by: Jaxad0127 --- src/net/tmwa/inventoryhandler.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'src/net') diff --git a/src/net/tmwa/inventoryhandler.cpp b/src/net/tmwa/inventoryhandler.cpp index f5b379b9..3809399d 100644 --- a/src/net/tmwa/inventoryhandler.cpp +++ b/src/net/tmwa/inventoryhandler.cpp @@ -270,7 +270,11 @@ void InventoryHandler::handleMessage(Net::MessageIn &msg) if (Item *item = inventory->getItem(index)) { - item->setQuantity(amount); + if (amount) + item->setQuantity(amount); + else + inventory->removeItemAt(index); + inventoryWindow->updateButtons(); } @@ -288,7 +292,11 @@ void InventoryHandler::handleMessage(Net::MessageIn &msg) { if (Item *item = inventory->getItem(index)) { - item->setQuantity(amount); + if (amount) + item->setQuantity(amount); + else + inventory->removeItemAt(index); + inventoryWindow->updateButtons(); } } -- cgit v1.2.3-70-g09d2 From 81dd53a536f3f76636b058250750a661911a94ea Mon Sep 17 00:00:00 2001 From: Stefan Dombrowski Date: Sat, 11 Sep 2010 20:25:24 +0200 Subject: Fixing misspelling in Setup_Video and removing empty lines from log Reviewed-by: Jaxad0127 --- src/client.cpp | 2 +- src/gui/serverdialog.cpp | 2 +- src/gui/setup_video.cpp | 6 +++--- src/net/tmwa/guildhandler.cpp | 2 +- src/net/tmwa/network.cpp | 2 +- src/net/tmwa/partyhandler.cpp | 4 ++-- 6 files changed, 9 insertions(+), 9 deletions(-) (limited to 'src/net') diff --git a/src/client.cpp b/src/client.cpp index 5488d8ad..482bb9dc 100644 --- a/src/client.cpp +++ b/src/client.cpp @@ -961,7 +961,7 @@ int Client::exec() case STATE_ERROR: logger->log("State: ERROR"); - logger->log("Error: %s\n", errorMessage.c_str()); + logger->log("Error: %s", errorMessage.c_str()); mCurrentDialog = new OkDialog(_("Error"), errorMessage); mCurrentDialog->addActionListener(&errorListener); mCurrentDialog = NULL; // OkDialog deletes itself diff --git a/src/gui/serverdialog.cpp b/src/gui/serverdialog.cpp index 0762b00f..09ba7cd1 100644 --- a/src/gui/serverdialog.cpp +++ b/src/gui/serverdialog.cpp @@ -676,7 +676,7 @@ int ServerDialog::downloadUpdate(void *ptr, DownloadStatus status, } else if (status < 0) { - logger->log("Error retreiving server list: %s\n", + logger->log("Error retreiving server list: %s", sd->mDownload->getError()); sd->mDownloadStatus = DOWNLOADING_ERROR; } diff --git a/src/gui/setup_video.cpp b/src/gui/setup_video.cpp index 81ce8107..b576f302 100644 --- a/src/gui/setup_video.cpp +++ b/src/gui/setup_video.cpp @@ -224,11 +224,11 @@ Setup_Video::Setup_Video(): mParticleEffectsCheckBox(new CheckBox(_("Particle effects"), mParticleEffectsEnabled)), mNameCheckBox(new CheckBox(_("Show own name"), mNameEnabled)), - mNPCLogCheckBox(new CheckBox(_("Log NPC interations"), mNPCLogEnabled)), + mNPCLogCheckBox(new CheckBox(_("Log NPC interactions"), mNPCLogEnabled)), mPickupNotifyLabel(new Label(_("Show pickup notification"))), - // TRANSLATORS: Refers to "Show own name" + // TRANSLATORS: Refers to "Show pickup notification" mPickupChatCheckBox(new CheckBox(_("in chat"), mPickupChatEnabled)), - // TRANSLATORS: Refers to "Show own name" + // TRANSLATORS: Refers to "Show pickup notification" mPickupParticleCheckBox(new CheckBox(_("as particle"), mPickupParticleEnabled)), mSpeechSlider(new Slider(0, 3)), diff --git a/src/net/tmwa/guildhandler.cpp b/src/net/tmwa/guildhandler.cpp index 8a106841..dac57b64 100644 --- a/src/net/tmwa/guildhandler.cpp +++ b/src/net/tmwa/guildhandler.cpp @@ -118,7 +118,7 @@ void GuildHandler::handleMessage(Net::MessageIn &msg) msg.readInt8(); // Unused std::string guildName = msg.readString(24); - logger->log("Guild position info: %d %d %d %s\n", guildId, + logger->log("Guild position info: %d %d %d %s", guildId, emblem, posMode, guildName.c_str()); } break; diff --git a/src/net/tmwa/network.cpp b/src/net/tmwa/network.cpp index ddfbbc5d..aff19b11 100644 --- a/src/net/tmwa/network.cpp +++ b/src/net/tmwa/network.cpp @@ -326,7 +326,7 @@ MessageIn Network::getNextMessage() len = readWord(2); #ifdef DEBUG - logger->log("Received packet 0x%x of length %d\n", msgId, len); + logger->log("Received packet 0x%x of length %d", msgId, len); #endif MessageIn msg(mInBuffer, len); diff --git a/src/net/tmwa/partyhandler.cpp b/src/net/tmwa/partyhandler.cpp index a88a27b6..611fe3e6 100644 --- a/src/net/tmwa/partyhandler.cpp +++ b/src/net/tmwa/partyhandler.cpp @@ -189,7 +189,7 @@ void PartyHandler::handleMessage(Net::MessageIn &msg) partyTab->chatLog(_("Experience sharing not possible."), BY_SERVER); break; default: - logger->log("Unknown party exp option: %d\n", exp); + logger->log("Unknown party exp option: %d", exp); } switch (item) @@ -213,7 +213,7 @@ void PartyHandler::handleMessage(Net::MessageIn &msg) partyTab->chatLog(_("Item sharing not possible."), BY_SERVER); break; default: - logger->log("Unknown party item option: %d\n", exp); + logger->log("Unknown party item option: %d", exp); } break; } -- cgit v1.2.3-70-g09d2 From 7d0738df0d139af3175fcc1fec5b9be4a467f4f4 Mon Sep 17 00:00:00 2001 From: Stefan Dombrowski Date: Tue, 14 Sep 2010 17:55:53 +0200 Subject: Avoid log message for unhandled SMSG_BEING_SPAWN This log message shows up in mana.log: "Unhandled packet: 7c". Later, the client will have to actually take care of it, though. Reviewed-by: Bertram, jaxad0127. --- src/net/tmwa/beinghandler.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/net') diff --git a/src/net/tmwa/beinghandler.cpp b/src/net/tmwa/beinghandler.cpp index 04690c50..889f8777 100644 --- a/src/net/tmwa/beinghandler.cpp +++ b/src/net/tmwa/beinghandler.cpp @@ -48,6 +48,7 @@ BeingHandler::BeingHandler(bool enableSync): static const Uint16 _messages[] = { SMSG_BEING_VISIBLE, SMSG_BEING_MOVE, + SMSG_BEING_SPAWN, SMSG_BEING_MOVE2, SMSG_BEING_REMOVE, SMSG_SKILL_DAMAGE, @@ -236,6 +237,13 @@ void BeingHandler::handleMessage(Net::MessageIn &msg) dstBeing->setStatusEffectBlock(16, statusEffects & 0xffff); break; + case SMSG_BEING_SPAWN: + /* + * TODO: This packet might need handling in the future. + */ + // Do nothing. + break; + case SMSG_BEING_MOVE2: /* * A simplified movement packet, used by the -- cgit v1.2.3-70-g09d2