develop
kaetemi 4 years ago
parent 298e912949
commit 52e3ca024f

@ -58,7 +58,7 @@ CGroupHTMLForum::~CGroupHTMLForum()
void CGroupHTMLForum::addHTTPGetParams (string &url, bool /*trustedDomain*/) void CGroupHTMLForum::addHTTPGetParams (string &url, bool /*trustedDomain*/)
{ {
ucstring user_name = UserEntity->getLoginName (); string user_name = UserEntity->getLoginName ();
const SGuild &guild = CGuildManager::getInstance()->getGuild(); const SGuild &guild = CGuildManager::getInstance()->getGuild();
string gname = guild.Name; string gname = guild.Name;
@ -76,7 +76,7 @@ void CGroupHTMLForum::addHTTPGetParams (string &url, bool /*trustedDomain*/)
url += ((url.find('?') != string::npos) ? "&" : "?") + url += ((url.find('?') != string::npos) ? "&" : "?") +
string("shard=") + toString(CharacterHomeSessionId) + string("shard=") + toString(CharacterHomeSessionId) +
string("&user_login=") + user_name.toString() + string("&user_login=") + user_name +
string("&forum=") + gname + string("&forum=") + gname +
string("&session_cookie=") + NetMngr.getLoginCookie().toString(); string("&session_cookie=") + NetMngr.getLoginCookie().toString();
} }
@ -90,14 +90,14 @@ void CGroupHTMLForum::addHTTPGetParams (string &url, bool /*trustedDomain*/)
void CGroupHTMLForum::addHTTPPostParams (SFormFields &formfields, bool /*trustedDomain*/) void CGroupHTMLForum::addHTTPPostParams (SFormFields &formfields, bool /*trustedDomain*/)
{ {
ucstring user_name = UserEntity->getLoginName (); string user_name = UserEntity->getLoginName ();
const SGuild &guild = CGuildManager::getInstance()->getGuild(); const SGuild &guild = CGuildManager::getInstance()->getGuild();
string gname = guild.Name; string gname = guild.Name;
if (!gname.empty()) if (!gname.empty())
{ {
formfields.add("shard", toString(CharacterHomeSessionId)); formfields.add("shard", toString(CharacterHomeSessionId));
formfields.add("user_login", user_name.toString()); formfields.add("user_login", user_name);
formfields.add("forum", gname); formfields.add("forum", gname);
formfields.add("session_cookie", NetMngr.getLoginCookie().toString()); formfields.add("session_cookie", NetMngr.getLoginCookie().toString());
} }

@ -57,10 +57,10 @@ CGroupHTMLMail::~CGroupHTMLMail()
void CGroupHTMLMail::addHTTPGetParams (string &url, bool /*trustedDomain*/) void CGroupHTMLMail::addHTTPGetParams (string &url, bool /*trustedDomain*/)
{ {
ucstring user_name = UserEntity->getLoginName (); string user_name = UserEntity->getLoginName ();
url += ((url.find('?') != string::npos) ? "&" : "?") + url += ((url.find('?') != string::npos) ? "&" : "?") +
string("shard=") + toString(CharacterHomeSessionId) + string("shard=") + toString(CharacterHomeSessionId) +
string("&user_login=") + user_name.toString() + string("&user_login=") + user_name + // FIXME: UrlEncode
string("&session_cookie=") + NetMngr.getLoginCookie().toString() + string("&session_cookie=") + NetMngr.getLoginCookie().toString() +
string("&lang=") + CI18N::getCurrentLanguageCode(); string("&lang=") + CI18N::getCurrentLanguageCode();
} }
@ -69,9 +69,9 @@ void CGroupHTMLMail::addHTTPGetParams (string &url, bool /*trustedDomain*/)
void CGroupHTMLMail::addHTTPPostParams (SFormFields &formfields, bool /*trustedDomain*/) void CGroupHTMLMail::addHTTPPostParams (SFormFields &formfields, bool /*trustedDomain*/)
{ {
ucstring user_name = UserEntity->getLoginName (); string user_name = UserEntity->getLoginName ();
formfields.add("shard", toString(CharacterHomeSessionId)); formfields.add("shard", toString(CharacterHomeSessionId));
formfields.add("user_login", user_name.toString()); formfields.add("user_login", user_name); // FIXME: UrlEncode
formfields.add("session_cookie", NetMngr.getLoginCookie().toString()); formfields.add("session_cookie", NetMngr.getLoginCookie().toString());
formfields.add("lang", CI18N::getCurrentLanguageCode()); formfields.add("lang", CI18N::getCurrentLanguageCode());
} }

@ -66,7 +66,7 @@ static string getWebAuthKey()
// authkey = <sharid><name><cid><cookie> // authkey = <sharid><name><cid><cookie>
uint32 cid = NetMngr.getLoginCookie().getUserId() * 16 + PlayerSelectedSlot; uint32 cid = NetMngr.getLoginCookie().getUserId() * 16 + PlayerSelectedSlot;
string rawKey = toString(CharacterHomeSessionId) + string rawKey = toString(CharacterHomeSessionId) +
UserEntity->getLoginName().toString() + UserEntity->getLoginName() +
toString(cid) + toString(cid) +
NetMngr.getLoginCookie().toString(); NetMngr.getLoginCookie().toString();
string key = getMD5((const uint8*)rawKey.c_str(), (uint32)rawKey.size()).toString(); string key = getMD5((const uint8*)rawKey.c_str(), (uint32)rawKey.size()).toString();
@ -85,7 +85,7 @@ void addWebIGParams (string &url, bool trustedDomain)
uint32 cid = NetMngr.getLoginCookie().getUserId() * 16 + PlayerSelectedSlot; uint32 cid = NetMngr.getLoginCookie().getUserId() * 16 + PlayerSelectedSlot;
url += ((url.find('?') != string::npos) ? "&" : "?") + url += ((url.find('?') != string::npos) ? "&" : "?") +
string("shardid=") + toString(CharacterHomeSessionId) + string("shardid=") + toString(CharacterHomeSessionId) +
string("&name=") + UserEntity->getLoginName().toUtf8() + string("&name=") + UserEntity->getLoginName() + // FIXME: UrlEncode
string("&lang=") + CI18N::getCurrentLanguageCode() + string("&lang=") + CI18N::getCurrentLanguageCode() +
string("&datasetid=") + toString(UserEntity->dataSetId()) + string("&datasetid=") + toString(UserEntity->dataSetId()) +
string("&ig=1"); string("&ig=1");
@ -384,7 +384,7 @@ void CGroupHTMLAuth::addHTTPPostParams (SFormFields &formfields, bool trustedDom
uint32 cid = NetMngr.getLoginCookie().getUserId() * 16 + PlayerSelectedSlot; uint32 cid = NetMngr.getLoginCookie().getUserId() * 16 + PlayerSelectedSlot;
formfields.add("shardid", toString(CharacterHomeSessionId)); formfields.add("shardid", toString(CharacterHomeSessionId));
formfields.add("name", UserEntity->getLoginName().toUtf8()); formfields.add("name", UserEntity->getLoginName());
formfields.add("lang", CI18N::getCurrentLanguageCode()); formfields.add("lang", CI18N::getCurrentLanguageCode());
formfields.add("ig", "1"); formfields.add("ig", "1");
if (trustedDomain) if (trustedDomain)

@ -614,8 +614,8 @@ static CInterfaceChatDisplayer InterfaceChatDisplayer;
void CInterfaceChatDisplayer::colorizeSender(string &text, const string &senderName, CRGBA baseColor) void CInterfaceChatDisplayer::colorizeSender(string &text, const string &senderName, CRGBA baseColor)
{ {
// find the sender/text separator to put color tags // find the sender/text separator to put color tags
ucstring::size_type pos = senderName.length() - 1; string::size_type pos = senderName.length() - 1;
if (pos != ucstring::npos) if (pos != string::npos)
{ {
string str; string str;
@ -666,7 +666,7 @@ void CInterfaceChatDisplayer::displayChat(TDataSetIndex compressedSenderIndex, c
for(;;) for(;;)
{ {
string::size_type index = finalString.find("{break}"); string::size_type index = finalString.find("{break}");
if (index == ucstring::npos) break; if (index == string::npos) break;
finalString = finalString.substr(0, index) + finalString.substr(index+7,finalString.size()); finalString = finalString.substr(0, index) + finalString.substr(index+7,finalString.size());
} }
@ -819,7 +819,7 @@ void CInterfaceChatDisplayer::displayChat(TDataSetIndex compressedSenderIndex, c
else else
{ {
string::size_type index = finalString.find("<BPFX>"); string::size_type index = finalString.find("<BPFX>");
if (index != ucstring::npos) if (index != string::npos)
{ {
bubbleWanted = false; bubbleWanted = false;
finalString = finalString.substr(index+6,finalString.size()); finalString = finalString.substr(index+6,finalString.size());
@ -1015,7 +1015,7 @@ void inpulseDynStringInChatGroup(NLMISC::CBitMemStream &impulse)
// impulse.serialBit(huff); // impulse.serialBit(huff);
// //
// uint32 index; // uint32 index;
// ucstring ucstr; // ucstring ucstr; // OLD
// //
// impulse.serial( index ); // impulse.serial( index );
// impulse.serial( ucstr ); // impulse.serial( ucstr );
@ -1109,15 +1109,15 @@ void setFakeNews ()
CViewText *inter2 = (CViewText *)inter->getView("title0"); CViewText *inter2 = (CViewText *)inter->getView("title0");
nlassert (inter2 != NULL); nlassert (inter2 != NULL);
inter2->setText(ucstring(shortNews[rnd*3])); inter2->setText(ucstring(shortNews[rnd*3])); // OLD
CViewText *inter3 = (CViewText *)inter->getView("title1"); CViewText *inter3 = (CViewText *)inter->getView("title1");
nlassert (inter3 != NULL); nlassert (inter3 != NULL);
inter3->setText(ucstring(shortNews[rnd*3+1])); inter3->setText(ucstring(shortNews[rnd*3+1])); // OLD
CViewText *inter4 = (CViewText *)inter->getView("title2"); CViewText *inter4 = (CViewText *)inter->getView("title2");
nlassert (inter4 != NULL); nlassert (inter4 != NULL);
inter4->setText(ucstring(shortNews[rnd*3+2])); inter4->setText(ucstring(shortNews[rnd*3+2])); // OLD
} }
{ // set test for the neutral main { // set test for the neutral main
string iname; string iname;
@ -1134,11 +1134,11 @@ void setFakeNews ()
CViewText *inter2 = (CViewText *)inter->getView("title0"); CViewText *inter2 = (CViewText *)inter->getView("title0");
nlassert (inter2 != NULL); nlassert (inter2 != NULL);
inter2->setText(ucstring(shortNews[rnd*3])); inter2->setText(ucstring(shortNews[rnd*3])); // OLD
CViewText *inter3 = (CViewText *)inter->getView("title1"); CViewText *inter3 = (CViewText *)inter->getView("title1");
nlassert (inter3 != NULL); nlassert (inter3 != NULL);
inter3->setText(ucstring(shortNews[rnd*3+1])); inter3->setText(ucstring(shortNews[rnd*3+1])); // OLD
} }
{ // set test for the more news { // set test for the more news
string iname; string iname;
@ -1155,15 +1155,15 @@ void setFakeNews ()
CViewText *inter2 = (CViewText *)inter->getView("title0"); CViewText *inter2 = (CViewText *)inter->getView("title0");
nlassert (inter2 != NULL); nlassert (inter2 != NULL);
inter2->setText(ucstring(longNews[rnd*3])); inter2->setText(ucstring(longNews[rnd*3])); // OLD
CViewText *inter3 = (CViewText *)inter->getView("title1"); CViewText *inter3 = (CViewText *)inter->getView("title1");
nlassert (inter3 != NULL); nlassert (inter3 != NULL);
inter3->setText(ucstring(longNews[rnd*3+1])); inter3->setText(ucstring(longNews[rnd*3+1])); // OLD
CViewText *inter4 = (CViewText *)inter->getView("title2"); CViewText *inter4 = (CViewText *)inter->getView("title2");
nlassert (inter4 != NULL); nlassert (inter4 != NULL);
inter4->setText(ucstring(longNews[rnd*3+2])); inter4->setText(ucstring(longNews[rnd*3+2])); // OLD
} }
} }
} }
@ -1180,7 +1180,7 @@ void setFakeNews ()
static void setupBotChatChoiceList(CInterfaceGroup *botChatGroup) static void setupBotChatChoiceList(CInterfaceGroup *botChatGroup)
{ {
// Temp for test. Should then be read from server msg // Temp for test. Should then be read from server msg
std::vector<ucstring> choices; std::vector<string> choices;
for(uint k = 0; k < 90; ++k) for(uint k = 0; k < 90; ++k)
{ {
choices.push_back("Choice " + toString(k)); choices.push_back("Choice " + toString(k));
@ -1195,7 +1195,7 @@ static void setupBotChatChoiceList(CInterfaceGroup *botChatGroup)
/* /*
static void setupBotChatDescription(CInterfaceGroup *botChatGroup) static void setupBotChatDescription(CInterfaceGroup *botChatGroup)
{ {
ucstring desc; string desc;
for(uint k = 0; k < 90; ++k) for(uint k = 0; k < 90; ++k)
{ {
desc += "This is a multi line description. "; desc += "This is a multi line description. ";
@ -1216,7 +1216,7 @@ static void setupBotChatBotGift(CInterfaceGroup *botChatGroup)
NLGUI::CDBManager::getInstance()->getDbProp("SERVER:INVENTORY:20:0:QUALITY")->setValue32(0); NLGUI::CDBManager::getInstance()->getDbProp("SERVER:INVENTORY:20:0:QUALITY")->setValue32(0);
NLGUI::CDBManager::getInstance()->getDbProp("SERVER:INVENTORY:20:1:SHEET")->setValue32(CSheetId("fyros_sword_lvl_01_05.item").asInt()); NLGUI::CDBManager::getInstance()->getDbProp("SERVER:INVENTORY:20:1:SHEET")->setValue32(CSheetId("fyros_sword_lvl_01_05.item").asInt());
NLGUI::CDBManager::getInstance()->getDbProp("SERVER:INVENTORY:20:1:QUALITY")->setValue32(2); NLGUI::CDBManager::getInstance()->getDbProp("SERVER:INVENTORY:20:1:QUALITY")->setValue32(2);
CBotChat::setBotGift(botChatGroup, ucstring("Thanks to have succeeded the mission"), ucstring("Here's your reward"), ucstring("The bot has taken the object quest from your inventory")); CBotChat::setBotGift(botChatGroup, "Thanks to have succeeded the mission", "Here's your reward", "The bot has taken the object quest from your inventory");
} }
*/ */
@ -1798,7 +1798,7 @@ void impulseTeamContactInit(NLMISC::CBitMemStream &impulse)
{ {
vector<uint32> vFriendListName; vector<uint32> vFriendListName;
vector<TCharConnectionState> vFriendListOnline; vector<TCharConnectionState> vFriendListOnline;
vector<ucstring> vIgnoreListName; vector<ucstring> vIgnoreListName; // TODO: UTF-8 (serial)
impulse.serialCont(vFriendListName); impulse.serialCont(vFriendListName);
uint32 nbState; uint32 nbState;
@ -2136,9 +2136,9 @@ void impulseWhere(NLMISC::CBitMemStream &impulse)
void impulseWho(NLMISC::CBitMemStream &impulse) void impulseWho(NLMISC::CBitMemStream &impulse)
{ {
nlinfo("impulseWho Received"); nlinfo("impulseWho Received");
CInterfaceManager::getInstance()->displaySystemInfo(ucstring("Players currently in the game :")); CInterfaceManager::getInstance()->displaySystemInfo("Players currently in the game :");
ucstring name; ucstring name; // OLD
uint32 loginId; uint32 loginId;
uint16 dist; uint16 dist;
uint8 dirshort; uint8 dirshort;
@ -2176,7 +2176,7 @@ void impulseWho(NLMISC::CBitMemStream &impulse)
}; };
str = toString (" - uid %d - distance %hu meters - direction ", loginId, dist); str = toString (" - uid %d - distance %hu meters - direction ", loginId, dist);
CInterfaceManager::getInstance()->displaySystemInfo(ucstring(name + ucstring(str) + CI18N::get(txts[direction]))); CInterfaceManager::getInstance()->displaySystemInfo(name + str + CI18N::get(txts[direction]));
} }
}// impulseWho // }// impulseWho //
*/ */
@ -2185,9 +2185,9 @@ void impulseWho(NLMISC::CBitMemStream &impulse)
void impulseWhoGM(NLMISC::CBitMemStream &impulse) void impulseWhoGM(NLMISC::CBitMemStream &impulse)
{ {
nlinfo("impulseWhoGM Received"); nlinfo("impulseWhoGM Received");
CInterfaceManager::getInstance()->displaySystemInfo(ucstring("Players currently in the game :")); CInterfaceManager::getInstance()->displaySystemInfo("Players currently in the game :");
ucstring name; ucstring name; // OLD
uint32 loginId; uint32 loginId;
uint16 dist; uint16 dist;
uint8 dirshort; uint8 dirshort;
@ -2225,7 +2225,7 @@ void impulseWhoGM(NLMISC::CBitMemStream &impulse)
}; };
str = toString (" - uid %d - distance %hu meters - direction ", loginId, dist); str = toString (" - uid %d - distance %hu meters - direction ", loginId, dist);
CInterfaceManager::getInstance()->displaySystemInfo(ucstring(name + ucstring(str) + CI18N::get(txts[direction]))); CInterfaceManager::getInstance()->displaySystemInfo(name + str + CI18N::get(txts[direction]));
} }
}// impulseWho // }// impulseWho //
*/ */
@ -3115,12 +3115,12 @@ void impulsePVPChooseClan(NLMISC::CBitMemStream &impulse)
CCtrlTextButton * butClan1 = dynamic_cast<CCtrlTextButton*>(CWidgetManager::getInstance()->getElementFromId("ui:interface:join_pvp_clan_proposal:content:clan1")); CCtrlTextButton * butClan1 = dynamic_cast<CCtrlTextButton*>(CWidgetManager::getInstance()->getElementFromId("ui:interface:join_pvp_clan_proposal:content:clan1"));
if( butClan1 == NULL ) if( butClan1 == NULL )
return; return;
butClan1->setText( ucstring(EGSPD::CPeople::toString( clan1 )) ); butClan1->setText( EGSPD::CPeople::toString( clan1 ) );
CCtrlTextButton * butClan2 = dynamic_cast<CCtrlTextButton*>(CWidgetManager::getInstance()->getElementFromId("ui:interface:join_pvp_clan_proposal:content:clan2")); CCtrlTextButton * butClan2 = dynamic_cast<CCtrlTextButton*>(CWidgetManager::getInstance()->getElementFromId("ui:interface:join_pvp_clan_proposal:content:clan2"));
if( butClan2 == NULL ) if( butClan2 == NULL )
return; return;
butClan2->setText( ucstring(EGSPD::CPeople::toString( clan2 )) ); butClan2->setText( EGSPD::CPeople::toString( clan2 ) );
} }
*/ */
@ -3316,8 +3316,8 @@ private:
if(i!=digitMaxEnd) if(i!=digitMaxEnd)
{ {
// get the width // get the width
ucstring digitStr= contentStr.substr(digitStart, i-digitStart); string digitStr= contentStr.substr(digitStart, i-digitStart);
fromString(digitStr.toString(), w); fromString(digitStr, w);
// remove the first tag // remove the first tag
contentStr= contentStr.substr(i+1); contentStr= contentStr.substr(i+1);
} }

@ -312,7 +312,7 @@ void CProgress::internalProgress (float value)
// More help // More help
TextContext->setFontSize((uint)(12.f * fontFactor)); TextContext->setFontSize((uint)(12.f * fontFactor));
/* todo tips of the day uncomment /* todo tips of the day uncomment
ucstring ucstr = CI18N::get ("uiTipsEnd"); string ucstr = CI18N::get ("uiTipsEnd");
TextContext->printAt(0.5f, fY, ucstr); */ TextContext->printAt(0.5f, fY, ucstr); */
fY = nextLine (TextContext->getFontSize(), Driver->getWindowHeight(), fY); fY = nextLine (TextContext->getFontSize(), Driver->getWindowHeight(), fY);
fY = nextLine (TextContext->getFontSize(), Driver->getWindowHeight(), fY); fY = nextLine (TextContext->getFontSize(), Driver->getWindowHeight(), fY);
@ -360,11 +360,9 @@ void CProgress::internalProgress (float value)
(uint)RT.getRyzomTime(), (uint)RT.getRyzomTime(),
CI18N::get ("uiSeason"+toStringEnum(CRyzomTime::getSeasonByDay(day))).c_str(), CI18N::get ("uiSeason"+toStringEnum(CRyzomTime::getSeasonByDay(day))).c_str(),
CI18N::get (WeatherManager.getCurrWeatherState().LocalizedName).c_str()); CI18N::get (WeatherManager.getCurrWeatherState().LocalizedName).c_str());
ucstring ucstr;
ucstr.fromUtf8 (str);
TextContext->setHotSpot(UTextContext::MiddleBottom); TextContext->setHotSpot(UTextContext::MiddleBottom);
TextContext->setColor(CRGBA(186, 179, 163, 255)); TextContext->setColor(CRGBA(186, 179, 163, 255));
TextContext->printAt(0.5f, 25/768.f, ucstr); TextContext->printAt(0.5f, 25/768.f, str);
} }
// apply text commands // apply text commands

