Package com.jcloisterzone

Examples of com.jcloisterzone.VersionComparator


    @WsSubscribe
    public void handleHello(WebSocket ws, HelloMessage msg) {
//        //devel
//        if (clientIds.size() == 1) msg.setProtocolVersion("3.1");
//        //---
        if (new VersionComparator().compare(Application.PROTCOL_VERSION, msg.getProtocolVersion()) != 0) {
            send(ws, new ErrorMessage(ErrorMessage.BAD_VERSION, "Protocol version " + Application.PROTCOL_VERSION + " required."));
            ws.close();
            return;
        }
        if (gameStarted) throw new IllegalArgumentException("Game is already started.");
View Full Code Here


            (new Thread() {
                public void run() {
                    try {
                        URL url = new URL(updateUrlStr);
                        final AppUpdate update = AppUpdate.fetch(url);
                        if (update != null && (new VersionComparator()).compare(com.jcloisterzone.Application.VERSION, update.getVersion()) < 0) {
                            SwingUtilities.invokeLater(new Runnable() {
                                public void run() {
                                    client.showUpdateIsAvailable(update);
                                };
                            });
View Full Code Here

    public void load(InputStream is) throws SnapshotCorruptedException {
        doc = XmlUtils.parseDocument(is);
        root = doc.getDocumentElement();
        String snapshotVersion = root.getAttribute("app-version");
        if (!snapshotVersion.equals(Application.VERSION) && !snapshotVersion.equals(Application.DEV_VERSION)) {
            if ((new VersionComparator()).compare(snapshotVersion, Snapshot.COMPATIBLE_FROM) < 0) {
                throw new SnapshotVersionException("Saved game is not compatible with current JCloisterZone application. (saved in "+snapshotVersion+")");
            }
        }
    }
View Full Code Here

TOP

Related Classes of com.jcloisterzone.VersionComparator

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.