Onforum.net - Web and gaming resource community

Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members .

Tutorial [Mini Release] multi language for different channels same server same db

Blaze

Elite
Elite
VIP
Credits
607
a simple system to load a different locale on different channels of the same server with the same database,
so if you want to channel2 in the LANG_GLOBAL config
: germany you will need to have everything inside what about the local germany so 'you can make for example
4 channels one Italian one Spanish one German one English and have a multi-language server complete with quests

in local_service.cpp
Code:
bool LocaleService_Init(const std::string& c_rstServiceName)
changed with
Code:
C ++:
bool LocaleService_Init(const std::string& c_rstServiceName)
{
#ifdef ENABLE_MULTY_LANG // Raziel |maked a new Token for Global Lang|
    sys_err("NEW LANGUAGE GLOBAL ARE MAKED |WELL DONE!!|");
#else
    if (!g_stServiceName.empty())
    {
        sys_err("ALREADY exist service");
        return false;
    }

    g_stServiceName = c_rstServiceName;
#endif
    if ( "japan" == g_stServiceName)
    {
        __LocaleService_Init_JAPAN();
    }

look
Code:
string g_stServiceName;
so '
Code:
C ++:
#ifdef ENABLE_MULTY_LANG // Raziel |maked a new Token for Global Lang|
extern string    g_stServiceName;
#else
string g_stServiceName;
#endif
look in config.h and add later
Code:
enum
{
ADDRESS_MAX_LEN = 15
};


Code:
C ++:
#ifdef ENABLE_MULTY_LANG // Raziel |maked a new Token for Global Lang|
extern std::string    g_stServiceName;
#endif

look in config.cpp add later
Code:
char g_szPublicIP[16] = "0";

char g_szInternalIP[16] = "0";

bool g_bSkillDisable = false;

int g_iFullUserCount = 2000;

int g_iBusyUserCount = 200;

//Canada


Code:
C ++:
#ifdef ENABLE_MULTY_LANG
string    g_stServiceName = "";
#endif

now in config.cpp look for add later
Code:
TOKEN("channel")

{

str_to_number(g_bChannel, value_string);

continue;

}

Code:
C ++:
#ifdef ENABLE_MULTY_LANG
        TOKEN("LANG_GLOBAL") // Raziel |maked a new Token for Global Lang|
        {
            g_stServiceName = value_string;
            fprintf(stdout, "g_stServiceName: %s\n", g_stServiceName.c_str());
            continue;
        }
#endif

now in service.h add this
Code:
C ++:
#define ENABLE_MULTY_LANG // Raziel |maked a new Token for Global Lang| sintax |LANG_GLOBAL: germany| config from core

1 server 1 database and all the rooms you want by setting them in the config of each ch
 
Thread starter Similar threads Forum Replies Date
Tutorials 1

Similar threads


Top

Dear User!

We found that you are blocking the display of ads on our site.

Please add it to the exception list or disable AdBlock.

The advertises that you'll see aren't intrusive they just help us to keep the community alive

If you don't want to see those ads just buy an upgrade.

Thank you for understanding!

Rogue

Rogue Purchase

User upgrade! at

🔥 Upgrade Now
Baba2

Baba2 Purchase

User upgrade! at

🔥 Upgrade Now

Escanor25 Purchase

User upgrade! at

🔥 Upgrade Now