Account/Char ban with delay

Support for the latest build of L2J Server, get help here with installations, upgrades, problems.
Do not post bugs reports here, use viewforum.php?f=77 instead.
There is no support for other server builds than the official provided by l2jserver.com
Forum rules
READ NOW: L2j Forums Rules of Conduct
Post Reply
hyperpara
Posts: 8
Joined: Sat Mar 21, 2009 7:50 pm

Account/Char ban with delay

Post by hyperpara »

Hi there guys!
First of all, sorry for my english.

Can you tell me that is it possible to create a script, or something for ban the characters/accounts for only a limited time?
Example:
//ban_jake_30
When using this command, server will ban character "jake" for 30 minutes or days (depends on what we set to).
Or another example:
//ban_acc_cliff_30
And when using this, the server will ban cliff's account for 30 mins, days, hrs (again the same above).

I'm beginner in it, i tried to create it, with no luck..
Thanks for your help
hyper
User avatar
janiii
L2j Veteran
L2j Veteran
Posts: 4269
Joined: Wed May 28, 2008 3:15 pm
Location: Slovakia

Re: Account/Char ban with delay

Post by janiii »

check the jail command.
DO NOT EVEN TRY TO MESS WITH ME!
forum flOOder dancing dEVILoper
I don't give private support - PM will be ignored!
User avatar
Tan
L2j Veteran
L2j Veteran
Posts: 873
Joined: Wed Jun 10, 2009 10:31 pm
Location: Poland

Re: Account/Char ban with delay

Post by Tan »

Code: Select all

	    	{	    		_punishLevel = state;	    		_punishTimer = 0;		        // Remove the task if any		        stopPunishTask(false); 	            if (delayInMinutes > 0)	            {	                _punishTimer = delayInMilliseconds; 	                // start the countdown	                _punishTask = ThreadPoolManager.getInstance().scheduleGeneral(new PunishTask(this), _punishTimer);	                sendMessage("You are in jail for "+delayInMinutes+" minutes.");	            }
Some people believe in God... i believe in Music... some people pray..... I turn on Winamp
http://www.last.fm/user/L2jTan
User avatar
Tan
L2j Veteran
L2j Veteran
Posts: 873
Joined: Wed Jun 10, 2009 10:31 pm
Location: Poland

Re: Account/Char ban with delay

Post by Tan »

hmmm not sure but should be it like this?

Code: Select all

### Eclipse Workspace Patch 1.0#P L2_GameServerIndex: java/com/l2jserver/gameserver/model/actor/instance/L2PcInstance.java===================================================================--- java/com/l2jserver/gameserver/model/actor/instance/L2PcInstance.java	(revision 4219)+++ java/com/l2jserver/gameserver/model/actor/instance/L2PcInstance.java	(working copy)@@ -12607,7 +12607,19 @@ 	    	default: 	    	{ 	    		_punishLevel = state;-	    		break;+	    		_punishTimer = 0;+		        // Remove the task if any+		        stopPunishTask(false);+	+	            if (delayInMinutes > 0)+	            {+	                _punishTimer = delayInMilliseconds;+	+	                // start the countdown+	                _punishTask = ThreadPoolManager.getInstance().scheduleGeneral(new PunishTask(this), _punishTimer);+	                sendMessage("You are Banned for "+delayInMinutes+" minutes.");+                     +	            } 	    	}     	}  
Some people believe in God... i believe in Music... some people pray..... I turn on Winamp
http://www.last.fm/user/L2jTan
User avatar
janiii
L2j Veteran
L2j Veteran
Posts: 4269
Joined: Wed May 28, 2008 3:15 pm
Location: Slovakia

Re: Account/Char ban with delay

Post by janiii »

there is more to do. ban means the player cannot get ingame. the delay would work if the delay would timeout when server is running and the timer was loaded in memory. but it would not work when there was a server restart between. this has to be handled in login for account ban and before enter world (CharacterSelect) for char ban.
DO NOT EVEN TRY TO MESS WITH ME!
forum flOOder dancing dEVILoper
I don't give private support - PM will be ignored!
User avatar
Raikkon35
Posts: 178
Joined: Sat Mar 08, 2008 2:54 pm

Re: Account/Char ban with delay

Post by Raikkon35 »

Ok, I have a proposal for whoever is interested in code it.

The system can calculate the time when the punishment ends.
1. Type "/ban epi 30" (minutes, hours, or days, what you feel like).
2. Calculate: if the time is 18:00, at 18:30 the punishment should end.
3. Insert into db accounts table.
4. If the user wants to enter, the login server checks the database. If it's 18:25, do not let in, if at 18:31, yes.

:D
User avatar
JIV
L2j Veteran
L2j Veteran
Posts: 1882
Joined: Sun Jan 06, 2008 8:17 pm
Location: Slovakia
Contact:

Re: Account/Char ban with delay

Post by JIV »

punishment which is active during offline time has no effect..
Post Reply