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
  • Upvote 1
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
  • Like 1
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
  • Like 1
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!

  • Thanks 1
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.

  • Thanks 1
Posted
3 hours ago, Tryskell said:

...

+	public static final <T> T get(Set<T> set)
+	{
+		return get(new ArrayList<>(set));
+	}

:happyforever:

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

    • "I recently purchased the account panel from this developer and wanted to leave a positive review.   The transaction was smooth, and the developer demonstrated exceptional professionalism throughout the process.   What truly sets them apart is their outstanding post-sale support. They are responsive, patient, and genuinely helpful when addressing questions or issues. It's clear they care about their customers' experience beyond just the initial sale.   I am thoroughly satisfied and grateful for the service. This is a trustworthy seller who provides real value through both a quality product and reliable support. 100% recommended."
    • Server owners, Top.MaxCheaters.com is now live and accepting Lineage 2 server listings. There is no voting, no rankings manipulation, and no paid advantages. Visibility is clean and equal, and early listings naturally appear at the top while the platform grows. If your server is active, it should already be listed. Submit here https://Top.MaxCheaters.com This platform is part of the MaxCheaters.com network and is being built as a long-term reference point for the Lineage 2 community. — MaxCheaters.com Team
    • ⚙️ General Changed “No Carrier” title to “Disconnected” to avoid confusion after abnormal DC. On-screen Clan War kill notifications will no longer appear during Sieges, Epics, or Events. Bladedancer or SwordSinger classes can now log in even when Max Clients (2) is reached, you cannot have both at the same time. The max is 3 clients. Duels will now be aborted if a monster aggros players during a duel (retail-like behavior). Players can no longer send party requests to blocked players (retail-like). Fixed Researcher Euclie NPC dialogue HTML error. Changed Clan leave/kick penalty from 12 hours to 3 hours. 🧙 Skills Adjusted Decrease Atk. Spd. & Decrease Speed land rates in Varka & FoG. Fixed augmented weapons not getting cooldown when entering Olympiad. 🎉 Events New Team vs Team map added. New Save the King map added (old TvT map). Mounts disabled during Events. Letter Collector Event enabled Monsters drop letters until Feb. 13th Louie the Cat in Giran until Feb. 16th Inventory slots +10 during event period 📜 Quests Fixed “Possessor of a Precious Soul Part 1” rare stuck issue when exceeding max quest items. Fixed Seven Signs applying Strife buff/debuff every Monday until restart. 🏆 Milestones New milestone: “Defeat 700 Monsters in Varka” 🎁 Rewards: 200 Varka’s Mane + Daily Coin 🌍 NEW EXP Bonus Zones Hot Springs added Varka Silenos added (hidden spots excluded) As always, thank you for your support! L2Elixir keeps evolving, improving, and growing every day 💙   Website: https://l2elixir.org/ Discord: https://discord.gg/5ydPHvhbxs
    • https://sms.pro/ — we are an SMS activation platform  seeking partners  mobile number providers  mobile number owners  owners of GSM modems  SIM card owners We process 1,000,000 activations every day.  寻找合作伙伴  手机号码提供商  手机号码持有者  GSM调制解调器持有者  SIM卡持有者 我们每天处理1,000,000次激活。  Ищем партнеров  Владельцы сим карт  провайдеров  владельцев мобильных номеров  владельцев модемов  Обрабатываем от 1 000 000 активаций в день ⚡️ Fast. Reliable.   https://sms.pro/ Support: https://t.me/alismsorg_bot
  • 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..