diff options
author | Björn Steinbrink <B.Steinbrink@gmx.de> | 2006-03-09 05:16:27 +0000 |
---|---|---|
committer | Björn Steinbrink <B.Steinbrink@gmx.de> | 2006-03-09 05:16:27 +0000 |
commit | e5f795ad9952b8bba6993ee3e324b22a0f104816 (patch) | |
tree | 1602ac0f74865135eae5acf935b0a285a8e918c2 /src/net | |
parent | 7593d6c71e2331c3e43c732db60ad03ee4d5385d (diff) | |
download | mana-e5f795ad9952b8bba6993ee3e324b22a0f104816.tar.gz mana-e5f795ad9952b8bba6993ee3e324b22a0f104816.tar.bz2 mana-e5f795ad9952b8bba6993ee3e324b22a0f104816.tar.xz mana-e5f795ad9952b8bba6993ee3e324b22a0f104816.zip |
Made all class members named like mClassMember.
Diffstat (limited to 'src/net')
-rw-r--r-- | src/net/beinghandler.cpp | 50 | ||||
-rw-r--r-- | src/net/buysellhandler.cpp | 2 | ||||
-rw-r--r-- | src/net/charserverhandler.cpp | 26 | ||||
-rw-r--r-- | src/net/maploginhandler.cpp | 4 | ||||
-rw-r--r-- | src/net/playerhandler.cpp | 142 |
5 files changed, 124 insertions, 100 deletions
diff --git a/src/net/beinghandler.cpp b/src/net/beinghandler.cpp index a01122d1..e95f785e 100644 --- a/src/net/beinghandler.cpp +++ b/src/net/beinghandler.cpp @@ -95,15 +95,15 @@ void BeingHandler::handleMessage(MessageIn *msg) { dstBeing->clearPath(); dstBeing->mFrame = 0; - dstBeing->walk_time = tick_time; - dstBeing->action = Being::STAND; + dstBeing->mWalkTime = tick_time; + dstBeing->mAction = Being::STAND; } // Prevent division by 0 when calculating frame if (speed == 0) { speed = 150; } dstBeing->setWalkSpeed(speed); - dstBeing->job = job; + dstBeing->mJob = job; dstBeing->setHairStyle(msg->readInt16()); dstBeing->setWeapon(msg->readInt16()); msg->readInt16(); // head option bottom @@ -131,15 +131,15 @@ void BeingHandler::handleMessage(MessageIn *msg) { Uint16 srcX, srcY, dstX, dstY; msg->readCoordinatePair(srcX, srcY, dstX, dstY); - dstBeing->action = Being::STAND; - dstBeing->x = srcX; - dstBeing->y = srcY; + dstBeing->mAction = Being::STAND; + dstBeing->mX = srcX; + dstBeing->mY = srcY; dstBeing->setDestination(dstX, dstY); } else { - msg->readCoordinates(dstBeing->x, dstBeing->y, - dstBeing->direction); + msg->readCoordinates(dstBeing->mX, dstBeing->mY, + dstBeing->mDirection); } msg->readInt8(); // unknown @@ -160,13 +160,13 @@ void BeingHandler::handleMessage(MessageIn *msg) switch (dstBeing->getType()) { case Being::MONSTER: - dstBeing->action = Being::MONSTER_DEAD; + dstBeing->mAction = Being::MONSTER_DEAD; dstBeing->mFrame = 0; - dstBeing->walk_time = tick_time; + dstBeing->mWalkTime = tick_time; break; default: - dstBeing->action = Being::DEAD; + dstBeing->mAction = Being::DEAD; break; } } @@ -205,27 +205,27 @@ void BeingHandler::handleMessage(MessageIn *msg) // buggy if (srcBeing->getType() == Being::MONSTER) { - srcBeing->action = Being::MONSTER_ATTACK; + srcBeing->mAction = Being::MONSTER_ATTACK; } else { - srcBeing->action = Being::ATTACK; + srcBeing->mAction = Being::ATTACK; } srcBeing->mFrame = 0; - srcBeing->walk_time = tick_time; + srcBeing->mWalkTime = tick_time; } break; case 2: // Sit if (srcBeing == NULL) break; srcBeing->mFrame = 0; - srcBeing->action = Being::SIT; + srcBeing->mAction = Being::SIT; break; case 3: // Stand up if (srcBeing == NULL) break; srcBeing->mFrame = 0; - srcBeing->action = Being::STAND; + srcBeing->mAction = Being::STAND; break; } break; @@ -246,8 +246,8 @@ void BeingHandler::handleMessage(MessageIn *msg) break; } - dstBeing->emotion = msg->readInt8(); - dstBeing->emotion_time = EMOTION_TIME; + dstBeing->mEmotion = msg->readInt8(); + dstBeing->mEmotionTime = EMOTION_TIME; break; case SMSG_BEING_CHANGE_LOOKS: @@ -298,7 +298,7 @@ void BeingHandler::handleMessage(MessageIn *msg) } dstBeing->setWalkSpeed(speed); - dstBeing->job = job; + dstBeing->mJob = job; dstBeing->setHairStyle(msg->readInt16()); dstBeing->setWeaponById(msg->readInt16()); // item id 1 msg->readInt16(); // item id 2 @@ -324,14 +324,14 @@ void BeingHandler::handleMessage(MessageIn *msg) { Uint16 srcX, srcY, dstX, dstY; msg->readCoordinatePair(srcX, srcY, dstX, dstY); - dstBeing->x = srcX; - dstBeing->y = srcY; + dstBeing->mX = srcX; + dstBeing->mY = srcY; dstBeing->setDestination(dstX, dstY); } else { - msg->readCoordinates(dstBeing->x, dstBeing->y, - dstBeing->direction); + msg->readCoordinates(dstBeing->mX, dstBeing->mY, + dstBeing->mDirection); } msg->readInt8(); // unknown @@ -341,7 +341,7 @@ void BeingHandler::handleMessage(MessageIn *msg) { if (msg->readInt8() == 2) { - dstBeing->action = Being::SIT; + dstBeing->mAction = Being::SIT; } } else if (msg->getId() == SMSG_PLAYER_MOVE) @@ -352,7 +352,7 @@ void BeingHandler::handleMessage(MessageIn *msg) msg->readInt8(); // Lv msg->readInt8(); // unknown - dstBeing->walk_time = tick_time; + dstBeing->mWalkTime = tick_time; dstBeing->mFrame = 0; break; diff --git a/src/net/buysellhandler.cpp b/src/net/buysellhandler.cpp index 501762ad..b10c7ab9 100644 --- a/src/net/buysellhandler.cpp +++ b/src/net/buysellhandler.cpp @@ -72,7 +72,7 @@ void BuySellHandler::handleMessage(MessageIn *msg) msg->readInt16(); // length n_items = (msg->getLength() - 4) / 11; buyDialog->reset(); - buyDialog->setMoney(player_node->gp); + buyDialog->setMoney(player_node->mGp); buyDialog->setVisible(true); for (int k = 0; k < n_items; k++) diff --git a/src/net/charserverhandler.cpp b/src/net/charserverhandler.cpp index 015c9d94..55bfa0c6 100644 --- a/src/net/charserverhandler.cpp +++ b/src/net/charserverhandler.cpp @@ -165,22 +165,22 @@ LocalPlayer* CharServerHandler::readPlayerData(MessageIn *msg, int &slot) LocalPlayer *tempPlayer = new LocalPlayer(mLoginData->account_ID, 0, NULL); tempPlayer->mCharId = msg->readInt32(); - tempPlayer->totalWeight = 0; - tempPlayer->maxWeight = 0; - tempPlayer->lastAttackTime = 0; - tempPlayer->xp = msg->readInt32(); - tempPlayer->gp = msg->readInt32(); - tempPlayer->jobXp = msg->readInt32(); - tempPlayer->jobLvl = msg->readInt32(); + tempPlayer->mTotalWeight = 0; + tempPlayer->mMaxWeight = 0; + tempPlayer->mLastAttackTime = 0; + tempPlayer->mXp = msg->readInt32(); + tempPlayer->mGp = msg->readInt32(); + tempPlayer->mJobXp = msg->readInt32(); + tempPlayer->mJobLevel = msg->readInt32(); msg->skip(8); // unknown msg->readInt32(); // option msg->readInt32(); // karma msg->readInt32(); // manner msg->skip(2); // unknown - tempPlayer->hp = msg->readInt16(); - tempPlayer->maxHp = msg->readInt16(); - tempPlayer->mp = msg->readInt16(); - tempPlayer->maxMp = msg->readInt16(); + tempPlayer->mHp = msg->readInt16(); + tempPlayer->mMaxHp = msg->readInt16(); + tempPlayer->mMp = msg->readInt16(); + tempPlayer->mMaxMp = msg->readInt16(); msg->readInt16(); // speed msg->readInt16(); // class tempPlayer->setHairStyle(msg->readInt16()); @@ -188,7 +188,7 @@ LocalPlayer* CharServerHandler::readPlayerData(MessageIn *msg, int &slot) if (weapon == 11) weapon = 2; tempPlayer->setWeapon(weapon); - tempPlayer->lvl = msg->readInt16(); + tempPlayer->mLevel = msg->readInt16(); msg->readInt16(); // skill point msg->readInt16(); // head bottom msg->readInt16(); // shield @@ -198,7 +198,7 @@ LocalPlayer* CharServerHandler::readPlayerData(MessageIn *msg, int &slot) msg->readInt16(); // unknown tempPlayer->setName(msg->readString(24)); for (int i = 0; i < 6; i++) { - tempPlayer->ATTR[i] = msg->readInt8(); + tempPlayer->mAttr[i] = msg->readInt8(); } slot = msg->readInt8(); // character slot msg->readInt8(); // unknown diff --git a/src/net/maploginhandler.cpp b/src/net/maploginhandler.cpp index 27a7b4c6..0afc8357 100644 --- a/src/net/maploginhandler.cpp +++ b/src/net/maploginhandler.cpp @@ -48,10 +48,10 @@ void MapLoginHandler::handleMessage(MessageIn *msg) { case SMSG_LOGIN_SUCCESS: msg->readInt32(); // server tick - msg->readCoordinates(player_node->x, player_node->y, direction); + msg->readCoordinates(player_node->mX, player_node->mY, direction); msg->skip(2); // unknown logger->log("Protocol: Player start position: (%d, %d), Direction: %d", - player_node->x, player_node->y, direction); + player_node->mX, player_node->mY, direction); state = GAME_STATE; break; diff --git a/src/net/playerhandler.cpp b/src/net/playerhandler.cpp index 7bf97b5f..02afc9db 100644 --- a/src/net/playerhandler.cpp +++ b/src/net/playerhandler.cpp @@ -106,11 +106,11 @@ void PlayerHandler::handleMessage(MessageIn *msg) current_npc = 0; - player_node->action = Being::STAND; + player_node->mAction = Being::STAND; player_node->stopAttack(); player_node->mFrame = 0; - player_node->x = x; - player_node->y = y; + player_node->mX = x; + player_node->mY = y; } break; @@ -124,19 +124,19 @@ void PlayerHandler::handleMessage(MessageIn *msg) //case 0x0000: // player_node->setWalkSpeed(msg->readInt32()); // break; - case 0x0005: player_node->hp = value; break; - case 0x0006: player_node->maxHp = value; break; - case 0x0007: player_node->mp = value; break; - case 0x0008: player_node->maxMp = value; break; - case 0x000b: player_node->lvl = value; break; + case 0x0005: player_node->mHp = value; break; + case 0x0006: player_node->mMaxHp = value; break; + case 0x0007: player_node->mMp = value; break; + case 0x0008: player_node->mMaxMp = value; break; + case 0x000b: player_node->mLevel = value; break; case 0x000c: - player_node->skillPoint = value; + player_node->mSkillPoint = value; skillDialog->update(); break; case 0x0018: - if (value >= player_node->maxWeight / 2 && - player_node->totalWeight < - player_node->maxWeight / 2) + if (value >= player_node->mMaxWeight / 2 && + player_node->mTotalWeight < + player_node->mMaxWeight / 2) { weightNotice = new OkDialog("Message", "You are carrying more then half your " @@ -144,12 +144,12 @@ void PlayerHandler::handleMessage(MessageIn *msg) "health."); weightNotice->addActionListener(&weightNoticeListener); } - player_node->totalWeight = value; + player_node->mTotalWeight = value; break; - case 0x0019: player_node->maxWeight = value; break; - case 0x0037: player_node->jobLvl = value; break; + case 0x0019: player_node->mMaxWeight = value; break; + case 0x0037: player_node->mJobLevel = value; break; case 0x0009: - player_node->statsPointsToAttribute = value; + player_node->mStatsPointsToAttribute = value; break; case 0x0029: player_node->ATK = value; break; case 0x002b: player_node->MATK = value; break; @@ -157,15 +157,15 @@ void PlayerHandler::handleMessage(MessageIn *msg) case 0x002f: player_node->MDEF = value; break; case 0x0031: player_node->HIT = value; break; case 0x0032: player_node->FLEE = value; break; - case 0x0035: player_node->aspd = value; break; + case 0x0035: player_node->mAttackSpeed = value; break; } - if (player_node->hp == 0 && deathNotice == NULL) + if (player_node->mHp == 0 && deathNotice == NULL) { deathNotice = new OkDialog("Message", "You're now dead, press ok to restart"); deathNotice->addActionListener(&deathNoticeListener); - player_node->action = Being::DEAD; + player_node->mAction = Being::DEAD; } } break; @@ -173,19 +173,19 @@ void PlayerHandler::handleMessage(MessageIn *msg) case SMSG_PLAYER_STAT_UPDATE_2: switch (msg->readInt16()) { case 0x0001: - player_node->xp = msg->readInt32(); + player_node->mXp = msg->readInt32(); break; case 0x0002: - player_node->jobXp = msg->readInt32(); + player_node->mJobXp = msg->readInt32(); break; case 0x0014: - player_node->gp = msg->readInt32(); + player_node->mGp = msg->readInt32(); break; case 0x0016: - player_node->xpForNextLevel = msg->readInt32(); + player_node->mXpForNextLevel = msg->readInt32(); break; case 0x0017: - player_node->jobXpForNextLevel = msg->readInt32(); + player_node->mJobXpForNextLevel = msg->readInt32(); break; } break; @@ -198,12 +198,18 @@ void PlayerHandler::handleMessage(MessageIn *msg) Sint32 total = base + bonus; switch (type) { - case 0x000d: player_node->ATTR[LocalPlayer::STR] = total; break; - case 0x000e: player_node->ATTR[LocalPlayer::AGI] = total; break; - case 0x000f: player_node->ATTR[LocalPlayer::VIT] = total; break; - case 0x0010: player_node->ATTR[LocalPlayer::INT] = total; break; - case 0x0011: player_node->ATTR[LocalPlayer::DEX] = total; break; - case 0x0012: player_node->ATTR[LocalPlayer::LUK] = total; break; + case 0x000d: player_node->mAttr[LocalPlayer::STR] = total; + break; + case 0x000e: player_node->mAttr[LocalPlayer::AGI] = total; + break; + case 0x000f: player_node->mAttr[LocalPlayer::VIT] = total; + break; + case 0x0010: player_node->mAttr[LocalPlayer::INT] = total; + break; + case 0x0011: player_node->mAttr[LocalPlayer::DEX] = total; + break; + case 0x0012: player_node->mAttr[LocalPlayer::LUK] = total; + break; } } break; @@ -214,35 +220,41 @@ void PlayerHandler::handleMessage(MessageIn *msg) Sint8 fail = msg->readInt8(); Sint8 value = msg->readInt8(); - if (fail == 1) - { - switch (type) { - case 0x000d: player_node->ATTR[LocalPlayer::STR] = value; break; - case 0x000e: player_node->ATTR[LocalPlayer::AGI] = value; break; - case 0x000f: player_node->ATTR[LocalPlayer::VIT] = value; break; - case 0x0010: player_node->ATTR[LocalPlayer::INT] = value; break; - case 0x0011: player_node->ATTR[LocalPlayer::DEX] = value; break; - case 0x0012: player_node->ATTR[LocalPlayer::LUK] = value; break; - } + if (fail != 1) + break; + + switch (type) { + case 0x000d: player_node->mAttr[LocalPlayer::STR] = value; + break; + case 0x000e: player_node->mAttr[LocalPlayer::AGI] = value; + break; + case 0x000f: player_node->mAttr[LocalPlayer::VIT] = value; + break; + case 0x0010: player_node->mAttr[LocalPlayer::INT] = value; + break; + case 0x0011: player_node->mAttr[LocalPlayer::DEX] = value; + break; + case 0x0012: player_node->mAttr[LocalPlayer::LUK] = value; + break; } } break; // Updates stats and status points case SMSG_PLAYER_STAT_UPDATE_5: - player_node->statsPointsToAttribute = msg->readInt16(); - player_node->ATTR[LocalPlayer::STR] = msg->readInt8(); - player_node->ATTR_UP[LocalPlayer::STR] = msg->readInt8(); - player_node->ATTR[LocalPlayer::AGI] = msg->readInt8(); - player_node->ATTR_UP[LocalPlayer::AGI] = msg->readInt8(); - player_node->ATTR[LocalPlayer::VIT] = msg->readInt8(); - player_node->ATTR_UP[LocalPlayer::VIT] = msg->readInt8(); - player_node->ATTR[LocalPlayer::INT] = msg->readInt8(); - player_node->ATTR_UP[LocalPlayer::INT] = msg->readInt8(); - player_node->ATTR[LocalPlayer::DEX] = msg->readInt8(); - player_node->ATTR_UP[LocalPlayer::DEX] = msg->readInt8(); - player_node->ATTR[LocalPlayer::LUK] = msg->readInt8(); - player_node->ATTR_UP[LocalPlayer::LUK] = msg->readInt8(); + player_node->mStatsPointsToAttribute = msg->readInt16(); + player_node->mAttr[LocalPlayer::STR] = msg->readInt8(); + player_node->mAttrUp[LocalPlayer::STR] = msg->readInt8(); + player_node->mAttr[LocalPlayer::AGI] = msg->readInt8(); + player_node->mAttrUp[LocalPlayer::AGI] = msg->readInt8(); + player_node->mAttr[LocalPlayer::VIT] = msg->readInt8(); + player_node->mAttrUp[LocalPlayer::VIT] = msg->readInt8(); + player_node->mAttr[LocalPlayer::INT] = msg->readInt8(); + player_node->mAttrUp[LocalPlayer::INT] = msg->readInt8(); + player_node->mAttr[LocalPlayer::DEX] = msg->readInt8(); + player_node->mAttrUp[LocalPlayer::DEX] = msg->readInt8(); + player_node->mAttr[LocalPlayer::LUK] = msg->readInt8(); + player_node->mAttrUp[LocalPlayer::LUK] = msg->readInt8(); player_node->ATK = msg->readInt16(); // ATK player_node->ATK_BONUS = msg->readInt16(); // ATK bonus player_node->MATK = msg->readInt16(); // MATK max @@ -260,12 +272,24 @@ void PlayerHandler::handleMessage(MessageIn *msg) case SMSG_PLAYER_STAT_UPDATE_6: switch (msg->readInt16()) { - case 0x0020: player_node->ATTR_UP[LocalPlayer::STR] = msg->readInt8(); break; - case 0x0021: player_node->ATTR_UP[LocalPlayer::AGI] = msg->readInt8(); break; - case 0x0022: player_node->ATTR_UP[LocalPlayer::VIT] = msg->readInt8(); break; - case 0x0023: player_node->ATTR_UP[LocalPlayer::INT] = msg->readInt8(); break; - case 0x0024: player_node->ATTR_UP[LocalPlayer::DEX] = msg->readInt8(); break; - case 0x0025: player_node->ATTR_UP[LocalPlayer::LUK] = msg->readInt8(); break; + case 0x0020: + player_node->mAttrUp[LocalPlayer::STR] = msg->readInt8(); + break; + case 0x0021: + player_node->mAttrUp[LocalPlayer::AGI] = msg->readInt8(); + break; + case 0x0022: + player_node->mAttrUp[LocalPlayer::VIT] = msg->readInt8(); + break; + case 0x0023: + player_node->mAttrUp[LocalPlayer::INT] = msg->readInt8(); + break; + case 0x0024: + player_node->mAttrUp[LocalPlayer::DEX] = msg->readInt8(); + break; + case 0x0025: + player_node->mAttrUp[LocalPlayer::LUK] = msg->readInt8(); + break; } break; |