Jump to content

Recommended Posts

Posted

Well, i just synchronized all the function so it will be executed all before we could delete any player.

 

It works fine, couldnt get any exceptions, or create extra task, so no problems with a lot of times trying 150 mils, 6000 players and removing random players one by one

 

If any expert of concurrence want to help, or just comment, it is welcome

 

Shouldn't it be a FastList ?

FastList will improve the speed of adding and removing (FastMap has synchronizatio implemented, but FastList doesnt), so with FastList it will be faster but eith the same behavor

 

well the code:

package test;

import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.ScheduledFuture;

public class TakeBreakManager {

private final static long TIME_EACH_BREAK = 150; //2h by default

private static volatile List<Object> queue;

private static TakeBreakManager instance;

private static ScheduledFuture<?> task;

private WarnUserTakeBreak warn;


private TakeBreakManager(){
queue = new ArrayList<Object>();
warn = new WarnUserTakeBreak();
}

public static TakeBreakManager getInstance(){
if (instance == null)
	instance = new TakeBreakManager();
return instance;
}

public void addPlayer(L2PcInstance player){
synchronized(this){
	queue.add(System.currentTimeMillis());
	queue.add(player);
	if (task == null)
		start();
}
}

private void start(){

task = ThreadPoolManager.getInstance().scheduleGeneral(warn ,TIME_EACH_BREAK - (System.currentTimeMillis() - (Long)queue.remove(0)) );
}


public void removePlayer(L2PcInstance player){
if (player == queue.get(0)){
	synchronized(this){
	queue.remove(0);
	task.cancel(false);
	if (!queue.isEmpty())
		start();
	}
	return;
}
int index = 2;
while (index < queue.size()-1){
	if (queue.get(index) == player){
		synchronized(this){
		queue.remove(index);
		queue.remove(index-1);
		}
		return;
	}
	index = 2;
}
}

protected class WarnUserTakeBreak implements Runnable
{
@Override
public void run()
{
	synchronized(TakeBreakManager.this){
	L2PcInstance player;
	long time = 0;
	do{

//			synchronized(TakeBreakManager.this){
			if (queue.size() > 1){
					player = (L2PcInstance) queue.remove(0);
					time = (Long) queue.remove(0);
			}
			else if (queue.size() == 1)
					player = (L2PcInstance) queue.remove(0);
			else{
				task = null;
				return;
			}
//			}
		if (player.isOnline())
		{
			//SystemMessage msg = SystemMessage.getSystemMessage(SystemMessageId.PLAYING_FOR_LONG_TIME);
			//player.sendPacket(msg);
//			System.out.println("time: " System.currentTimeMillis()  " player: " player);
			if (queue.isEmpty()){
//					synchronized(TakeBreakManager.this){
					queue.add(player);
//					}
				time = System.currentTimeMillis();
				break;
			}
			else
//					synchronized(TakeBreakManager.this){
					queue.add(System.currentTimeMillis());
					queue.add(player);
//					}
		}
	}
	while (System.currentTimeMillis() <= time);
	if (!queue.isEmpty())
		task = ThreadPoolManager.getInstance().scheduleGeneral(this , TIME_EACH_BREAK - (System.currentTimeMillis() - time) );
	else
		task = null;
	}
	}
}
}

Posted

Don't you melt L2FastList with FastList ? FastList/FastMap are part of javolution, until L2J reworked javolution JAR, which is possible, they should be synchro by default.

 

Or I missed a point.

 

.shared() ?

Posted

you are right, i just looked at the doc of fastlist, it implements FastCollection, that is thread-safe, anyway my problem was that when i remove player that is the next player to be warned:

 

- I need to remove him from the queue: no problem here

- cancel the programed task

- create new task for the next player to be warned

 

and the problem was that if i was warning that player in the moment that i wanted to remove him, the old task will create the new task for the next player and the remove will create another new task.

Posted

task.cancel(true) would interrupt it. Did you try it ?

i thought about it but, if i:

[playerA][timeB][playerB]...

-task remove playerA and next time (timeB), but didnt warned him yet

-now i try to remove the next player to be warned (playerB), so i cancel the task and interupt it

 

i dont warn player A, nor add it to the queue to be warned next time

Posted

true story

 

