Çözülemedi Server türkçeleştirme türkçe karekter sorunu

  • Konuyu açan Konuyu açan zonszoon
  • Açılış Tarihi Açılış Tarihi
  • Yanıt Yanıt 10
  • Gösterim Gösterim 1K
Ne yazık ki bu konuda sorulara çözüm bulunmuyor. Eğer konuda yorumlar varsa hepsini inceleyebilirsiniz. Belki sizlerin sorununuzu çözmek için için ipuçları bulabilirsiniz.
Durum
İçerik kilitlendiği için mesaj gönderimine kapatıldı.

zonszoon

Üye
Üye
Mesaj
35
Çözümler
2
Beğeni
21
Puan
689
Ticaret Puanı
0
kod:
Genişlet Daralt Kopyala
[HASH=3922]#ARAT[/HASH]:
import dbg

[HASH=2312]#altına[/HASH] ekle:
import os

[HASH=3922]#ARAT[/HASH]:
__builtins__.pack_open = pack_open = pack_file

[HASH=126669]#Üzerine[/HASH] ekle:
if not os.path.isfile("locale.cfg"):
    localeConfig = open("locale.cfg", "w")
    localeConfig.write("10012 1254 tr")
    localeConfig.close()
iyi günler yabancı alt yapı filesi kullanıyorum oyun dosyalarında locale.cfg yoktu locale oluşması için root'tan ayar yaptım kullanıdığım kod locale dosyası oluştu ama halen türkçe karekter hatası alıyorum locale dosyası ru olduğu için 10012 1254 ro " olarakta değiştirdim ama sorunum halen devam ediyor yardımcı olursanız sevinirim bir türlü nereden değiştiriyoruz bulamadım :(
 
Client source dosyaları elinizde mevcut ise notepat ile açıp .cfg araştırıp kod satırını paylaşırmısınız.
 
Client source dosyaları elinizde mevcut ise notepat ile açıp .cfg araştırıp kod satırını paylaşırmısınız.
UserInterface.cpp:
Genişlet Daralt Kopyala
#include "StdAfx.h"
#include "PythonApplication.h"
#include "ProcessScanner.h"
#include "PythonExceptionSender.h"
#include "resource.h"
#include "Version.h"

#include "../eterPack/EterPackManager.h"
#include "../eterLib/Util.h"
#include "../CWebBrowser/CWebBrowser.h"
#include "../eterBase/CPostIt.h"

#include <stdlib.h>
#include <cryptopp/cryptoppLibLink.h>
#include "m2protect.h"
#include <lzo-2.03/lzoLibLink.h>

extern "C" {  extern int _fltused;  volatile int _AVOID_FLOATING_POINT_LIBRARY_BUG = _fltused; }; 
#pragma comment(linker, "/NODEFAULTLIB:libci.lib")

#pragma comment( lib, "version.lib" )
#pragma comment( lib, "python27.lib" )
#pragma comment( lib, "imagehlp.lib" )
#pragma comment( lib, "devil.lib" )
#pragma comment( lib, "granny2.lib" )
#pragma comment( lib, "mss32.lib" )
#pragma comment( lib, "winmm.lib" )
#pragma comment( lib, "imm32.lib" )
#pragma comment( lib, "oldnames.lib" )
#pragma comment( lib, "SpeedTreeRT.lib" )
#pragma comment( lib, "dinput8.lib" )
#pragma comment( lib, "dxguid.lib" )
#pragma comment( lib, "ws2_32.lib" )
#pragma comment( lib, "strmiids.lib" )
#pragma comment( lib, "ddraw.lib" )
#pragma comment( lib, "dmoguids.lib" )

static const char * sc_apszPythonLibraryFilenames[] =
{
    "UserDict.pyc",
    "__future__.pyc",
    "copy_reg.pyc",
    "linecache.pyc",
    "ntpath.pyc",
    "os.pyc",
    "site.pyc",
    "stat.pyc",
    "string.pyc",
    "traceback.pyc",
    "types.pyc",
    "\n",
};

