Skip to content

adenaman

Members
  • Joined

  • Last visited

  • Trader rating

    N/A

Everything posted by adenaman

  1. Find a team, at least the main members and then and only then think about the chronicle. Also there are already a pack of that chronicle (what ever you choose) so then next question that you need to ask is, what will ours have that the old one doesn't. That may be less bugs, more customs, more retail like, more plug and play system, better efficiency, ... If it is educational purpose, then how far do you want to go? just create the javadocs or remake the whole system, starting with diagrams of all types. But the main point to start is to find and organize a competitive team for your goals
  2. Find a team, at least the main members and then and only then think about the chronicle. Also there are already a pack of that chronicle (what ever you choose) so then next question that you need to ask is, what will ours have that the old one doesn't. That may be less bugs, more customs, more retail like, more plug and play system, better efficiency, ... If it is educational purpose, then how far do you want to go? just create the javadocs or remake the whole system, starting with diagrams of all types. But the main point to start is to find and organize a competitive team for your goals
  3. Find a team, at least the main members and then and only then think about the chronicle. Also there are already a pack of that chronicle (what ever you choose) so then next question that you need to ask is, what will ours have that the old one doesn't. That may be less bugs, more customs, more retail like, more plug and play system, better efficiency, ... If it is educational purpose, then how far do you want to go? just create the javadocs or remake the whole system, starting with diagrams of all types. But the main point to start is to find and organize a competitive team for your goals
  4. You can copy the Varka/Ketra system, if you add the Tryskell idea -100 to -20 = love completly Varka -20 to +20 = neutral +20 to 100 = love Ketra If you want any interface then it must be something like Comparable (or Comparator dont remmember now) but i dont think that you need it. if it is personal player based (love Dion or love Heine) then just add a int / boolean at L2PcInstance and some help method "boolean isDionFriend()" or "int getDionHeineFriendship()" if it is not, (like Hellbound levels more or less) then you need a manager that store that var, it can be singleton because there will be only one (no 2 Dion-Heine relationship) Btw the link is about behavior simulations, dont think that is relevant
  5. i got a bit lost: "Instances": check how postIl did it, but it must be just controling knownList or smth like that Relations between Npc's you can create a manager that save the info (Joe alive?) onCreate() turn it true, onDie() false [no idea if Npcs have onCreate(), they must, because some make an animation or a skill, i dont know] that manager may be static so you can access it easy. AIs, there are some usefull information about this, i have read long time ago something about birds/fish simulations that are based on 3 keys: - they follow a leader - they have a formation - they do random moves inside that formation or something like that Edit: http://www.red3d.com/cwr/boids/
  6. im talking about grafic effect of 27 players hitting with ss at the same view for an extended time (those mobs were like mini bosses), after a lot of time in that instance you do want to see that effects
  7. java.lang.StackOverflowError = recursive error aka: public void a (){ b(); } public void b (){ a(); } or public void a (){ a(); }
  8. but its still a good thing, i remmember that in one server i went to an instance with 3 partys, everyone hitting mobs, that was a real dafaq of soulshots
  9. 60 *60 * 1000 / 1000, omg math! Srsly it was so hard to find where that config ends? next time try to fix it by yourself before asking here
  10. use forum search engine, take a look at sticked topics, ... we are not google
  11. and that is what scientists call "bitch slapped"
  12. the main point to use final is to be better readable, when you see a final var you know what is going to be used for.
  13. they do, since you have a var that can only de intialized once, the VM can use it read-only, and that will increase the performance. http://www.ibm.com/developerworks/java/library/j-jtp1029/index.html http://renaud.waldura.com/doc/java/final-keyword.shtml Example of Strings differences (final/ not final). nothing to do with our case, but still a relation between "final" and "performance" http://www.coderanch.com/t/518466/Performance/java/Compiler-optimization-final-variables This is a minimal impove. And there are things that can give a lot more than this (for example direct access and not getters/setters, inside the class) or use C++. But still impact on performance
  14. add the {} to the else block before player.setKarma(0); { after player.sendMessage("Your karma cleaned, continue to play!"); } add an else before the super(...) call, we dont need it if it was CleanPK add "final" to L2ItemInstance item = player.getInventory().getItemByItemId(Config.PK_CLEAN_ID); this is not an error but will have better performance
  15. l2 rusteam , and there are some more, just can remmember them atm
  16. 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
  17. 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.
  18. There are also some russian packs, that are kinda famous there, no idea how good/bad they are
  19. 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 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; } } } }
  20. thats why i said that it had bo be synchronized, synchronized(this) queue.add(System.getTimeInMillis(), queue.length); queue.add(player, queue.length); if (task == null) start(); ... run() ... synchronized(this){ queue.add(System.getTimeInMillis(), queue.length); queue.add(player, queue.length); } I had some problems with my main pc, so now im working with my laptop, i dont have here server nor client EDIT: i made a new java project in eclipse to try this, made some tests its usually working great but in extreme tests (break warn each 150 milis) and 600 players, i found that sometimes i get a problem on remove the first element it is some problem of synchronization, because im trying to cancel the task and create another one and they make evil things. But all other things are working great EDIT2: Ok i found where as my main problem, atm its sometimes creating one extra task, that may be anotheer synchr problem. 5 am, time to sleep

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.