Tryskell 1 question. To contribute on the pack, we pay 1€ for the last rev and then 1€ for each commit?

 

The price is as following : 1 euro / rev, 9 euros minimum (for 9 revs) and no maximum
Posted

true story

 

Tryskell 1 question. To contribute on the pack, we pay 1€ for the last rev and then 1€ for each commit?

 

You can either :

  • wait for free rev (happens every 10 revs, will begin at rev 260 then at 270, 280...) : you will have sources but got all issues coming from old rev.
  • donate to get a range of revs (261-269 let's say), I accept as minimum a range of 9 revs, so only multiple of 9 : you get latest source and patch following what you bought, your forum account will be downgraded once period is down. No access to SVN.
  • share things as before, become a Inner Circle and get access to sources directly from SVN.

 

There are no precompiled pack anymore, ppl who want to take a look have to use old sources. You can make shares based on old sources and then become part of Inner Circle and get updates for free. As before, I ask some shares before you can enter, or a lot of bugs reports.

 

If you still didn't understand :

 

rev 260 - free

rev 261 to 269 - accessible by donors and inner circle members.

rev 270 - free

rev 271 to 279 - accessible by donors and inner circle members.

...etc, etc...

 

As donator, if you buy for 18€ when that service will be launched (rev 260), you get 18 rev +2 free = 280.

 

If you ask "why should I donate" :

  • it's first a mean to thank me for the work I make since dec 2010. I made 0€ until now.
  • it's a mean to pay codes you can eventually ninja for your own pack / server. I improved my skills and my codes are unique (to name some: Baium AI, Valakas AI with retail like cinematics, //bk command, corrected quests py -> java, and in future retail events and missing features such as retail castle doors HP upgrade && traps system).
  • relying on free revisions isn't enough if you want to launch a live server, as you will miss a lot of fixes, and won't have any help from me or my community to fix them. And as project got a forum, I will close any "fix that bug" thread on MxC forum if you use aCis. You use free revs knowing the fact you won't have any assistance.
  • that money would be reinvested in the project to pay ppl/features. Which mean contributing money would enhance features in future. I mostly think about an event engine, or simply pay ppl who make an amazing help in order they correct missing features.

Posted

Ty for the 40k views guys ^^.

 

Yep yep yep yep yep.

 

 

Changeset 258

 

Siege/castles rework, misc

 

Siege/castles rework

- Fix possible targets on siege summons skills (one siege summon can only aim L2PcInstance, others can only aim L2DoorInstance).

- Fix doors issue (doors not respawning at siege end). At siege end, they revive, fully HPregen and close if opened.

- Doors don't respawn if destroyed during a midVictory, but they will respawn at siege end.

- castle chamberlain instance is fully rewritten, HTMs names have been shortened and content is harmonized. Many privileges checks have been added.

- when a castle wall is destroyed, the correct message is displayed.

- skill cast on Artifacts is fixed (changing target before the end of "Seal Of Ruler" won't stop the skill)

- Addition of retail-like castle gate upgrade system via castle chamberlain.

- It uses 2 "cursors" to calculate the price :

- type of door (basic doors, additional doors or walls)

- power of the reinforcement (x2, x3 or x5 HPs).

- the cost of doors updates, as their pdef/mdef, are infuenced by Seal of Strife owner.

- the upgrade is instant, and is loaded/saved through server restarts aswell (as I need _doorUpdates being fed for the hp ratio check on chamberlain).

- all retails HTMs have been added, and checks are ok (not enough money in CWH, door already updated with a similar or better level, etc).

 

Misc

- GMs non-aggro state has been moved from //invul to //hide command. Ty Pleasure for the good idea.

- drop some GMs "privileges" which could lead to "false alarms" reports from users (like GMs not being ported when a siege begins).

- all variables are (and will be from now, no matter how sad Java-Man will be) initialized in the shorter possible scope. Fix an ugly issue where DoorTable was adding all left doors to latest castle _doors (so Schuttgart had 50+ gates). Castle gates aren't verified anymore for CH purposes.

- drop String.valueOf() on getNodeValue() - as the result is a String, it doesn't need further operation...

 

NOTE : TRAPS SYSTEM ISN'T MADE AT ALL. DON'T COMPLAIN ABOUT IT.

 

 

Posted
Changeset 259

 

Fishes rework (ty Java-man), misc (ty xblx for random fixes and sahar for reports)

 

Fishes rework

- handles differently load and get fish process (regroup data in 1 array instead of 3, avoid to create multiple arrays and new FishData objects)

- fix fishTable skills levels, ty 100500.

 

Misc

- if identical jewel is currently worn, then replace the other slot if different (explanation is messy, but just test ingame and gtfo).

- fix an exploit using clan warehouse when you left your clan (active warehouse could be clan, and wasn't cleaned).

- fix previous knownlists update (int cast was affecting only 1.5 value). It is rounded aswell.

- fix pets pickup, which are now affected by party distribution modes.

- fix Goblets NPC.

- fix double click on dead monsters (avoid to be stucked), cleanup those methods aswell. Drop of canTarget() method.

- onActionShift() use L2PcInstance rather than GameClient as parameter.

- add skillId on callSkill exception log for easier debug purposes.

- fix 2 issues on Valakas AI and 1 on Baium AI, related to skills priority and offline target. Rework Baium getRandomTarget() method to be faster.

- fix a ClassCastException on RequestRecipeShopManagePrev packet.

- fix a NullPointerException on RequestPledgeSetAcademyMaster packet.

- fix an NumberFormatException with CrestCache system ("Crest_Large_" were cutted as "Crest_", and so the id was containing "Large_".

- getCharactersInside() has been changed for a FastList instead of FastMap, as there is no interest to keep Map format. Use of _characterList rather than the getter.

- sendPacket() implementation for L2Summon, which refer directly to owner.

- L2GoldenRamInstance cleanup, the FastMap has been changed for an int[][]. Updates the related HTM.

Posted
Changeset 260

 

Skills rework (elemental, cancel, negate), misc

 

Skills rework

- implementation of following methods: ssUncharge(), spsUncharge(), isSoulshotCharged(), isSpiritshotCharged() && isBlessedSpiritshotCharged(). Move ss/bss checks out of targets loops.

- fix Cancel/Banes skillhandler :

- formula rework : addition of level diff, baseRate (80% for single target, 40% for aoe), and vuln is now applied on the good section of formula.

- toggles aren't counted anymore as possible effects to cancel.

- failed attempts are now counted (before effects were looped until 5 effects were dropped).

- all (L2Character[]) casts have been dropped in order to avoid ClassCastException using skills.

- cleanup BalanceLife skillhandler ; store valid targets in another list rather than using old list and make twice same checks (...).

- CombatPointHeal doesn't heal dead targets anymore.

- addition of suicide stuff on PDAM skillhandler (potential use for antharas minions).

- NEGATE L2SkillType (part of Disabler skillhandler) is heavily cleaned, and not affected anymore by calcSkillSuccess().

- fix "SKILLS" elemental vuln/pro (revert to IL, was using postIL formula).

- addition of "WEAPONS" elemental system (fix skills such as Holy Blade toggle, Holy weapon PP buff). Vuln/pro affect damages TOO !

 

Misc

- cleanup && addition of missing PaganKeys, ty sahar. No clue if it's retail-like, they're added here for the moment.

- NPCs social animations are divided by 2.

- L2Npc : drop of _isBusy / _busyMessage and associated getters/setters + drop of the HTM.

- fix issue from previous commit about hpRatio impacting earned XP/SP (I HATE DOUBLE).

 


 

With that changeset finally comes the opening of freemium system.

[*]All informations regarding the system can be already found on forum.

[*]Any PM, either on that forum or on aCis forum concerning such infos will be ignored. If my explanations don't cover your questions, I will answer you and add an addendum on the Announcements section aswell.

[*]You have 1 rev (3-4 next days) to order your subscription , after that time you have to wait the next 10th step to be able to subscribe.

[*]Latest free revision (actual rev - 10) will be shared on aCis forum (and only the latest). You probably could find it on others websites, but I invite you to download it directly from aCis forum in order to avoid viruses, addition of malware code, etc.

[*]The complete system will take some times to put in shape.

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Posts

    • @Mobius I only asked you one question! All your previous versions are sh*t and the last version is the best ? Because this is what you said.
    • Close that LOLserver. And change name to L2Wipe&Money.
    • Open Beta January 17th & 21:00 UTC +2 Launch Date January 24th & 21:00 UTC +2 Click Here to Explore Vanilla Gracia Final Low-Rate Server. Join our Discord Community     Following the success of our Vanilla project, we decided to launch it again as Last PlayINERA’s Server! Core Settings *Vanilla will have Strict Botting & Client Limitation Rules and Chronicle Progression from Gracia Final to Gracia Epilogue to H5 in Long term! XP: x4 SP: x4 Adena: x2 Drop: x2 Spoil: x3 Manor: x0.4 (60% reduction) - Festive sweeper enabled! Seal Stones: x2 Herbs: x1 Safe Enchant: +3 Maximum Enchant: Retail Enchant Rate: Dynamic General Settings Auto-loot Can be toggled Buffs Adventurer Guide buffs are free, retail level limit removed. Buff Slots: 20 (+ 4) Summon buffs will remain on re-summoning & on death while Noblesse blessing is applied! (Olympiad excluded) Pet buffs will be saved on relog but not during summon/unsummon. Event Buffer [NEW] Event Buffer is enabled and will spawn randomly between 18:00 ~ 23:00 in Giran for 10 minutes, it will apply Farm Only buffs that are cancelled in PvP, Siege / Epic PvP zones & while in a chaotic state! Duration: 1-hour! Territory Wars every two weeks on Saturday. Castle sieges every two weeks on Sunday Class Transfer 1st Class Transfer: Available for purchase with either Adena or iCoin 2nd Class Transfer: Available for purchase with either Adena or iCoin 3rd Class Transfer: Quest or iCoin (the 3rd class transfer will become available for purchase with iCoin as soon as someone has entered the Hall of Fame for completing the 3rd class transfer quest for the class in question) Hellbound Hellbound Lv. 0-6: ATOD x1 Hellbound Lv. 7-12: ATOD x2 Tiat & Ekimus will become available at Stage 12 Hellbound can only be leveled up by killing monsters. No quests or raids are needed To open Hellbound, a party must kill Baylor in the Crystal Caverns The following items are now tradable: Ancient Tome of the Demon  Hidden First Page  Hidden Second Page  Demon Contract Fragment INERA Hub Library Clan Recruitment System Options Services Milestone Rewards Earn rewards for reaching various daily/one-time goals Client Limit: 1 (+1 with Standard Premium) Shift + Click Information on Monsters SP are required to learn new skills Offline shops Lasts for 15 days Olympiad Olympiad period: 1st and 15th day of the month (14th & Last day of month is the last day) 3 Vs. 3 match disabled Class-based matches will be held over the weekends One registration per HWID (PC) Minimum participants: 9 Party Matching System Earn bonuses for finding a group via the Party Matching system Vote Reward System World Chat No limits for first day! Available from level 20 Raid Bosses Epic Raid Boss zones will turn into a PvP zone while the Epic Raid Boss is alive ( + means Random) Server will start with all grand raids dead. Normal Raids: 12h (+6 hours random). Subclass raids, respawn 12h (+6 hours random). Noblesse Barakiel 12h (+6 hours random, PvP zone). Anakim & Lilith are static 24 hours respawn. Queen Ant: 24 hours (+2 hours random). Core: 40 hours (+2 hours random). Orfen: 32 hours (+2 hours random). Antharas Respawn: 8 Days. Randomly spawns at 19:00 ~ 21:00 Boosted to level 83 on Hellbound stage 7. Valakas Respawn: 10 Days. Randomly spawns at 19:00 ~ 21:00 Baium Respawn: 5 Days. Randomly spawns at 21:00 ~ 23:00 Boosted to level 83 on Hellbound stage 7. Frintezza Respawn: 2 Days. Randomly spawns at 21:00 ~ 23:00 Instanced Zaken Zaken (Day): Monday, Wednesday, Friday at 6:30. Zaken (Day): 9 players, LvL 55-65, 1hr max. Zaken (Night): Wednesday at 6:30 Zaken (Night): 18-45 players, LvL 55-65, 6hr max. Tiat: Saturday at 6:30, 18-36 players, 2 hrs max. Boosted to level 85. Ekimus: 24h at 6:30, 18-27 players, 1hr max. Tully’s Workshop (Darion & Tully): 24h +-1h. Tower of Naia (Beleth): 5 days, 18 min. & 36 max.
  • Topics

×
×
  • Create New...