From 75393d035b70a59e26d578235eeaa1d3050884fb Mon Sep 17 00:00:00 2001 From: Dave Schuyler Date: Fri, 18 Feb 2005 22:22:36 +0000 Subject: [PATCH] commenting out old code --- direct/src/distributed/ClientRepository.py | 64 +++++++++++----------- 1 file changed, 33 insertions(+), 31 deletions(-) diff --git a/direct/src/distributed/ClientRepository.py b/direct/src/distributed/ClientRepository.py index 246e2f82a5..50a95242ab 100644 --- a/direct/src/distributed/ClientRepository.py +++ b/direct/src/distributed/ClientRepository.py @@ -46,9 +46,10 @@ class ClientRepository(ConnectionRepository.ConnectionRepository): self.bootedIndex = None self.bootedText = None - self.worldScale = render.attachNewNode("worldScale") # for grid zones. - self.worldScale.setScale(base.config.GetFloat('world-scale', 100)) - self.priorWorldPos = None + if 0: # unused: + self.worldScale = render.attachNewNode("worldScale") # for grid zones. + self.worldScale.setScale(base.config.GetFloat('world-scale', 100)) + self.priorWorldPos = None # create a parentMgr to handle distributed reparents # this used to be 'token2nodePath' @@ -98,39 +99,40 @@ class ClientRepository(ConnectionRepository.ConnectionRepository): self.disconnect() self.stopHeartbeat() - def setWorldOffset(self, xOffset=0, yOffset=0): - self.worldXOffset=xOffset - self.worldYOffset=yOffset + if 0: # Code that became obsolete before it was used: + def setWorldOffset(self, xOffset=0, yOffset=0): + self.worldXOffset=xOffset + self.worldYOffset=yOffset - def getWorldPos(self, nodePath): - pos = nodePath.getPos(self.worldScale) - return (int(round(pos.getX())), int(round(pos.getY()))) + def getWorldPos(self, nodePath): + pos = nodePath.getPos(self.worldScale) + return (int(round(pos.getX())), int(round(pos.getY()))) - def sendWorldPos(self, x, y): - # The server will need to know the world - # offset of our current render node path - # and adjust the x, y accordingly. At one - # point I considered adding the world offset - # here, but that would just use extra bits. + def sendWorldPos(self, x, y): + # The server will need to know the world + # offset of our current render node path + # and adjust the x, y accordingly. At one + # point I considered adding the world offset + # here, but that would just use extra bits. - onScreenDebug.add("worldPos", "%-4d, %-4d"%(x, y)) - return #*# + onScreenDebug.add("worldPos", "%-4d, %-4d"%(x, y)) + return #*# - datagram = PyDatagram() - # Add message type - datagram.addUint16(CLIENT_SET_WORLD_POS) - # Add x - datagram.addInt16(x) - # Add y - datagram.addSint16(y) - # send the message - self.send(datagram) + datagram = PyDatagram() + # Add message type + datagram.addUint16(CLIENT_SET_WORLD_POS) + # Add x + datagram.addInt16(x) + # Add y + datagram.addSint16(y) + # send the message + self.send(datagram) - def checkWorldPos(self, nodePath): - worldPos = self.getWorldPos(nodePath) - if self.priorWorldPos != worldPos: - self.priorWorldPos = worldPos - self.sendWorldPos(worldPos[0], worldPos[1]) + def checkWorldPos(self, nodePath): + worldPos = self.getWorldPos(nodePath) + if self.priorWorldPos != worldPos: + self.priorWorldPos = worldPos + self.sendWorldPos(worldPos[0], worldPos[1]) def setServerDelta(self, delta): """