diff options
author | Ira Rice <irarice@gmail.com> | 2008-12-07 16:53:32 -0700 |
---|---|---|
committer | Ira Rice <irarice@gmail.com> | 2008-12-07 16:53:32 -0700 |
commit | aef082e6fe4fca268f9bfe401409eb342f82e4af (patch) | |
tree | 26e9f2f2be9ad59666a4c039c7717e0e5becd3eb /src/net | |
parent | 7f24abc455a407e84f13d75099e36db77fa8931d (diff) | |
parent | a7c21e6f8add37af7412449742ec55c8daa8571a (diff) | |
download | mana-aef082e6fe4fca268f9bfe401409eb342f82e4af.tar.gz mana-aef082e6fe4fca268f9bfe401409eb342f82e4af.tar.bz2 mana-aef082e6fe4fca268f9bfe401409eb342f82e4af.tar.xz mana-aef082e6fe4fca268f9bfe401409eb342f82e4af.zip |
Merge commit 'a7c21e6f8add37af7412449742ec55c8daa8571a'
Conflicts:
AUTHORS
CMakeLists.txt
ChangeLog
INSTALL
README
aethyra.cbp
configure.ac
data/help/changes.txt
data/help/commands.txt
data/help/header.txt
data/help/support.txt
src/Makefile.am
src/aethyra.rc
src/being.cpp
src/being.h
src/equipment.cpp
src/equipment.h
src/floor_item.h
src/game.cpp
src/gui/buddywindow.cpp
src/gui/char_select.cpp
src/gui/char_server.cpp
src/gui/chat.cpp
src/gui/chat.h
src/gui/equipmentwindow.cpp
src/gui/equipmentwindow.h
src/gui/gui.cpp
src/gui/inventorywindow.cpp
src/gui/inventorywindow.h
src/gui/itemcontainer.cpp
src/gui/itemcontainer.h
src/gui/minimap.cpp
src/gui/ministatus.cpp
src/gui/newskill.cpp
src/gui/npc_text.cpp
src/gui/npclistdialog.h
src/gui/ok_dialog.cpp
src/gui/setup_video.cpp
src/gui/skill.cpp
src/gui/skill.h
src/gui/status.h
src/gui/table_model.h
src/gui/updatewindow.cpp
src/gui/viewport.cpp
src/inventory.cpp
src/inventory.h
src/keyboardconfig.cpp
src/keyboardconfig.h
src/localplayer.cpp
src/localplayer.h
src/logindata.h
src/main.cpp
src/map.cpp
src/monster.cpp
src/monster.h
src/net/beinghandler.cpp
src/net/beinghandler.h
src/net/buysellhandler.cpp
src/net/equipmenthandler.cpp
src/net/loginhandler.cpp
src/net/loginhandler.h
src/net/network.h
src/net/npchandler.cpp
src/net/playerhandler.cpp
src/net/protocol.h
src/net/tradehandler.cpp
src/npc.cpp
src/npc.h
src/particleemitter.cpp
src/particleemitterprop.h
src/player.cpp
src/player.h
src/player_relations.cpp
src/resources/imageset.cpp
src/resources/imageset.h
src/resources/itemdb.cpp
src/resources/mapreader.cpp
src/resources/monsterinfo.h
src/text.cpp
src/text.h
src/textmanager.cpp
src/textmanager.h
src/tileset.h
src/utils/fastsqrt.h
src/utils/strprintf.cpp
src/winver.h
tools/tmxcopy/Makefile
tools/tmxcopy/base64.cpp
tools/tmxcopy/base64.h
tools/tmxcopy/tostring.h
Signed-off-by: Ira Rice <irarice@gmail.com>
Diffstat (limited to 'src/net')
-rw-r--r-- | src/net/beinghandler.cpp | 24 | ||||
-rw-r--r-- | src/net/buysellhandler.cpp | 2 | ||||
-rw-r--r-- | src/net/charserverhandler.cpp | 2 | ||||
-rw-r--r-- | src/net/equipmenthandler.cpp | 3 | ||||
-rw-r--r-- | src/net/loginhandler.cpp | 12 | ||||
-rw-r--r-- | src/net/loginhandler.h | 5 | ||||
-rw-r--r-- | src/net/network.h | 6 | ||||
-rw-r--r-- | src/net/playerhandler.cpp | 3 | ||||
-rw-r--r-- | src/net/protocol.h | 1 | ||||
-rw-r--r-- | src/net/tradehandler.cpp | 4 |
10 files changed, 32 insertions, 30 deletions
diff --git a/src/net/beinghandler.cpp b/src/net/beinghandler.cpp index b016b5cf..3c022af6 100644 --- a/src/net/beinghandler.cpp +++ b/src/net/beinghandler.cpp @@ -204,21 +204,15 @@ void BeingHandler::handleMessage(MessageIn *msg) // If this is player's current target, clear it. if (dstBeing == player_node->getTarget()) - { player_node->stopAttack(); - } if (dstBeing == current_npc) current_npc = NULL; if (msg->readInt8() == 1) - { dstBeing->setAction(Being::DEAD); - } else - { beingManager->destroyBeing(dstBeing); - } break; @@ -236,27 +230,26 @@ void BeingHandler::handleMessage(MessageIn *msg) switch (type) { case 0x0a: // Critical Damage - if (dstBeing) { + if (dstBeing) dstBeing->showCrit(); - } - case 0x00: // Damage - if (dstBeing) { + case 0x00: // Damage + if (dstBeing) dstBeing->takeDamage(param1); - } - if (srcBeing) { + if (srcBeing) srcBeing->handleAttack(dstBeing, param1); - } break; case 0x02: // Sit - if (srcBeing) { + if (srcBeing) + { srcBeing->mFrame = 0; srcBeing->setAction(Being::SIT); } break; case 0x03: // Stand up - if (srcBeing) { + if (srcBeing) + { srcBeing->mFrame = 0; srcBeing->setAction(Being::STAND); } @@ -518,3 +511,4 @@ void BeingHandler::handleMessage(MessageIn *msg) break; } } + diff --git a/src/net/buysellhandler.cpp b/src/net/buysellhandler.cpp index ad613889..b2fe99b9 100644 --- a/src/net/buysellhandler.cpp +++ b/src/net/buysellhandler.cpp @@ -113,6 +113,8 @@ void BuySellHandler::handleMessage(MessageIn *msg) if (msg->readInt8() == 0) { chatWindow->chatLog("Thanks for buying", BY_SERVER); } else { + // Reset player money since buy dialog already assumed purchase + // would go fine buyDialog->setMoney(player_node->mGp); chatWindow->chatLog("Unable to buy", BY_SERVER); } diff --git a/src/net/charserverhandler.cpp b/src/net/charserverhandler.cpp index 833732db..281923f8 100644 --- a/src/net/charserverhandler.cpp +++ b/src/net/charserverhandler.cpp @@ -178,7 +178,7 @@ void CharServerHandler::handleMessage(MessageIn *msg) errorMessage = "Duplicated login"; break; default: - errorMessage = "Unkown error with 0x0081"; + errorMessage = "Unknown error with 0x0081"; break; } mCharInfo->unlock(); diff --git a/src/net/equipmenthandler.cpp b/src/net/equipmenthandler.cpp index 23a8063f..2e0cc562 100644 --- a/src/net/equipmenthandler.cpp +++ b/src/net/equipmenthandler.cpp @@ -117,6 +117,7 @@ void EquipmentHandler::handleMessage(MessageIn *msg) position++; } logger->log("Position %i", position); + item = player_node->getInventory()->getItem(player_node->mEquipment->getEquipment(position)); // Unequip any existing equipped item in this position @@ -155,6 +156,7 @@ void EquipmentHandler::handleMessage(MessageIn *msg) break; item->setEquipped(false); + if (equipPoint & 0x8000) { // Arrows player_node->mEquipment->setArrows(0); } @@ -176,6 +178,7 @@ void EquipmentHandler::handleMessage(MessageIn *msg) break; item = inventory->getItem(index); + if (item) { item->setEquipped(true); player_node->mEquipment->setArrows(index); diff --git a/src/net/loginhandler.cpp b/src/net/loginhandler.cpp index 9a7aaabd..2b98e4e4 100644 --- a/src/net/loginhandler.cpp +++ b/src/net/loginhandler.cpp @@ -48,11 +48,11 @@ void LoginHandler::handleMessage(MessageIn *msg) { case 0x0063: int len; - - len = msg->readInt16() - 4; + + len = msg->readInt16() - 4; mUpdateHost = msg->readString(len); - logger->log("Received update host \"%s\" from login server", + logger->log("Received update host \"%s\" from login server", mUpdateHost.c_str()); break; @@ -107,10 +107,12 @@ void LoginHandler::handleMessage(MessageIn *msg) errorMessage = "Rejected from server"; break; case 4: - errorMessage = "You have been blocked by the GM Team"; + + errorMessage = "You have been permanently banned from the game. Please contact the GM Team"; break; case 6: - errorMessage = "You have been temporarily banned from the game until " + msg->readString(20) + ".\n Please contact the GM team"; + errorMessage = "You have been temporarily banned from the game until " + + msg->readString(20) + ".\n Please contact the GM team via the forums"; break; case 9: errorMessage = "This user name is already taken"; diff --git a/src/net/loginhandler.h b/src/net/loginhandler.h index 1e087619..047434b4 100644 --- a/src/net/loginhandler.h +++ b/src/net/loginhandler.h @@ -25,6 +25,7 @@ #include <string> #include "messagehandler.h" +#include <string> struct LoginData; @@ -37,10 +38,8 @@ class LoginHandler : public MessageHandler void setLoginData(LoginData *loginData) { mLoginData = loginData; }; - protected: - LoginData *mLoginData; - private: + LoginData *mLoginData; std::string mUpdateHost; }; diff --git a/src/net/network.h b/src/net/network.h index 856808a2..43b4dbbc 100644 --- a/src/net/network.h +++ b/src/net/network.h @@ -27,9 +27,9 @@ #include <SDL_thread.h> #include <string> -#define TMW_CLIENT_PROTOCOL_VERSION 1 - /***< Protocol version, reported to the eAthena char and mapserver who - can adjust the protocol accordingly */ +#define TMW_CLIENT_PROTOCOL_VERSION 1 + /**< Protocol version, reported to the eAthena char and mapserver who + can adjust the protocol accordingly */ class MessageHandler; class MessageIn; diff --git a/src/net/playerhandler.cpp b/src/net/playerhandler.cpp index c8442a89..a4a2dcc9 100644 --- a/src/net/playerhandler.cpp +++ b/src/net/playerhandler.cpp @@ -133,7 +133,8 @@ void PlayerHandler::handleMessage(MessageIn *msg) player_node->stopAttack(); nearby = (engine->getCurrentMapName() == mapPath); - // Switch the actual map, deleting the previous one + + // Switch the actual map, deleting the previous one if necessary engine->changeMap(mapPath); current_npc = 0; diff --git a/src/net/protocol.h b/src/net/protocol.h index fabe6911..783283ba 100644 --- a/src/net/protocol.h +++ b/src/net/protocol.h @@ -27,6 +27,7 @@ *********************************/ #define SMSG_LOGIN_SUCCESS 0x0073 /**< Contains starting location */ #define SMSG_SERVER_PING 0x007f /**< Contains server tick */ +#define SMSG_UPDATE_HOST 0x0063 /**< Custom update host packet */ #define SMSG_PLAYER_UPDATE_1 0x01d8 #define SMSG_PLAYER_UPDATE_2 0x01d9 #define SMSG_PLAYER_MOVE 0x01da /**< A nearby player moves */ diff --git a/src/net/tradehandler.cpp b/src/net/tradehandler.cpp index 11fe2c19..746e1d06 100644 --- a/src/net/tradehandler.cpp +++ b/src/net/tradehandler.cpp @@ -127,7 +127,7 @@ void TradeHandler::handleMessage(MessageIn *msg) chatWindow->chatLog("Trade with " + tradePartnerName + " cancelled", BY_SERVER); // otherwise ignore silently - + tradeWindow->setVisible(false); player_node->setTrading(false); break; @@ -186,7 +186,7 @@ void TradeHandler::handleMessage(MessageIn *msg) "partner is over weighted.", BY_SERVER); break; - case 2: + case 2: // Add item failed - player has no free slot chatWindow->chatLog("Failed adding item. Trade " "partner has no free slot.", |