Register for your free account! | Forgot your password?

You last visited: Today at 21:14

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

Advertisement



[RELEASE] In-game ban command for GMs

Discussion on [RELEASE] In-game ban command for GMs within the Metin2 PServer Guides & Strategies forum part of the Metin2 Private Server category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Apr 2009
Posts: 121
Received Thanks: 780
[RELEASE] In-game ban command for GMs

Hello everyone,
today I'm releasing a mod for the game file which has always been sought, at least in the past.
It's the in-game ban command, which GMs can use in the same way they would use the "block chat" command.
The mod is applied to the game with the "dynamic library" method, but I haven't used any code from the one posted by niky90, everything's been done from scratch by me and only me: the "base" library is the same I will use on my server, , but, obviously, there are just two modules in this one, the "Command extension" and the "Ban command" ones.

To use the library, download it and put it somewhere on your server, then edit the start script, to be more precise the line where it runs the "cores" (it'll probably look like "./corename"):
Code:
env LD_PRELOAD="/full/path/to/the/lib.so" ./corename
Warning: if you're using a 64-bit OS, you should use the "LD_32_PRELOAD" environment variable instead of that one.

You can check if the library has been loaded by the message it shows when the game starts:

The in-game usage is really simple:
Code:
/ban playername [duration]
The duration parameter is optional, in which case the ban will be permanent, otherwise you can specify the timespan you want the player to be banned in exactly the same way you would with the "block_chat" command. For redundancy, you might as well write "permanent" in the duration parameter, and it will execute as if you didn't write anything (which means a permanent ban).
To unban, just write:
Code:
/ban playername 0
The library requires that you have the "account" database named exactly like that, "account". If that database has another name on your server, the library will not work.

That should be all. I will probably update this when I have time, to make it show a notice to all players that a certain user has been (un)banned.

Credits:
me XD
, since I wouldn't have made the library, nor could I have tested without this server.

Changelog:
  • 29/04/2013: Initial release, added automatic disconnect and database query in case the banned player is not online.

Quote:
Update: someone asked via PM to have the source of the ban function. While it's not a problem for me to post that, it would be to post the source for my whole library. So, I'm posting this just for reference, to let people see how it works (and also check if there is any bug, why not). You probably won't be able to compile the source as it is, if you don't have the right header files XD


Password: UniversalElements
ricky92 is offline  
Thanks
32 Users
Old 04/29/2013, 16:03   #2
 
Stαgє6's Avatar
 
elite*gold: 0
Join Date: Jul 2011
Posts: 2,019
Received Thanks: 1,471
This is not bad when this going its good ^^
Stαgє6 is offline  
Old 04/29/2013, 16:08   #3
 
.αpeх''s Avatar
 
elite*gold: 244
Join Date: Jun 2010
Posts: 602
Received Thanks: 471
Very nice. Well done!
.αpeх' is offline  
Old 04/29/2013, 16:20   #4
 
elite*gold: 26
Join Date: Oct 2011
Posts: 1,262
Received Thanks: 1,062
Good Job.

Source please.
He3o Crysis is offline  
Old 04/29/2013, 16:42   #5
 
elite*gold: 0
Join Date: Jun 2012
Posts: 1,560
Received Thanks: 188
Good Work!

Thanks!
I3rockencyde is offline  
Old 04/29/2013, 16:44   #6
 
.Nexus''s Avatar
 
elite*gold: LOCKED
Join Date: Jan 2012
Posts: 807
Received Thanks: 245
Well done!
Thanks.
.Nexus' is offline  
Old 04/29/2013, 16:47   #7
 
elite*gold: 0
Join Date: Apr 2009
Posts: 121
Received Thanks: 780
Quote:
Originally Posted by Lerσx™ View Post
Good Job.

Source please.
I won't release the source for the whole lib, as it contains way more than what is needed to compile this, but if you want I can release the source of the do_ban function

Quote:
Originally Posted by kwiatmix View Post
I have this error:

When i write and press to do it comman "./compile.sh".
I've all files from topic "library game file".

What's wrong ?
You don't need to compile it, it's already compiled.
ricky92 is offline  
Old 04/29/2013, 16:47   #8
 
[SA]Con's Avatar
 
elite*gold: 150
Join Date: Sep 2010
Posts: 1,071
Received Thanks: 556
Hmm, irgendwie funktioniert das ganze nicht ganz.

Sobald ich eingebe /ban BannTest 50 stopt der Server und die Cores crashen. Komisch...

Dennoch Gute arbeit.
[SA]Con is offline  
Old 04/29/2013, 17:04   #9
 
elite*gold: 0
Join Date: Apr 2009
Posts: 121
Received Thanks: 780
Quote:
Originally Posted by [SA]Con View Post
Hmm, irgendwie funktioniert das ganze nicht ganz.

Sobald ich eingebe /ban BannTest 50 stopt der Server und die Cores crashen. Komisch...

Dennoch Gute arbeit.
Is the GM character you're trying to ban BannTest itself?
ricky92 is offline  
Old 04/29/2013, 17:16   #10
 
[SA]Con's Avatar
 
elite*gold: 150
Join Date: Sep 2010
Posts: 1,071
Received Thanks: 556
Quote:
Originally Posted by ricky92 View Post
Is the GM character you're trying to ban BannTest itself?
No, my GM is [SA]Con "BannTest" is the Test Character (Other account)

I use the command: /ban BannTest 50 but no reason in the chat 3 seconds after the command => Kick from Game and all Cores are Crashed. Sorry for my bad english
[SA]Con is offline  
Old 04/29/2013, 17:20   #11
 
Sphinx²'s Avatar
 
elite*gold: 1918
Join Date: Feb 2008
Posts: 1,368
Received Thanks: 1,287
Quote:
Originally Posted by [SA]Con View Post
No, my GM is [SA]Con "BannTest" is the Test Character (Other account)

I use the command: /ban BannTest 50 but no reason in the chat 3 seconds after the command => Kick from Game and all Cores are Crashed. Sorry for my bad english
Welche Revision nutzt du?

Gruss
Sphinx
Sphinx² is offline  
Old 04/29/2013, 17:21   #12
 
[SA]Con's Avatar
 
elite*gold: 150
Join Date: Sep 2010
Posts: 1,071
Received Thanks: 556
Quote:
Originally Posted by Sphinx² View Post
Welche Revision nutzt du?

Gruss
Sphinx
2089
[SA]Con is offline  
Old 04/29/2013, 17:21   #13
 
Sphinx²'s Avatar
 
elite*gold: 1918
Join Date: Feb 2008
Posts: 1,368
Received Thanks: 1,287
Quote:
Originally Posted by [SA]Con View Post
2089
Hast du schon mal in den "*.core" Dateien nachgeschaut mit dem
Debugger was da raus kommt?

Gruss
Sphinx
Sphinx² is offline  
Old 04/29/2013, 17:23   #14
 
[SA]Con's Avatar
 
elite*gold: 150
Join Date: Sep 2010
Posts: 1,071
Received Thanks: 556
Quote:
Originally Posted by Sphinx² View Post
Hast du schon mal in den "*.core" Dateien nachgeschaut mit dem
Debugger was da raus kommt?

Gruss
Sphinx
Doofe frage aber welcher Debugger?
[SA]Con is offline  
Old 04/29/2013, 17:31   #15
 
.Nexus''s Avatar
 
elite*gold: LOCKED
Join Date: Jan 2012
Posts: 807
Received Thanks: 245
Its not working

Code:
******************************************************
*        Universal Elements extension library        *
*                  made by ricky92                   *
*                   Version 1.0.0                    *
******************************************************
[*] Module "Ban command" loaded.[*] Module "Command Extensions" loaded.
        Command registered: "ban" (early initialization)

[COLOR="DarkRed"]Can not open [CONFIG][/COLOR]
Ingame I type in:
Code:
/ban Nexus 50
And he starts dancing ^^
.Nexus' is offline  
Reply


Similar Threads Similar Threads
Server command from outside the game
10/21/2012 - Aion Private Server - 8 Replies
How i can send a command from outside the game? For example, change the //weather without having to be in the game. Thanks!
A game small command
09/15/2009 - General Coding - 0 Replies
Delete this since no1 can help, Thanks
[Release] a new command
07/16/2009 - CO2 PServer Guides & Releases - 8 Replies
ok this is the /pet command ok its not hard to do and i thank it will only work if u have the summon guard working becaz i us its atk type or u can edit it if u want but ul hafe to fix it up so it wont atk its self if u do that well any way here u go find wear u put commands in and put this if (Splitter == "/pet") { // /pet HP atk name mech lvl ...
[Release]-- New Command --
12/10/2008 - CO2 PServer Guides & Releases - 7 Replies
GOT That Damianpesta _1_



All times are GMT +1. The time now is 21:15.


Powered by vBulletin®
Copyright ©2000 - 2025, 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 ©2025 elitepvpers All Rights Reserved.