Other question: Ids_name To "Friendly Name"
-
I’ve made the necessary changes to CResString for it to return wstrings.
In ResString.cpp add (after the int CResString::GetString( UINT nIndex, LPSTR pszText ) and string CResString::GetString( UINT nIndex ) methods respectively):```
int CResString::GetWString( UINT nIndex, LPWSTR pswzText )
{
if( NULL == pStrBlock )
{
return INVALID_BLOCK;
}
if( (nIndex < 0) || (nIndex >= NO_OF_STRINGS_PER_BLOCK) )
{
return INVALID_BLOCK_INDEX;
}
if( NULL == pswzText )
{
return INVALID_STRING;
}
wcscpy(pswzText, pStrBlock->strArray[nIndex]);return SUCCESS_MADE;
}
wstring CResString::GetWString( UINT nIndex )
{
wstring wscText;
LPWSTR pwText;
int nLen = GetStringLength( nIndex ); // Determin length of stringpwText = (LPWSTR)malloc(sizeof(LPWSTR) * nLen); // Allocate memory for string if( this->GetWString( nIndex, pwText ) ) // Retrieve string { wscText = pwText; free( pwText ); // Free memory from retrieving text return wscText; }else return L""; // Return string;
}
In ResString.h add (same as above):
// Retrieves the wstring at nIndex
int GetWString( UINT nIndex, LPWSTR pswzText );wstring GetWString( UINT nIndex );
In HkFuncTools.cpp add:
wstring HkGetWStringFromIDS(uint iIDS) //Only works for names
{
if(!iIDS)
return L"";uint iDLL = iIDS / 0x10000; iIDS -= iDLL * 0x10000; if(vDLLs[iDLL-1].GetStringBlock((iIDS / 16) + 1, 0) != 1000) return L""; return vDLLs[iDLL-1].GetWString(iIDS - ((iIDS / 16) * 16));
}
-
Yeah, the fix worked, but Euyis helps me to this by other way, ;D
and M0tah, im still trying to load system name and player rank, thanks for reply me on 88flak forum, but i can’t load that two thing successfuly, im not found GetRank or GetName in my SDK or FLHook also in FlakCommon plugin(without a “Class call” named “pub::Reputation::GetName(iPlayerRep, fsOut1, fsOut2);”, but it be /**/ed….)…, so that so strange…
-
Thanks M0tah, now I can fix it myself.
Why you don’t share your “other way” before the M0tah fix ?
This issue let me disable some function in flhook.
You know that, I will kill you ASAP. ;D
Sorry but im busy to do building a classified project so i have not any free time for clean up my code. ;D
-
Yes I know that, share or not, that’s up to you.
Seem like some issue, please look this picture:
You can find it have a “=” in those Chines word, how to fix it ?
Hehe, you need to clear one thing first, i don’t says “Im not share” ;D
Actually, i must share this moded module because other people helps me. but i need to clean code first to take the code out from my project that need take time but im working on other thing. so i need time ;D
And, i shared my idea here, take a look my post on page 1, i just make the idea come true and get success ;D
-
Seem like some issue, please look this picture:
You can find it have a “=” in those Chines word, how to fix it ?
Does this happen with every IDS read or just with a specific one? And are characters the right ones other than the ‘=’? I’m not really sure what could be causing this.
and M0tah, im still trying to load system name and player rank, thanks for reply me on 88flak forum, but i can’t load that two thing successfuly, im not found GetRank or GetName in my SDK or FLHook also in FlakCommon plugin(without a “Class call” named “pub::Reputation::GetName(iPlayerRep, fsOut1, fsOut2);”, but it be /**/ed….)…, so that so strange…
Both of the method declarations are in the FLCoreServer.h file in the FLCoreSDK. pub::System::GetName is on line 654 and pub::Player::GetRank is on line 525.
-
It’s happen with that, when the faction name or IDS name bigger then 3 Chinese characters (1 Chinese characters = 2 English characters), and every time the characters is not same like “=”, some time is “I”, some time is “>”, some time is other characters.
Chinese characters is use two bytes characters make up, its first characters bigger then ASCII 127, but the seconds characters is no limit, so how to get it ?
Oh, and one thing I forget to tell you, some time the player get killed by NPC, but it will show the player be killed by another player, even the player not in same systme, why ?
Clear one thing first ? Is what ?
-
In chinese, have one way to make people to tell you he’s secret, called “taunts”.
JONG you want to use the “taunts” to me? ok here it is:
When i see the CResString code in FlakComm plugin, im go pass out……because… i dont understand the code, almost all… so i planing to make a new one to help me to load resstring. but one problem is: im so n00b…i dont know how to load Freelancer.ini (un standed ini file)… so i do this:
Add
string CResString::GetCurrentFileName() { return this->scAppPath; //lol, CResString get the path for me, i knon i can do this with others like list <inisectionvalue>lstValues, but i don't know how..... }</inisectionvalue>
Add
/////////////////////////////////////////////////////////////////////////////////////////////////////////////// //Get DLL Filename by IDS Number string GetResDLLFileName(uint iIDS) //Only works for names { char szCurDir[MAX_PATH]; GetCurrentDirectory(sizeof(szCurDir), szCurDir); if(!iIDS) return ""; if (iIDS < 65536) { return string(szCurDir) + "\\resources.dll"; } else { uint iDLL = iIDS / 0x10000; iIDS -= iDLL * 0x10000; /*if(vDLLs[iDLL-1].GetStringBlock((iIDS / 16) + 1, 0) != 1000) return ""; return vDLLs[iDLL-1].GetString(iIDS - ((iIDS / 16) * 16)); */ return vDLLs[iDLL-1].GetCurrentFileName(); } } //Get really String ID in DLL File for load ResString. uint GetResIDByIDS(uint iIDS) //Only works for names { uint iResStringID; if (iIDS < 65536){ return iIDS; } else { //This is why i says i need long time to test iResStringID = iIDS / 65536; iResStringID = iIDS - 65536 * uint(iResStringID); //turn to integer, needn't float. return iResStringID; } } //Send Get res to blablabla wstring GetIDSName(uint iIDS) { return LoadResFromDLL(GetResDLLFileName(iIDS), GetResIDByIDS(iIDS)); } ///////////////////////////////////////////////////////////////////////////////////////////////////////////////
Add
//Very simply API to load String wstring LoadResFromDLL(string sFileName, int iStringID) { HINSTANCE hDllString; char DllString[600]; hDllString = LoadLibraryEx(sFileName.c_str(), NULL, LOAD_LIBRARY_AS_DATAFILE); // LoadString(hDllString, iStringID, DllString, 600); // FreeLibrary(hDllString); // return stows(ctos(DllString)); }
i known, i “solved” this problem by a “fool’s way”……but it worked…
and M0tah, please help me to load Rank and SystemName, im trying long time and can’t make it work… Thanks…
-
Hehe, finally, I got the secret in your hand. ;D
But I don’t know why the M0tah of code fix can’t fix Chinese word issue ?
Before you both give me a hand, I was google it and try to learn how to and try to fix it, even I’m a C++ idiot (not only a noob), but I never finish it.
I think if you can tell M0tah why the fix can’t fix our issue, maybe next time M0tah make his code can reference it, right ?
And I’m very inquisitive why you want to load the Rank and SystemName ? another secret ? ;D
Oh, and almost forget to Thanks your share ! ;D
May you can check the Nieckey’s code ?
Ps.Nieckey: no offence, just make sure that’s not cause another issue. ;D