diff options
author | Andrei Karas <akaras@inbox.ru> | 2012-07-15 18:37:00 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2012-07-15 18:37:00 +0300 |
commit | 65f11a2d85f26932b0e2f0679ddbfc6b6fc4b635 (patch) | |
tree | 493d6441dd152419908d28178c26112a4639e89f /src/net | |
parent | e1e411459e9c9aae819eee474d48d0cc20f6ca07 (diff) | |
download | manaplus-65f11a2d85f26932b0e2f0679ddbfc6b6fc4b635.tar.gz manaplus-65f11a2d85f26932b0e2f0679ddbfc6b6fc4b635.tar.bz2 manaplus-65f11a2d85f26932b0e2f0679ddbfc6b6fc4b635.tar.xz manaplus-65f11a2d85f26932b0e2f0679ddbfc6b6fc4b635.zip |
Fix code style.
Diffstat (limited to 'src/net')
-rw-r--r-- | src/net/ea/buysellhandler.cpp | 4 | ||||
-rw-r--r-- | src/net/ea/inventoryhandler.cpp | 4 | ||||
-rw-r--r-- | src/net/ea/playerhandler.cpp | 78 | ||||
-rw-r--r-- | src/net/eathena/buysellhandler.cpp | 2 | ||||
-rw-r--r-- | src/net/eathena/charserverhandler.cpp | 14 | ||||
-rw-r--r-- | src/net/eathena/generalhandler.cpp | 16 | ||||
-rw-r--r-- | src/net/eathena/playerhandler.cpp | 2 | ||||
-rw-r--r-- | src/net/tmwa/buysellhandler.cpp | 2 | ||||
-rw-r--r-- | src/net/tmwa/charserverhandler.cpp | 14 | ||||
-rw-r--r-- | src/net/tmwa/generalhandler.cpp | 16 | ||||
-rw-r--r-- | src/net/tmwa/playerhandler.cpp | 2 |
11 files changed, 77 insertions, 77 deletions
diff --git a/src/net/ea/buysellhandler.cpp b/src/net/ea/buysellhandler.cpp index 5208f34fc..46292bae5 100644 --- a/src/net/ea/buysellhandler.cpp +++ b/src/net/ea/buysellhandler.cpp @@ -144,7 +144,7 @@ void BuySellHandler::processNpcSell(Net::MessageIn &msg, int offset) if (n_items > 0) { SellDialog *dialog = new SellDialog(mNpcId); - dialog->setMoney(PlayerInfo::getAttribute(MONEY)); + dialog->setMoney(PlayerInfo::getAttribute(PlayerInfo::MONEY)); for (int k = 0; k < n_items; k++) { @@ -175,7 +175,7 @@ void BuySellHandler::processNpcBuyResponse(Net::MessageIn &msg) // Reset player money since buy dialog already assumed purchase // would go fine if (mBuyDialog) - mBuyDialog->setMoney(PlayerInfo::getAttribute(MONEY)); + mBuyDialog->setMoney(PlayerInfo::getAttribute(PlayerInfo::MONEY)); SERVER_NOTICE(_("Unable to buy.")) } } diff --git a/src/net/ea/inventoryhandler.cpp b/src/net/ea/inventoryhandler.cpp index a03ea45af..b194afd0d 100644 --- a/src/net/ea/inventoryhandler.cpp +++ b/src/net/ea/inventoryhandler.cpp @@ -590,8 +590,8 @@ void InventoryHandler::processPlayerAttackRange(Net::MessageIn &msg) int range = msg.readInt16(); if (player_node) player_node->setAttackRange(range); - PlayerInfo::setStatBase(ATTACK_RANGE, range); - PlayerInfo::setStatMod(ATTACK_RANGE, 0); + PlayerInfo::setStatBase(PlayerInfo::ATTACK_RANGE, range); + PlayerInfo::setStatMod(PlayerInfo::ATTACK_RANGE, 0); } void InventoryHandler::processPlayerArrowEquip(Net::MessageIn &msg) diff --git a/src/net/ea/playerhandler.cpp b/src/net/ea/playerhandler.cpp index b31f9aa2f..4c6e894c9 100644 --- a/src/net/ea/playerhandler.cpp +++ b/src/net/ea/playerhandler.cpp @@ -274,12 +274,12 @@ void PlayerHandler::processPlayerStatUpdate1(Net::MessageIn &msg) case 0x0000: player_node->setWalkSpeed(Vector(static_cast<float>( value), static_cast<float>(value), 0)); - PlayerInfo::setStatBase(WALK_SPEED, value); - PlayerInfo::setStatMod(WALK_SPEED, 0); + PlayerInfo::setStatBase(PlayerInfo::WALK_SPEED, value); + PlayerInfo::setStatMod(PlayerInfo::WALK_SPEED, 0); break; case 0x0004: break; // manner case 0x0005: - PlayerInfo::setAttribute(HP, value); + PlayerInfo::setAttribute(PlayerInfo::HP, value); if (player_node->isInParty() && Party::getParty(1)) { PartyMember *m = Party::getParty(1) @@ -287,12 +287,12 @@ void PlayerHandler::processPlayerStatUpdate1(Net::MessageIn &msg) if (m) { m->setHp(value); - m->setMaxHp(PlayerInfo::getAttribute(MAX_HP)); + m->setMaxHp(PlayerInfo::getAttribute(PlayerInfo::MAX_HP)); } } break; case 0x0006: - PlayerInfo::setAttribute(MAX_HP, value); + PlayerInfo::setAttribute(PlayerInfo::MAX_HP, value); if (player_node->isInParty() && Party::getParty(1)) { @@ -300,22 +300,22 @@ void PlayerHandler::processPlayerStatUpdate1(Net::MessageIn &msg) player_node->getId()); if (m) { - m->setHp(PlayerInfo::getAttribute(HP)); + m->setHp(PlayerInfo::getAttribute(PlayerInfo::HP)); m->setMaxHp(value); } } break; case 0x0007: - PlayerInfo::setAttribute(MP, value); + PlayerInfo::setAttribute(PlayerInfo::MP, value); break; case 0x0008: - PlayerInfo::setAttribute(MAX_MP, value); + PlayerInfo::setAttribute(PlayerInfo::MAX_MP, value); break; case 0x0009: - PlayerInfo::setAttribute(CHAR_POINTS, value); + PlayerInfo::setAttribute(PlayerInfo::CHAR_POINTS, value); break; case 0x000b: - PlayerInfo::setAttribute(LEVEL, value); + PlayerInfo::setAttribute(PlayerInfo::LEVEL, value); if (player_node) { player_node->setLevel(value); @@ -323,15 +323,17 @@ void PlayerHandler::processPlayerStatUpdate1(Net::MessageIn &msg) } break; case 0x000c: - PlayerInfo::setAttribute(SKILL_POINTS, value); + PlayerInfo::setAttribute(PlayerInfo::SKILL_POINTS, value); if (skillDialog) skillDialog->update(); break; case 0x0018: if (!weightNotice) { - const int max = PlayerInfo::getAttribute(MAX_WEIGHT) / 2; - const int total = PlayerInfo::getAttribute(TOTAL_WEIGHT); + const int max = PlayerInfo::getAttribute( + PlayerInfo::MAX_WEIGHT) / 2; + const int total = PlayerInfo::getAttribute( + PlayerInfo::TOTAL_WEIGHT); if (value >= max && total < max) { weightNoticeTime = cur_time + 5; @@ -353,10 +355,10 @@ void PlayerHandler::processPlayerStatUpdate1(Net::MessageIn &msg) &weightListener); } } - PlayerInfo::setAttribute(TOTAL_WEIGHT, value); + PlayerInfo::setAttribute(PlayerInfo::TOTAL_WEIGHT, value); break; case 0x0019: - PlayerInfo::setAttribute(MAX_WEIGHT, value); + PlayerInfo::setAttribute(PlayerInfo::MAX_WEIGHT, value); break; case 0x0029: @@ -406,8 +408,8 @@ void PlayerHandler::processPlayerStatUpdate1(Net::MessageIn &msg) case 0x0035: player_node->setAttackSpeed(value); - PlayerInfo::setStatBase(ATTACK_DELAY, value); - PlayerInfo::setStatMod(ATTACK_DELAY, 0); + PlayerInfo::setStatBase(PlayerInfo::ATTACK_DELAY, value); + PlayerInfo::setStatMod(PlayerInfo::ATTACK_DELAY, 0); PlayerInfo::updateAttrs(); break; @@ -425,7 +427,7 @@ void PlayerHandler::processPlayerStatUpdate1(Net::MessageIn &msg) break; } - if (PlayerInfo::getAttribute(HP) == 0 && !deathNotice) + if (PlayerInfo::getAttribute(PlayerInfo::HP) == 0 && !deathNotice) { deathNotice = new OkDialog(_("Message"), randomDeathMessage(), DIALOG_OK, false); @@ -440,7 +442,7 @@ void PlayerHandler::processPlayerStatUpdate2(Net::MessageIn &msg) switch (type) { case 0x0001: - PlayerInfo::setAttribute(EXP, msg.readInt32()); + PlayerInfo::setAttribute(PlayerInfo::EXP, msg.readInt32()); break; case 0x0002: PlayerInfo::setStatExperience(EA_JOB, msg.readInt32(), @@ -448,26 +450,24 @@ void PlayerHandler::processPlayerStatUpdate2(Net::MessageIn &msg) break; case 0x0014: { - int oldMoney = PlayerInfo::getAttribute(MONEY); - int newMoney = msg.readInt32(); - if (newMoney > oldMoney) - { - SERVER_NOTICE(strprintf(_("You picked up %s."), - Units::formatCurrency(newMoney - - oldMoney).c_str())) - } - else if (newMoney < oldMoney) - { - SERVER_NOTICE(strprintf(_("You spent %s."), - Units::formatCurrency(oldMoney - - newMoney).c_str())) - } + int oldMoney = PlayerInfo::getAttribute(PlayerInfo::MONEY); + int newMoney = msg.readInt32(); + if (newMoney > oldMoney) + { + SERVER_NOTICE(strprintf(_("You picked up %s."), + Units::formatCurrency(newMoney - oldMoney).c_str())) + } + else if (newMoney < oldMoney) + { + SERVER_NOTICE(strprintf(_("You spent %s."), + Units::formatCurrency(oldMoney - newMoney).c_str())) + } - PlayerInfo::setAttribute(MONEY, newMoney); + PlayerInfo::setAttribute(PlayerInfo::MONEY, newMoney); break; } case 0x0016: - PlayerInfo::setAttribute(EXP_NEEDED, msg.readInt32()); + PlayerInfo::setAttribute(PlayerInfo::EXP_NEEDED, msg.readInt32()); break; case 0x0017: PlayerInfo::setStatExperience(EA_JOB, @@ -488,7 +488,7 @@ void PlayerHandler::processPlayerStatUpdate3(Net::MessageIn &msg) PlayerInfo::setStatBase(type, base, false); PlayerInfo::setStatMod(type, bonus); - if (type == EA_ATK || type == ATTACK_DELAY) + if (type == EA_ATK || type == PlayerInfo::ATTACK_DELAY) PlayerInfo::updateAttrs(); } @@ -501,9 +501,9 @@ void PlayerHandler::processPlayerStatUpdate4(Net::MessageIn &msg) if (ok != 1) { int oldValue = PlayerInfo::getStatBase(type); - int points = PlayerInfo::getAttribute(CHAR_POINTS); + int points = PlayerInfo::getAttribute(PlayerInfo::CHAR_POINTS); points += oldValue - value; - PlayerInfo::setAttribute(CHAR_POINTS, points); + PlayerInfo::setAttribute(PlayerInfo::CHAR_POINTS, points); SERVER_NOTICE(_("Cannot raise skill!")) } @@ -512,7 +512,7 @@ void PlayerHandler::processPlayerStatUpdate4(Net::MessageIn &msg) void PlayerHandler::processPlayerStatUpdate5(Net::MessageIn &msg) { - PlayerInfo::setAttribute(CHAR_POINTS, msg.readInt16()); + PlayerInfo::setAttribute(PlayerInfo::CHAR_POINTS, msg.readInt16()); int val = msg.readInt8(); PlayerInfo::setStatBase(EA_STR, val); diff --git a/src/net/eathena/buysellhandler.cpp b/src/net/eathena/buysellhandler.cpp index bc53daeff..785338373 100644 --- a/src/net/eathena/buysellhandler.cpp +++ b/src/net/eathena/buysellhandler.cpp @@ -108,7 +108,7 @@ void BuySellHandler::processNpcBuy(Net::MessageIn &msg) int sz = 11; int n_items = (msg.getLength() - 4) / sz; mBuyDialog = new BuyDialog(mNpcId); - mBuyDialog->setMoney(PlayerInfo::getAttribute(MONEY)); + mBuyDialog->setMoney(PlayerInfo::getAttribute(PlayerInfo::MONEY)); for (int k = 0; k < n_items; k++) { diff --git a/src/net/eathena/charserverhandler.cpp b/src/net/eathena/charserverhandler.cpp index c2c5f1ebf..2348e0a67 100644 --- a/src/net/eathena/charserverhandler.cpp +++ b/src/net/eathena/charserverhandler.cpp @@ -176,8 +176,8 @@ void CharServerHandler::readPlayerData(Net::MessageIn &msg, tempPlayer->setGender(token.sex); PlayerInfoBackend &data = character->data; - data.mAttributes[EXP] = msg.readInt32(); - data.mAttributes[MONEY] = msg.readInt32(); + data.mAttributes[PlayerInfo::EXP] = msg.readInt32(); + data.mAttributes[PlayerInfo::MONEY] = msg.readInt32(); data.mStats[JOB].exp = msg.readInt32(); int temp = msg.readInt32(); @@ -194,10 +194,10 @@ void CharServerHandler::readPlayerData(Net::MessageIn &msg, msg.readInt32(); // manner msg.readInt16(); // character points left - data.mAttributes[HP] = msg.readInt16(); - data.mAttributes[MAX_HP] = msg.readInt16(); - data.mAttributes[MP] = msg.readInt16(); - data.mAttributes[MAX_MP] = msg.readInt16(); + data.mAttributes[PlayerInfo::HP] = msg.readInt16(); + data.mAttributes[PlayerInfo::MAX_HP] = msg.readInt16(); + data.mAttributes[PlayerInfo::MP] = msg.readInt16(); + data.mAttributes[PlayerInfo::MAX_MP] = msg.readInt16(); msg.readInt16(); // speed tempPlayer->setSubtype(msg.readInt16()); // class (used for race) @@ -205,7 +205,7 @@ void CharServerHandler::readPlayerData(Net::MessageIn &msg, uint16_t weapon = msg.readInt16(); // server not used it. may be need use? tempPlayer->setSprite(SPRITE_WEAPON, weapon, "", 1, true); - data.mAttributes[LEVEL] = msg.readInt16(); + data.mAttributes[PlayerInfo::LEVEL] = msg.readInt16(); msg.readInt16(); // skill point int bottomClothes = msg.readInt16(); diff --git a/src/net/eathena/generalhandler.cpp b/src/net/eathena/generalhandler.cpp index 3fce80ad2..76bb2cb36 100644 --- a/src/net/eathena/generalhandler.cpp +++ b/src/net/eathena/generalhandler.cpp @@ -278,14 +278,14 @@ void GeneralHandler::processEvent(Channels channel, statusWindow->addAttribute(FLEE, _("% Evade"), false, ""); // xgettext:no-c-format statusWindow->addAttribute(CRIT, _("% Critical"), false, ""); - statusWindow->addAttribute(ATTACK_DELAY, _("Attack Delay"), - false, ""); - statusWindow->addAttribute(WALK_SPEED, _("Walk Delay"), - false, ""); - statusWindow->addAttribute(ATTACK_RANGE, _("Attack Range"), - false, ""); - statusWindow->addAttribute(ATTACK_SPEED, _("Damage per sec."), - false, ""); + statusWindow->addAttribute(PlayerInfo::ATTACK_DELAY, + _("Attack Delay"), false, ""); + statusWindow->addAttribute(PlayerInfo::WALK_SPEED, + _("Walk Delay"), false, ""); + statusWindow->addAttribute(PlayerInfo::ATTACK_RANGE, + _("Attack Range"), false, ""); + statusWindow->addAttribute(PlayerInfo::ATTACK_SPEED, + _("Damage per sec."), false, ""); } else if (event.getName() == EVENT_GUIWINDOWSUNLOADING) { diff --git a/src/net/eathena/playerhandler.cpp b/src/net/eathena/playerhandler.cpp index dfce8812c..13a6ec018 100644 --- a/src/net/eathena/playerhandler.cpp +++ b/src/net/eathena/playerhandler.cpp @@ -149,7 +149,7 @@ void PlayerHandler::increaseAttribute(int attr) void PlayerHandler::increaseSkill(unsigned short skillId) { - if (PlayerInfo::getAttribute(SKILL_POINTS) <= 0) + if (PlayerInfo::getAttribute(PlayerInfo::SKILL_POINTS) <= 0) return; MessageOut outMsg(CMSG_SKILL_LEVELUP_REQUEST); diff --git a/src/net/tmwa/buysellhandler.cpp b/src/net/tmwa/buysellhandler.cpp index 664953e4e..aa0a07d9d 100644 --- a/src/net/tmwa/buysellhandler.cpp +++ b/src/net/tmwa/buysellhandler.cpp @@ -110,7 +110,7 @@ void BuySellHandler::processNpcBuy(Net::MessageIn &msg) sz += 1; int n_items = (msg.getLength() - 4) / sz; mBuyDialog = new BuyDialog(mNpcId); - mBuyDialog->setMoney(PlayerInfo::getAttribute(MONEY)); + mBuyDialog->setMoney(PlayerInfo::getAttribute(PlayerInfo::MONEY)); for (int k = 0; k < n_items; k++) { diff --git a/src/net/tmwa/charserverhandler.cpp b/src/net/tmwa/charserverhandler.cpp index 85ee3ce44..b851a5093 100644 --- a/src/net/tmwa/charserverhandler.cpp +++ b/src/net/tmwa/charserverhandler.cpp @@ -177,8 +177,8 @@ void CharServerHandler::readPlayerData(Net::MessageIn &msg, tempPlayer->setGender(token.sex); PlayerInfoBackend &data = character->data; - data.mAttributes[EXP] = msg.readInt32(); - data.mAttributes[MONEY] = msg.readInt32(); + data.mAttributes[PlayerInfo::EXP] = msg.readInt32(); + data.mAttributes[PlayerInfo::MONEY] = msg.readInt32(); data.mStats[JOB].exp = msg.readInt32(); int temp = msg.readInt32(); @@ -195,10 +195,10 @@ void CharServerHandler::readPlayerData(Net::MessageIn &msg, msg.readInt32(); // manner msg.readInt16(); // character points left - data.mAttributes[HP] = msg.readInt16(); - data.mAttributes[MAX_HP] = msg.readInt16(); - data.mAttributes[MP] = msg.readInt16(); - data.mAttributes[MAX_MP] = msg.readInt16(); + data.mAttributes[PlayerInfo::HP] = msg.readInt16(); + data.mAttributes[PlayerInfo::MAX_HP] = msg.readInt16(); + data.mAttributes[PlayerInfo::MP] = msg.readInt16(); + data.mAttributes[PlayerInfo::MAX_MP] = msg.readInt16(); msg.readInt16(); // speed tempPlayer->setSubtype(msg.readInt16()); // class (used for race) @@ -206,7 +206,7 @@ void CharServerHandler::readPlayerData(Net::MessageIn &msg, uint16_t weapon = msg.readInt16(); // server not used it. may be need use? tempPlayer->setSprite(SPRITE_WEAPON, weapon, "", 1, true); - data.mAttributes[LEVEL] = msg.readInt16(); + data.mAttributes[PlayerInfo::LEVEL] = msg.readInt16(); msg.readInt16(); // skill point int bottomClothes = msg.readInt16(); diff --git a/src/net/tmwa/generalhandler.cpp b/src/net/tmwa/generalhandler.cpp index 9839dfe10..0006d724d 100644 --- a/src/net/tmwa/generalhandler.cpp +++ b/src/net/tmwa/generalhandler.cpp @@ -278,14 +278,14 @@ void GeneralHandler::processEvent(Channels channel, statusWindow->addAttribute(FLEE, _("% Evade"), false, ""); // xgettext:no-c-format statusWindow->addAttribute(CRIT, _("% Critical"), false, ""); - statusWindow->addAttribute(ATTACK_DELAY, _("Attack Delay"), - false, ""); - statusWindow->addAttribute(WALK_SPEED, _("Walk Delay"), - false, ""); - statusWindow->addAttribute(ATTACK_RANGE, _("Attack Range"), - false, ""); - statusWindow->addAttribute(ATTACK_SPEED, _("Damage per sec."), - false, ""); + statusWindow->addAttribute(PlayerInfo::ATTACK_DELAY, + _("Attack Delay"), false, ""); + statusWindow->addAttribute(PlayerInfo::WALK_SPEED, + _("Walk Delay"), false, ""); + statusWindow->addAttribute(PlayerInfo::ATTACK_RANGE, + _("Attack Range"), false, ""); + statusWindow->addAttribute(PlayerInfo::ATTACK_SPEED, + _("Damage per sec."), false, ""); } else if (event.getName() == EVENT_GUIWINDOWSUNLOADING) { diff --git a/src/net/tmwa/playerhandler.cpp b/src/net/tmwa/playerhandler.cpp index 5c0b8d950..92bfaef74 100644 --- a/src/net/tmwa/playerhandler.cpp +++ b/src/net/tmwa/playerhandler.cpp @@ -143,7 +143,7 @@ void PlayerHandler::increaseAttribute(int attr) void PlayerHandler::increaseSkill(unsigned short skillId) { - if (PlayerInfo::getAttribute(SKILL_POINTS) <= 0) + if (PlayerInfo::getAttribute(PlayerInfo::SKILL_POINTS) <= 0) return; MessageOut outMsg(CMSG_SKILL_LEVELUP_REQUEST); |