The amazing refactor forteen hundred billion: eliminated "locations",
portals will by dynamically created, combined display/runtime/editable scenes into one, enhanced support for modifying scenes and distributing updates to the clients, various other small stuff that should not be sweated. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2274 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// $Id: ZoneDirector.java,v 1.13 2003/01/18 22:45:16 mdb Exp $
|
||||
// $Id: ZoneDirector.java,v 1.14 2003/02/12 07:23:32 mdb Exp $
|
||||
|
||||
package com.threerings.whirled.zone.client;
|
||||
|
||||
@@ -14,6 +14,7 @@ import com.threerings.crowd.data.PlaceConfig;
|
||||
|
||||
import com.threerings.whirled.client.SceneDirector;
|
||||
import com.threerings.whirled.data.SceneModel;
|
||||
import com.threerings.whirled.data.SceneUpdate;
|
||||
import com.threerings.whirled.util.WhirledContext;
|
||||
|
||||
import com.threerings.whirled.zone.Log;
|
||||
@@ -158,19 +159,38 @@ public class ZoneDirector extends BasicDirector
|
||||
notifyObservers(summary);
|
||||
}
|
||||
|
||||
/**
|
||||
* Called in response to a successful {@link ZoneService#moveTo}
|
||||
* request when our cached scene was out of date and the server
|
||||
* determined that we needed some updates.
|
||||
*/
|
||||
public void moveSucceededWithUpdates (
|
||||
int placeId, PlaceConfig config, ZoneSummary summary,
|
||||
SceneUpdate[] updates)
|
||||
{
|
||||
// keep track of the summary
|
||||
_summary = summary;
|
||||
|
||||
// pass the rest off to the standard scene transition code
|
||||
_scdir.moveSucceededWithUpdates(placeId, config, updates);
|
||||
|
||||
// and let the zone observers know what's up
|
||||
notifyObservers(summary);
|
||||
}
|
||||
|
||||
/**
|
||||
* Called in response to a successful {@link ZoneService#moveTo}
|
||||
* request when our cached scene was out of date and the server
|
||||
* determined that we needed an updated copy.
|
||||
*/
|
||||
public void moveSucceededPlusUpdate (
|
||||
public void moveSucceededWithScene (
|
||||
int placeId, PlaceConfig config, ZoneSummary summary, SceneModel model)
|
||||
{
|
||||
// keep track of the summary
|
||||
_summary = summary;
|
||||
|
||||
// pass the rest off to the standard scene transition code
|
||||
_scdir.moveSucceededPlusUpdate(placeId, config, model);
|
||||
_scdir.moveSucceededWithScene(placeId, config, model);
|
||||
|
||||
// and let the zone observers know what's up
|
||||
notifyObservers(summary);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// $Id: ZoneService.java,v 1.6 2002/08/14 19:07:58 mdb Exp $
|
||||
// $Id: ZoneService.java,v 1.7 2003/02/12 07:23:32 mdb Exp $
|
||||
|
||||
package com.threerings.whirled.zone.client;
|
||||
|
||||
@@ -8,6 +8,7 @@ import com.threerings.presents.client.InvocationService;
|
||||
|
||||
import com.threerings.crowd.data.PlaceConfig;
|
||||
import com.threerings.whirled.data.SceneModel;
|
||||
import com.threerings.whirled.data.SceneUpdate;
|
||||
|
||||
import com.threerings.whirled.zone.data.ZoneSummary;
|
||||
|
||||
@@ -17,12 +18,17 @@ import com.threerings.whirled.zone.data.ZoneSummary;
|
||||
*/
|
||||
public interface ZoneService extends InvocationService
|
||||
{
|
||||
/** Used to deliver responses to {@link #moveTo} requests. */
|
||||
public static interface ZoneMoveListener extends InvocationListener
|
||||
{
|
||||
public void moveSucceeded (
|
||||
int placeId, PlaceConfig config, ZoneSummary summary);
|
||||
|
||||
public void moveSucceededPlusUpdate (
|
||||
public void moveSucceededWithUpdates (
|
||||
int placeId, PlaceConfig config, ZoneSummary summary,
|
||||
SceneUpdate[] updates);
|
||||
|
||||
public void moveSucceededWithScene (
|
||||
int placeId, PlaceConfig config, ZoneSummary summary,
|
||||
SceneModel model);
|
||||
}
|
||||
@@ -33,11 +39,11 @@ public interface ZoneService extends InvocationService
|
||||
*
|
||||
* @param zoneId the zone id to which we want to move.
|
||||
* @param sceneId the scene id to which we want to move.
|
||||
* @param sceneVers the version number of the scene object that we
|
||||
* have in our local repository.
|
||||
* @param version the version number of the scene object that we have
|
||||
* in our local repository.
|
||||
* @param listener the object that will receive the callback when the
|
||||
* request succeeds or fails.
|
||||
*/
|
||||
public void moveTo (Client client, int zoneId, int sceneId,
|
||||
int sceneVers, ZoneMoveListener listener);
|
||||
int version, ZoneMoveListener listener);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// $Id: ZoneMarshaller.java,v 1.2 2002/08/20 19:38:16 mdb Exp $
|
||||
// $Id: ZoneMarshaller.java,v 1.3 2003/02/12 07:23:32 mdb Exp $
|
||||
|
||||
package com.threerings.whirled.zone.data;
|
||||
|
||||
@@ -8,6 +8,7 @@ import com.threerings.presents.client.Client;
|
||||
import com.threerings.presents.data.InvocationMarshaller;
|
||||
import com.threerings.presents.dobj.InvocationResponseEvent;
|
||||
import com.threerings.whirled.data.SceneModel;
|
||||
import com.threerings.whirled.data.SceneUpdate;
|
||||
import com.threerings.whirled.zone.client.ZoneService;
|
||||
import com.threerings.whirled.zone.client.ZoneService.ZoneMoveListener;
|
||||
import com.threerings.whirled.zone.data.ZoneSummary;
|
||||
@@ -18,10 +19,6 @@ import com.threerings.whirled.zone.data.ZoneSummary;
|
||||
* on the server. Also provides an implementation of the response listener
|
||||
* interfaces that marshall the response arguments and deliver them back
|
||||
* to the requesting client.
|
||||
*
|
||||
* <p> Generated from <code>
|
||||
* $Id: ZoneMarshaller.java,v 1.2 2002/08/20 19:38:16 mdb Exp $
|
||||
* </code>
|
||||
*/
|
||||
public class ZoneMarshaller extends InvocationMarshaller
|
||||
implements ZoneService
|
||||
@@ -42,15 +39,27 @@ public class ZoneMarshaller extends InvocationMarshaller
|
||||
new Object[] { new Integer(arg1), arg2, arg3 }));
|
||||
}
|
||||
|
||||
/** The method id used to dispatch {@link #moveSucceededPlusUpdate}
|
||||
/** The method id used to dispatch {@link #moveSucceededWithUpdates}
|
||||
* responses. */
|
||||
public static final int MOVE_SUCCEEDED_PLUS_UPDATE = 2;
|
||||
public static final int MOVE_SUCCEEDED_WITH_UPDATES = 2;
|
||||
|
||||
// documentation inherited from interface
|
||||
public void moveSucceededPlusUpdate (int arg1, PlaceConfig arg2, ZoneSummary arg3, SceneModel arg4)
|
||||
public void moveSucceededWithUpdates (int arg1, PlaceConfig arg2, ZoneSummary arg3, SceneUpdate[] arg4)
|
||||
{
|
||||
omgr.postEvent(new InvocationResponseEvent(
|
||||
callerOid, requestId, MOVE_SUCCEEDED_PLUS_UPDATE,
|
||||
callerOid, requestId, MOVE_SUCCEEDED_WITH_UPDATES,
|
||||
new Object[] { new Integer(arg1), arg2, arg3, arg4 }));
|
||||
}
|
||||
|
||||
/** The method id used to dispatch {@link #moveSucceededWithScene}
|
||||
* responses. */
|
||||
public static final int MOVE_SUCCEEDED_WITH_SCENE = 3;
|
||||
|
||||
// documentation inherited from interface
|
||||
public void moveSucceededWithScene (int arg1, PlaceConfig arg2, ZoneSummary arg3, SceneModel arg4)
|
||||
{
|
||||
omgr.postEvent(new InvocationResponseEvent(
|
||||
callerOid, requestId, MOVE_SUCCEEDED_WITH_SCENE,
|
||||
new Object[] { new Integer(arg1), arg2, arg3, arg4 }));
|
||||
}
|
||||
|
||||
@@ -63,8 +72,13 @@ public class ZoneMarshaller extends InvocationMarshaller
|
||||
((Integer)args[0]).intValue(), (PlaceConfig)args[1], (ZoneSummary)args[2]);
|
||||
return;
|
||||
|
||||
case MOVE_SUCCEEDED_PLUS_UPDATE:
|
||||
((ZoneMoveListener)listener).moveSucceededPlusUpdate(
|
||||
case MOVE_SUCCEEDED_WITH_UPDATES:
|
||||
((ZoneMoveListener)listener).moveSucceededWithUpdates(
|
||||
((Integer)args[0]).intValue(), (PlaceConfig)args[1], (ZoneSummary)args[2], (SceneUpdate[])args[3]);
|
||||
return;
|
||||
|
||||
case MOVE_SUCCEEDED_WITH_SCENE:
|
||||
((ZoneMoveListener)listener).moveSucceededWithScene(
|
||||
((Integer)args[0]).intValue(), (PlaceConfig)args[1], (ZoneSummary)args[2], (SceneModel)args[3]);
|
||||
return;
|
||||
|
||||
@@ -87,5 +101,5 @@ public class ZoneMarshaller extends InvocationMarshaller
|
||||
});
|
||||
}
|
||||
|
||||
// Class file generated on 12:33:05 08/20/02.
|
||||
// Generated on 15:03:19 02/08/03.
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// $Id: ZoneDispatcher.java,v 1.2 2002/08/20 19:38:16 mdb Exp $
|
||||
// $Id: ZoneDispatcher.java,v 1.3 2003/02/12 07:23:32 mdb Exp $
|
||||
|
||||
package com.threerings.whirled.zone.server;
|
||||
|
||||
@@ -10,6 +10,7 @@ import com.threerings.presents.data.InvocationMarshaller;
|
||||
import com.threerings.presents.server.InvocationDispatcher;
|
||||
import com.threerings.presents.server.InvocationException;
|
||||
import com.threerings.whirled.data.SceneModel;
|
||||
import com.threerings.whirled.data.SceneUpdate;
|
||||
import com.threerings.whirled.zone.client.ZoneService;
|
||||
import com.threerings.whirled.zone.client.ZoneService.ZoneMoveListener;
|
||||
import com.threerings.whirled.zone.data.ZoneMarshaller;
|
||||
@@ -17,10 +18,6 @@ import com.threerings.whirled.zone.data.ZoneSummary;
|
||||
|
||||
/**
|
||||
* Dispatches requests to the {@link ZoneProvider}.
|
||||
*
|
||||
* <p> Generated from <code>
|
||||
* $Id: ZoneDispatcher.java,v 1.2 2002/08/20 19:38:16 mdb Exp $
|
||||
* </code>
|
||||
*/
|
||||
public class ZoneDispatcher extends InvocationDispatcher
|
||||
{
|
||||
@@ -56,4 +53,6 @@ public class ZoneDispatcher extends InvocationDispatcher
|
||||
super.dispatchRequest(source, methodId, args);
|
||||
}
|
||||
}
|
||||
|
||||
// Generated on 15:03:19 02/08/03.
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// $Id: ZoneProvider.java,v 1.13 2002/12/03 06:58:57 mdb Exp $
|
||||
// $Id: ZoneProvider.java,v 1.14 2003/02/12 07:23:32 mdb Exp $
|
||||
|
||||
package com.threerings.whirled.zone.server;
|
||||
|
||||
@@ -161,10 +161,10 @@ public class ZoneProvider
|
||||
}
|
||||
|
||||
// check to see if they need a newer version of the scene data
|
||||
SceneModel model = scmgr.getSceneModel();
|
||||
SceneModel model = scmgr.getScene().getSceneModel();
|
||||
if (sceneVersion < model.version) {
|
||||
// then send the moveTo response
|
||||
listener.moveSucceededPlusUpdate(ploid, config, summary, model);
|
||||
listener.moveSucceededWithScene(ploid, config, summary, model);
|
||||
|
||||
} else {
|
||||
// then send the moveTo response
|
||||
|
||||
Reference in New Issue
Block a user