com.threerings.whirled.zone.peer.server

## Class PeeredZoneRegistry

- java.lang.Object
- - com.threerings.whirled.zone.server.ZoneRegistry
  - - com.threerings.whirled.zone.peer.server.PeeredZoneRegistry

All Implemented Interfaces:
  com.threerings.presents.server.InvocationProvider, ZoneProvider

    public abstract class PeeredZoneRegistry
    extends ZoneRegistry

### Nested Class Summary

Nested Classes
`static class` `PeeredZoneRegistry.PeerZoneMoveHandler` A ZoneMoveHandler that can receive the sceneOnNode() callback.
`static interface` `PeeredZoneRegistry.PeerZoneResolutionListener` Peer-awareness for finding out about zones.
`static interface` `PeeredZoneRegistry.PeerZoneShutdownListener` Peered zones should be sure to call back to one of these when they're going away.

### Constructor Summary

Constructors
Constructor and Description
`PeeredZoneRegistry(com.threerings.presents.server.InvocationManager invmgr, ZonePeerManager peerMgr)`

### Method Summary

All Methods Instance Methods Concrete Methods
`PeeredZoneManager` `getZoneManager(int qualifiedZoneId)` Returns the zone manager that handles the specified zone id.
`void` `moveTo(com.threerings.presents.data.ClientObject caller, int zoneId, int sceneId, int sceneVer, ZoneService.ZoneMoveListener listener)` Handles a `ZoneService.moveTo(int, int, int, com.threerings.whirled.zone.client.ZoneService.ZoneMoveListener)` request.
`void` `registerZoneManager(byte zoneType, ZoneManager manager)` Registers the supplied zone manager as the manager for the specified zone type.
`void` `resolvePeerZone(int zoneId, PeeredZoneRegistry.PeerZoneResolutionListener listener)` Resolve a zone, or return the information on the peer on which it's hosted.
`void` `resolveZone(int zoneId, ZoneManager.ResolutionListener listener)`
`void` `zoneDidShutdown(int zoneId)` Pass on that the zone has shutdown.

### Methods inherited from class com.threerings.whirled.zone.server.ZoneRegistry

`leaveOccupiedZone, moveBody`

### Methods inherited from class java.lang.Object

`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### PeeredZoneRegistry

    @Inject
    public PeeredZoneRegistry(com.threerings.presents.server.InvocationManager invmgr,
                                      ZonePeerManager peerMgr)

### Method Detail

#### registerZoneManager

    public void registerZoneManager(byte zoneType,
                                    ZoneManager manager)

Description copied from class: `ZoneRegistry`
Registers the supplied zone manager as the manager for the specified zone type. Zone types are 7 bits and managers are responsible for making sure they don't use a zone type that collides with another manager (given that we have only three zone types at present, this doesn't seem unreasonable).

Overrides:
  `registerZoneManager` in class `ZoneRegistry`

#### getZoneManager

    public PeeredZoneManager getZoneManager(int qualifiedZoneId)

Description copied from class: `ZoneRegistry`
Returns the zone manager that handles the specified zone id.

Overrides:
  `getZoneManager` in class `ZoneRegistry`
Parameters:
  `qualifiedZoneId` - the qualified zone id for which the manager should be looked up.

#### moveTo

    public void moveTo(com.threerings.presents.data.ClientObject caller,
                       int zoneId,
                       int sceneId,
                       int sceneVer,
                       ZoneService.ZoneMoveListener listener)
                throws com.threerings.presents.server.InvocationException

Description copied from interface: `ZoneProvider`
Handles a `ZoneService.moveTo(int, int, int, com.threerings.whirled.zone.client.ZoneService.ZoneMoveListener)` request.

Specified by:
  `moveTo` in interface `ZoneProvider`
Overrides:
  `moveTo` in class `ZoneRegistry`
Throws:
  `com.threerings.presents.server.InvocationException`

#### resolveZone

    public void resolveZone(int zoneId,
                            ZoneManager.ResolutionListener listener)

#### resolvePeerZone

    public void resolvePeerZone(int zoneId,
                                PeeredZoneRegistry.PeerZoneResolutionListener listener)

Resolve a zone, or return the information on the peer on which it's hosted.

#### zoneDidShutdown

    public void zoneDidShutdown(int zoneId)

Pass on that the zone has shutdown.