Package svs_core :: Package network :: Module clientavatar :: Class ClientAvatar
[show private | hide private]
[frames | no frames]

Class ClientAvatar

    Avatar --+
             |
Listenable --+
             |
            ClientAvatar


Generic client, provides base client functionality as represented to the server.

Clients interact with the simulation world by calling remote methods on the proxy.

For more information see the Perspective Broker system within the twisted framework: http://twistedmatrix.com/documents/howto/.
Method Summary
  __init__(self, name)
  attached(self, mind)
Called by the ClusterRealm when a client connects to the server.
  detached(self, mind)
Called by the ClusterRealm when a client disconnects from the server.
  getProfile(self, requester)
Returns profile.
  handleDataRequest(self, dataRequest)
Checks if requested data is in cache and returns that.
  perspective_clearDepositedData(self, label)
Empties cache of data deposits held by avatar.
  perspective_depositData(self, dataPacket)
Stores data packet in cache for other clients to collect.
  perspective_getProfile(self)
object perspective_joinClusterGroup(self, groupName)
Proxy invocation of svs.network.clientuser.GenericClient.joinClusterGroup called by client.
object perspective_leaveClusterGroup(self)
Proxy invocation of svs.network.clientuser.GenericClient.leaveCluster called by client.
  perspective_notifyListeners(self, dataPacket)
Forwards data onto listeners.
  perspective_retrieveOwnData(self, dataRequest)
Returns requested in cache data back to client.
  perspective_sendCommand(self, cmd)
Sends commands to another client.
  perspective_sendCommandResult(self, cmdResult)
Sends command result to sending client.
  profileReceived(self, profile)
Deferred callback for receiving profile from real client.
  receiveData(self, dataPacket)
Receive data from another client, forward to own client.
  receiveDataResult(self, cmdResult)
Receive data from another client, forward to own client.
  sendChatMessage(self, message)
Sends char message to client.
  sendCommand(self, cmd)
Sends command to client.
  sendCommandResult(self, cmdResult)
Sends comamnd result to client.
  sendData(self, dataPacket)
Sends data packet to cluster group for forwarding to other client.
  sendDataResult(self, cmdResult)
Sends data packet to cluster group for forwarding to other client.
  sendErrorMessage(self, message)
Sends error message to client.
  sendStatusMessage(self, message)
Sends status message to client.
  sendUpdate(self, simTime)
Calls update method on client.
    Inherited from Avatar
  perspectiveMessageReceived(self, broker, message, args, kw)
This method is called when a network message is received.
    Inherited from Listenable
  addListener(self, listener, listenFor)
Adds new listener to avatar.
  handleListenRequest(self, listenRequest)
Deals with listen request from another client.
  notifyListeners(self, listenFor, dataPacket)
Forward data to listeners.
  removeListener(self, listener, listenFor)
Removes listener from avatar.

Class Variable Summary
    Inherited from Avatar
Implements __implemented__ = <implementedBy twisted.spread.pb.Avata...
_implementsTuple __implements__ = (<MetaInterface twisted.spread.pb.IPers...
ClassProvides __providedBy__ = <zope.interface.declarations.ClassProvi...
ClassProvides __provides__ = <zope.interface.declarations.ClassProvide...

Method Details

attached(self, mind)

Called by the ClusterRealm when a client connects to the server. It passes a mind object to the proxy. This is a reference to the client connection and is used to pass remote method calls back to the client from the server.
Parameters:
mind - reference to client connection
           (type=object)

detached(self, mind)

Called by the ClusterRealm when a client disconnects from the server. It passes a mind object to the proxy. This is a reference to the client connection and is used to pass remote method calls back to the client from the server.

The client is also removed from the group it joined earlier.
Parameters:
mind - reference to client connection
           (type=object)

getProfile(self, requester=None)

Returns profile. If requester given notifies remote self with name of requester.

handleDataRequest(self, dataRequest)

Checks if requested data is in cache and returns that. If not, then forwards request to client.

perspective_clearDepositedData(self, label=None)

Empties cache of data deposits held by avatar.

If a label is specified then only data stored under that label is removed.

perspective_depositData(self, dataPacket)

Stores data packet in cache for other clients to collect.

If the data packet is labelled it is stored under this label, if not it replaces the current unlabelled data.

perspective_joinClusterGroup(self, groupName)

Proxy invocation of svs.network.clientuser.GenericClient.joinClusterGroup called by client.
Parameters:
groupName - name of cluster group to join
           (type=string)
Returns:
object

perspective_leaveClusterGroup(self)

Proxy invocation of svs.network.clientuser.GenericClient.leaveCluster called by client.
Returns:
result of leaveCluster call to server
           (type=object)

perspective_notifyListeners(self, dataPacket)

Forwards data onto listeners.

perspective_retrieveOwnData(self, dataRequest)

Returns requested in cache data back to client.

This can be used by the client as a temporary store for its own information.

perspective_sendCommand(self, cmd)

Sends commands to another client.

perspective_sendCommandResult(self, cmdResult)

Sends command result to sending client.

Note: not implemented.

profileReceived(self, profile)

Deferred callback for receiving profile from real client.

receiveData(self, dataPacket)

Receive data from another client, forward to own client.

receiveDataResult(self, cmdResult)

Receive data from another client, forward to own client.

The data is wrapped inside a makeCommandResult object.

sendChatMessage(self, message)

Sends char message to client.
Parameters:
message - status message
           (type=string)

sendCommand(self, cmd)

Sends command to client.

sendCommandResult(self, cmdResult)

Sends comamnd result to client.

sendData(self, dataPacket)

Sends data packet to cluster group for forwarding to other client.

sendDataResult(self, cmdResult)

Sends data packet to cluster group for forwarding to other client.

sendErrorMessage(self, message)

Sends error message to client.
Parameters:
message - error message
           (type=string)

sendStatusMessage(self, message)

Sends status message to client.
Parameters:
message - status message
           (type=string)

sendUpdate(self, simTime)

Calls update method on client.
Parameters:
simTime - current simulation time
           (type=list)

Generated by Epydoc 2.1 on Thu Oct 20 15:30:24 2005 http://epydoc.sf.net