wyvern.common.net
Interface RemoteMap

All Known Subinterfaces:
RemoteClient

public interface RemoteMap

Interface for updating the client's map display. This is the interface that the server calls to send data to the client. Its equivalent on the client side is client.core.ClientMap.

Version:
1.0, Apr 20, 1998
Author:
Steve Yegge

Method Summary
 void sendPartialScreen(RPCDataSource sender, short[] locs, int[][][] terrain, short[] objects)
          Sends the data for a partial-screen update.
 void sendZippedScreen(RPCDataSource sender, int[][] terrain, short[] data)
          Sends a complete screen (terrain records and non-terrain) with an implicit flushGraphics().
 

Method Detail

sendZippedScreen

public void sendZippedScreen(RPCDataSource sender,
                             int[][] terrain,
                             short[] data)
Sends a complete screen (terrain records and non-terrain) with an implicit flushGraphics(). The screen is a byte array, zipped using gzip. The format (when unzipped) is: This RPC call is unusual in that the parameters passed by the caller are different from the parameters received by the client. The caller passes in two data arrays that are subsequently zipped together and shoved over the network. The receiver end gets an RPC call as if the parameters were: (int ulen, int zlen, int w, int h, byte[] zipdata), where ulen is the length of the unzipped data, and w/h are the width and height of the terrain array. This arrangement allows the data to be zipped up on the client-output thread(s) of the game server. This in turn makes much better use of multi-processor boxes, as the zipping is somewhat expensive.

Parameters:
sender - the RPCDataSource that constructed this request, so it can be called back for more data when the request finishes sending.
terrain - the terrain[][]
data - the object[]

sendPartialScreen

public void sendPartialScreen(RPCDataSource sender,
                              short[] locs,
                              int[][][] terrain,
                              short[] objects)
Sends the data for a partial-screen update. This method replaces DrawTerrain and DrawObjects, which were being called separately. This method packages all the data components into a single array, which is zipped before sending it over the network.

Parameters:
locs - terrain locations (from Frame.getSparseTerrainInfo())
terrain - terrain records (same source)
objects - object tile numbers (from Frame.makeSparseArray())