summaryrefslogtreecommitdiff
path: root/src/net/tradehandler.cpp
diff options
context:
space:
mode:
authorBjørn Lindeijer <bjorn@lindeijer.nl>2006-08-20 16:14:12 +0000
committerBjørn Lindeijer <bjorn@lindeijer.nl>2006-08-20 16:14:12 +0000
commit2fe42d32c6d368a66586c605cc1b38ee8d85ed1d (patch)
tree705a76dffde116ddbffb5cba9aa45e4b0700f280 /src/net/tradehandler.cpp
parent292f3e50a59b06bf129893b352466d7d54fa3d71 (diff)
downloadmana-2fe42d32c6d368a66586c605cc1b38ee8d85ed1d.tar.gz
mana-2fe42d32c6d368a66586c605cc1b38ee8d85ed1d.tar.bz2
mana-2fe42d32c6d368a66586c605cc1b38ee8d85ed1d.tar.xz
mana-2fe42d32c6d368a66586c605cc1b38ee8d85ed1d.zip
Changed MessageHandler::handleMessage to take a reference instead of a pointer.
Removed unused Packet class. Added stub for handling GPMSG_BEING_ENTER.
Diffstat (limited to 'src/net/tradehandler.cpp')
-rw-r--r--src/net/tradehandler.cpp26
1 files changed, 13 insertions, 13 deletions
diff --git a/src/net/tradehandler.cpp b/src/net/tradehandler.cpp
index b0baa5ea..2ebc160f 100644
--- a/src/net/tradehandler.cpp
+++ b/src/net/tradehandler.cpp
@@ -63,9 +63,9 @@ TradeHandler::TradeHandler()
handledMessages = _messages;
}
-void TradeHandler::handleMessage(MessageIn *msg)
+void TradeHandler::handleMessage(MessageIn &msg)
{
- switch (msg->getId())
+ switch (msg.getId())
{
case SMSG_TRADE_REQUEST:
// If a trade window or request window is already open, send a
@@ -81,7 +81,7 @@ void TradeHandler::handleMessage(MessageIn *msg)
}
player_node->setTrading(true);
- tradePartnerName = msg->readString(24);
+ tradePartnerName = msg.readString(24);
ConfirmDialog *dlg;
dlg = new ConfirmDialog("Request for trade",
tradePartnerName +
@@ -90,7 +90,7 @@ void TradeHandler::handleMessage(MessageIn *msg)
break;
case SMSG_TRADE_RESPONSE:
- switch (msg->readByte())
+ switch (msg.readByte())
{
case 0: // Too far away
chatWindow->chatLog("Trading isn't possible. "
@@ -126,11 +126,11 @@ void TradeHandler::handleMessage(MessageIn *msg)
case SMSG_TRADE_ITEM_ADD:
{
- Sint32 amount = msg->readLong();
- Sint16 type = msg->readShort();
- msg->readByte(); // identified flag
- msg->readByte(); // attribute
- msg->readByte(); // refine
+ Sint32 amount = msg.readLong();
+ Sint16 type = msg.readShort();
+ msg.readByte(); // identified flag
+ msg.readByte(); // attribute
+ msg.readByte(); // refine
// TODO: handle also identified, etc
if (type == 0) {
@@ -144,10 +144,10 @@ void TradeHandler::handleMessage(MessageIn *msg)
case SMSG_TRADE_ITEM_ADD_RESPONSE:
// Trade: New Item add response (was 0x00ea, now 01b1)
{
- Item *item = player_node->getInvItem(msg->readShort());
- Sint16 quantity = msg->readShort();
+ Item *item = player_node->getInvItem(msg.readShort());
+ Sint16 quantity = msg.readShort();
- switch (msg->readByte())
+ switch (msg.readByte())
{
case 0:
// Successfully added item
@@ -175,7 +175,7 @@ void TradeHandler::handleMessage(MessageIn *msg)
case SMSG_TRADE_OK:
// 0 means ok from myself, 1 means ok from other;
- tradeWindow->receivedOk(msg->readByte() == 0);
+ tradeWindow->receivedOk(msg.readByte() == 0);
break;
case SMSG_TRADE_CANCEL: