Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @Override
- public void receieveMessage(Object o) {
- if (!(o instanceof LoginDetails)) {
- return;
- }
- LoginDetails details = (LoginDetails) o;
- SocketChannel channel = (SocketChannel) details.getChannel().channel();
- Player player = new Player(this);
- String username = details.getUsername();
- String password = details.getPassword();
- String address = channel.remoteAddress().getAddress().getHostAddress();
- player.setUsername(username);
- player.setPassword(password);
- player.setAddress(address);
- channel.pipeline().replace("decoder", "incoming-packet-decoder", new IncomingPacketDecoder(details.getOut()));
- World.getWorld().addPlayer(player);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement