Packet sending during Netty migration

This commit is contained in:
P0nk
2021-06-25 14:43:05 +02:00
parent 80cacd609a
commit f6aca2018e
3 changed files with 35 additions and 4 deletions

View File

@@ -11,11 +11,11 @@ public class LoginServerInitializer extends ServerChannelInitializer {
@Override
public void initChannel(SocketChannel socketChannel) {
final String clientIp = socketChannel.remoteAddress().getHostName();
final String clientIp = socketChannel.remoteAddress().getHostString();
log.debug("Client connected to login server from {} ", clientIp);
PacketProcessor packetProcessor = PacketProcessor.getLoginServerProcessor();
final MapleClient client = new MapleClient(packetProcessor, LoginServer.WORLD, LoginServer.CHANNEL);
final MapleClient client = new MapleClient(packetProcessor, LoginServer.WORLD_ID, LoginServer.CHANNEL_ID);
client.setSessionId(sessionId.getAndIncrement());
initPipeline(socketChannel, client);

View File

@@ -12,6 +12,11 @@ import java.awt.*;
public class ByteBufOutPacket implements OutPacket {
private final ByteBuf byteBuf;
@Deprecated(forRemoval = true)
public ByteBufOutPacket() {
this.byteBuf = Unpooled.buffer();
}
public ByteBufOutPacket(SendOpcode op) {
ByteBuf byteBuf = Unpooled.buffer();
byteBuf.writeShortLE((short) op.getValue());