Index: source/gameserver/l2s/gameserver/network/l2/GameClient.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/source/gameserver/l2s/gameserver/network/l2/GameClient.java b/source/gameserver/l2s/gameserver/network/l2/GameClient.java
--- a/source/gameserver/l2s/gameserver/network/l2/GameClient.java
+++ b/source/gameserver/l2s/gameserver/network/l2/GameClient.java (date 1676042824703)
@@ -1,5 +1,6 @@
package l2s.gameserver.network.l2;
+import java.nio.Buffer;
import java.nio.ByteBuffer;
import java.sql.Connection;
import java.sql.PreparedStatement;
@@ -295,15 +296,15 @@
@Override
public boolean encrypt(final ByteBuffer buf, final int size)
{
- _crypt.encrypt(buf.array(), buf.position(), size);
- buf.position(buf.position() + size);
+ _crypt.encrypt(buf.array(), ((Buffer) buf).position(), size);
+ ((Buffer) buf).position(((Buffer) buf).position() + size);
return true;
}
@Override
public boolean decrypt(ByteBuffer buf, int size)
{
- boolean ret = _crypt.decrypt(buf.array(), buf.position(), size);
+ boolean ret = _crypt.decrypt(buf.array(), ((Buffer) buf).position(), size);
return ret;
}
Index: source/gameserver/l2s/gameserver/network/authcomm/AuthServerCommunication.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/source/gameserver/l2s/gameserver/network/authcomm/AuthServerCommunication.java b/source/gameserver/l2s/gameserver/network/authcomm/AuthServerCommunication.java
--- a/source/gameserver/l2s/gameserver/network/authcomm/AuthServerCommunication.java
+++ b/source/gameserver/l2s/gameserver/network/authcomm/AuthServerCommunication.java (date 1676043335666)
@@ -2,6 +2,7 @@
import java.io.IOException;
import java.net.InetSocketAddress;
+import java.nio.Buffer;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
import java.nio.channels.CancelledKeyException;
@@ -264,14 +265,14 @@
if(count == 0)
return;
- buf.flip();
+ ((Buffer) buf).flip();
while(tryReadPacket(key, buf));
}
private boolean tryReadPacket(SelectionKey key, ByteBuffer buf) throws IOException
{
- int pos = buf.position();
+ int pos = ((Buffer) buf).position();
if(buf.remaining() > 2)
{
@@ -288,8 +289,8 @@
if(size <= buf.remaining())
{
- int limit = buf.limit();
- buf.limit(pos + size + 2);
+ int limit = ((Buffer) buf).limit();
+ ((Buffer) buf).limit(pos + size + 2);
ReceivablePacket rp = PacketHandler.handlePacket(buf);
@@ -299,21 +300,21 @@
ThreadPoolManager.getInstance().execute(rp);
}
- buf.limit(limit);
- buf.position(pos + size + 2);
+ ((Buffer) buf).limit(limit);
+ ((Buffer) buf).position(pos + size + 2);
if(!buf.hasRemaining())
{
- buf.clear();
+ ((Buffer) buf).clear();
return false;
}
return true;
}
-
- buf.position(pos);
+
+ ((Buffer) buf).position(pos);
}
buf.compact();
@@ -335,22 +336,22 @@
SendablePacket sp;
while(i++ < 64 && (sp = sendQueue.poll()) != null)
{
- int headerPos = buf.position();
- buf.position(headerPos + 2);
+ int headerPos = ((Buffer) buf).position();
+ ((Buffer) buf).position(headerPos + 2);
sp.write();
- int dataSize = buf.position() - headerPos - 2;
+ int dataSize = ((Buffer) buf).position() - headerPos - 2;
if(dataSize == 0)
{
- buf.position(headerPos);
+ ((Buffer) buf).position(headerPos);
continue;
}
-
- buf.position(headerPos);
+
+ ((Buffer) buf).position(headerPos);
buf.putShort((short) (dataSize + 2));
- buf.position(headerPos + dataSize + 2);
+ ((Buffer) buf).position(headerPos + dataSize + 2);
}
done = sendQueue.isEmpty();
@@ -361,7 +362,7 @@
{
sendLock.unlock();
}
- buf.flip();
+ ((Buffer) buf).flip();
channel.write(buf);
@@ -372,7 +373,7 @@
}
else
{
- buf.clear();
+ ((Buffer) buf).clear();
}
if(!done)
@@ -407,8 +408,8 @@
sendLock.unlock();
}
- readBuffer.clear();
- writeBuffer.clear();
+ ((Buffer) readBuffer).clear();
+ ((Buffer) writeBuffer).clear();
isPengingWrite.set(false);