Package net.lightstone.msg.handler

Source Code of net.lightstone.msg.handler.RotationMessageHandler

package net.lightstone.msg.handler;

import net.lightstone.model.Player;
import net.lightstone.model.Rotation;
import net.lightstone.msg.RotationMessage;
import net.lightstone.net.Session;

/**
* A {@link MessageHandler} that updates a {@link Player}'s {@link Rotation}
* when the server receives a {@link RotationMessage}.
* @author Graham Edgecombe
*/
public final class RotationMessageHandler extends MessageHandler<RotationMessage> {

  @Override
  public void handle(Session session, Player player, RotationMessage message) {
    if (player == null)
      return;

    player.setRotation(new Rotation(message.getRotation(), message.getPitch()));
  }

}
TOP

Related Classes of net.lightstone.msg.handler.RotationMessageHandler

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.