[SoulWorker]SoulWorker emu java

Results 1 to 3 of 3
  1. #1
    Apprentice 4312303 is offline
    MemberRank
    Oct 2018 Join Date
    17Posts

    [SoulWorker]SoulWorker emu java

    Hi everyone.I'am now trying to develop a emulator for a game called "SoulWorker".
    And it is my very first time to develop a emulator,so,I got a problem.
    I'm using Netty as my framework.
    I create a login server as the following
    Code:
    EventLoopGroup bossGroup = new NioEventLoopGroup(); EventLoopGroup workerGroup = new NioEventLoopGroup();
    ServerBootstrap b = new ServerBootstrap();            b.group(bossGroup, workerGroup).channel(NioServerSocketChannel.class)                    .childHandler(new ChannelInitializer<SocketChannel>() {                        @Override                        public void initChannel(SocketChannel ch) throws Exception {                            ch.pipeline().addLast(new DiscardServerHandler());                        }                    }).option(ChannelOption.SO_BACKLOG, 128)                    .childOption(ChannelOption.SO_KEEPALIVE, true)                    .childOption(ChannelOption.TCP_NODELAY, true);             ChannelFuture f = b.bind(LOGIN_SERVER_PORT).sync();            f.channel().closeFuture().sync();
    And here is my handler:
    Code:
    public class DiscardServerHandler extends ChannelInboundHandlerAdapter {    @Override    public void channelActive(ChannelHandlerContext ctx) throws Exception {        // TODO Auto-generated method stub        System.out.println("connected");        super.channelActive(ctx);    }        @Override    public void channelRead(ChannelHandlerContext ctx, Object msg) { // (2)        System.out.println("reading");        if (!(msg instanceof ByteBuf)) return;        try {            System.out.println("read....");        } finally {            ReferenceCountUtil.release(msg);        }    }
    }
    So the problem is,after I launched my client.
    the string "connected" is able to print to my console but,
    I CAN NOT read anything.
    String "reading" is never been printed to my console.

    plz help me.

    - - - Updated - - -

    Ok I know my client isn't sent anything to server.
    I don't know why but I guess if login info wasn't there the client would not send anything to server


  2. #2
    Enthusiast Zaseth is offline
    MemberRank
    Oct 2018 Join Date
    The NetherlandsLocation
    31Posts

    Re: [SoulWorker]SoulWorker emu java

    It could be possible that the message is not a ByteBuf.

  3. #3
    Apprentice 4312303 is offline
    MemberRank
    Oct 2018 Join Date
    17Posts

    Re: [SoulWorker]SoulWorker emu java

    tks for the reply
    I've fixed this issue.The problem is there is an argument required so the client could get login infos.



Advertisement