def __init__(self, name, geomap, blocksize=64, near=40, far=200, elevation=100): GeoMipTerrain.__init__(self, name) self.setBorderStitching(True) self.setHeightfield(Filename(geomap)) self.setBlockSize(blocksize) self.setNear(near) self.setFar(far) self.setMinLevel(0) #self.setBruteforce(True) try: self.setFocalPoint(base.camera) except: pass self.root = self.getRoot() self.root.setSz(elevation) self.generate() self.updateSemaphore = threading.Semaphore(0) self.updateThread = self.AsyncUpdate(self, self.updateSemaphore) self.updateThread.start() self.generate()
def __init__(self, socket, handler): self.socket = socket self.dispatcher = ToontownRPCDispatcher(handler) self.socketLock = threading.Lock() self.readLock = threading.RLock() self.writeLock = threading.RLock() self.readBuffer = '' self.writeQueue = [] self.writeSemaphore = threading.Semaphore(0) self.writeThread = threading.Thread(target=self.__writeThread) self.writeThread.start()