[Release] Rappelz RDB Tool with tabs

02/13/2014 01:04 glandu2#46
There was a BUILDING_DATABASE to define when compiling database DLLs, but I can remove this define. Before I update the original post, replace ExportDLL.h with that:

Code:
#ifndef EXPORTDLL_H_INCLUDED
#define EXPORTDLL_H_INCLUDED

#ifdef __unix__
#	if defined(BUILDING_BASE)
#		define EBASEDLL __attribute__((visibility("default")))
#	else
#		define EBASEDLL
#	endif
#	define EDATABASEDLL __attribute__((visibility("default")))
#else
#	if defined(BUILDING_BASE)
#		define EBASEDLL __declspec(dllexport)
#	else
#		define EBASEDLL __declspec(dllimport)
#	endif
#	define EDATABASEDLL __declspec(dllexport)
#endif

#ifdef __unix__
#	define DLLCALLCONV
#else
#	define DLLCALLCONV __stdcall
#endif


#endif // EXPORTDLL_H_INCLUDED
Also be careful to compile as a 32 bits DLL, not 64 bits
And that you need to add the option
Code:
-Wl,--kill-at -static-libgcc -static-libstdc++
to the linker (apply only to mingw).
On codeblocks it's there:
[Only registered and activated users can see links. Click Here To Register...]
In "Other linker options" (don't put what is on the image, I take this image from internet as I don't have codeblocks)

[edit]
I updated the version to 2.3.2 with the dialog box to convert between hash and filenames (menu: options -> Show/hide Hash converter)

In attachment: a sample project for codeblock and mingw that works (-Wl,--kill-at -static-libgcc -static-libstdc++ is already added in this project)
02/13/2014 03:05 sona998#47
Quote:
Originally Posted by glandu2 View Post
Weird, I don't have this crash, but found a crash when loading SQL table with 0 length strings

Does it crash before loading anything (ie: the progress bar stay at 0% ?)

I updated the post with the correction about SQL table and 0 length strings crash. But I definitely didn't have any crashes when saving the file to RDB, maybe it was related to the corrected bug
Yes, the program crashes when that progress bar shows at 0%.

In terms of compiling DLLs, I just used msvc2012, I think all versions of msvc work fine. When I used Codeblocks, then yes, I had the same problem as eziorav but after using msvc, those problems seem non-existent, and so I stopped using Codeblocks to compile.
02/13/2014 03:43 glandu2#48
Quote:
Originally Posted by sona998 View Post
Yes, the program crashes when that progress bar shows at 0%.

In terms of compiling DLLs, I just used msvc2012, I think all versions of msvc work fine. When I used Codeblocks, then yes, I had the same problem as eziorav but after using msvc, those problems seem non-existent, and so I stopped using Codeblocks to compile.
Did you tried the latest version I put on the original post ? (2.3.2)
02/13/2014 03:52 sona998#49
Quote:
Originally Posted by glandu2 View Post
Did you tried the latest version I put on the original post ? (2.3.2)
Yes, just tried that now. It still crashes, for whatever reason. Version 2.2.0 works for some reason, but then that ones doesn't reads in type_decimal correctly.

[Edit] Looks like the dlls given in the pack works. But I'm using a custom made dll for Epic 4/5.2 rdb's and that seems to be crashing, not sure why.

I've doubled checked this custom dll to Skilldatabase.dll and nothing has changed.

[Edit] I've found what's crashing the program. In my SkillFullDatabase.dll


