public boolean init() {
        try {
            System.out.println("Starting server...");
            commonsConfig = new DDJOCommonsConfig();
            
            Serializer.registerClass(StartGameMessage.class);
            NetOwlSerializerRegister.registerClasses(commonsConfig);
            
            
            gameServer = Network.createServer("DDJO", 0, port, port);
            gameServer.start();
            
            System.out.println("Spidermonkey started...");
            
            //Add connection handler
            ConnectHandler conHandler = new ConnectHandler();
            gameServer.addConnectionListener(conHandler);
            gameServer.addConnectionListener(this);
            
            
            //Start ConsoleReader for quitting
            ConsoleInputReader cir = new ConsoleInputReader();
            cir.addConsoleEventListener(this);

            System.out.println("Server started.");
            cir.start();
        } catch (IOException ex) {
            Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex);
            
            if(gameServer.isRunning()) {
                gameServer.close();
            }
            
            return false;
        }
        
        return true;
    }