bool CheckPythonLibraryFilenames()
{
    for (int i = 0; *sc_apszPythonLibraryFilenames[i] != '\n'; ++i)
    {
        std::string stFilename = "lib\\";
        stFilename += sc_apszPythonLibraryFilenames[i];

        if (_access(stFilename.c_str(), 0) != 0)
            return false;

        MoveFile(stFilename.c_str(), stFilename.c_str());
    }

    return true;
}

struct ApplicationStringTable
{
    HINSTANCE m_hInstance;
    std::map<DWORD, std::string> m_kMap_dwID_stLocale;
} gs_kAppStrTable;

void ApplicationStringTable_Initialize(HINSTANCE hInstance)
{
    gs_kAppStrTable.m_hInstance=hInstance;
}

const std::string& ApplicationStringTable_GetString(DWORD dwID, LPCSTR szKey)
{
    char szBuffer[512];
    char szIniFileName[256];
    char szLocale[256];

    ::GetCurrentDirectory(sizeof(szIniFileName), szIniFileName);
    if(szIniFileName[lstrlen(szIniFileName)-1] != '\\')
        strcat(szIniFileName, "\\");
    strcat(szIniFileName, "Metin2.exe");

    strcpy(szLocale, LocaleService_GetLocalePath());
    if(strnicmp(szLocale, "locale/", strlen("locale/")) == 0)
        strcpy(szLocale, LocaleService_GetLocalePath() + strlen("locale/"));
    ::GetPrivateProfileString(szLocale, szKey, NULL, szBuffer, sizeof(szBuffer)-1, szIniFileName);
    if(szBuffer[0] == '\0')
        LoadString(gs_kAppStrTable.m_hInstance, dwID, szBuffer, sizeof(szBuffer)-1);
    if(szBuffer[0] == '\0')
        ::GetPrivateProfileString("en", szKey, NULL, szBuffer, sizeof(szBuffer)-1, szIniFileName);
    if(szBuffer[0] == '\0')
        strcpy(szBuffer, szKey);

    std::string& rstLocale=gs_kAppStrTable.m_kMap_dwID_stLocale[dwID];
    rstLocale=szBuffer;

    return rstLocale;
}

const std::string& ApplicationStringTable_GetString(DWORD dwID)
{
    char szBuffer[512];

    LoadString(gs_kAppStrTable.m_hInstance, dwID, szBuffer, sizeof(szBuffer)-1);
    std::string& rstLocale=gs_kAppStrTable.m_kMap_dwID_stLocale[dwID];
    rstLocale=szBuffer;

    return rstLocale;
}

const char* ApplicationStringTable_GetStringz(DWORD dwID, LPCSTR szKey)
{
    return ApplicationStringTable_GetString(dwID, szKey).c_str();
}

const char* ApplicationStringTable_GetStringz(DWORD dwID)
{
    return ApplicationStringTable_GetString(dwID).c_str();
}

////////////////////////////////////////////
int Setup(LPSTR lpCmdLine)
{
    TIMECAPS tc;
    UINT wTimerRes;

    if (timeGetDevCaps(&tc, sizeof(TIMECAPS)) != TIMERR_NOERROR)
        return 0;

    wTimerRes = MINMAX(tc.wPeriodMin, 1, tc.wPeriodMax);
    timeBeginPeriod(wTimerRes);

    return 1;
}

static const char * indexFiles[] =
{
    "bgm",
    "icon",
    "locale_ro",
    "maps",
    "property",
    "seasons",
    "sound",
    "uiscript",
    "others",
    "monsters",
    "pcs",
    "zone",
    "\n",
};

bool PackInitialize(const char * c_pszFolder)
{
    if (_access(c_pszFolder, 0) != 0)
        return true;

    std::string stFolder(c_pszFolder);
    stFolder += "/";

    bool bPackFirst = FALSE;

    CTextFileLoader::SetCacheMode();
#if defined(USE_RELATIVE_PATH)
    CEterPackManager::Instance().SetRelativePathMode();
#endif
    CEterPackManager::Instance().SetCacheMode();
    CEterPackManager::Instance().SetSearchMode(bPackFirst);

    CSoundData::SetPackMode(); // Miles ÆÄÀÏ ÄݹéÀ» ¼ÂÆÃ

    for (int i = 0; *indexFiles[i] != '\n'; ++i)
    {
        const std::string & c_rstName = indexFiles[i];
        std::string strPackName = stFolder + c_rstName;
        CEterPackManager::Instance().RegisterPack(strPackName.c_str(), c_rstName.c_str());   
    }

    CEterPackManager::Instance().RegisterRootPack((stFolder + std::string("root")).c_str());

    return true;
}

