diff options
Diffstat (limited to 'src/net')
-rw-r--r-- | src/net/ea/charserverhandler.cpp | 6 | ||||
-rw-r--r-- | src/net/ea/chathandler.cpp | 2 | ||||
-rw-r--r-- | src/net/ea/generalhandler.cpp | 14 | ||||
-rw-r--r-- | src/net/ea/loginhandler.cpp | 22 | ||||
-rw-r--r-- | src/net/ea/maphandler.cpp | 4 | ||||
-rw-r--r-- | src/net/ea/playerhandler.cpp | 3 | ||||
-rw-r--r-- | src/net/tmwserv/beinghandler.cpp | 14 | ||||
-rw-r--r-- | src/net/tmwserv/charserverhandler.cpp | 30 | ||||
-rw-r--r-- | src/net/tmwserv/chathandler.cpp | 31 | ||||
-rw-r--r-- | src/net/tmwserv/loginhandler.cpp | 40 | ||||
-rw-r--r-- | src/net/tmwserv/partyhandler.cpp | 7 |
11 files changed, 92 insertions, 81 deletions
diff --git a/src/net/ea/charserverhandler.cpp b/src/net/ea/charserverhandler.cpp index 762652a0..6fae1864 100644 --- a/src/net/ea/charserverhandler.cpp +++ b/src/net/ea/charserverhandler.cpp @@ -90,13 +90,13 @@ void CharServerHandler::handleMessage(MessageIn &msg) case SMSG_CHAR_LOGIN_ERROR: switch (msg.readInt8()) { case 0: - errorMessage = _("Access denied"); + errorMessage = _("Access denied."); break; case 1: - errorMessage = _("Cannot use this ID"); + errorMessage = _("Cannot use this ID."); break; default: - errorMessage = _("Unknown failure to select character"); + errorMessage = _("Unknown failure to select character."); break; } mCharInfo->unlock(); diff --git a/src/net/ea/chathandler.cpp b/src/net/ea/chathandler.cpp index 49f83e67..65f1db3c 100644 --- a/src/net/ea/chathandler.cpp +++ b/src/net/ea/chathandler.cpp @@ -166,7 +166,7 @@ void ChatHandler::handleMessage(MessageIn &msg) case SMSG_MVP: // Display MVP player msg.readInt32(); // id - localChatTab->chatLog("MVP player", BY_SERVER); + localChatTab->chatLog(_("MVP player."), BY_SERVER); break; } } diff --git a/src/net/ea/generalhandler.cpp b/src/net/ea/generalhandler.cpp index 0750ee86..1d500d62 100644 --- a/src/net/ea/generalhandler.cpp +++ b/src/net/ea/generalhandler.cpp @@ -117,26 +117,26 @@ void GeneralHandler::handleMessage(MessageIn &msg) switch (code) { case 0: - errorMessage = _("Authentication failed"); + errorMessage = _("Authentication failed."); break; case 1: - errorMessage = _("No servers available"); + errorMessage = _("No servers available."); break; case 2: if (state == STATE_GAME) errorMessage = _("Someone else is trying to use this " - "account"); + "account."); else - errorMessage = _("This account is already logged in"); + errorMessage = _("This account is already logged in."); break; case 3: - errorMessage = _("Speed hack detected"); + errorMessage = _("Speed hack detected."); break; case 8: - errorMessage = _("Duplicated login"); + errorMessage = _("Duplicated login."); break; default: - errorMessage = _("Unknown connection error"); + errorMessage = _("Unknown connection error."); break; } state = STATE_ERROR; diff --git a/src/net/ea/loginhandler.cpp b/src/net/ea/loginhandler.cpp index 54e31cf3..8e7187c0 100644 --- a/src/net/ea/loginhandler.cpp +++ b/src/net/ea/loginhandler.cpp @@ -76,13 +76,13 @@ void LoginHandler::handleMessage(MessageIn &msg) errorMessage = _("Account was not found. Please re-login."); break; case 2: - errorMessage = _("Old password incorrect"); + errorMessage = _("Old password incorrect."); break; case 3: - errorMessage = _("New password too short"); + errorMessage = _("New password too short."); break; default: - errorMessage = _("Unknown error"); + errorMessage = _("Unknown error."); break; } state = STATE_ACCOUNTCHANGE_ERROR; @@ -96,7 +96,7 @@ void LoginHandler::handleMessage(MessageIn &msg) len = msg.readInt16() - 4; mUpdateHost = msg.readString(len); - logger->log("Received update host \"%s\" from login server", + logger->log("Received update host \"%s\" from login server.", mUpdateHost.c_str()); break; @@ -139,21 +139,21 @@ void LoginHandler::handleMessage(MessageIn &msg) switch (code) { case 0: - errorMessage = _("Unregistered ID"); + errorMessage = _("Unregistered ID."); break; case 1: - errorMessage = _("Wrong password"); + errorMessage = _("Wrong password."); break; case 2: - errorMessage = _("Account expired"); + errorMessage = _("Account expired."); break; case 3: - errorMessage = _("Rejected from server"); + errorMessage = _("Rejected from server."); break; case 4: errorMessage = _("You have been permanently banned from " - "the game. Please contact the GM Team."); + "the game. Please contact the GM team."); break; case 6: errorMessage = strprintf(_("You have been temporarily " @@ -163,10 +163,10 @@ void LoginHandler::handleMessage(MessageIn &msg) msg.readString(20).c_str()); break; case 9: - errorMessage = _("This user name is already taken"); + errorMessage = _("This user name is already taken."); break; default: - errorMessage = _("Unknown error"); + errorMessage = _("Unknown error."); break; } state = STATE_ERROR; diff --git a/src/net/ea/maphandler.cpp b/src/net/ea/maphandler.cpp index 3036612e..c3c9437c 100644 --- a/src/net/ea/maphandler.cpp +++ b/src/net/ea/maphandler.cpp @@ -79,8 +79,8 @@ void MapHandler::handleMessage(MessageIn &msg) break; case SMSG_WHO_ANSWER: - localChatTab->chatLog("Online users: " + toString(msg.readInt32()), - BY_SERVER); + localChatTab->chatLog(strprintf(_("Online users: %d"), + msg.readInt32()), BY_SERVER); break; } } diff --git a/src/net/ea/playerhandler.cpp b/src/net/ea/playerhandler.cpp index edd58562..3e379d82 100644 --- a/src/net/ea/playerhandler.cpp +++ b/src/net/ea/playerhandler.cpp @@ -317,7 +317,8 @@ void PlayerHandler::handleMessage(MessageIn &msg) int curGp = player_node->getMoney(); player_node->setMoney(msg.readInt32()); if (player_node->getMoney() > curGp) - localChatTab->chatLog(strprintf(_("You picked up %s"), + localChatTab->chatLog(strprintf(_("You picked up " + "%s."), Units::formatCurrency(player_node->getMoney() - curGp).c_str()), BY_SERVER); } diff --git a/src/net/tmwserv/beinghandler.cpp b/src/net/tmwserv/beinghandler.cpp index 93f76ce7..acd6b62c 100644 --- a/src/net/tmwserv/beinghandler.cpp +++ b/src/net/tmwserv/beinghandler.cpp @@ -268,18 +268,22 @@ void BeingHandler::handleBeingActionChangeMessage(MessageIn &msg) static char const *const deadMsg[] = { _("You are dead."), - _("We regret to inform you that your character was killed in battle."), + _("We regret to inform you that your character was killed in " + "battle."), _("You are not that alive anymore."), _("The cold hands of the grim reaper are grabbing for your soul."), _("Game Over!"), - _("No, kids. Your character did not really die. It... err... went to a better place."), - _("Your plan of breaking your enemies weapon by bashing it with your throat failed."), + _("No, kids. Your character did not really die. It... err... " + "went to a better place."), + _("Your plan of breaking your enemies weapon by bashing it with " + "your throat failed."), _("I guess this did not run too well."), _("Do you want your possessions identified?"), // Nethack reference _("Sadly, no trace of you was ever found..."), // Secret of Mana reference _("Annihilated."), // Final Fantasy VI reference - _("Looks like you got your head handed to you."), //Earthbound reference - _("You screwed up again, dump your body down the tubes and get you another one.") // Leisure Suit Larry 1 Reference + _("Looks like you got your head handed to you."), // Earthbound reference + _("You screwed up again, dump your body down the tubes and get " + "you another one.") // Leisure Suit Larry 1 Reference }; std::string message(deadMsg[rand()%13]); diff --git a/src/net/tmwserv/charserverhandler.cpp b/src/net/tmwserv/charserverhandler.cpp index 010c49d5..0146babb 100644 --- a/src/net/tmwserv/charserverhandler.cpp +++ b/src/net/tmwserv/charserverhandler.cpp @@ -81,7 +81,7 @@ void CharServerHandler::handleMessage(MessageIn &msg) delete mCharInfo->getEntry(); mCharInfo->setEntry(0); mCharInfo->unlock(); - new OkDialog(_("Info"), _("Player deleted")); + new OkDialog(_("Info"), _("Player deleted.")); } // Character deletion failed else @@ -90,13 +90,13 @@ void CharServerHandler::handleMessage(MessageIn &msg) switch (errMsg) { case ERRMSG_NO_LOGIN: - errorMessage = _("Not logged in"); + errorMessage = _("Not logged in."); break; case ERRMSG_INVALID_ARGUMENT: - errorMessage = _("Selection out of range"); + errorMessage = _("Selection out of range."); break; default: - errorMessage = _("Unknown error"); + errorMessage = _("Unknown error."); } mCharInfo->unlock(); new OkDialog(_("Error"), errorMessage); @@ -135,37 +135,37 @@ void CharServerHandler::handleCharCreateResponse(MessageIn &msg) switch (errMsg) { case ERRMSG_NO_LOGIN: - errorMessage = _("Not logged in"); + errorMessage = _("Not logged in."); break; case CREATE_TOO_MUCH_CHARACTERS: - errorMessage = _("No empty slot"); + errorMessage = _("No empty slot."); break; case ERRMSG_INVALID_ARGUMENT: - errorMessage = _("Invalid name"); + errorMessage = _("Invalid name."); break; case CREATE_EXISTS_NAME: - errorMessage = _("Character's name already exists"); + errorMessage = _("Character's name already exists."); break; case CREATE_INVALID_HAIRSTYLE: - errorMessage = _("Invalid hairstyle"); + errorMessage = _("Invalid hairstyle."); break; case CREATE_INVALID_HAIRCOLOR: - errorMessage = _("Invalid hair color"); + errorMessage = _("Invalid hair color."); break; case CREATE_INVALID_GENDER: - errorMessage = _("Invalid gender"); + errorMessage = _("Invalid gender."); break; case CREATE_RAW_STATS_TOO_HIGH: - errorMessage = _("Character's stats are too high"); + errorMessage = _("Character's stats are too high."); break; case CREATE_RAW_STATS_TOO_LOW: - errorMessage = _("Character's stats are too low"); + errorMessage = _("Character's stats are too low."); break; case CREATE_RAW_STATS_EQUAL_TO_ZERO: - errorMessage = _("One stat is zero"); + errorMessage = _("One stat is zero."); break; default: - errorMessage = _("Unknown error"); + errorMessage = _("Unknown error."); break; } new OkDialog(_("Error"), errorMessage); diff --git a/src/net/tmwserv/chathandler.cpp b/src/net/tmwserv/chathandler.cpp index e2d09534..c95f6ac5 100644 --- a/src/net/tmwserv/chathandler.cpp +++ b/src/net/tmwserv/chathandler.cpp @@ -159,7 +159,7 @@ void ChatHandler::handleEnterChannelResponse(MessageIn &msg) std::string user; std::string userModes; - tab->chatLog("Players in this channel:", BY_CHANNEL); + tab->chatLog(_("Players in this channel:"), BY_CHANNEL); while(msg.getUnreadLength()) { user = msg.readString(); @@ -176,13 +176,13 @@ void ChatHandler::handleEnterChannelResponse(MessageIn &msg) } else { - localChatTab->chatLog("Error joining channel.", BY_SERVER); + localChatTab->chatLog(_("Error joining channel."), BY_SERVER); } } void ChatHandler::handleListChannelsResponse(MessageIn &msg) { - localChatTab->chatLog("Listing channels", BY_SERVER); + localChatTab->chatLog(_("Listing channels."), BY_SERVER); while(msg.getUnreadLength()) { std::string channelName = msg.readString(); @@ -194,7 +194,7 @@ void ChatHandler::handleListChannelsResponse(MessageIn &msg) channelName += numUsers.str(); localChatTab->chatLog(channelName, BY_SERVER); } - localChatTab->chatLog("End of channel list.", BY_SERVER); + localChatTab->chatLog(_("End of channel list."), BY_SERVER); } void ChatHandler::handlePrivateMessage(MessageIn &msg) @@ -237,7 +237,7 @@ void ChatHandler::handleListChannelUsersResponse(MessageIn &msg) std::string userNick; std::string userModes; Channel *channel = channelManager->findByName(channelName); - channel->getTab()->chatLog("Players in this channel:", BY_CHANNEL); + channel->getTab()->chatLog(_("Players in this channel:"), BY_CHANNEL); while(msg.getUnreadLength()) { userNick = msg.readString(); @@ -266,15 +266,18 @@ void ChatHandler::handleChannelEvent(MessageIn &msg) switch(eventId) { case CHAT_EVENT_NEW_PLAYER: - line += " entered the channel."; + channel->getTab()->chatLog(strprintf(_("%s entered the " + "channel."), line.c_str()), BY_CHANNEL); break; case CHAT_EVENT_LEAVING_PLAYER: - line += " left the channel."; + channel->getTab()->chatLog(strprintf(_("%s left the channel."), + line.c_str()), BY_CHANNEL); break; case CHAT_EVENT_TOPIC_CHANGE: - line = "Topic: " + line; + channel->getTab()->chatLog(strprintf(_("Topic: %s"), + line.c_str()), BY_CHANNEL); break; case CHAT_EVENT_MODE_CHANGE: @@ -284,7 +287,9 @@ void ChatHandler::handleChannelEvent(MessageIn &msg) std::string user1 = line.substr(0, first); std::string user2 = line.substr(first+1, second); std::string mode = line.substr(second+1, line.length()); - line = user1 + " has set mode " + mode + " on user " + user2; + channel->getTab()->chatLog(strprintf(_("%s has set mode %s " + "on user %s."), user1.c_str(), mode.c_str(), + user2.c_str()), BY_CHANNEL); } break; case CHAT_EVENT_KICKED_PLAYER: @@ -292,14 +297,14 @@ void ChatHandler::handleChannelEvent(MessageIn &msg) int first = line.find(":"); std::string user1 = line.substr(0, first); std::string user2 = line.substr(first+1, line.length()); - line = user1 + " has kicked " + user2; + channel->getTab()->chatLog(strprintf(_("%s has kicked %s."), + user1.c_str(), user2.c_str()), BY_CHANNEL); } break; default: - line = "Unknown channel event."; + channel->getTab()->chatLog(_("Unknown channel event."), + BY_CHANNEL); } - - channel->getTab()->chatLog(line, BY_CHANNEL); } } diff --git a/src/net/tmwserv/loginhandler.cpp b/src/net/tmwserv/loginhandler.cpp index 4f14a635..f728d831 100644 --- a/src/net/tmwserv/loginhandler.cpp +++ b/src/net/tmwserv/loginhandler.cpp @@ -77,16 +77,16 @@ void LoginHandler::handleMessage(MessageIn &msg) { switch (errMsg) { case ERRMSG_INVALID_ARGUMENT: - errorMessage = _("Wrong magic_token"); + errorMessage = _("Wrong magic_token."); break; case ERRMSG_FAILURE: - errorMessage = _("Already logged in"); + errorMessage = _("Already logged in."); break; case LOGIN_SERVER_FULL: - errorMessage = _("Server is full"); + errorMessage = _("Server is full."); break; default: - errorMessage = _("Unknown error"); + errorMessage = _("Unknown error."); break; } state = STATE_ERROR; @@ -107,16 +107,16 @@ void LoginHandler::handleMessage(MessageIn &msg) { switch (errMsg) { case ERRMSG_INVALID_ARGUMENT: - errorMessage = _("New password incorrect"); + errorMessage = _("New password incorrect."); break; case ERRMSG_FAILURE: - errorMessage = _("Old password incorrect"); + errorMessage = _("Old password incorrect."); break; case ERRMSG_NO_LOGIN: errorMessage = _("Account not connected. Please login first."); break; default: - errorMessage = _("Unknown error"); + errorMessage = _("Unknown error."); break; } state = STATE_ACCOUNTCHANGE_ERROR; @@ -137,10 +137,10 @@ void LoginHandler::handleMessage(MessageIn &msg) { switch (errMsg) { case ERRMSG_INVALID_ARGUMENT: - errorMessage = _("New email address incorrect"); + errorMessage = _("New email address incorrect."); break; case ERRMSG_FAILURE: - errorMessage = _("Old email address incorrect"); + errorMessage = _("Old email address incorrect."); break; case ERRMSG_NO_LOGIN: errorMessage = _("Account not connected. Please login first."); @@ -149,7 +149,7 @@ void LoginHandler::handleMessage(MessageIn &msg) errorMessage = _("The new email address already exists."); break; default: - errorMessage = _("Unknown error"); + errorMessage = _("Unknown error."); break; } state = STATE_ACCOUNTCHANGE_ERROR; @@ -173,19 +173,19 @@ void LoginHandler::handleLoginResponse(MessageIn &msg) { switch (errMsg) { case LOGIN_INVALID_VERSION: - errorMessage = _("Client version is too old"); + errorMessage = _("Client version is too old."); break; case ERRMSG_INVALID_ARGUMENT: - errorMessage = _("Wrong username or password"); + errorMessage = _("Wrong username or password."); break; case ERRMSG_FAILURE: - errorMessage = _("Already logged in"); + errorMessage = _("Already logged in."); break; case LOGIN_SERVER_FULL: - errorMessage = _("Server is full"); + errorMessage = _("Server is full."); break; default: - errorMessage = _("Unknown error"); + errorMessage = _("Unknown error."); break; } state = STATE_LOGIN_ERROR; @@ -205,19 +205,19 @@ void LoginHandler::handleRegisterResponse(MessageIn &msg) { switch (errMsg) { case REGISTER_INVALID_VERSION: - errorMessage = _("Client version is too old"); + errorMessage = _("Client version is too old."); break; case ERRMSG_INVALID_ARGUMENT: - errorMessage = _("Wrong username, password or email address"); + errorMessage = _("Wrong username, password or email address."); break; case REGISTER_EXISTS_USERNAME: - errorMessage = _("Username already exists"); + errorMessage = _("Username already exists."); break; case REGISTER_EXISTS_EMAIL: - errorMessage = _("Email address already exists"); + errorMessage = _("Email address already exists."); break; default: - errorMessage = _("Unknown error"); + errorMessage = _("Unknown error."); break; } state = STATE_LOGIN_ERROR; diff --git a/src/net/tmwserv/partyhandler.cpp b/src/net/tmwserv/partyhandler.cpp index 557a3a43..220d20c0 100644 --- a/src/net/tmwserv/partyhandler.cpp +++ b/src/net/tmwserv/partyhandler.cpp @@ -100,8 +100,8 @@ void PartyHandler::handleMessage(MessageIn &msg) int id = msg.readInt16(); // being id std::string name = msg.readString(); - localChatTab->chatLog(strprintf(_("%s joined the " - "party."), name.c_str())); + localChatTab->chatLog(strprintf(_("%s joined the party."), + name.c_str())); if (!player_node->isInParty()) player_node->setInParty(true); @@ -117,7 +117,8 @@ void PartyHandler::handleMessage(MessageIn &msg) case CPMSG_PARTY_REJECTED: { std::string name = msg.readString(); - localChatTab->chatLog(name + "rejected your invite."); + localChatTab->chatLog(strprintf(_("%s rejected your invite."), + name.c_str())); } break; } } |