LibM2 - A LibGame SDK

08/01/2013 14:57 IgorGlock#61
Man hat einfach "mehr" an Platz überschrieben... das ging aber bei einer bestimmten Game ... 2019 oder so.
08/01/2013 15:06 Mi4uric3#62
Quote:
Originally Posted by Computerfreek View Post
Sicher, dass er das nicht tut? Ich würde sagen er ändert von singed auf unsigned, also vorzeichenbehaftet auf vorzeichenunbehaftet.
Hmh darüber habe ich nicht nachgedacht. Was dann (evtl) angepasst wären müsste wären die Conditional Jumps.

Quote:
Originally Posted by Computerfreek View Post
Hatte xCPx nicht mal ein Video gemacht, wo er gezeigt hat dass auch mehr geht (beim Level)?
Möglich, hab ich dann aber nicht gesehen, da ich mich eigentlich gar nicht mit Privatservern beschäftige..
08/03/2013 11:33 ionutxp#63
Instaling boost other version than 1.52 (default that came with FREEBSD 8.2) is a pain in the ass. I tried to downgrade the version with no results. Can you give me an advice?

PS: More examples (especially with packets) will be nice.
08/03/2013 15:58 iMer#64
Quote:
Originally Posted by ionutxp View Post
Instaling boost other version than 1.52 (default that came with FREEBSD 8.2) is a pain in the ass. I tried to downgrade the version with no results. Can you give me an advice?

PS: More examples (especially with packets) will be nice.
(deinstall boost first)
Grab the version you want off of here:
[Only registered and activated users can see links. Click Here To Register...]
In there is a "boost"-Folder containing all kinds of headers and such
Just drop that one into /usr/local/include and you should be set


iMer
08/07/2013 11:41 ionutxp#65
UP !
It would be nice if add some samples for adding quest functions (item table, pc table..) and even for new packets in the documentation.
08/08/2013 07:27 iMer#66
Quote:
Originally Posted by ionutxp View Post
UP !
It would be nice if add some samples for adding quest functions (item table, pc table..) and even for new packets in the documentation.
You can only add new quest function tables.
So you'll have to use item2, pc2 and the sorts
I'll add examples after my vacation (~sunday next week)

As for packets:
You'd have to hook CInput<PHASE>::Analyze
where <PHASE> is the phase you want to add new packets in.
e.g. Main for the "ingame"-Phase

Check if the header matches one of yours and execute that one, if not execute the original function.
Pretty much like the command function I have already in place.
08/08/2013 10:08 JachuPL#67
is it possible to replace some functions in game using this tool? I mean i want to rewrite in ex. UseItemEx. Can I do such thing using Your tool? ;)
08/08/2013 11:11 xDeStRuCtx#68
Quote:
Originally Posted by JachuPL View Post
is it possible to replace some functions in game using this tool? I mean i want to rewrite in ex. UseItemEx. Can I do such thing using Your tool? ;)
Yep, but it`s... hard and boring to rewrite one of the biggest funcs in gamefile.
08/08/2013 14:14 ƬheGame#69
Quote:
Originally Posted by xDeStRuCtx View Post
Yep, but it`s... hard and boring to rewrite one of the biggest funcs in gamefile.
It's nearly impossible the function UseItemEx has over 900 variables and 7500 lines of code ^^
08/08/2013 17:19 iMer#70
Quote:
Originally Posted by ƬheGame View Post
It's nearly impossible the function UseItemEx has over 900 variables and 7500 lines of code ^^
Again: You could hook it - check if it's an item you want to modify
If it is - execute yours otherwise just run the original function.
No need to rewrite it

I might even add an interface for that at some point (adding custom items)

iMer
08/08/2013 19:22 Computerfreek#71
Quote:
Originally Posted by iMer View Post
Again: You could hook it - check if it's an item you want to modify
If it is - execute yours otherwise just run the original function.
No need to rewrite it

I might even add an interface for that at some point (adding custom items)

iMer
Yip, but if you want to overwrite an existing function you have to rewrite it. Or to hook the original function which is called hope it's nowher other used and let it do nothing.
08/08/2013 19:35 iMer#72
Quote:
Originally Posted by Computerfreek View Post
Yip, but if you want to overwrite an existing function you have to rewrite it. Or to hook the original function which is called hope it's nowher other used and let it do nothing.
[Only registered and activated users can see links. Click Here To Register...]
PHP Code:
void LibM2::interpretCommand(LPCHARACTER ch,const chardatasize_t len) {
    
LibM2self=instance();
    
std::istringstream iss(std::string(data,len));
    
std::vector<std::stringarguments;
    
// split command string into arguments (whitespaces)
    
copy(std::istream_iterator<std::string>(iss),std::istream_iterator<std::string>(),std::back_inserter<std::vector<std::string> >(arguments));

    if (
self->m_map_command.find(arguments.front())!=self->m_map_command.end()) { // Check if custom command exists
        
ICommandcmd self->m_map_command[arguments.front()];
        if (
cmd->usableFor(ch)) { // check if command is useable
            
cmd->use(charguments); // if useable, use it
            
return;
        } else if(
cmd->isReplaced()) { // if not usable, but replaced - send "command not found"-chatpacket
            
ch->ChatPacket(1,locale_find("그런 명령어는 없습니다"));
            return;
        }
    }
    
// if no custom command, just let the original function handle the rest
    
self->detour_interpretCommand->GetOriginalFunction()(ch,data,len);

08/08/2013 22:47 Computerfreek#73
Quote:
Originally Posted by iMer View Post
[Only registered and activated users can see links. Click Here To Register...]
PHP Code:
void LibM2::interpretCommand(LPCHARACTER ch,const chardatasize_t len) {
    
LibM2self=instance();
    
std::istringstream iss(std::string(data,len));
    
std::vector<std::stringarguments;
    
// split command string into arguments (whitespaces)
    
copy(std::istream_iterator<std::string>(iss),std::istream_iterator<std::string>(),std::back_inserter<std::vector<std::string> >(arguments));

    if (
self->m_map_command.find(arguments.front())!=self->m_map_command.end()) { // Check if custom command exists
        
ICommandcmd self->m_map_command[arguments.front()];
        if (
cmd->usableFor(ch)) { // check if command is useable
            
cmd->use(charguments); // if useable, use it
            
return;
        } else if(
cmd->isReplaced()) { // if not usable, but replaced - send "command not found"-chatpacket
            
ch->ChatPacket(1,locale_find("그런 명령어는 없습니다"));
            return;
        }
    }
    
// if no custom command, just let the original function handle the rest
    
self->detour_interpretCommand->GetOriginalFunction()(ch,data,len);

Ah, okay. Sorry, logic fail.
08/09/2013 22:11 dhbfurrff_bugnot#74
Hi, How I compile this library? thanks
08/09/2013 22:19 iMer#75
Quote:
Originally Posted by dhbfurrff_bugnot View Post
Hi, How I compile this library? thanks
I am using Codeblocks with uniwin to do the compiling for me
[Only registered and activated users can see links. Click Here To Register...]

Other than that you'll need gcc48 (or higher) and a FreeBSD (32bit) system to compile on.
I myself use a vm for that.
What you'll have to do is install gcc48 and move the old gcc/g++ commands to gcc_old or something and then rename the new gcc48 to gcc (same with g++)
[Only registered and activated users can see links. Click Here To Register...]

iMer