Package com.threerings.whirled.data

Examples of com.threerings.whirled.data.SceneUpdate


            _updates.add(update);
            return;
        }

        // otherwise make sure this update conforms to our update sequence
        SceneUpdate last = _updates.get(_updates.size()-1);
        int expVersion = last.getSceneVersion() + last.getVersionIncrement();
        int gotVersion = update.getSceneVersion();
        if (gotVersion > expVersion) {
            log.warning("Update continuity broken, flushing list [got=" + update +
                        ", expect=" + expVersion + ", ucount=" + _updates.size() + "].");
            _updates.clear(); // flush out our old updates, fall through and add this one
View Full Code Here


    public boolean validate (int sceneVersion)
    {
        if (_updates.size() == 0) {
            return true;
        }
        SceneUpdate last = _updates.get(_updates.size()-1);
        return sceneVersion == (last.getSceneVersion() + last.getVersionIncrement());
    }
View Full Code Here

                    ", sceneVersion=" + sceneVersion + ", updateType=" + updateType + "].";
                throw new PersistenceException(errmsg);
            }

            // create the update
            SceneUpdate update = (SceneUpdate)updateClass.newInstance();
            update.init(sceneId, sceneVersion);

            // decode its contents from the serialized data
            ByteArrayInputStream bin = new ByteArrayInputStream(data);
            update.unpersistFrom(new ObjectInputStream(bin));
            return update;

        } catch (IOException ioe) {
            error = ioe;
            errmsg = "Unable to decode update";
View Full Code Here

TOP

Related Classes of com.threerings.whirled.data.SceneUpdate

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.