Code:
#pragma comment(linker, "/EXPORT:convertData=_convertData@16")
void EDATABASEDLL DLLCALLCONV convertData(eDataFormat dst, eDataConvertionType mode, IRowManipulator *row, unsigned int rowNum) {
	if(mode == DCT_Write && dst == DF_RDB) {

		*static_cast<short*>(row->getValuePtr("unknown")) = 1;
		*static_cast<char*>(row->getValuePtr("skill_lvup_limit")) = 0;
		*static_cast<short*>(row->getValuePtr("skill_enchant_link")) = 243; <-- It crashes here. 
		*static_cast<char*>(row->getValuePtr("unknown0")) = 115;
		*static_cast<char*>(row->getValuePtr("unknown1")) = 105;
		*static_cast<char*>(row->getValuePtr("unknown2")) = 115;
		*static_cast<short*>(row->getValuePtr("unknown3")) = 15727;
		*static_cast<short*>(row->getValuePtr("unknown4")) = 27745;
		*static_cast<short*>(row->getValuePtr("unknown5")) = 0;
		*static_cast<char*>(row->getValuePtr("unknown6")) = 31;
		*static_cast<char*>(row->getValuePtr("unknown7")) = 37;
		*static_cast<char*>(row->getValuePtr("unknown8")) = 0;
		*static_cast<short*>(row->getValuePtr("unknown9")) = 16441;
		*static_cast<char*>(row->getValuePtr("unknown10")) = 0;
		*static_cast<char*>(row->getValuePtr("hasJPCost")) = 0;
	}
}
When I uncomment everything but the first two, no crashes, but once I uncomment the third line, that's when it crashes the program. When the program is writing to rdb that is when it crashes because the above method is apart of the saving process. This above method works in v2.1.0, but not in the versions afterwards. In v2.1.0, I can save into rdb just fine to force client changes. (Note this is for Epic4/5.2, thus why there are alot more fields for 'unknowns', etc.)
02/13/2014 05:13 naik127#50
Quote:
Originally Posted by eziorav View Post
Glandu im getting these errors while trying to compile a new dll
help please
[Only registered and activated users can see links. Click Here To Register...]
Please give structure item 8.3. Rdb
02/13/2014 12:05 glandu2#51
Quote:
Originally Posted by sona998 View Post
Yes, just tried that now. It still crashes, for whatever reason. Version 2.2.0 works for some reason, but then that ones doesn't reads in type_decimal correctly.

[Edit] Looks like the dlls given in the pack works. But I'm using a custom made dll for Epic 4/5.2 rdb's and that seems to be crashing, not sure why.

I've doubled checked this custom dll to Skilldatabase.dll and nothing has changed.

[Edit] I've found what's crashing the program. In my SkillFullDatabase.dll


Code:
#pragma comment(linker, "/EXPORT:convertData=_convertData@16")
void EDATABASEDLL DLLCALLCONV convertData(eDataFormat dst, eDataConvertionType mode, IRowManipulator *row, unsigned int rowNum) {
	if(mode == DCT_Write && dst == DF_RDB) {

		*static_cast<short*>(row->getValuePtr("unknown")) = 1;
		*static_cast<char*>(row->getValuePtr("skill_lvup_limit")) = 0;
		*static_cast<short*>(row->getValuePtr("skill_enchant_link")) = 243; <-- It crashes here. 
		*static_cast<char*>(row->getValuePtr("unknown0")) = 115;
		*static_cast<char*>(row->getValuePtr("unknown1")) = 105;
		*static_cast<char*>(row->getValuePtr("unknown2")) = 115;
		*static_cast<short*>(row->getValuePtr("unknown3")) = 15727;
		*static_cast<short*>(row->getValuePtr("unknown4")) = 27745;
		*static_cast<short*>(row->getValuePtr("unknown5")) = 0;
		*static_cast<char*>(row->getValuePtr("unknown6")) = 31;
		*static_cast<char*>(row->getValuePtr("unknown7")) = 37;
		*static_cast<char*>(row->getValuePtr("unknown8")) = 0;
		*static_cast<short*>(row->getValuePtr("unknown9")) = 16441;
		*static_cast<char*>(row->getValuePtr("unknown10")) = 0;
		*static_cast<char*>(row->getValuePtr("hasJPCost")) = 0;
	}
}
When I uncomment everything but the first two, no crashes, but once I uncomment the third line, that's when it crashes the program. When the program is writing to rdb that is when it crashes because the above method is apart of the saving process. This above method works in v2.1.0, but not in the versions afterwards. In v2.1.0, I can save into rdb just fine to force client changes. (Note this is for Epic4/5.2, thus why there are alot more fields for 'unknowns', etc.)
Be sure that the column name is correct and that the type is TYPE_INT16 (because of short keyword). The column names are case sensitive.

