Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class ServerMP {
- public static final String ip = "localhost";
- public static final int tcpPort = 32000, udpPort = 32556;
- private Server server;
- public ServerMP() {
- server = new Server(1024 * 64, 4096);
- registerPackets();
- NetworkListener nl = new NetworkListener();
- server.addListener(nl);
- try {
- server.bind(tcpPort, udpPort);
- } catch (IOException e) {
- e.printStackTrace();
- }
- server.start();
- }
- public void registerPackets() {
- Kryo kryo = server.getKryo();
- kryo.register(Packet00LoginRequest.class);
- kryo.register(Packet01LoginAnswer.class);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement