Register for your free account! | Forgot your password?

Go Back   elitepvpers > Popular Games > Metin2 > Metin2 Private Server > Metin2 PServer Guides & Strategies
You last visited: Today at 22:50

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



[RELEASE] Source library for add functions to game

Discussion on [RELEASE] Source library for add functions to game within the Metin2 PServer Guides & Strategies forum part of the Metin2 Private Server category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Jun 2008
Posts: 60
Received Thanks: 39
[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.
Niks90 is offline  
Thanks
25 Users
Old 03/19/2013, 11:24   #2
 
elite*gold: 0
Join Date: Sep 2010
Posts: 503
Received Thanks: 609
wrong password
*Casi* is offline  
Old 03/19/2013, 11:49   #3
 
elite*gold: 0
Join Date: Jun 2008
Posts: 60
Received Thanks: 39
Try now, without "http://"
Niks90 is offline  
Thanks
1 User
Old 03/19/2013, 12:24   #4
 
elite*gold: 0
Join Date: Aug 2011
Posts: 15
Received Thanks: 0
i haven`t can open the file because the pass is bad i test with
mt2malaka is offline  
Old 03/19/2013, 12:26   #5
 
MrGanja's Avatar
 
elite*gold: 0
Join Date: Feb 2012
Posts: 262
Received Thanks: 200
Quote:
Originally Posted by mt2malaka View Post
i haven`t can open the file because the pass is bad i test with
try without http:// only .
MrGanja is offline  
Old 03/19/2013, 12:27   #6
 
[The]Domco's Avatar
 
elite*gold: 45
Join Date: Mar 2011
Posts: 253
Received Thanks: 239
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 ?
[The]Domco is offline  
Old 03/19/2013, 12:36   #7
 
Zonni's Avatar
 
elite*gold: 100
Join Date: Feb 2008
Posts: 195
Received Thanks: 270
Quote:
Originally Posted by [The]Domco View Post
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 ?
Yes. You can.
Zonni is offline  
Thanks
1 User
Old 03/19/2013, 14:29   #8
 
Mi4uric3's Avatar
 
elite*gold: 405
Join Date: Dec 2007
Posts: 6,615
Received Thanks: 6,356
Quote:
Originally Posted by pixen1 View Post
Reupload - no password.
There is no need of reuploading it.
I reported your post
Mi4uric3 is offline  
Thanks
1 User
Old 03/19/2013, 14:45   #9
 
elite*gold: 0
Join Date: Sep 2010
Posts: 503
Received Thanks: 609
Thx
*Casi* is offline  
Old 03/19/2013, 15:42   #10
 
JachuPL's Avatar
 
elite*gold: 0
Join Date: May 2012
Posts: 50
Received Thanks: 83
sooo, if i know C/C++ i can write my own functions and recompile it using your stuff, right?
JachuPL is offline  
Old 03/19/2013, 16:49   #11
 
elite*gold: 0
Join Date: Sep 2010
Posts: 503
Received Thanks: 609
Quote:
Originally Posted by JachuPL View Post
sooo, if i know C/C++ i can write my own functions and recompile it using your stuff, right?
yes
*Casi* is offline  
Old 03/19/2013, 16:52   #12
 
balika01's Avatar
 
elite*gold: 0
Join Date: Feb 2010
Posts: 179
Received Thanks: 350
not nice source
balika01 is offline  
Old 03/19/2013, 17:08   #13
 
Sphinx²'s Avatar
 
elite*gold: 1918
Join Date: Feb 2008
Posts: 1,368
Received Thanks: 1,287
Hmm.... It's bad(wrong?) to release the method for hooking functions in the game...
Now every idiot can do that...

Kind regards
Sphinx
Sphinx² is offline  
Old 03/19/2013, 19:38   #14
 
HalloweeN²'s Avatar
 
elite*gold: 0
Join Date: Nov 2010
Posts: 219
Received Thanks: 92
ich versteh nur bhf

Edit: liegt nicht an meinem Englisch
HalloweeN² is offline  
Old 03/19/2013, 19:57   #15
 
elite*gold: 17
Join Date: Jan 2009
Posts: 2,538
Received Thanks: 2,405
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 nicht jeder kann C++ :P ( ich bin am lernen ).

zum thread:
Nice thread very good, thanks bro
Perfection- is offline  
Thanks
3 Users
Reply


Similar Threads Similar Threads
Release Library
06/04/2013 - Maestia - 6 Replies
Here are all the working Releases and Tutorials. Speed Hack: This will increase your movement speed http://www.elitepvpers.com/forum/maestia/1288146- release-maestia-speed-hack-v-1-x86-64-a.html Hackshieldkiller, Bot,...: The bot will level automatically. The Hackshieldbypass will bypass the Hackshield, so you wont get kicked.
[Biete] Elitepvpers Library Source [VB.NET] | [Suche] elite*gold
01/19/2013 - elite*gold Trading - 3 Replies
.
Small CO Memory Functions Library...
01/15/2007 - Conquer Online 2 - 4 Replies
I've begun to work on a small dynamic load library (DLL) for Conquer Online in pure assembler. Due to it being programmed in assembler not only will the library be incredibly small in file size, but it will also be much faster than any Visual Basic, C++, or Pascal equivalent. Not to mention I just plain love programming in assembler languages. Before I get started on some major functions, I would like some of the more intelligent users to suggest and chose features for each so that...



All times are GMT +2. The time now is 22:50.


Powered by vBulletin®
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2024 elitepvpers All Rights Reserved.