To debug values, you can use OutputDebugString and sprintf and [Only registered and activated users can see links. Click Here To Register...] like this:
Code:
char buffer[512]; //the buffer can hold 512 characters max
sprintf(buffer, "The value is: %d", variableyouwanttosee);
OutputDebugString(buffer);
You need to add #include <windows.h> at the beginning of your file to use OutputDebugString
See there: [Only registered and activated users can see links. Click Here To Register...] for an example at the bottom of how to use the format string (sprintf use the same format as printf)

You can debug your DLL too, that would be much simpler to see what's going on, information here: [Only registered and activated users can see links. Click Here To Register...]
The executable to select is RappelzRDBToolQt.exe
Then you can put a breakpoint in convertData function or just execute the program and visual studio will break at your breakpoint or where the crash occur
02/13/2014 15:33 eziorav#52
Glandu while trying to add dll i get this error
[Only registered and activated users can see links. Click Here To Register...]
02/13/2014 21:16 glandu2#53
Are you sure you added -Wl,--kill-at to the linker options ?

This error means that my tool didn't find the function named registerDBStructure. Without any options, gcc names functions with a @ and a number based on the parameters count so it probably named registerDBStructure() like this: registerDBStructure@8. Using -Wl,--kill-at remove the '@8'. I could use this function name instead, but this name depends on the compiler (msvc will not use that name by default, but the #pragma tell it explicitly the name I want)
02/13/2014 21:39 eziorav#54
lol sorry glandu
i was trying to add an old dll that i compiled without adding "-Wl,--kill"
and that was stupid from me to do
02/14/2014 03:53 sona998#55
Yes, I've fixed the problem. Was an error on my part, (not sure why the column name changed, because there is no need to change it but whatever).

Very powerful tool. Thank you. Can easily be used to recreate Epic 4 pets using Epic 5.2 client for sure. :D

So the tool has good multi-epic support. ^^

Happy Valentines' Day. Feel the love with Siren whipping you!

[IMG=expandable: 1][Only registered and activated users can see links. Click Here To Register...]
02/15/2014 00:25 glandu2#56
I updated the tool to version 2.3.3: you should not need to add -Wl,--kill-at to mingw and the #pragma in database DLL sources should not be needed anymore. I also fixed a display bug when a string has a length of 0
02/23/2014 15:06 KirieZ#57
Hi glandu2, I'm trying to convert my ItemResource to rdb but when I try to equip anything it says that I don't have the requirements. I'm using 8.1 Server Files and database. I did this way:
- Configured the SQL Connection (following your images some pages back)
- Chose ItemDatabase.dll structure
- File > Load From SQL
- Save to File > db_item.rdb
- Renamed db_item.rdb to U{W.Y(_ZdT!JV

I tried to use the rdb from Royal Repack and convert it back to my database but it crashes the server.

Can you help me? Thanks in advance
02/25/2014 18:03 rcadil#58
hi glandu2
When i make rdb from Stringresource & i put it to Resource folder, skills crash the client

more instruction:
when I put the mouse above some skills ===>
[Only registered and activated users can see links. Click Here To Register...]
[Only registered and activated users can see links. Click Here To Register...]

= client crash after that
Is there any solution ?
02/25/2014 18:31 ThunderNikk#59
Quote:
Originally Posted by rcadil View Post
hi glandu2
When i make rdb from Stringresource & i put it to Resource folder, skills crash the client

more instruction:
when I put the mouse above some skills ===>
[Only registered and activated users can see links. Click Here To Register...]
[Only registered and activated users can see links. Click Here To Register...]

= client crash after that
Is there any solution ?
This is an error caused by Raskim's Database Manager 2013 and the string resource. As far as I know it is the only database table and RDB that you can not edit with it.

Roll back your db_string.rdb to one that has not been edited with the database manager and try to use this tool on it instead.
02/25/2014 18:47 rcadil#60
Quote:
Originally Posted by thndr View Post
This is an error caused by Raskim's Database Manager 2013 and the string resource. As far as I know it is the only database table and RDB that you can not edit with it.

Roll back your db_string.rdb to one that has not been edited with the database manager and try to use this tool on it instead.
but, I have make the db_string.rdb directly from Arcadia database with no editing.

(I'm using Royal Rapack)