Jump to content

Recommended Posts

Posted (edited)

missing 
net.sf.l2j.gameserver.handler.admincommandhandlers.AdminEventEngine;

 

and some imports are wrong. example ....events. must be "event" and ...impl.. must be imp or vice versa.

Edited by wongerlt
Posted (edited)
7 hours ago, StinkyMadness said:

  

Eu não acho que os jogadores se importem com o ID de itens de recompensa, mas pelo Nome : D

 

already changed for

 

for (IntIntHolder reward: Config.TVT_REWARDS)
            World.announceToOnlinePlayers("TvT Event: Reward "+ ItemTable.getInstance().getTemplate(reward.getId()).getName() +","+ reward.getValue(), true);
        

4 hours ago, edusz93 said:

 

Tem um pequeno erro no código que faz com que o tempo todo seja apenas teleportado de volta e removido do evento. 

 

Correção:



		 
		
		  
		
			
			  
				 
			   
			 
			
			  
				
			
			
				  
				
					  
						
					
					
					  
					
						    
					
				
			
			
			  
			
				 
				
			
		
	  
	

 

 

already fixed

 

Edited by Williams
Posted
On 8/6/2019 at 9:30 PM, Williams said:

about threadpool execution i don't know how i will do i will do more research on.

 

ThreadPool.schedule(new Runnable()
{
	@Override
	public void run()
	{
		"ACTION"
	}
}, "TIME ACTION IN SECONDS"*1000);

 

Posted (edited)
ThreadPool.schedule(() -> finishChamp(), _endDate - System.currentTimeMillis());

In case you got a method to call, otherwise use following if you got some actions to do.

		_earthQuakeTask = ThreadPool.schedule(() ->
		{
			for (Player member : getAvailablePlayers(_party))
				member.sendPacket(new Earthquake(member.getX(), member.getY(), member.getZ(), 65, 9));
		}, jumpTime - 7000);

As shown in last exemple, you can retain the task on a variable, in order to stop it when you want (notably used to delay a scheduled action, to avoid to get it twice).

 

		if (_earthQuakeTask != null)
		{
			_earthQuakeTask.cancel(false);
			_earthQuakeTask = null;
		}

There's a huge amount of tasks here and there, simply read.

 

Edited by Tryskell
Posted

Estou tentando e tendo dificuldades em fazer com que o TVT fique com horário fixo. 


Exemplo na "events.properties":
# Times TvT will occur (24h format).
TvTEventInterval = 00:00,02:00,04:00,06:00,08:00,10:00,13:34,14:00,16:00,18:00,20:00,22:00

Posted
On 8/12/2019 at 10:25 AM, edusz93 said:

Estou tentando e tendo dificuldades em fazer com que o TVT fique com horário fixo. 


Exemplo na "events.properties":
# Times TvT will occur (24h format).
TvTEventInterval = 00:00,02:00,04:00,06:00,08:00,10:00,13:34,14:00,16:00,18:00,20:00,22:00

 

2.jpg?1565823032

 

3.jpg?1565823007

 

Consegui!

Posted
1 hour ago, Williams said:

 

Estou sem tempo, quando estiver posto as alterações feitas.

 


Se quiser, te mando essa minha alteração e depois você posta tudo junto.

Posted (edited)
12 hours ago, edusz93 said:


Se quiser, te mando essa minha alteração e depois você posta tudo junto.

manda em mp que faco o pacth, amanha ja posto

Edited by Williams
  • 2 weeks later...
Posted (edited)
On 8/6/2019 at 5:50 PM, Tryskell said:

 

To name few, after some look :

 

* eventTimer(int time) should be handled with a Future<?> task and ThreadPool.

* _originalCoordinates is (probably) redundant with _savedLocation, and the use of it is wrong (see _savedLocation usage to see correct)

* CopyOnWriteArrayList container should be avoid for performance reason, use ConcurrentHashMap.newKeySet instead.


+                   if (reward == null)
+                       continue;

can never be null, since you manipulate it from A TO Z.

* TVT_DOOR_LIST doesn't seem to be used and can use getProperty(final String name, final int[] defaultValue, final String delimiter) instead of self coded array manipulation.

 

 

* CopyOnWriteArrayList container should be avoid for performance reason, use ConcurrentHashMap.newKeySet instead.

 

Hello Master, I'm studying and improving TVT, I'm tending to change the player lists. I changed to ConcurrentHashMap.newKeySet ()

 

in 

private List<Player> _registered = new CopyOnWriteArrayList<>();

 

for 

 

private Set<Player> _registered = ConcurrentHashMap.newKeySet();

 

I have this error

 

JBoTJgC.png

 

I don't know if it's the correct one but I did it like this

 

in Player player = _registered.get(Rnd.get(_registered.size()));

 

for Player player = World.getInstance().getPlayer(Rnd.get(_registered.size()));

