Index: C:/workspace/c4/java/net/sf/l2j/gameserver/SelectorThread.java
===================================================================
--- C:/workspace/c4/java/net/sf/l2j/gameserver/SelectorThread.java (revision 1654)
+++ C:/workspace/c4/java/net/sf/l2j/gameserver/SelectorThread.java (working copy)
@@ -203,7 +203,7 @@
if (Config.ASSERT) assert b.position() == 0;
if (Config.ASSERT) assert b.limit() == WRITE_BUF_SIZE;
writeBuffers[numWriteBuffers++] = b;
- }
+ } else b=null;
}
/** Main loop, see class description */
@@ -245,7 +245,7 @@
// wait for read/write, timeout is to be on safe side,
// if waking up selector after a message push will fail
// this is needed because we are in an infinite loop
- int numKeys = _selector.select(50L);
+ int numKeys = _selector.select(20L);
// check for shutdown
if (isInterrupted())
{
@@ -317,6 +317,7 @@
if (b != null) {
int r = ((SocketChannel)sk.channel()).write(b);
if (r < 0) {
+ _log.warning("could not write data to channel, closing client");
closeClient(con);
return;
}
@@ -589,6 +590,13 @@
continue;
}
+ if (System.currentTimeMillis()-msg.getTime()>10000) // no packet should live that long
+ {
+ _log.warning("removed strange, suspicious packet with >10000 LifeTime");
+ _log.warning("packet details... type: "+msg.getType()+" connection: "+msg.getConnection().toString());
+ iter.remove();
+ continue;
+ }
Connection con = msg.getConnection();
SelectionKey sk = con.getChannel().keyFor(_selector);