![]() |
[RELEASE] Source library for add functions to game
THAT SOURCE IS NOT COPYRIGHTED, IS NOT A YMIR WORK, SO DONT DELETE MY THREAD!!!!
As the first topic has been closed without a valid reason by a moderator, now i re-post that source. Hello guys, this release is targeted to publish the source code of the infamous library for editing and the addition of features to the game file. The source code is quite simple, there is a main that has the task of loading and initialize the modules (which will contain the code changes to the server) and there are folders containing utility and some functions already written. This library contains an example the addition of a function of quests has the task of query through lua (using directly the functions of the server, so no unnecessary lua modules and scripts pataccosi), which I called "sql.query()" and another function that its role is to apply files "dif" directly at server startup, in memory (hotpatch), without actually changing the executable itself. USE: The example functions are two as I said. For "sql.query()" i'll write some example for explain is at best. The query is performed trivially by passing it as an argument to the function. Example: sql.query("UPDATE table SET a = b WHERE c = d ;") If the query does not return values (UPDATE, DROP, etc ...), then there is no problem, but if I were to get interest one or more values returned from query, how do you make that? Example: local my_query = sql.query("SELECT a, b, c, d FROM table WHERE a = b ;") Nothing could be easier! We have a variable my_query, that my function "fills" as if it were a lua table. So you must return name_of_variable.column_selected: my_query.a Simple, no? With regard to differ on the fly instead, as you can see in the main there is a way, but what does it represent? Is the path the folder that contains the dif be applied when the server starts. Instead of the one present at the time, it can be use any path, but since he is "the same" for each game, if the folders that contain the game are not symmetrical to the folder that contains the dif advice to put a static route (Example "/usr/user/my_dif_folder/"). In this folder, you must create a file called "dif.cfg" which will contain in order (one per line) the names of the files loaded, which must be in the same folder. Example: file1.dif file2.dif # File3.dif ---> yes, putting a # in front of the name of the file will not load! ... filen.dif For convenience, it is best that the dif files contain only the offset and bytes to patch (without header created by ida and without various comments in the file). HOW TO FILL: Make sure you have gcc installed on the server, place a terminal in the source directory and run the command "./compile.sh" (if it says that you can not run, it is likely that the missing execute permissions, assign them with a "chmod + x compile.sh" and then fed back the compile command). This will create a new file in the folder above where the source, called "royalsword.so", this is your library. HOW TO START WITH THE LIB: To make it load to the server, just change the script you use to start different game, changing the line Run the game (eg "./path/to/my/game") with: LD_PRELOAD = "/path/to/my/lib/royalsword.so" ./Path/to/my/game Obviously, for a server with multiple cores, you need to edit each line where a core is loaded. |
wrong password
|
Try now, without "http://"
|
i haven`t can open the file because the pass is bad i test with [Only registered and activated users can see links. Click Here To Register...]
|
Quote:
|
So what the hell this does ? I must write code in C++ and then save it and i can add functions to the game core or what ?
|
Quote:
|
Quote:
I reported your post |
Thx
|
sooo, if i know C/C++ i can write my own functions and recompile it using your stuff, right?
|
Quote:
|
not nice source :D
|
Hmm.... It's bad(wrong?) to release the method for hooking functions in the game...
Now every idiot can do that... Kind regards Sphinx |
ich versteh nur bhf
Edit: liegt nicht an meinem Englisch |
mit den sachen hier kannst du quasi alles zur game an funktionen hinzufügen was du willst und wie du lustig bist, so im klartext so das hier ist ein beispiel so wie ich das verstehe.
Aber die methode ist auch nicht ganz so neu eig musste man nur hier in den threads rumschauen es wurden immer hinweise gegebene wie es funktioniert, naja jetzt weis es jeder nur noch ein hindernis gibt es :D nicht jeder kann C++ :P ( ich bin am lernen ). zum thread: Nice thread very good, thanks bro :) |
Quote:
Yet, you came here saying "not nice source", and you probably also rated this thread at just one star just to make people think this release is rubbish. I'm astonished. Back on topic, anyway, this is a great release and will allow greater development on the metin2 server files. I already had a library I made, but I'm sure this will let people be creative. |
Every idiot who can at least do some C++, you mean.
Not all can understand those kind of thing |
Quote:
void __attribute__ ((destructor)) my_unload(void); .." from [Only registered and activated users can see links. Click Here To Register...] not full copy?! and detour main? what the hell? xD no, this not nice souce. that all form full stolen stuffs.. and any copyright or licence? i found nothing.. (and i said nothing about your releases..) edit: who didn't made own dinamic library? (ex.: my petsytem in a lib :cool:) |
Quote:
ADE32 is adapted (from darkanima and mr.lucifer) to run on linux, so, how it can be copied? Part of this code was taken on stackoverflow, and documentation of BSD. my_load and my_unload, are just a coincidence that they are like the code that you linked. Are you angry because you no longer have the exclusive? |
Quote:
--> mr.lucifer have it from s0beit WinDef.h for linux: (form vc++2010 whit removed unneeded stuffs for linux) (whit this work official ADE32) Code:
/**************************************************************************** |
Quote:
|
Quote:
Copied or not, these are things never seen on a metin2 forum since i remember. |
This library works on AMD 64bit's?
|
Quote:
(if you mean amd i can say yes) |
Hello,
the source code doesn't look nice, needs a rework of code. I worked out this method of modding with ld_preload since months, it's nothing special. Use g++(c++) to compile! (Object oriented programming) :handsdown: To attaching the i386 library in a amd64 environment you must adjust the ld_preload environment variable. To inject the library in amd64 environment you can make usage of the coreext_amd64 injector. With regards, Anohros |
Quote:
Code:
#compile |
but we have to get some game functions such as equipitem etc. can we get current functions ? if yes then how?
|
Yes, you can use all default functions how you prefer.
How? Eheh, you must analyze your elf :D |
look, if i inject new func, like pc.kill or something like that.. then, how to do, that first argument of this function is vid of player? you know, like:
int kill(a1){ gamefunctionkill(a1) return 1 } |
Quote:
|
hey kann mir einer von den wissenden erklären, ob wenn ich es am anfang mit LD_32_Preload in die game einfüge ( also bevor ich die cores starte ) ob ich es dann nach dem core start in jeden core nochmal einfügen muss oder nicht?
und wenn es so ist das ich es nur 1 mal einfügen muss ist es dann nach einem reboot wieder weg und muss neu gemacht werden? danke im vorraus an die wissenden :P |
Quote:
|
Quote:
|
Please how to run the library ? the ld_preload i think dont work can anyone send me your start server file where it works ? :(
|
Quote:
use coreext to preload .so to your gamefile. |
Quote:
|
I'll republic the link, mod in this forum like remove all :asd:
[Only registered and activated users can see links. Click Here To Register...] |
ld_preload
It works; but you need a shell script! #!/bin/sh |
[Only registered and activated users can see links. Click Here To Register...]
Help me v.v |
This is a great library.
1.You can make a small documentation for it. Documentation with: Classes and methods from the game. Ingame cmd's support. 2. It would be awsome if you can get the mysql function to act like: PHP Code:
|
| All times are GMT +2. The time now is 15:14. |
Powered by vBulletin®
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.