Package net.lightstone.msg

Examples of net.lightstone.msg.IdentificationMessage


  @Override
  public void handle(Session session, Player player, IdentificationMessage message) {
    Session.State state = session.getState();
    if (state == Session.State.EXCHANGE_IDENTIFICATION) {
      session.setState(State.GAME);
      session.send(new IdentificationMessage(0, "", 0, 0));
      session.setPlayer(new Player(session, message.getName())); // TODO case-correct the name
    } else {
      boolean game = state == State.GAME;
      session.disconnect(game ? "Identification already exchanged." : "Handshake not yet exchanged.");
    }
View Full Code Here


  public IdentificationMessage decode(ChannelBuffer buffer) {
    int version = buffer.readInt();
    String name = ChannelBufferUtils.readString(buffer);
    long seed = buffer.readLong();
    int dimension = buffer.readByte();
    return new IdentificationMessage(version, name, seed, dimension);
  }
View Full Code Here

TOP

Related Classes of net.lightstone.msg.IdentificationMessage

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.