Roxas07 216 Posted February 22, 2017 Share Posted February 22, 2017 M2 Download Center This is the hidden content, please Sign In or Sign Up ( Internal ) Hello to all here is a system I created just recently because I wanted to do it simply It is only the first part of the system that allows to select the Local pack according to the IP address of the player automatically! The next part will be available in a second tutorial. System Description: This system allows a player to be linked to a script hosted on your website, the web script will analyze the location of the player's IP and return the acronym of his Country (example: FR) according to the acronym the client Va This will pass from the client's locale.cfg and read the pack file corresponding to the acronym received seamlessly and quickly. Step 1: Open the file Locale_inc.h and add y this line: #define ENABLE_MULTILANGUE_SYSTEM Then open your UserInterface.cpp file and locate the following line: LocaleService_LoadConfig("locale.cfg"); And replace it with: #ifdef ENABLE_MULTILANGUE_SYSTEM LocaleService_LoadMultilangue(M_VerifLangue()); #else LocaleService_LoadConfig("locale.cfg"); #endif Then add the following method by replacing the web link with the one of your choice: std::string M_VerifLangue(){ // Méthode vérifiant la langue string versionActuel = "fr"; string url = "https://ping-hosting.com/langue.php"; string destination = "langue.php"; char buffer[MAX_LINE]; dl = URLDownloadToFile(NULL, url.c_str(), destination.c_str(), NULL, NULL); if (dl == S_OK) { std::ifstream infile("langue.php"); std::string line; while (std::getline(infile, line)) { std::istringstream iss(line); int a, b; if (!(iss >> a >> b)) { break; } } infile.close(); remove("langue.php"); return line; } else if (dl == E_OUTOFMEMORY) // En cas de surcharge, ferme le lanceur. { exit(0); } else // Ferme le lanceur si aucun des cas n'a été franchis. { exit(0); } return ""; } Step 2: Now open the file Locale.h and look for the following line: void LocaleService_LoadConfig(const char* fileName); Add the following lines: #ifdef ENABLE_MULTILANGUE_SYSTEM void LocaleService_LoadMultilangue(std::string langue); #endif Open your Locale.cpp now and add the following function: #ifdef ENABLE_MULTILANGUE_SYSTEM void LocaleService_LoadMultilangue(std::string langue) { MULTI_LOCALE_REPORT_PORT = 10000; MULTI_LOCALE_CODE = 1252; strcpy(MULTI_LOCALE_NAME, langue.c_str()); sprintf(MULTI_LOCALE_PATH, "locale/%s", MULTI_LOCALE_NAME); } #endif Web Part: Download the attached file in the article and upload it in your web hosting corresponding to the link you have chosen. The GeoIP.dat file can be updated regularly by uploading it to the official GeoIP site. Link of the file: This is the hidden content, please Sign In or Sign Up Creator of the system : Me Source link of the System: Online-Game The second part (for the Server) will be created soon, you can use another server part for complete it if you want. Cordialy 45 1 1 1 20 4 26 Link to comment Share on other sites More sharing options...
Kori 170 Posted February 23, 2017 Share Posted February 23, 2017 Nice guy Link to comment Share on other sites More sharing options...
Dr.Eagle 2 Posted February 23, 2017 Share Posted February 23, 2017 Noce thanks! Link to comment Share on other sites More sharing options...
Roxas07 216 Posted February 23, 2017 Author Share Posted February 23, 2017 Thank, you can do the same for make a check system for start updater automaticaly Link to comment Share on other sites More sharing options...
Roxas07 216 Posted February 23, 2017 Author Share Posted February 23, 2017 Post edited, sorry Link to comment Share on other sites More sharing options...
Management Karbust 4881 Posted February 24, 2017 Management Share Posted February 24, 2017 I think this isn't going to work very well... For example, we guys from Portugal, are spread around Europe, Portugal (of course) France, UK, Germany, Switzerland, Luxembourg, and Belgium, this are the main countries, if I have Portuguese, English, French, Germany translations on my client, it will get the languages of the IP address's, they maybe still prefer using their mother language, in this case Portuguese, is there a way to still use the system, but the user can choose which language to use? Thanks for sharing... Link to comment Share on other sites More sharing options...
Roxas07 216 Posted February 24, 2017 Author Share Posted February 24, 2017 You can edit the system has you wish, remember, with the php script you can return some language like that: if ($pays != "FR" && $pays != "DE" && $pays != "EN") { $pays = "EN"; // Return English } Create if you want a little Gui with that system . But if you not happy make the system by your own hands Link to comment Share on other sites More sharing options...
PeaceMaker 121 Posted October 1, 2017 Share Posted October 1, 2017 link down Link to comment Share on other sites More sharing options...
kingshero 8 Posted October 21, 2017 Share Posted October 21, 2017 please reupload files languge Link to comment Share on other sites More sharing options...
TeoDoR 12 Posted November 14, 2017 Share Posted November 14, 2017 On 01.10.2017 at 5:51 PM, PeaceMaker said: link down On 21.10.2017 at 8:48 PM, kingshero said: please reupload files languge This is the hidden content, please Sign In or Sign Up 1 1 1 2 3 Link to comment Share on other sites More sharing options...
kingshero 8 Posted November 14, 2017 Share Posted November 14, 2017 5 hours ago, TeoDoR said: This is the hidden content, please Sign In or Sign Up thank you 2 Link to comment Share on other sites More sharing options...
Recommended Posts