diff options
author | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2006-08-20 16:14:12 +0000 |
---|---|---|
committer | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2006-08-20 16:14:12 +0000 |
commit | 2fe42d32c6d368a66586c605cc1b38ee8d85ed1d (patch) | |
tree | 705a76dffde116ddbffb5cba9aa45e4b0700f280 /src/net/charserverhandler.cpp | |
parent | 292f3e50a59b06bf129893b352466d7d54fa3d71 (diff) | |
download | mana-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/charserverhandler.cpp')
-rw-r--r-- | src/net/charserverhandler.cpp | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/src/net/charserverhandler.cpp b/src/net/charserverhandler.cpp index 2bf2c4b4..5a2be683 100644 --- a/src/net/charserverhandler.cpp +++ b/src/net/charserverhandler.cpp @@ -48,20 +48,20 @@ CharServerHandler::CharServerHandler() } void -CharServerHandler::handleMessage(MessageIn *msg) +CharServerHandler::handleMessage(MessageIn &msg) { int slot; LocalPlayer *tempPlayer; - switch (msg->getId()) + switch (msg.getId()) { case APMSG_CHAR_CREATE_RESPONSE: - handleCharCreateResponse(*msg); + handleCharCreateResponse(msg); break; case APMSG_CHAR_DELETE_RESPONSE: { - int errMsg = msg->readByte(); + int errMsg = msg.readByte(); // Character deletion successful if (errMsg == ERRMSG_OK) { @@ -101,7 +101,7 @@ CharServerHandler::handleMessage(MessageIn *msg) break; case APMSG_CHAR_SELECT_RESPONSE: - handleCharSelectResponse(*msg); + handleCharSelectResponse(msg); break; } } @@ -193,18 +193,18 @@ CharServerHandler::handleCharSelectResponse(MessageIn &msg) } LocalPlayer* -CharServerHandler::readPlayerData(MessageIn *msg, int &slot) +CharServerHandler::readPlayerData(MessageIn &msg, int &slot) { LocalPlayer *tempPlayer = new LocalPlayer(mLoginData->account_ID, 0, NULL); - slot = msg->readByte(); // character slot - tempPlayer->mName = msg->readString(); - tempPlayer->mSex = msg->readByte(); - tempPlayer->setHairStyle(msg->readByte()); - tempPlayer->setHairColor(msg->readByte()); - tempPlayer->mLevel = msg->readByte(); - tempPlayer->mMoney = msg->readShort(); + slot = msg.readByte(); // character slot + tempPlayer->mName = msg.readString(); + tempPlayer->mSex = msg.readByte(); + tempPlayer->setHairStyle(msg.readByte()); + tempPlayer->setHairColor(msg.readByte()); + tempPlayer->mLevel = msg.readByte(); + tempPlayer->mMoney = msg.readShort(); for (int i = 0; i < 6; i++) { - tempPlayer->mAttr[i] = msg->readByte(); + tempPlayer->mAttr[i] = msg.readByte(); } return tempPlayer; } |