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/gui | |
parent | c0c8775271679ac4904bc0bc02a74d28fc75efd0 (diff) | |
download | mana-c7e7b62aa94bf295ca1dc556762ad6070221e0cd.tar.gz mana-c7e7b62aa94bf295ca1dc556762ad6070221e0cd.tar.bz2 mana-c7e7b62aa94bf295ca1dc556762ad6070221e0cd.tar.xz mana-c7e7b62aa94bf295ca1dc556762ad6070221e0cd.zip |
Switched client to use enet and modified login sequence to work with the new protocol from tmwserv.
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/buy.cpp | 10 | ||||
-rw-r--r-- | src/gui/char_select.cpp | 34 | ||||
-rw-r--r-- | src/gui/chat.cpp | 16 | ||||
-rw-r--r-- | src/gui/sell.cpp | 10 | ||||
-rw-r--r-- | src/gui/trade.cpp | 28 |
5 files changed, 49 insertions, 49 deletions
diff --git a/src/gui/buy.cpp b/src/gui/buy.cpp index 86bd5413..e96cc04f 100644 --- a/src/gui/buy.cpp +++ b/src/gui/buy.cpp @@ -216,11 +216,11 @@ void BuyDialog::action(const std::string& eventId) // there a better way to ensure this fails in an _obivous_ way in C++? else if (eventId == "buy" && (mAmountItems > 0 && mAmountItems <= mMaxItems)) { - MessageOut outMsg(mNetwork); - outMsg.writeInt16(CMSG_NPC_BUY_REQUEST); - outMsg.writeInt16(8); - outMsg.writeInt16(mAmountItems); - outMsg.writeInt16(mShopItems->at(selectedItem).id); + MessageOut outMsg; + outMsg.writeShort(CMSG_NPC_BUY_REQUEST); + outMsg.writeShort(8); + outMsg.writeShort(mAmountItems); + outMsg.writeShort(mShopItems->at(selectedItem).id); // update money ! mMoney -= mAmountItems * mShopItems->at(selectedItem).price; diff --git a/src/gui/char_select.cpp b/src/gui/char_select.cpp index 801b0ffe..e8aa84e0 100644 --- a/src/gui/char_select.cpp +++ b/src/gui/char_select.cpp @@ -207,9 +207,9 @@ void CharSelectDialog::updatePlayerInfo() void CharSelectDialog::attemptCharDelete() { // Request character deletion - MessageOut outMsg(mNetwork); - outMsg.writeInt16(0x0068); - outMsg.writeInt32(mCharInfo->getEntry()->mCharId); + MessageOut outMsg; + outMsg.writeShort(0x0068); + outMsg.writeLong(mCharInfo->getEntry()->mCharId); outMsg.writeString("a@a.com", 40); mCharInfo->lock(); } @@ -217,9 +217,9 @@ void CharSelectDialog::attemptCharDelete() void CharSelectDialog::attemptCharSelect() { // Request character selection - MessageOut outMsg(mNetwork); - outMsg.writeInt16(0x0066); - outMsg.writeInt8(mCharInfo->getPos()); + MessageOut outMsg; + outMsg.writeShort(0x0066); + outMsg.writeByte(mCharInfo->getPos()); mCharInfo->lock(); } @@ -326,16 +326,16 @@ std::string CharCreateDialog::getName() void CharCreateDialog::attemptCharCreate() { // Send character infos - MessageOut outMsg(mNetwork); - outMsg.writeInt16(0x0067); + MessageOut outMsg; + outMsg.writeShort(0x0067); outMsg.writeString(getName(), 24); - outMsg.writeInt8(5); - outMsg.writeInt8(5); - outMsg.writeInt8(5); - outMsg.writeInt8(5); - outMsg.writeInt8(5); - outMsg.writeInt8(5); - outMsg.writeInt8(mSlot); - outMsg.writeInt16(mPlayerBox->mHairColor + 1); - outMsg.writeInt16(mPlayerBox->mHairStyle + 1); + outMsg.writeByte(5); + outMsg.writeByte(5); + outMsg.writeByte(5); + outMsg.writeByte(5); + outMsg.writeByte(5); + outMsg.writeByte(5); + outMsg.writeByte(mSlot); + outMsg.writeShort(mPlayerBox->mHairColor + 1); + outMsg.writeShort(mPlayerBox->mHairStyle + 1); } diff --git a/src/gui/chat.cpp b/src/gui/chat.cpp index 64b56caf..870582df 100644 --- a/src/gui/chat.cpp +++ b/src/gui/chat.cpp @@ -261,9 +261,9 @@ ChatWindow::chatSend(const std::string &nick, std::string msg) if (msg.substr(0, IS_ANNOUNCE_LENGTH) == IS_ANNOUNCE) { msg.erase(0, IS_ANNOUNCE_LENGTH); - MessageOut outMsg(mNetwork); - outMsg.writeInt16(0x0099); - outMsg.writeInt16(msg.length() + 4); + MessageOut outMsg; + outMsg.writeShort(0x0099); + outMsg.writeShort(msg.length() + 4); outMsg.writeString(msg, msg.length()); } else if (msg.substr(0, IS_HELP_LENGTH) == IS_HELP) @@ -280,8 +280,8 @@ ChatWindow::chatSend(const std::string &nick, std::string msg) } else if (msg.substr(0, IS_WHO_LENGTH) == IS_WHO) { - MessageOut outMsg(mNetwork); - outMsg.writeInt16(0x00c1); + MessageOut outMsg; + outMsg.writeShort(0x00c1); } else { @@ -292,9 +292,9 @@ ChatWindow::chatSend(const std::string &nick, std::string msg) else { msg = nick + " : " + msg; - MessageOut outMsg(mNetwork); - outMsg.writeInt16(CMSG_CHAT_MESSAGE); - outMsg.writeInt16(msg.length() + 4); + MessageOut outMsg; + outMsg.writeShort(CMSG_CHAT_MESSAGE); + outMsg.writeShort(msg.length() + 4); outMsg.writeString(msg, msg.length()); } } diff --git a/src/gui/sell.cpp b/src/gui/sell.cpp index ec565ac3..0b7abf6f 100644 --- a/src/gui/sell.cpp +++ b/src/gui/sell.cpp @@ -213,11 +213,11 @@ void SellDialog::action(const std::string& eventId) // Attempt sell assert(mAmountItems > 0 && mAmountItems <= mMaxItems); - MessageOut outMsg(mNetwork); - outMsg.writeInt16(CMSG_NPC_SELL_REQUEST); - outMsg.writeInt16(8); - outMsg.writeInt16(mShopItems->at(selectedItem).index); - outMsg.writeInt16(mAmountItems); + MessageOut outMsg; + outMsg.writeShort(CMSG_NPC_SELL_REQUEST); + outMsg.writeShort(8); + outMsg.writeShort(mShopItems->at(selectedItem).index); + outMsg.writeShort(mAmountItems); mMaxItems -= mAmountItems; mAmountItems = 0; diff --git a/src/gui/trade.cpp b/src/gui/trade.cpp index 9b98fa09..4efdb06c 100644 --- a/src/gui/trade.cpp +++ b/src/gui/trade.cpp @@ -215,10 +215,10 @@ void TradeWindow::receivedOk(bool own) void TradeWindow::tradeItem(Item *item, int quantity) { - MessageOut outMsg(mNetwork); - outMsg.writeInt16(CMSG_TRADE_ITEM_ADD_REQUEST); - outMsg.writeInt16(item->getInvIndex()); - outMsg.writeInt32(quantity); + MessageOut outMsg; + outMsg.writeShort(CMSG_TRADE_ITEM_ADD_REQUEST); + outMsg.writeShort(item->getInvIndex()); + outMsg.writeLong(quantity); } void TradeWindow::mouseClick(int x, int y, int button, int count) @@ -287,8 +287,8 @@ void TradeWindow::action(const std::string &eventId) } else if (eventId == "cancel") { - MessageOut outMsg(mNetwork); - outMsg.writeInt16(CMSG_TRADE_CANCEL_REQUEST); + MessageOut outMsg; + outMsg.writeShort(CMSG_TRADE_CANCEL_REQUEST); } else if (eventId == "ok") { @@ -298,20 +298,20 @@ void TradeWindow::action(const std::string &eventId) { mMoneyField->setText(toString(tempInt)); - MessageOut outMsg(mNetwork); - outMsg.writeInt16(CMSG_TRADE_ITEM_ADD_REQUEST); - outMsg.writeInt16(0); - outMsg.writeInt32(tempInt); + MessageOut outMsg; + outMsg.writeShort(CMSG_TRADE_ITEM_ADD_REQUEST); + outMsg.writeShort(0); + outMsg.writeLong(tempInt); } else { mMoneyField->setText(""); } mMoneyField->setEnabled(false); - MessageOut outMsg(mNetwork); - outMsg.writeInt16(CMSG_TRADE_ADD_COMPLETE); + MessageOut outMsg; + outMsg.writeShort(CMSG_TRADE_ADD_COMPLETE); } else if (eventId == "trade") { - MessageOut outMsg(mNetwork); - outMsg.writeInt16(CMSG_TRADE_OK); + MessageOut outMsg; + outMsg.writeShort(CMSG_TRADE_OK); } } |