bool RunMainScript(CPythonLauncher& pyLauncher, const char* lpCmdLine)
{
    initpack();
    initdbg();
    initime();
    initgrp();
    initgrpImage();
    initgrpText();
    initwndMgr();
    /////////////////////////////////////////////
    initapp();
    initsystem();
    initchr();
    initchrmgr();
    initPlayer();
    initItem();
    initNonPlayer();
    initTrade();
    initChat();
    initTextTail();
    initnet();
    initMiniMap();
    initProfiler();
    initEvent();
    initeffect();
    initfly();
    initsnd();
    initeventmgr();
    initshop();
    initskill();
    initquest();
    initBackground();
    initMessenger();
    initsafebox();
    initguild();
    initServerStateChecker();

    {
        if (!pyLauncher.RunFile("system.py"))
        {
            TraceError("RunMain Error");
            return false;
        }
    }

    return true;
}

bool Main(HINSTANCE hInstance, LPSTR lpCmdLine)
{
    DWORD dwRandSeed=time(NULL)+DWORD(GetCurrentProcess());
    srandom(dwRandSeed);
    srand(random());

    SetLogLevel(1);

#ifndef __VTUNE__
    ilInit();
#endif
    if (!Setup(lpCmdLine))
        return false;

    OpenLogFile(false); // false == uses syserr.txt only

    static CLZO                lzo;
    static CEterPackManager    EterPackManager;

    if (!PackInitialize("pack"))
    {
        LogBox("Pack Initialization failed. Check log.txt file..");
        return false;
    }

    CPythonApplication * app = new CPythonApplication;

    app->Initialize(hInstance);

    bool ret=false;
    {
        CPythonLauncher pyLauncher;
        CPythonExceptionSender pyExceptionSender;
        SetExceptionSender(&pyExceptionSender);

        if (pyLauncher.Create())
            ret=RunMainScript(pyLauncher, lpCmdLine);

        //ProcessScanner_ReleaseQuitEvent();
        
        app->Clear();
        timeEndPeriod(1);
        pyLauncher.Clear();
    }

    app->Destroy();
    delete app;
    
    return ret;
}

HANDLE CreateMetin2GameMutex()
{
    SECURITY_ATTRIBUTES sa;
    ZeroMemory(&sa, sizeof(SECURITY_ATTRIBUTES));
    sa.nLength                = sizeof(sa);
    sa.lpSecurityDescriptor    = NULL;
    sa.bInheritHandle        = FALSE;

    return CreateMutex(&sa, FALSE, "Metin2GameMutex");
}

void DestroyMetin2GameMutex(HANDLE hMutex)
{
    if (hMutex)
    {
        ReleaseMutex(hMutex);
        hMutex = NULL;
    }
}

void __ErrorPythonLibraryIsNotExist()
{
    LogBoxf("FATAL ERROR!! Python Library file not exist!");
}

//#define NEEDED_COMMAND_ARGUMENT "autopatcher"

int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
{
    ApplicationStringTable_Initialize(hInstance);

    thread bwT(&workingThread::M2Protect, wT, GetCurrentThreadId());
    bwT.detach();

#if defined(NEEDED_COMMAND_ARGUMENT)
    if (strstr(lpCmdLine, NEEDED_COMMAND_ARGUMENT) == 0) {
        MessageBox(NULL, ApplicationStringTable_GetStringz(IDS_ERR_MUST_LAUNCH_FROM_PATCHER, "ERR_MUST_LAUNCH_FROM_PATCHER"), ApplicationStringTable_GetStringz(IDS_APP_NAME, "APP_NAME"), MB_ICONSTOP);
            goto Clean;
    }
#endif

    WebBrowser_Startup(hInstance);

    if (!CheckPythonLibraryFilenames())
    {
        __ErrorPythonLibraryIsNotExist();
        return 0;
    }

    Main(hInstance, lpCmdLine);
    WebBrowser_Cleanup();
    ::CoUninitialize();

    return 0;
}
 