Edited by Williams
Posted

A Set got no .get() method, and a Map would give you the key related value if you .get() it. I would use a ConcurrentHashMap (cause keys are probably useful anyway elsewhere), then generate a List based on values() with

List<Player>registeredPlayers = new ArrayList(_registered.values())

then

Collections.shuffle(registeredPlayers);

 

Why shuffle instead of Rnd.get ? Simply because to avoid multiple Rnd.get.

 

And in the end, .clear() the _registered, once all players are allocated (or even in the beginning, just after registeredPlayers creation). That would avoid to .remove everytime a loop is done. You .clear() only once.

 

That would also avoid you that dangerous (while) loop (I'm not a big fan of loops). You only for loop, for the given shuffled internal List.

 

It basically depends about what you do with leftover Players, if any. But your current writting means there is no leftover, otherwise you would end with infinite loop.

Posted
5 hours ago, Tryskell said:

A Set got no .get() method, and a Map would give you the key related value if you .get() it. I would use a ConcurrentHashMap (cause keys are probably useful anyway elsewhere), then generate a List based on values() with


List<Player>registeredPlayers = new ArrayList(_registered.values())

then


Collections.shuffle(registeredPlayers);

 

Why shuffle instead of Rnd.get ? Simply because to avoid multiple Rnd.get.

 

And in the end, .clear() the _registered, once all players are allocated (or even in the beginning, just after registeredPlayers creation). That would avoid to .remove everytime a loop is done. You .clear() only once.

 

That would also avoid you that dangerous (while) loop (I'm not a big fan of loops). You only for loop, for the given shuffled internal List.

 

It basically depends about what you do with leftover Players, if any. But your current writting means there is no leftover, otherwise you would end with infinite loop.

 

which would be better to list the players?

 

private Map<Integer, Player> _registered = new ConcurrentHashMap<>();

 

or 

 

    private Set<Player> _registered = ConcurrentHashMap.newKeySet();

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



  • Posts

    • POLAND — New VPS Location Our new VPS location in Poland is now available. Promo code: POLAND • 40% off new VPS orders in the Poland location • Offer valid until July 29, 2026 Enter the promo code POLAND during checkout to receive your discount.
    • In your place l will join to Mobius community to get something decent or just go to Lucera 2 ( ofc no source) if you want interlude on Classic client, coz Acis not have have it yet.
    • The client and the system aren't working very well; the screen is black, and some things aren't loading.  😞 
    • LINEAGE2.SK Summer Season is Comming! GRAND OPENING - 14.08.2026 at 20:00 GMT+1  OBT - 07.08.2025 at 20:00 GMT+1   Website :https://lineage2.sk Discord : https://discord.gg/gj7AC5juGP       Server Features and Rates Xp – 20x Sp – 20x Adena – 10x Drop – 15x Spoil - 15x  Epic Raid Boss  - 1x Regular RB - 5x  Quest - 5x Fame - 2x Epaulette - 15x Manor - 15x     Special Features Somik Interface Limited AutoFarm Vote System Champions System Achievement System And more in information below     Enchant Settings  Safe Enchant: +3  Max Enchant: +16 Enchant Chance: 63%  Attribute Stone Chance: 50%  Attribute Crystal Chance: 30%     NPC Buffer all buffs, songs, dances including 3rd prof + resists Buff Slots: 24 (+4) / 12 Buff Duration: 2 Hours     Epic Bosses & Respawns Queen Ant: 24 hours +/-8h Core: 3 days +/-8h Orfen: 2 days +/-8h Baium: 5 days +/-8h Beleth: 7 days +/-8h Antharas: 7 days +/-8h Valakas: 7 days +/-8h     Instances Zones Zaken: 6 players Normal Freya: 6 players Hard Freya: 12 Players Frintezza: 6 Players Tiat: 6 Players Beleth: 12 Players     GM Shop weapon/armor/jwl (max S grade) shots/spiritshots (max S grade) mana potions (1000 MP, 10s)      Global Gatekeeper all towns including cata/necro ToI Gracia Hellbound ...     Olympiad period 7 days (Monday) no class participants min 6 base class participants min 6 max enchant +6 Start points 20     Class Transfer for Adena     Subclass Quest Not required Max Subclass 3 Subclass Max LvL 85     Events Team vs Team Capture the Flag Death Match Last Hero Korean Style Treasure Hunt      Clans All new clans start with Clan LvL 5! Clan Skills/LvL for Clan Coins     Others  max 3 windows per HWID  BoM/MoM spawned in towns Auto-learn skills Autoloot Retail LvL of Epic Bosses Cancellation return buff system (30sec) Cancellation return buff -  not effect olympiad
  • Topics

×
×
  • Create New...

Important Information

This community uses essential cookies to function properly. Non-essential cookies and third-party services are used only with your consent. Read our Privacy Policy and We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue..