public static void start()
    {
        try {
            server = new Server();
            //Registers
            server.getKryo().register(ErrorPacket.class);
            server.getKryo().register(LoginDataPacket.class);
            server.getKryo().register(UserInfoPacket.class);
            
            
            
            //Binding and starting
            server.bind(port, port);
            server.start();
            server.addListener(new ServerListener());
            
            System.out.println("Server has started.");
            
        } catch (IOException ex) {
            Logger.getLogger(ServerListener.class.getName()).log(Level.SEVERE, null, ex);
        }
    }