diff options
author | Blue <bluesansdouze@gmail.com> | 2009-05-21 15:14:52 +0200 |
---|---|---|
committer | Blue <bluesansdouze@gmail.com> | 2009-05-21 15:14:52 +0200 |
commit | a9df0306b4949f10287657a229e1f8d33cfae5e9 (patch) | |
tree | b3dff4b9f36e12d1492d534943796017a955bc3e /src/net/ea | |
parent | 7b76f0e8c4c489254d7519e2916b951601423801 (diff) | |
parent | b85793ec89e57ae20140957f833a06b874eb3120 (diff) | |
download | mana-a9df0306b4949f10287657a229e1f8d33cfae5e9.tar.gz mana-a9df0306b4949f10287657a229e1f8d33cfae5e9.tar.bz2 mana-a9df0306b4949f10287657a229e1f8d33cfae5e9.tar.xz mana-a9df0306b4949f10287657a229e1f8d33cfae5e9.zip |
Merge branch 'master' of git@gitorious.org:tmw/mainline
Diffstat (limited to 'src/net/ea')
-rw-r--r-- | src/net/ea/buysellhandler.cpp | 10 | ||||
-rw-r--r-- | src/net/ea/charserverhandler.cpp | 6 | ||||
-rw-r--r-- | src/net/ea/chathandler.cpp | 6 | ||||
-rw-r--r-- | src/net/ea/inventoryhandler.cpp | 9 | ||||
-rw-r--r-- | src/net/ea/loginhandler.cpp | 2 | ||||
-rw-r--r-- | src/net/ea/playerhandler.cpp | 10 | ||||
-rw-r--r-- | src/net/ea/playerhandler.h | 6 | ||||
-rw-r--r-- | src/net/ea/tradehandler.cpp | 45 |
8 files changed, 51 insertions, 43 deletions
diff --git a/src/net/ea/buysellhandler.cpp b/src/net/ea/buysellhandler.cpp index ca155228..48e856e4 100644 --- a/src/net/ea/buysellhandler.cpp +++ b/src/net/ea/buysellhandler.cpp @@ -108,7 +108,7 @@ void BuySellHandler::handleMessage(MessageIn &msg) } else { - localChatTab->chatLog(_("Nothing to sell"), BY_SERVER); + localChatTab->chatLog(_("Nothing to sell."), BY_SERVER); current_npc = 0; } break; @@ -116,22 +116,22 @@ void BuySellHandler::handleMessage(MessageIn &msg) case SMSG_NPC_BUY_RESPONSE: if (msg.readInt8() == 0) { - localChatTab->chatLog(_("Thanks for buying"), BY_SERVER); + localChatTab->chatLog(_("Thanks for buying."), BY_SERVER); } else { // Reset player money since buy dialog already assumed purchase // would go fine buyDialog->setMoney(player_node->getMoney()); - localChatTab->chatLog(_("Unable to buy"), BY_SERVER); + localChatTab->chatLog(_("Unable to buy."), BY_SERVER); } break; case SMSG_NPC_SELL_RESPONSE: if (msg.readInt8() == 0) - localChatTab->chatLog(_("Thanks for selling"), BY_SERVER); + localChatTab->chatLog(_("Thanks for selling."), BY_SERVER); else - localChatTab->chatLog(_("Unable to sell"), BY_SERVER); + localChatTab->chatLog(_("Unable to sell."), BY_SERVER); break; } diff --git a/src/net/ea/charserverhandler.cpp b/src/net/ea/charserverhandler.cpp index b28961b6..77bfaa50 100644 --- a/src/net/ea/charserverhandler.cpp +++ b/src/net/ea/charserverhandler.cpp @@ -120,8 +120,8 @@ void CharServerHandler::handleMessage(MessageIn &msg) break; case SMSG_CHAR_CREATE_FAILED: - new OkDialog(_("Error"), _("Failed to create character. Most likely" - " the name is already taken.")); + new OkDialog(_("Error"), _("Failed to create character. Most " + "likely the name is already taken.")); if (mCharCreateDialog) mCharCreateDialog->unlock(); @@ -132,7 +132,7 @@ void CharServerHandler::handleMessage(MessageIn &msg) mCharInfo->setEntry(0); mCharInfo->unlock(); n_character--; - new OkDialog(_("Info"), _("Player deleted")); + new OkDialog(_("Info"), _("Character deleted.")); break; case SMSG_CHAR_DELETE_FAILED: diff --git a/src/net/ea/chathandler.cpp b/src/net/ea/chathandler.cpp index 09eca6f9..49f83e67 100644 --- a/src/net/ea/chathandler.cpp +++ b/src/net/ea/chathandler.cpp @@ -75,10 +75,12 @@ void ChatHandler::handleMessage(MessageIn &msg) //localChatTab->chatLog("Whisper sent", BY_SERVER); break; case 0x01: - localChatTab->chatLog(_("Whisper could not be sent, user is offline"), BY_SERVER); + localChatTab->chatLog(_("Whisper could not be sent, user " + "is offline."), BY_SERVER); break; case 0x02: - localChatTab->chatLog(_("Whisper could not be sent, ignored by user"), BY_SERVER); + localChatTab->chatLog(_("Whisper could not be sent, " + "ignored by user."), BY_SERVER); break; } break; diff --git a/src/net/ea/inventoryhandler.cpp b/src/net/ea/inventoryhandler.cpp index 30c583b8..e91a1c19 100644 --- a/src/net/ea/inventoryhandler.cpp +++ b/src/net/ea/inventoryhandler.cpp @@ -181,7 +181,10 @@ void InventoryHandler::handleMessage(MessageIn &msg) if (msg.readInt8() > 0) { if (config.getValue("showpickupchat", 1)) - localChatTab->chatLog(_("Unable to pick up item"), BY_SERVER); + { + localChatTab->chatLog(_("Unable to pick up item."), + BY_SERVER); + } } else { @@ -191,7 +194,7 @@ void InventoryHandler::handleMessage(MessageIn &msg) if (config.getValue("showpickupchat", 1)) { - localChatTab->chatLog(strprintf(_("You picked up %s [@@%d|%s@@]"), + localChatTab->chatLog(strprintf(_("You picked up %s [@@%d|%s@@]."), amountStr.c_str(), itemInfo.getId(), itemInfo.getName().c_str()), BY_SERVER); } @@ -237,7 +240,7 @@ void InventoryHandler::handleMessage(MessageIn &msg) amount = msg.readInt16(); if (msg.readInt8() == 0) { - localChatTab->chatLog(_("Failed to use item"), BY_SERVER); + localChatTab->chatLog(_("Failed to use item."), BY_SERVER); } else { if (Item *item = inventory->getItem(index)) item->setQuantity(amount); diff --git a/src/net/ea/loginhandler.cpp b/src/net/ea/loginhandler.cpp index 44eabe46..31d2c020 100644 --- a/src/net/ea/loginhandler.cpp +++ b/src/net/ea/loginhandler.cpp @@ -126,7 +126,7 @@ void LoginHandler::handleMessage(MessageIn &msg) case 6: errorMessage = strprintf(_("You have been temporarily " "banned from the game until " - "%s.\n Please contact the GM " + "%s.\nPlease contact the GM " "team via the forums."), msg.readString(20).c_str()); break; diff --git a/src/net/ea/playerhandler.cpp b/src/net/ea/playerhandler.cpp index b7131f0a..c1b7cc84 100644 --- a/src/net/ea/playerhandler.cpp +++ b/src/net/ea/playerhandler.cpp @@ -410,7 +410,7 @@ void PlayerHandler::handleMessage(MessageIn &msg) switch (type) { case 0: - localChatTab->chatLog(_("Equip arrows first"), + localChatTab->chatLog(_("Equip arrows first."), BY_SERVER); break; default: @@ -422,10 +422,10 @@ void PlayerHandler::handleMessage(MessageIn &msg) } } -void PlayerHandler::attack(Being *being) +void PlayerHandler::attack(int id) { MessageOut outMsg(CMSG_PLAYER_ATTACK); - outMsg.writeInt32(being->getId()); + outMsg.writeInt32(id); outMsg.writeInt8(0); } @@ -513,12 +513,12 @@ void PlayerHandler::respawn() outMsg.writeInt8(0); } -void PlayerHandler::ingorePlayer(const std::string &player, bool ignore) +void PlayerHandler::ignorePlayer(const std::string &player, bool ignore) { // TODO } -void PlayerHandler::ingoreAll(bool ignore) +void PlayerHandler::ignoreAll(bool ignore) { // TODO } diff --git a/src/net/ea/playerhandler.h b/src/net/ea/playerhandler.h index 94ae952f..5dbc171b 100644 --- a/src/net/ea/playerhandler.h +++ b/src/net/ea/playerhandler.h @@ -35,7 +35,7 @@ class PlayerHandler : public MessageHandler, public Net::PlayerHandler void handleMessage(MessageIn &msg); - void attack(Being *being); + void attack(int id); void emote(int emoteId); @@ -53,9 +53,9 @@ class PlayerHandler : public MessageHandler, public Net::PlayerHandler void respawn(); - void ingorePlayer(const std::string &player, bool ignore); + void ignorePlayer(const std::string &player, bool ignore); - void ingoreAll(bool ignore); + void ignoreAll(bool ignore); }; } // namespace EAthena diff --git a/src/net/ea/tradehandler.cpp b/src/net/ea/tradehandler.cpp index 74722332..4f045573 100644 --- a/src/net/ea/tradehandler.cpp +++ b/src/net/ea/tradehandler.cpp @@ -38,6 +38,7 @@ #include "gui/widgets/chattab.h" #include "utils/gettext.h" +#include "utils/stringutils.h" std::string tradePartnerName; @@ -88,7 +89,8 @@ void TradeHandler::handleMessage(MessageIn &msg) // special message about the player being occupied. tradePartnerName = msg.readString(24); - if (player_relations.hasPermission(tradePartnerName, PlayerRelation::TRADE)) + if (player_relations.hasPermission(tradePartnerName, + PlayerRelation::TRADE)) { if (!player_node->tradeRequestOk()) { @@ -98,9 +100,9 @@ void TradeHandler::handleMessage(MessageIn &msg) player_node->setTrading(true); ConfirmDialog *dlg; - dlg = new ConfirmDialog(_("Request for trade"), - tradePartnerName + - _(" wants to trade with you, do you accept?")); + dlg = new ConfirmDialog(_("Request for Trade"), + strprintf(_("%s wants to trade with you, do you " + "accept?"), tradePartnerName.c_str())); dlg->addActionListener(&listener); } else @@ -114,35 +116,36 @@ void TradeHandler::handleMessage(MessageIn &msg) switch (msg.readInt8()) { case 0: // Too far away - localChatTab->chatLog(_("Trading isn't possible. Trade partner is too far away."), - BY_SERVER); + localChatTab->chatLog(_("Trading isn't possible. Trade " + "partner is too far away."), BY_SERVER); break; case 1: // Character doesn't exist - localChatTab->chatLog(_("Trading isn't possible. Character doesn't exist."), - BY_SERVER); + localChatTab->chatLog(_("Trading isn't possible. Character " + "doesn't exist."), BY_SERVER); break; case 2: // Invite request check failed... - localChatTab->chatLog(_("Trade cancelled due to an unknown reason."), - BY_SERVER); + localChatTab->chatLog(_("Trade cancelled due to an unknown " + "reason."), BY_SERVER); break; case 3: // Trade accepted tradeWindow->reset(); - tradeWindow->setCaption( - _("Trade: You and ") + tradePartnerName); + tradeWindow->setCaption(strprintf(_("Trade: You and %s"), + tradePartnerName.c_str())); tradeWindow->setVisible(true); break; case 4: // Trade cancelled if (player_relations.hasPermission(tradePartnerName, PlayerRelation::SPEECH_LOG)) - localChatTab->chatLog(_("Trade with ") + tradePartnerName + - _(" cancelled"), BY_SERVER); + localChatTab->chatLog(strprintf(_("Trade with %s " + "cancelled."), tradePartnerName.c_str()), + BY_SERVER); // otherwise ignore silently tradeWindow->setVisible(false); player_node->setTrading(false); break; default: // Shouldn't happen as well, but to be sure - localChatTab->chatLog(_("Unhandled trade cancel packet"), + localChatTab->chatLog(_("Unhandled trade cancel packet."), BY_SERVER); break; } @@ -192,17 +195,17 @@ void TradeHandler::handleMessage(MessageIn &msg) break; case 1: // Add item failed - player overweighted - localChatTab->chatLog(_("Failed adding item. Trade partner is over weighted."), - BY_SERVER); + localChatTab->chatLog(_("Failed adding item. Trade " + "partner is over weighted."), BY_SERVER); break; case 2: // Add item failed - player has no free slot - localChatTab->chatLog(_("Failed adding item. Trade partner has no free slot."), - BY_SERVER); + localChatTab->chatLog(_("Failed adding item. Trade " + "partner has no free slot."), BY_SERVER); break; default: - localChatTab->chatLog(_("Failed adding item for unknown reason."), - BY_SERVER); + localChatTab->chatLog(_("Failed adding item for " + "unknown reason."), BY_SERVER); break; } } |