- Katılım
- 30 May 2025
- Konular
- 10
- Mesajlar
- 180
- Online süresi
- 6d 19h
- Reaksiyon Skoru
- 59
- Altın Konu
- 0
- TM Yaşı
- 1 Yıl 4 Gün
- Başarım Puanı
- 51
- MmoLira
- 1,979
- DevLira
- 12
ROHAN2 WORLD 1-120 TR TİPİ OFFICIAL YOHARA, BALATHOR VE AMON! 80. GÜNÜNDE! +10.000 ONLİNE! HİLE VE BOT %100 ENGELLİ HEMEN TIKLA!
Hello
I'm using this version and it's good, but I have one problem with its language system; it's very buggy.
forum.turkmmo.com
The problem is that the locale_quest.txt file prints text literally. For example, if it finds text containing %d symbols, it prints the text exactly as it appears. For example:
6704 %d hediyeden %d hediye daha açabilirsin.
It appears in the chat like this:
%d hediyeden %d hediye daha açabilirsin.
Although the `%d` symbol is supposed to change the number of remaining occurrences, and the user does the same with the `%s` symbol, the symbol appears, but the time or the number that should be displayed is not. After some research and careful consideration, I discovered that I have to go to each task on the server side and add this command to every string containing the aforementioned symbols (`string.format`). However, it is extremely tedious to go to each task to add the text, and the command might work on one line but not another, unlike other programming languages where it works automatically.
I tried searching on the source server side and found functions responsible for the command, and I also searched on the client source side and found functions responsible for the command, but my mind went blank at that moment. When I asked the AI, it told me to modify the function on the server, then it told me not to modify anything on the server and to modify the function in the client source. I am confused. Therefore, I hope someone can help me with this matter. Thank you.
All the information I searched for and found
I'm using this version and it's good, but I have one problem with its language system; it's very buggy.
M2Project - 1-120 Şampiyon Seviye Server Files
Merhaba arkadaşlar arşivde duruyordu içinde Seviyeli (Growth) Pet sistemi eklenmiş Owshap 'ın farklı bir versiyonu umarım işinize yarar. Not: Videodaki bot sistemi ekli değildir bilginize .. Bu linkte içinde herşey mevcut (Game/Mysql/FreeBSD/Source/DumpProto Full + Full) Öğeyi görmek için üye...
The problem is that the locale_quest.txt file prints text literally. For example, if it finds text containing %d symbols, it prints the text exactly as it appears. For example:
6704 %d hediyeden %d hediye daha açabilirsin.
It appears in the chat like this:
%d hediyeden %d hediye daha açabilirsin.
Although the `%d` symbol is supposed to change the number of remaining occurrences, and the user does the same with the `%s` symbol, the symbol appears, but the time or the number that should be displayed is not. After some research and careful consideration, I discovered that I have to go to each task on the server side and add this command to every string containing the aforementioned symbols (`string.format`). However, it is extremely tedious to go to each task to add the text, and the command might work on one line but not another, unlike other programming languages where it works automatically.
I tried searching on the source server side and found functions responsible for the command, and I also searched on the client source side and found functions responsible for the command, but my mind went blank at that moment. When I asked the AI, it told me to modify the function on the server, then it told me not to modify anything on the server and to modify the function in the client source. I am confused. Therefore, I hope someone can help me with this matter. Thank you.
All the information I searched for and found
Kod:
bool CPythonNetworkStream::LoadLocaleQuestVnum(const char* c_szLocaleQuestFileName)
{
CMappedFile file;
const VOID* pvData;
if (!CEterPackManager::Instance().Get(file, c_szLocaleQuestFileName, &pvData))
{
Tracef("CPythonNetworkStream::LoadLocaleQuestVnum(c_szLocaleQuestFileName=%s) - Load Error", c_szLocaleQuestFileName);
return false;
}
CMemoryTextFileLoader kMemTextFileLoader;
kMemTextFileLoader.Bind(file.Size(), pvData);
m_kMap_dwID_strLocaleQuest.clear();
CTokenVector TokenVector;
for (DWORD i = 0; i < kMemTextFileLoader.GetLineCount(); ++i)
{
if (!kMemTextFileLoader.SplitLineByTab(i, &TokenVector))
continue;
const char* c_szComment = "#";
if (TokenVector[0].compare(0, 1, c_szComment) == 0 || TokenVector.size() != 2)
continue;
m_kMap_dwID_strLocaleQuest.insert(std::make_pair(atoi(TokenVector[0].c_str()), TokenVector[1]));
}
return true;
}
const char* CPythonNetworkStream::GetLocaleQuestVnum(DWORD dwVnum)
{
std::map<DWORD, std::string>::iterator it = m_kMap_dwID_strLocaleQuest.find(dwVnum);
static char s_szChat[1024 + 1] = "";
if (it != m_kMap_dwID_strLocaleQuest.end())
{
sprintf(s_szChat, "%s", it->second.c_str());
}
return s_szChat;
}
Kod:
void LoadLocaleQuest(const char* c_szFileName, BYTE bLocale)
{
FILE* pFile = nullptr;
if (nullptr == (pFile = fopen(c_szFileName, "r")))
return;
gLocaleQuestMapType[bLocale].clear(); // Support for resetting the map type.
static SToken sToken = { 0, "" };
BYTE bToken = 0;
char szLine[BUFSIZ] = { 0 }, * pBuf = nullptr;
while (fgets(szLine, BUFSIZ, pFile))
{
// Tokenise the read line, using "\" delimiter*/
pBuf = strtok(szLine, "\t");
sToken.dwVNum = std::atol(pBuf);
while (nullptr != (pBuf = strtok(nullptr, "\n")))
{
bToken++;
// Store the tokens as per structure members , where (i == 0) is first member and so on...
if (bToken == 1)
sToken.stString = pBuf;
}
gLocaleQuestMapType[bLocale].emplace(std::make_pair(sToken.dwVNum, sToken.stString));
sToken.stString.clear(); // Clear last string.
bToken = 0; // Reset token value of iToken.
}
fclose(pFile);
}
const char* FindLocaleQuest(DWORD dwVNum, BYTE bLocale)
{
LocaleMapType::iterator it = gLocaleQuestMapType[bLocale].find(dwVNum);
if (it != gLocaleQuestMapType[bLocale].end())
return it->second.c_str();
return c_stDefaultString.c_str();
}







