Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Multiplayer {
- public Client client;
- public static final String ip = "localhost";
- public static final int tcpPort = 32000, udpPort = 32556;
- public static boolean messageRecieved = false;
- public Multiplayer() {
- try {
- client = new Client();
- register();
- NetworkListener nl = new NetworkListener();
- nl.init(client);
- client.addListener(nl);
- client.start();
- client.connect(5000, ip, tcpPort, udpPort);
- } catch (IOException e) {
- e.printStackTrace();
- client.stop();
- }
- }
- private synchronized void register() {
- Kryo kryo = new Kryo();
- kryo.register(Packet00LoginRequest.class);
- kryo.register(Packet01LoginAnswer.class);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement