20-bit zones

This commit is contained in:
Darren Ranalli 2003-07-01 21:25:13 +00:00
parent 1e600848e7
commit 5ea5135f63

View File

@ -12,6 +12,7 @@ import CRCache
#import DistributedObject #import DistributedObject
#import DistributedToon #import DistributedToon
import DirectObject import DirectObject
import PythonUtil
class ClientRepository(DirectObject.DirectObject): class ClientRepository(DirectObject.DirectObject):
notify = DirectNotifyGlobal.directNotify.newCategory("ClientRepository") notify = DirectNotifyGlobal.directNotify.newCategory("ClientRepository")
@ -591,16 +592,20 @@ class ClientRepository(DirectObject.DirectObject):
self.send(datagram) self.send(datagram)
return None return None
def sendSetZoneMsg(self, zoneId): def sendSetZoneMsg(self, zoneId, visibleZoneList=None):
datagram = Datagram() datagram = Datagram()
# Add message type # Add message type
datagram.addUint16(CLIENT_SET_ZONE) datagram.addUint16(CLIENT_SET_ZONE)
# Add zone id # Add zone id
datagram.addUint16(zoneId) datagram.addUint32(zoneId)
# if we have an explicit list of visible zones, add them
if visibleZoneList is not None:
for zone in visibleZoneList:
datagram.addUint32(zone)
# send the message # send the message
self.send(datagram) self.send(datagram)
return None
def sendUpdate(self, do, fieldName, args, sendToId = None): def sendUpdate(self, do, fieldName, args, sendToId = None):
# Get the DO id # Get the DO id
@ -615,6 +620,7 @@ class ClientRepository(DirectObject.DirectObject):
if self.notify.getDebug(): if self.notify.getDebug():
print "ClientRepository sending datagram:" print "ClientRepository sending datagram:"
datagram.dumpHex(ostream) datagram.dumpHex(ostream)
print "Caller is %s, line %s, func '%s'" % PythonUtil.callerInfo()
if not self.tcpConn: if not self.tcpConn:
self.notify.warning("Unable to send message after connection is closed.") self.notify.warning("Unable to send message after connection is closed.")