Package com.esotericsoftware.kryonet.examples.position

Source Code of com.esotericsoftware.kryonet.examples.position.Network$MoveCharacter

package com.esotericsoftware.kryonet.examples.position;

import com.esotericsoftware.kryo.Kryo;
import com.esotericsoftware.kryonet.EndPoint;

// This class is a convenient place to keep things common to both the client and server.
public class Network {
  static public final int port = 54555;

  // This registers objects that are going to be sent over the network.
  static public void register (EndPoint endPoint) {
    Kryo kryo = endPoint.getKryo();
    kryo.register(Login.class);
    kryo.register(RegistrationRequired.class);
    kryo.register(Register.class);
    kryo.register(AddCharacter.class);
    kryo.register(UpdateCharacter.class);
    kryo.register(RemoveCharacter.class);
    kryo.register(Character.class);
    kryo.register(MoveCharacter.class);
  }

  static public class Login {
    public String name;
  }

  static public class RegistrationRequired {
  }

  static public class Register {
    public String name;
    public String otherStuff;
  }

  static public class UpdateCharacter {
    public int id, x, y;
  }

  static public class AddCharacter {
    public Character character;
  }

  static public class RemoveCharacter {
    public int id;
  }

  static public class MoveCharacter {
    public int x, y;
  }
}
TOP

Related Classes of com.esotericsoftware.kryonet.examples.position.Network$MoveCharacter

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.
div> es of javax.servlet.ServletException">javax.servlet.ServletException
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.