[Guide]Convert your client to support multiple Catalog files (For multilang purpose)
#1

Yesterday I reverted the g@migo catalog.lod file to upload it to my database. And I noticed of November version does not support multi-language for the catalog, so I made a small code for the client to load catalog_*.lod file depending of language defined in g_iCountry. in addition to that I modified the '2' that /index.php?/profile/11151-vogelj1988/&do=hovercard" data-mentionid="11151" href="/index.php?/profile/11151-vogelj1988/" rel="">@Vogelj1988 shared on Github for exports catalog files with the strings (name & description) depending of selected language.

Here is client code, Just replace old function with this one. (in my case i use ifs and only add 3 languages, you can use a switch or ifs and add the rest(If you share the code with all languages you get a chocolate chip cookie ?))

void CWorld::loadCatalog()
{
CTString fnTemp;
CTString strFullPath = _fnmApplicationPath.FileDir();

{
static BOOL bLoadCashShopData = TRUE;
if(bLoadCashShopData && !_bWorldEditorApp)
{
CallProgressHook_t(0.0f);

{
wo_aCashGoodsData.m_vShopItemArray.clear();

fnTemp = strFullPath + "data\\catalog";

// hardcore
if (_pNetwork->m_iServerType == SERVER_TYPE_HARDCORE)
fnTemp += "_hardcore";
// NICOLASG MARK (LOAD CATALOG FILE BY LANG)
if (g_iCountry == USA)
fnTemp += "_usa";
if (g_iCountry == SPAIN)
fnTemp += "_spn";
if (g_iCountry == BRAZIL)
fnTemp += "_brz";
// NICOLASG MARK END

fnTemp += ".lod";

int iNumOfShop = CCashShopData::LoadShopDataFromFile(wo_aCashGoodsData, fnTemp);
}
bLoadCashShopData = FALSE;
CallProgressHook_t(1.0f);
}
}
}

 

Here you have the source code of the tool already modified and also the binary files

2

2

Small clarification:

1) I modified the export encoding of the catalog lod file, I defined 'Encoding.Default'(work fine 4 me), maybe this is not ideal and need have to change to 'Encoding.GetEncoding(1252)'... Maybe someone else with more knowledge than me can clarify this point. Btw the code is fucking horrible, I have no idea of c#, I did what I could.

2) In addition to that, according to the defined language, title & description are loaded & saved in the Catalog Editor.

 

If u don't want download source+bin, Here have only bin files (I'm not attaching virustotal in this case because these files contain a Trojan and I don't want them to notice.)

2



Messages In This Thread
[No subject] - by nicolasg - 07-29-2022, 09:35 PM
[No subject] - by Scura - 07-31-2022, 11:01 AM
[No subject] - by nicolasg - 07-31-2022, 12:57 PM
[No subject] - by Vogelj1988 - 08-08-2022, 02:53 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)