
Tw3ty
Members-
Posts
59 -
Credits
0 -
Joined
-
Last visited
-
Feedback
0%
Content Type
Articles
Profiles
Forums
Store
Everything posted by Tw3ty
-
Summons - skills problem [Interlude]
Tw3ty posted a question in Request Server Development Help [L2J]
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 ? -
I can .. But you said, that it's working ! ... But THIS IS NOT WORKING without edit ..
-
Where's LegendSkillTable ?? ... for (L2Skill s : LegendSkillTable.getLegendSkills()) I miss it !
-
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());
-
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) - { - - } - } - } }
-
Nothing special, but simple & good ;) Thanks I'll test if all teleports work ;)
-
[simple question] About l2j Passwords
Tw3ty replied to Dir50's question in Request Server Development Help [L2J]
base64_encode(pack('H*', sha1($password))) -
[Share] Modify Skill Duration for It
Tw3ty replied to xtremex's topic in Server Shares & Files [L2J]
Lol, credits for you ? :D Are you kidding me ? :D You can't steal java code, because of GNU license :D -
[Help] can't find config
Tw3ty replied to zazazaza's question in Request Server Development Help [L2J]
http://svn2.xp-dev.com/svn/L2J-Archid/trunk/Archid-Game/config/ -
enable it in configs ;)
-
[SHARE]Lineage II Website
Tw3ty replied to ImmortalKiller's topic in Website Templates & Themes (Free)
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 -
[SHARE]Lineage II Website
Tw3ty replied to ImmortalKiller's topic in Website Templates & Themes (Free)
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 .. -
Oh, really ? :D Are U stupid ? ;) Just search :P http://svn.l2jserver.com/trunk/MMOCore/
-
yes, you can't do it, if you haven't knowlegde in java ;)
-
[Question] Best private L2J team?
Tw3ty replied to estaz's question in Request Server Development Help [L2J]
Just make your own project ... based on L2JServer -
i think too, fix it
-
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 :)
-
[Help][Interlude]Gordon attack all players
Tw3ty replied to Tassadar's question in Request Server Development Help [L2J]
Why ? What's source of this information ?? .. -
i can't find it .. here
-
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
-
So try if (receiver.getClient().setDetached())
-
can someone help me in this?
Tw3ty replied to SkySkase's question in Request Server Development Help [L2J]
Wrong section ! It's client SIDE ! -
what about logs in console ? :D
-
but wrong ..
-
Interlude Geodata Problem
Tw3ty replied to Egealka's question in Request Server Development Help [L2J]
right click on startGameServer.bat -> select EDIT and find xmx and add 1g for xmx