public static void main(String[] args) {
        logln("LIG Client " + version + " Initializing..");
        Config main = new Config("main");
        logln("Loading configurations..");
        try {
            host = main.getString("host", "localhost");
            port = Integer.parseInt(main.getString("port", "20222"));
        }catch(Exception ex) {
            warn("Can't load configurations!", true);
        }
        try {
            logln("Connecting to " + host + ":" + port + "..");
            socket = new Socket(host, port);
            reader = new BufferedReader(new InputStreamReader(System.in));
            in = new DataInputStream(socket.getInputStream());
            out = new PrintStream(socket.getOutputStream());
        }catch(UnknownHostException ex) {
            warn("Unknown host " + host + ":" + port + "!", true);
        }catch(IOException ex) {
            warn("Can't connect to " + host + ":" + port + "!", true);
        }
        if(socket != null && in != null && out != null) {
            try {
                logln("Loading LAF..");
                UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
                logln("Loading graphics..");
                (gm = new GraphicsManager()).viewAuthorization();
            }catch(ClassNotFoundException | InstantiationException | IllegalAccessException | UnsupportedLookAndFeelException ex) {
                warn("Failed to load LAF or graphics! Cause:", false);
                ex.printStackTrace();
                warn("", true);
            }
            try {
                new Thread(new Client_Loader()).start();
                while(!closed) {}
                out.close();
                in.close();
                socket.close();
            }catch(IOException ex) {
                warn("Error while creating client thread!", true);
            }
        }
    }