Jump to content

Tw3ty

Members
  • Posts

    59
  • Credits

  • Joined

  • Last visited

  • Feedback

    0%

Everything posted by Tw3ty

  1. Hello, i've a problem with skills, which have summons (mostly the summons, which you can give at 76 lvl) I have code, which is written in RequestActionUse.java. f.ex. case 1031: // Feline King - Slash useSkill(5135); break; and i've skill id: 5135 in datapack, but in game this skill is not do anything.. I can't understand, why some skills as Blessing of Queen, Merrow unicorn (skills) can work and these can't.. Can you help me ?
  2. I can .. But you said, that it's working ! ... But THIS IS NOT WORKING without edit ..
  3. Where's LegendSkillTable ?? ... for (L2Skill s : LegendSkillTable.getLegendSkills()) I miss it !
  4. I think that the first is better ;) - _selectorThread = new SelectorThread<L2GameClient>(sc, gph, gph, gph, null); + _selectorThread = new SelectorThread<L2GameClient>(sc, gph, gph, gph, new IPv4Filter()); _selectorThread = new SelectorThread<L2GameClient>(ssc, gph, gph, gph); + _selectorThread.setAcceptFilter(new IPv4Filter());
  5. and did you change this ? :D net/sf/l2j/gameserver/GameServer.java - _selectorThread = new SelectorThread<L2GameClient>(sc, gph, gph, gph, null); + _selectorThread = new SelectorThread<L2GameClient>(sc, gph, gph, gph, new IPv4Filter()); net/sf/l2j/loginserver/SelectorHelper.java package net.sf.l2j.loginserver; -import java.net.InetAddress; import java.nio.channels.SocketChannel; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.Map.Entry; import java.util.concurrent.LinkedBlockingQueue; import java.util.concurrent.ThreadPoolExecutor; import java.util.concurrent.TimeUnit; import net.sf.l2j.loginserver.serverpackets.Init; +import net.sf.l2j.util.IPv4Filter; import org.mmocore.network.IAcceptFilter; import org.mmocore.network.IClientFactory; @@ -33,18 +30,15 @@ * * @author KenM */ -public class SelectorHelper extends Thread implements IMMOExecutor<L2LoginClient>, +public class SelectorHelper implements IMMOExecutor<L2LoginClient>, IClientFactory<L2LoginClient>, IAcceptFilter { - private HashMap<Integer, Flood> _ipFloodMap; private ThreadPoolExecutor _generalPacketsThreadPool; + private IPv4Filter _ipv4filter; public SelectorHelper() { - _generalPacketsThreadPool = new ThreadPoolExecutor(4, 6, 15L, TimeUnit.SECONDS, new LinkedBlockingQueue<Runnable>()); - _ipFloodMap = new HashMap<Integer, Flood>(); - super.setDaemon(true); - super.start(); + _ipv4filter = new IPv4Filter(); } /** @@ -73,110 +67,6 @@ */ public boolean accept(SocketChannel sc) { - InetAddress addr = sc.socket().getInetAddress(); - int h = hash(addr.getAddress()); - - long current = System.currentTimeMillis(); - Flood f; - synchronized (_ipFloodMap) - { - f = _ipFloodMap.get(h); - } - if (f != null) - { - if (f.trys == -1) - { - f.lastAccess = current; - return false; - } - - if (f.lastAccess + 1000 > current) - { - f.lastAccess = current; - - if (f.trys >= 3) - { - f.trys = -1; - return false; - } - - f.trys++; - } - else - { - f.lastAccess = current; - } - } - else - { - synchronized (_ipFloodMap) - { - _ipFloodMap.put(h, new Flood()); - } - } - return !LoginController.getInstance().isBannedAddress(addr); + return _ipv4filter.accept(sc) && !LoginController.getInstance().isBannedAddress(sc.socket().getInetAddress()); } - - /** - * - * @param ip - * @return - */ - private int hash(byte[] ip) - { - return ip[0] & 0xFF | ip[1] << 8 & 0xFF00 | ip[2] << 16 & 0xFF0000 | ip[3] << 24 - & 0xFF000000; - } - - private class Flood - { - long lastAccess; - int trys; - - Flood() - { - lastAccess = System.currentTimeMillis(); - trys = 0; - } - } - - /** - * - * @see java.lang.Thread#run() - */ - @Override - public void run() - { - while (true) - { - long reference = System.currentTimeMillis() - (1000 * 300); - ArrayList<Integer> toRemove = new ArrayList<Integer>(50); - synchronized (_ipFloodMap) - { - for (Entry<Integer, Flood> e : _ipFloodMap.entrySet()) - { - Flood f = e.getValue(); - if (f.lastAccess < reference) - toRemove.add(e.getKey()); - } - } - - synchronized (_ipFloodMap) - { - for (Integer i : toRemove) - { - _ipFloodMap.remove(i); - } - } - - try - { - Thread.sleep(5000); - } - catch (InterruptedException e) - { - - } - } - } }
  6. Nothing special, but simple & good ;) Thanks I'll test if all teleports work ;)
  7. base64_encode(pack('H*', sha1($password)))
  8. Lol, credits for you ? :D Are you kidding me ? :D You can't steal java code, because of GNU license :D
  9. http://svn2.xp-dev.com/svn/L2J-Archid/trunk/Archid-Game/config/
  10. enable it in configs ;)
  11. I don't like it at all 'cause it's too simple ;) Maybe more images , better menu buttons and some things from Lineage .. 'cause there is only header connected with lineage, the others are only thing, which can be downloaded from templates .. Sry .. double post, mod'll delete it, hope
  12. I don't like it at all 'cause it's too simple ;) Maybe more images , better menu buttons and some things from Lineage .. 'cause there is only header connected with lineage, the others are only thing, which can be downloaded from templates ..
  13. Oh, really ? :D Are U stupid ? ;) Just search :P http://svn.l2jserver.com/trunk/MMOCore/
  14. yes, you can't do it, if you haven't knowlegde in java ;)
  15. Just make your own project ... based on L2JServer
  16. i think too, fix it
  17. i can understand it, but please use better english :D ... :D Not witch ****** So Maven is plugin to Eclipse, so you can compile it in Eclipse :)
  18. Why ? What's source of this information ?? ..
  19. i can't find it .. here
  20. Infinity rod works good for him but when he click on skillType CONT or CRAFT (dwarven and common) he give full HP/CP/MP .. So there's something wrong with core i think
  21. So try if (receiver.getClient().setDetached())
  22. Wrong section ! It's client SIDE !
  23. what about logs in console ? :D
  24. but wrong ..
  25. right click on startGameServer.bat -> select EDIT and find xmx and add 1g for xmx
×
×
  • Create New...

AdBlock Extension Detected!

Our website is made possible by displaying online advertisements to our members.

Please disable AdBlock browser extension first, to be able to use our community.

I've Disabled AdBlock