Package packets.c2spackets

Source Code of packets.c2spackets.P0x00

package packets.c2spackets;

import network.MCConnection;
import exceptions.UnrecoverableException;
import packets.PacketHandler;
import packets.s2cpackets.S0x00;
import world.WorldState;


/**
* Client Ping to server.
* Returns a PING(0) back.
*/
public class P0x00 extends PacketHandler{

  public P0x00(WorldState state) {
    super(state);
  }

  @Override
  public void handle(MCConnection conn) throws UnrecoverableException {
    if(conn.r.readInt() == 0) {
      conn.send(new S0x00(0));
    } else {
      //PING REPLY!
      System.out.println("  PING REPLY!");
    }
  }

}
TOP

Related Classes of packets.c2spackets.P0x00

TOP
Copyright © 2018 www.massapi.com. 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.