Page 1 of 1
Account/Char ban with delay
Posted: Wed May 26, 2010 11:18 am
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
Re: Account/Char ban with delay
Posted: Wed May 26, 2010 11:26 am
by janiii
check the jail command.
Re: Account/Char ban with delay
Posted: Wed May 26, 2010 12:00 pm
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."); }
Re: Account/Char ban with delay
Posted: Wed May 26, 2010 1:20 pm
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.");+ + } } }
Re: Account/Char ban with delay
Posted: Wed May 26, 2010 1:55 pm
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.
Re: Account/Char ban with delay
Posted: Thu May 27, 2010 12:44 am
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.

Re: Account/Char ban with delay
Posted: Thu May 27, 2010 5:43 am
by JIV
punishment which is active during offline time has no effect..