diff options
author | Eugenio Favalli <elvenprogrammer@gmail.com> | 2006-07-25 18:04:38 +0000 |
---|---|---|
committer | Eugenio Favalli <elvenprogrammer@gmail.com> | 2006-07-25 18:04:38 +0000 |
commit | c7e7b62aa94bf295ca1dc556762ad6070221e0cd (patch) | |
tree | 04f827df0df64a80e04a4115986609486d715237 /src/net/buysellhandler.cpp | |
parent | c0c8775271679ac4904bc0bc02a74d28fc75efd0 (diff) | |
download | mana-client-c7e7b62aa94bf295ca1dc556762ad6070221e0cd.tar.gz mana-client-c7e7b62aa94bf295ca1dc556762ad6070221e0cd.tar.bz2 mana-client-c7e7b62aa94bf295ca1dc556762ad6070221e0cd.tar.xz mana-client-c7e7b62aa94bf295ca1dc556762ad6070221e0cd.zip |
Switched client to use enet and modified login sequence to work with the new protocol from tmwserv.
Diffstat (limited to 'src/net/buysellhandler.cpp')
-rw-r--r-- | src/net/buysellhandler.cpp | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/src/net/buysellhandler.cpp b/src/net/buysellhandler.cpp index b10c7ab9..be636d94 100644 --- a/src/net/buysellhandler.cpp +++ b/src/net/buysellhandler.cpp @@ -65,11 +65,11 @@ void BuySellHandler::handleMessage(MessageIn *msg) sellDialog->setVisible(false); sellDialog->reset(); buySellDialog->setVisible(true); - current_npc = dynamic_cast<NPC*>(beingManager->findBeing(msg->readInt32())); + current_npc = dynamic_cast<NPC*>(beingManager->findBeing(msg->readLong())); break; case SMSG_NPC_BUY: - msg->readInt16(); // length + msg->readShort(); // length n_items = (msg->getLength() - 4) / 11; buyDialog->reset(); buyDialog->setMoney(player_node->mGp); @@ -77,16 +77,16 @@ void BuySellHandler::handleMessage(MessageIn *msg) for (int k = 0; k < n_items; k++) { - Sint32 value = msg->readInt32(); - msg->readInt32(); // DCvalue - msg->readInt8(); // type - Sint16 itemId = msg->readInt16(); + Sint32 value = msg->readLong(); + msg->readLong(); // DCvalue + msg->readByte(); // type + Sint16 itemId = msg->readShort(); buyDialog->addItem(itemId, value); } break; case SMSG_NPC_SELL: - msg->readInt16(); // length + msg->readShort(); // length n_items = (msg->getLength() - 4) / 10; if (n_items > 0) { sellDialog->reset(); @@ -94,9 +94,9 @@ void BuySellHandler::handleMessage(MessageIn *msg) for (int k = 0; k < n_items; k++) { - Sint16 index = msg->readInt16(); - Sint32 value = msg->readInt32(); - msg->readInt32(); // OCvalue + Sint16 index = msg->readShort(); + Sint32 value = msg->readLong(); + msg->readLong(); // OCvalue Item *item = player_node->getInvItem(index); if (item && !(item->isEquipped())) { @@ -111,7 +111,7 @@ void BuySellHandler::handleMessage(MessageIn *msg) break; case SMSG_NPC_BUY_RESPONSE: - if (msg->readInt8() == 0) { + if (msg->readByte() == 0) { chatWindow->chatLog("Thanks for buying", BY_SERVER); } else { chatWindow->chatLog("Unable to buy", BY_SERVER); @@ -119,7 +119,7 @@ void BuySellHandler::handleMessage(MessageIn *msg) break; case SMSG_NPC_SELL_RESPONSE: - if (msg->readInt8() == 0) { + if (msg->readByte() == 0) { chatWindow->chatLog("Thanks for selling", BY_SERVER); } else { chatWindow->chatLog("Unable to sell", BY_SERVER); |