Bana locale.cpp paylaşırmısınız
tabiki
locale.cpp:
Genişlet Daralt Kopyala
#include "StdAfx.h"
#include "Locale.h"
#include "PythonApplication.h"
#include "resource.h"
#include "../eterBase/CRC32.h"
#include "../eterpack/EterPackManager.h"

unsigned LocaleService_GetLastExp(int level)
{
    static const int GUILD_LEVEL_MAX = 20;
    
    static DWORD INTERNATIONAL_GUILDEXP_LIST[GUILD_LEVEL_MAX+1] =
    {
        0,            // 0
        6000UL,        // 1
        18000UL,    // 2
        36000UL,    // 3
        64000UL,    // 4
        94000UL,    // 5
        130000UL,    // 6
        172000UL,    // 7
        220000UL,    // 8
        274000UL,    // 9
        334000UL,    // 10
        400000UL,    // 11
        600000UL,    // 12
        840000UL,    // 13
        1120000UL,    // 14
        1440000UL,    // 15
        1800000UL,    // 16
        2600000UL,    // 17
        3200000UL,    // 18
        4000000UL,    // 19
        16800000UL    // 20
    };

    if (level < 0 && level >= GUILD_LEVEL_MAX)
        return 0;
    
    return INTERNATIONAL_GUILDEXP_LIST[level];
}

int LocaleService_GetSkillPower(unsigned level)
{
    static const unsigned SKILL_POWER_NUM = 50;

    if (level >= SKILL_POWER_NUM)
        return 0;
    
    // 0 5 6 8 10 12 14 16 18 20 22 24 26 28 30 32 34 36 38 40 50 52 54 56 58 60 63 66 69 72 82 85 88 91 94 98 102 106 110 115 125 125 125 125 125
    static unsigned INTERNATIONAL_SKILL_POWERS[SKILL_POWER_NUM]=
    {
        0,
            5,  6,  8, 10, 12,
            14, 16, 18, 20, 22,
            24, 26, 28, 30, 32,
            34, 36, 38, 40, 50, // master
            52, 54, 56, 58, 60,
            63, 66, 69, 72, 82, // grand_master
            85, 88, 91, 94, 98,
            102,106,110,115,125,// perfect_master
            125,   
    };
    return INTERNATIONAL_SKILL_POWERS[level];
}

const char*    LocaleService_GetSecurityKey()
{
    return "1234abcd5678efgh";
}

const char* LocaleService_GetName()                { return "EUROPE";}
const char*    LocaleService_GetLocaleName()        { return "ro"; }
const char*    LocaleService_GetLocalePath()        { return "locale/ro"; }

BOOL LocaleService_IsLeadByte(const char chByte)
{
    return (((unsigned char) chByte) & 0x80) != 0;
}

int LocaleService_StringCompareCI( LPCSTR szStringLeft, LPCSTR szStringRight, size_t sizeLength )
{
    return strnicmp( szStringLeft, szStringRight, sizeLength );
}
 
const char* LocaleService_GetName() { return "EUROPE";}
const char* LocaleService_GetLocaleName() { return "ro"; }
const char* LocaleService_GetLocalePath() { return "locale/ro"; }

Burayı

const char* LocaleService_GetName() { return "TURKEY";}
const char* LocaleService_GetLocaleName() { return "tr"; }
const char* LocaleService_GetLocalePath() { return "locale/tr"; }

bununla değiştirip build ediniz
 
Son düzenleme:
const char* LocaleService_GetName() { return "EUROPE";}
const char* LocaleService_GetLocaleName() { return "ro"; }
const char* LocaleService_GetLocalePath() { return "locale/ro"; }

Burayı

const char* LocaleService_GetName() { return "TURKEY";}
const char* LocaleService_GetLocaleName() { return "tr"; }
const char* LocaleService_GetLocalePath() { return "locale/tr"; }

bununla değiştirip build ediniz
teşekkürler farklı bir filese geçtim.
 
Durum
İçerik kilitlendiği için mesaj gönderimine kapatıldı.
Geri
Üst