LCKB
[Guide]Convert your client to support multiple Catalog files (For multilang purpose) - Printable Version

+- LCKB (https://lckb.dev/forum)
+-- Forum: ** OLD LCKB DATABASE ** (https://lckb.dev/forum/forumdisplay.php?fid=109)
+--- Forum: Guides & Help Section (https://lckb.dev/forum/forumdisplay.php?fid=193)
+---- Forum: Tutorials & Guides (https://lckb.dev/forum/forumdisplay.php?fid=124)
+----- Forum: Ep4 Guides (https://lckb.dev/forum/forumdisplay.php?fid=125)
+----- Thread: [Guide]Convert your client to support multiple Catalog files (For multilang purpose) (/showthread.php?tid=4945)



- nicolasg - 07-29-2022


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




- Scura - 07-31-2022


Nice job man, i suggest to keep updated the DevPack by /index.php?/profile/2167-dethunter12/&do=hovercard" data-mentionid="2167" href="/index.php?/profile/2167-dethunter12/" rel="">@dethunter12 :

 

2




- nicolasg - 07-31-2022



1 hour ago, Scura said:




Nice job man, i suggest to keep updated the DevPack by /index.php?/profile/2167-dethunter12/&do=hovercard" data-mentionid="2167" href="/index.php?/profile/2167-dethunter12/" rel="">@dethunter12 :



 



2




Yesterday I came to the conclusion that the tool published by /index.php?/profile/11151-vogelj1988/&do=hovercard" data-mentionid="11151" href="/index.php?/profile/11151-vogelj1988/" rel="">@Vogelj1988 had more tools, that's why I chose to use that version and not the /index.php?/profile/2167-dethunter12/&do=hovercard" data-mentionid="2167" href="/index.php?/profile/2167-dethunter12/" rel="">@dethunter12 version. Btw the code are in my github, if u want add it to /index.php?/profile/2167-dethunter12/&do=hovercard" data-mentionid="2167" href="/index.php?/profile/2167-dethunter12/" rel="">@dethunter12 repo.




- Vogelj1988 - 08-08-2022



On 7/31/2022 at 7:01 AM, Scura said:




Nice job man, i suggest to keep updated the DevPack by /index.php?/profile/2167-dethunter12/&do=hovercard" data-mentionid="2167" href="/index.php?/profile/2167-dethunter12/" rel="">@dethunter12 :



 



2




lmao funny thing is that dev pack i used the same one before i updated it