@ -968,9 +968,7 @@ void CDisplayerVisualEntity::updateName()
//H_AUTO(R2_CDisplayerVisualEntity_updateName) //H_AUTO(R2_CDisplayerVisualEntity_updateName)
if (!_Entity) return; if (!_Entity) return;
std::string name = getString(&getProps(), "Name"); std::string ucName = getString(&getProps(), "Name");
ucstring ucName;
ucName.fromUtf8(name);
if (ucName.empty()) if (ucName.empty())
{ {
ucName = CI18N::get("uiR2EDNoName"); ucName = CI18N::get("uiR2EDNoName");
@ -1011,13 +1009,11 @@ void CDisplayerVisualEntity::updateName()
actName = NLMISC::toString(" [%s]", actName.c_str()); actName = NLMISC::toString(" [%s]", actName.c_str());
ucstring ucActName; ucName += actName;
ucActName.fromUtf8(actName);
ucName += ucActName;
{ {
//BENCH(setEntityName) //BENCH(setEntityName)
_Entity->setEntityName(ucName.toUtf8()); _Entity->setEntityName(ucName);
} }
{ {
//BENCH(buildInSceneInterface) //BENCH(buildInSceneInterface)

@ -971,7 +971,7 @@ restartLoop:
return referenceFile; return referenceFile;
} }
void CLoadProxy::loadStringFile(const string &filename, ucstring &text) void CLoadProxy::loadStringFile(const string &filename, ucstring &text) // TODO: UTF-8 (serial)
{ {
vector<TStringInfo> reference; vector<TStringInfo> reference;
vector<TStringInfo> addition; vector<TStringInfo> addition;
@ -1015,7 +1015,7 @@ restartLoop:
context.Diff.push_back(context.Addition[addIndex]); context.Diff.push_back(context.Addition[addIndex]);
//nldebug("Adding new string '%s' in CI18N", context.Addition[addIndex].Identifier.c_str()); //nldebug("Adding new string '%s' in CI18N", context.Addition[addIndex].Identifier.c_str());
if (ClientCfg.DebugStringManager) if (ClientCfg.DebugStringManager)
context.Diff.back().Text = ucstring("<NEW>")+context.Diff.back().Text; context.Diff.back().Text = ucstring("<NEW>")+context.Diff.back().Text; // TODO: UTF-8 (serial)
} }
void CLoadProxy::onRemove(uint /* addIndex */, uint /* refIndex */, TStringDiffContext &/* context */) void CLoadProxy::onRemove(uint /* addIndex */, uint /* refIndex */, TStringDiffContext &/* context */)
{ {
@ -1027,7 +1027,7 @@ restartLoop:
context.Diff.push_back(context.Addition[addIndex]); context.Diff.push_back(context.Addition[addIndex]);
//nldebug("Using changed string '%s' in CI18N", context.Addition[addIndex].Identifier.c_str()); //nldebug("Using changed string '%s' in CI18N", context.Addition[addIndex].Identifier.c_str());
if (ClientCfg.DebugStringManager) if (ClientCfg.DebugStringManager)
context.Diff.back().Text = ucstring("<CHG>")+context.Diff.back().Text; context.Diff.back().Text = ucstring("<CHG>")+context.Diff.back().Text; // TODO: UTF-8 (serial)
} }
void CLoadProxy::onSwap(uint /* newIndex */, uint /* refIndex */, TStringDiffContext &/* context */) void CLoadProxy::onSwap(uint /* newIndex */, uint /* refIndex */, TStringDiffContext &/* context */)
{ {
@ -1041,7 +1041,7 @@ restartLoop:
class CReadWorkSheetFile : public TWorkSheetDiff::IDiffCallback class CReadWorkSheetFile : public TWorkSheetDiff::IDiffCallback
{ {
public: public:
void readWorkSheetFile(const string &filename, ucstring &text) void readWorkSheetFile(const string &filename, ucstring &text) // TODO: UTF-8 (serial)
{ {
TWorksheet addition; TWorksheet addition;
TWorksheet reference; TWorksheet reference;
@ -1178,9 +1178,9 @@ bool CStringManagerClient::checkWordFileDates(vector<CFileCheck> &fileChecks, co
// *************************************************************************** // ***************************************************************************
void CStringManagerClient::initI18NSpecialWords(const string &languageCode) void CStringManagerClient::initI18NSpecialWords(const string &languageCode)
{ {
ucstring womenNameColIdent = ucstring("women_name"); ucstring womenNameColIdent = ucstring("women_name"); // TODO: UTF-8 (serial)
ucstring descColIdent = ucstring("description"); ucstring descColIdent = ucstring("description"); // TODO: UTF-8 (serial)
ucstring descColIdent2 = ucstring("description2"); ucstring descColIdent2 = ucstring("description2"); // TODO: UTF-8 (serial)
// List of words to append to the local CI18N system. // List of words to append to the local CI18N system.
static const char *specialWords[]= static const char *specialWords[]=
@ -1219,11 +1219,11 @@ void CStringManagerClient::initI18NSpecialWords(const string &languageCode)
{ {
uint32 profile0= (uint32)ryzomGetLocalTime(); uint32 profile0= (uint32)ryzomGetLocalTime();
ucstring ucs; ucstring ucs; // TODO: UTF-8 (serial)
string fileName = fileNames[i]; string fileName = fileNames[i];
string keyExtenstion = specialWords[i*3+2]; string keyExtenstion = specialWords[i*3+2];
// read the ucstring and make diffs with data in ./translation/work. // read the ucstring and make diffs with data in ./translation/work. // TODO: UTF-8 (serial)
CReadWorkSheetFile rwsf; CReadWorkSheetFile rwsf;
rwsf.readWorkSheetFile(fileName, ucs); rwsf.readWorkSheetFile(fileName, ucs);
if(ucs.empty()) if(ucs.empty())
@ -1235,9 +1235,9 @@ void CStringManagerClient::initI18NSpecialWords(const string &languageCode)
// Get the Key and Data ColIndex. // Get the Key and Data ColIndex.
uint nameColIndex = 0, keyColIndex = 0; uint nameColIndex = 0, keyColIndex = 0;
if( !ws.findCol(ucstring("name"), nameColIndex) ) if( !ws.findCol(ucstring("name"), nameColIndex) ) // TODO: UTF-8 (serial)
continue; continue;
if( !ws.findCol(ucstring(specialWords[i*3+1]), keyColIndex) ) if( !ws.findCol(ucstring(specialWords[i*3+1]), keyColIndex) ) // TODO: UTF-8 (serial)
continue; continue;
// Get the women name index if possible. // Get the women name index if possible.
@ -1282,7 +1282,7 @@ void CStringManagerClient::initI18NSpecialWords(const string &languageCode)
// insert in map of Women Name if OK. // insert in map of Women Name if OK.
if(womenNameColIndex!=std::numeric_limits<uint>::max()) if(womenNameColIndex!=std::numeric_limits<uint>::max())
{ {
const ucstring &womenName= ws.getData(j, womenNameColIndex); const ucstring &womenName= ws.getData(j, womenNameColIndex); // TODO: UTF-8 (serial)
_SpecItem_TempMap[keyStr].WomenName= womenName.toUtf8(); _SpecItem_TempMap[keyStr].WomenName= womenName.toUtf8();
// replace all \n in the women name with true \n // replace all \n in the women name with true \n
while(strFindReplace(_SpecItem_TempMap[keyStr].WomenName, "\\n", "\n")); while(strFindReplace(_SpecItem_TempMap[keyStr].WomenName, "\\n", "\n"));
@ -1291,7 +1291,7 @@ void CStringManagerClient::initI18NSpecialWords(const string &languageCode)
// insert in map of Description if OK. // insert in map of Description if OK.
if(descColIndex!=std::numeric_limits<uint>::max()) if(descColIndex!=std::numeric_limits<uint>::max())
{ {
const ucstring &desc= ws.getData(j, descColIndex); const ucstring &desc= ws.getData(j, descColIndex); // TODO: UTF-8 (serial)
_SpecItem_TempMap[keyStr].Desc= desc.toUtf8(); _SpecItem_TempMap[keyStr].Desc= desc.toUtf8();
// replace all \n in the desc with true \n // replace all \n in the desc with true \n
while(strFindReplace(_SpecItem_TempMap[keyStr].Desc, "\\n", "\n")); while(strFindReplace(_SpecItem_TempMap[keyStr].Desc, "\\n", "\n"));
@ -1300,7 +1300,7 @@ void CStringManagerClient::initI18NSpecialWords(const string &languageCode)
// insert in map of Description2 if OK. // insert in map of Description2 if OK.
if(descColIndex2!=std::numeric_limits<uint>::max()) if(descColIndex2!=std::numeric_limits<uint>::max())
{ {
const ucstring &desc= ws.getData(j, descColIndex2); const ucstring &desc= ws.getData(j, descColIndex2); // TODO: UTF-8 (serial)
_SpecItem_TempMap[keyStr].Desc2= desc.toUtf8(); _SpecItem_TempMap[keyStr].Desc2= desc.toUtf8();
// replace all \n in the desc with true \n // replace all \n in the desc with true \n
while(strFindReplace(_SpecItem_TempMap[keyStr].Desc2, "\\n", "\n")); while(strFindReplace(_SpecItem_TempMap[keyStr].Desc2, "\\n", "\n"));

@ -187,7 +187,7 @@ private:
struct TStringWaiter struct TStringWaiter
{ {
/// Pointer to the ucstring to fill /// Pointer to the utf-8 string to fill
std::string *Result; std::string *Result;
/// Pointer to the remover that contains this string reference /// Pointer to the remover that contains this string reference
const IStringWaiterRemover *Remover; const IStringWaiterRemover *Remover;
@ -277,10 +277,10 @@ private:
else else
{ {
nlassert(f.isReading()); nlassert(f.isReading());
ucstring name; ucstring name; // Old UTF-16 serial
ucstring womenName; ucstring womenName; // Old UTF-16 serial
ucstring desc; ucstring desc; // Old UTF-16 serial
ucstring desc2; ucstring desc2; // Old UTF-16 serial
f.serial(name); f.serial(name);
if (ver >= 1) if (ver >= 1)
f.serial(womenName); f.serial(womenName);
@ -419,7 +419,7 @@ public:
*/ */
class CLoadProxy : public NLMISC::CI18N::ILoadProxy, public TStringDiff::IDiffCallback class CLoadProxy : public NLMISC::CI18N::ILoadProxy, public TStringDiff::IDiffCallback
{ {
void loadStringFile(const std::string &filename, ucstring &text); void loadStringFile(const std::string &filename, ucstring &text); // TODO: UTF-8 (serial)
void onEquivalent(uint addIndex, uint refIndex, TStringDiffContext &context); void onEquivalent(uint addIndex, uint refIndex, TStringDiffContext &context);
void onAdd(uint addIndex, uint refIndex, TStringDiffContext &context); void onAdd(uint addIndex, uint refIndex, TStringDiffContext &context);

@ -15,7 +15,7 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>. // along with this program. If not, see <http://www.gnu.org/licenses/>.
#if 0
#include "stdpch.h" #include "stdpch.h"
@ -55,14 +55,14 @@ CTextManager::CTextManager()
//----------------------------------------------- //-----------------------------------------------
/// Return the text according to the Id. /// Return the text according to the Id.
//----------------------------------------------- //-----------------------------------------------
ucstring CTextManager::text(uint textId) ucstring CTextManager::text(uint textId) // OLD
{ {
map<uint, ucstring>::iterator it = _Texts.find(textId); map<uint, ucstring>::iterator it = _Texts.find(textId); // OLD
if(it != _Texts.end()) if(it != _Texts.end())
return (*it).second; return (*it).second;
// Return an empty string. // Return an empty string.
return ucstring(); return ucstring(); // OLD
} }
//----------------------------------------------- //-----------------------------------------------
@ -70,13 +70,14 @@ ucstring CTextManager::text(uint textId)
//----------------------------------------------- //-----------------------------------------------
void CTextManager::text(uint textId, const std::string &str) void CTextManager::text(uint textId, const std::string &str)
{ {
_Texts.insert(make_pair(textId, ucstring(str))); _Texts.insert(make_pair(textId, ucstring(str))); // OLD
} }
//----------------------------------------------- //-----------------------------------------------
/// Set the text for 'textId'. /// Set the text for 'textId'.
//----------------------------------------------- //-----------------------------------------------
void CTextManager::text(uint textId, const ucstring &str) void CTextManager::text(uint textId, const ucstring &str) // OLD
{ {
_Texts.insert(make_pair(textId, str)); _Texts.insert(make_pair(textId, str));
} }
#endif

@ -14,8 +14,9 @@
// You should have received a copy of the GNU Affero General Public License // You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>. // along with this program. If not, see <http://www.gnu.org/licenses/>.
// Lost code
#if 0
#ifndef NL_TEXT_MANAGER_H #ifndef NL_TEXT_MANAGER_H
#define NL_TEXT_MANAGER_H #define NL_TEXT_MANAGER_H
@ -25,7 +26,7 @@
///////////// /////////////
// Misc // Misc
#include "nel/misc/types_nl.h" #include "nel/misc/types_nl.h"
#include "nel/misc/ucstring.h" #include "nel/misc/ucstring.h" // OLD
// Std // Std
#include <map> #include <map>
@ -42,18 +43,18 @@
class CTextManager class CTextManager
{ {
protected: protected:
std::map<uint, ucstring> _Texts; std::map<uint, ucstring> _Texts; // OLD
public: public:
/// Constructor /// Constructor
CTextManager(); CTextManager();
/// Return the text according to the Id. /// Return the text according to the Id.
ucstring text(uint textId); ucstring text(uint textId); // OLD
/// Set the text for 'textId'. /// Set the text for 'textId'.
void text(uint textId, const std::string &str); void text(uint textId, const std::string &str);
/// Set the text for 'textId'. /// Set the text for 'textId'.
void text(uint textId, const ucstring &str); void text(uint textId, const ucstring &str); // OLD
}; };
@ -65,5 +66,6 @@ extern CTextManager TextMngr;
#endif // NL_TEXT_MANAGER_H #endif // NL_TEXT_MANAGER_H
#endif
/* End of text_manager.h */ /* End of text_manager.h */

@ -3078,7 +3078,7 @@ void CUserEntity::setAFK(bool b, string afkTxt)
nlwarning("CUserEntity:setAFK: unknown message named '%s'.", msgName.c_str()); nlwarning("CUserEntity:setAFK: unknown message named '%s'.", msgName.c_str());
// custom afk txt // custom afk txt
ucstring ucstr; ucstring ucstr; // TODO: UTF-8 (serial)
ucstr.fromUtf8( afkTxt ); ucstr.fromUtf8( afkTxt );
CBitMemStream outTxt; CBitMemStream outTxt;
static const string msgNameTxt = "STRING:AFK_TXT"; static const string msgNameTxt = "STRING:AFK_TXT";
@ -3828,11 +3828,10 @@ void CUserEntity::CSkillPointsObserver::update(ICDBNode* node )
string deltaStr = toString("%+d", delta); string deltaStr = toString("%+d", delta);
// get the sp title // get the sp title
ucstring spTitle; const string &spTitle = CI18N::get(toString("uiSkillPointsBold%d",SpType));
spTitle= CI18N::get(toString("uiSkillPointsBold%d",SpType));
// run the popup // run the popup
CAHManager::getInstance()->runActionHandler("message_popup", NULL, "text1="+deltaStr+"|text0="+spTitle.toUtf8()); CAHManager::getInstance()->runActionHandler("message_popup", NULL, "text1="+deltaStr+"|text0="+spTitle);
// Context help // Context help
contextHelp ("skill_point"); contextHelp ("skill_point");

@ -485,7 +485,7 @@ public:
/// true if current behaviour allows to change front /// true if current behaviour allows to change front
bool canChangeFront(); bool canChangeFront();
ucstring getLoginName() string getLoginName()
{ {
if (_LoginName.empty()) if (_LoginName.empty())
_LoginName = getDisplayName(); _LoginName = getDisplayName();
@ -772,7 +772,7 @@ private:
CItemSnapshot _PreviousRightHandItem; CItemSnapshot _PreviousRightHandItem;
CItemSnapshot _PreviousLeftHandItem; CItemSnapshot _PreviousLeftHandItem;
ucstring _LoginName; std::string _LoginName;
}; };
/// Out game received position /// Out game received position

Loading…
Cancel
Save