summaryrefslogtreecommitdiff
path: root/src/net/tmwserv
diff options
context:
space:
mode:
Diffstat (limited to 'src/net/tmwserv')
-rw-r--r--src/net/tmwserv/beinghandler.cpp14
-rw-r--r--src/net/tmwserv/charserverhandler.cpp30
-rw-r--r--src/net/tmwserv/chathandler.cpp31
-rw-r--r--src/net/tmwserv/loginhandler.cpp40
-rw-r--r--src/net/tmwserv/partyhandler.cpp7
5 files changed, 66 insertions, 56 deletions
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..ad3ae49b 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, user2), 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..2af0e4cb 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;
}
}