Hello would like help to leave the registration time every minute.
package net.sf.l2j.gameserver.model.entity.capturetheflag;import java.util.Calendar;import java.util.concurrent.ScheduledFuture;import java.util.logging.Logger;import net.sf.l2j.Config;import net.sf.l2j.commons.concurrent.ThreadPool;import net.sf.l2j.gameserver.util.Broadcast;/**
* @author FBIagent
*/publicclassCTFManager{protectedstatic final Logger _log =Logger.getLogger(CTFManager.class.getName());/** Task for event cycles<br> */privateCTFStartTask _task;/**
* New instance only by getInstance()<br>
*/publicCTFManager(){if(Config.CTF_EVENT_ENABLED){CTFEvent.init();this.scheduleEventStart();
_log.info("CTFEventEngine: Started.");}else{
_log.info("CTFEventEngine: Disabled.");}}/**
* Initialize new/Returns the one and only instance<br><br>
*
* @return CTFManager<br>
*/publicstaticCTFManager getInstance(){returnSingletonHolder._instance;}/**
* Starts CTFStartTask
*/publicvoid scheduleEventStart(){try{Calendar currentTime =Calendar.getInstance();Calendar nextStartTime = null;Calendar testStartTime = null;for(String timeOfDay :Config.CTF_EVENT_INTERVAL){// Creating a Calendar object from the specified interval value
testStartTime =Calendar.getInstance();
testStartTime.setLenient(true);String[] splitTimeOfDay = timeOfDay.split(":");
testStartTime.set(Calendar.HOUR_OF_DAY,Integer.parseInt(splitTimeOfDay[0]));
testStartTime.set(Calendar.MINUTE,Integer.parseInt(splitTimeOfDay[1]));// If the date is in the past, make it the next day (Example: Checking for "1:00", when the time is 23:57.)if(testStartTime.getTimeInMillis()< currentTime.getTimeInMillis()){
testStartTime.add(Calendar.DAY_OF_MONTH,1);}// Check for the test date to be the minimum (smallest in the specified list)if(nextStartTime == null || testStartTime.getTimeInMillis()< nextStartTime.getTimeInMillis()){
nextStartTime = testStartTime;}}if(nextStartTime != null){
_task =newCTFStartTask(nextStartTime.getTimeInMillis());ThreadPool.execute(_task);}}catch(Exception e){
_log.warning("CTFEventEngine[CTFManager.scheduleEventStart()]: Error figuring out a start time. Check CTFEventInterval in config file.");}}/**
* Method to start participation
*/publicvoid startReg(){if(!CTFEvent.startParticipation()){Broadcast.announceToOnlinePlayers("CTF Event: Event was cancelled.");
_log.warning("CTFEventEngine[CTFManager.run()]: Error spawning event npc for participation.");this.scheduleEventStart();}else{Broadcast.announceToOnlinePlayers("CTF Event: Registration opened for "+Config.CTF_EVENT_PARTICIPATION_TIME +" minute(s).",true);Broadcast.announceToOnlinePlayers("CTF Event: Joinable in "+Config.CTF_JOIN_LOCATION +".");if(Config.CTF_VOICED_COMMAND)Broadcast.announceToOnlinePlayers("CTF Event : Commands .ctfjoin .ctfleave .ctfinfo!");// schedule registration end
_task.setStartTime(System.currentTimeMillis()+60000L*Config.CTF_EVENT_PARTICIPATION_TIME);ThreadPool.execute(_task);}}/**
* Method to start the fight
*/publicvoid startEvent(){if(!CTFEvent.startFight()){Broadcast.announceToOnlinePlayers("CTF Event: Event cancelled due to lack of Participation.");
_log.info("CTFEventEngine[CTFManager.run()]: Lack of registration, abort event.");this.scheduleEventStart();}else{CTFEvent.sysMsgToAllParticipants("CTF Event: Teleporting participants to an arena in "+Config.CTF_EVENT_START_LEAVE_TELEPORT_DELAY +" second(s).");
_task.setStartTime(System.currentTimeMillis()+60000L*Config.CTF_EVENT_RUNNING_TIME);ThreadPool.execute(_task);}}/**
* Method to end the event and reward
*/publicvoid endEvent(){Broadcast.announceToOnlinePlayers(CTFEvent.calculateRewards());CTFEvent.sysMsgToAllParticipants("CTF Event: Teleporting back to the registration npc in "+Config.CTF_EVENT_START_LEAVE_TELEPORT_DELAY +" second(s).");CTFEvent.stopFight();this.scheduleEventStart();}publicvoid skipDelay(){if(_task.nextRun.cancel(false)){
_task.setStartTime(System.currentTimeMillis());ThreadPool.execute(_task);}}/**
* Class for CTF cycles
*/classCTFStartTask implements Runnable{privatelong _startTime;publicScheduledFuture<?> nextRun;publicCTFStartTask(long startTime){
_startTime = startTime;}publicvoid setStartTime(long startTime){
_startTime = startTime;}/**
* @see java.lang.Runnable#run()
*/@Overridepublicvoid run(){int delay =(int)Math.round((_startTime -System.currentTimeMillis())/1000.0);if(delay >0){this.announce(delay);}int nextMsg =0;if(delay >3600){
nextMsg = delay -3600;}elseif(delay >1800){
nextMsg = delay -1800;}elseif(delay >900){
nextMsg = delay -900;}elseif(delay >600){
nextMsg = delay -600;}elseif(delay >300){
nextMsg = delay -300;}elseif(delay >60){
nextMsg = delay -60;}elseif(delay >5){
nextMsg = delay -5;}elseif(delay >0){
nextMsg = delay;}else{// startif(CTFEvent.isInactive()){CTFManager.this.startReg();}elseif(CTFEvent.isParticipating()){CTFManager.this.startEvent();}else{CTFManager.this.endEvent();}}if(delay >0){
nextRun =ThreadPool.schedule(this, nextMsg *1000);}}privatevoid announce(long time){if(time >=3600&& time %3600==0){if(CTFEvent.isParticipating()){Broadcast.announceToOnlinePlayers("CTF Event: "+(time /60/60)+" hour(s) until registration is closed!");}elseif(CTFEvent.isStarted()){CTFEvent.sysMsgToAllParticipants("CTF Event: "+(time /60/60)+" hour(s) until event is finished!");}}elseif(time >=60){if(CTFEvent.isParticipating()){Broadcast.announceToOnlinePlayers("CTF Event: "+(time /60)+" minute(s) until registration is closed!");}elseif(CTFEvent.isStarted()){CTFEvent.sysMsgToAllParticipants("CTF Event: "+(time /60)+" minute(s) until the event is finished!");}}else{if(CTFEvent.isParticipating()){Broadcast.announceToOnlinePlayers("CTF Event: "+ time +" second(s) until registration is closed!");}elseif(CTFEvent.isStarted()){CTFEvent.sysMsgToAllParticipants("CTF Event: "+ time +" second(s) until the event is finished!");}}}}privatestaticclassSingletonHolder{protectedstatic final CTFManager _instance =newCTFManager();}}
You can post now and register later.
If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.
Faltan demasiados archivos, y lógicas en clases claves como L2pcInstance, entre otras. si bien muchas cosas están y el flujo es valorable. Gracias por tu esfuerzo es bastante... pero realmente no esta completo el código, falta que subas todas las modificaciones en clases colaterales... podrías intentar subir un diff de todo el mod completo de tu pack y bueno ahí si que cada uno adapte... pero faltan muchas cosas, dudo que haya gente que lo haya echo funcionar con esto...
I know people who have fully bypassed and reversed AAC. One day, they might even release the full source code, but for now, they’re still making money off it. I won’t name anyone, but it’s clear that there aren’t any truly solid anticheats for Lineage2. As I’ve said before, kernel level anticheats are the only real solution. Anything that runs as Internal and injects gets flagged, and your account ends up getting kicked or banned. That’s just how most games handle it nowadays.
To TL;DR the whole thing cheating will always exist because there are people out there smart enough to bypass any protection and run private cheats. Public cheats are always detected eventually, so I don’t see any point in buying AAC, especially when they claim it blocks adr, which simply isn’t true.
🌐 Website: https://l2adonis.com
📅 GRAND OPENING: July 18, 2025 – 20:00 (UTC+2)
💬 Discord: https://discord.com/invite/tZBj8JxAwx
🚫 No auto-farm • No auto-macro • No pay-to-win • No custom
Some Basic Info's (More detalied info's on website)
EXP/SP: x25
Adena: x15
Drop: x15
Spoil: x15
Seal Stones: x15
Raid Boss Drop: x10
Epic Boss Drop: x1
Manor: x10
Safe Enchant: +4
Max Enchant: +16
Normal Scroll Chance: 50%
Blessed Scroll Chance: 66% (If enchant fail item remain +4)
Buff Slots (30+4 extra with Divine Inspiration)
Dances/Songs Slots 14
Auto-learn skills
⚔️ Real PvP • Real Progression • Retail-like experience
JOIN NOW and relive the real L2 experience!
Discord : utchiha_market
Telegram : https://t.me/utchiha_market
Auto Buy Store : https://utchihamkt.mysellauth.com/
Not sure if we’re legit? Check Our server — real reviews, real buyers
https://discord.gg/uthciha-servicess | https://campsite.bio/utchihaamkt
Looking for a Developer – Lineage II Interlude (Vanganth Files)
I’m seeking a developer to collaborate on a project based on Vanganth Interlude files.
Important: Applicants with a bad attitude, lack of respect, or unwillingness to work will be immediately rejected.
Payment: Hourly rate, not per task.
Contact: Please reach out to me via PM.
Question
l2jkain
Hello would like help to leave the registration time every minute.
0 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.