def onDropOnItem( container, item ): dropper = item.container # Turn off the lightsource if item.id in burning and item.id in IDS: item.id = IDS[item.id] wolfpack.queuecode(update_light, (item.serial, )) dropper.soundeffect(0x226) return False
def run(self): global interval while not self.stopped.isSet(): # Get the processing state self.mutex.acquire() processed = self.processed self.mutex.release() # Create the page. if processed and wolfpack.isrunning(): self.processed = False wolfpack.queuecode(autostatuswrapper, (None, None)) # Wait for the next timer to pass. self.stopped.wait(interval)
def run(self): global interval while not self.stopped.isSet(): # Get the processing state self.mutex.acquire() processed = self.processed self.mutex.release() # Create the page. if processed and wolfpack.isrunning(): self.processed = False wolfpack.queuecode( autostatuswrapper, ( None, None ) ) # Wait for the next timer to pass. self.stopped.wait(interval)
def checkPayment(serials): partition = serials[:50] # Process 50 vendors rest = serials[50:] # Queue up the rest of the serials if len(rest) > 0: wolfpack.queuecode(checkPayment, (rest,)) else: # Finished processing global paymentthread paymentthread.mutex.acquire() paymentthread.processed = True paymentthread.mutex.release() for serial in partition: vendor = wolfpack.findchar(serial) if vendor: npc.playervendor.checkPayment(vendor)
def run(self): global interval while not self.stopped.isSet(): # Get the processing state self.mutex.acquire() processed = self.processed self.mutex.release() # Only gather new data if the old has been processed if processed and wolfpack.isrunning(): self.mutex.acquire() serials = self.serials[:] # Copy self.processed = False self.mutex.release() wolfpack.queuecode(checkPayment, (serials,)) # Wait until canceled or the next interval self.stopped.wait(interval)
def run(self): while not self.stopped.isSet(): self.lock() process = self.unprocessed[:50] self.unprocessed = self.unprocessed[50:] if DEBUG_SPAWNS == 1: console.log(LOG_MESSAGE, "Found %u spawn items." % len(process)) wolfpack.queuecode(processSpawns, (process, )) self.processed += process if len(self.unprocessed) == 0: self.unprocessed = self.processed self.processed = [] self.unlock() self.stopped.wait(15.0) # Every 15 seconds.
def run(self): while not self.stopped.isSet(): self.lock() process = self.unprocessed[:SpawnGemsCheckAmount] self.unprocessed = self.unprocessed[SpawnGemsCheckAmount:] if DEBUG_SPAWNS: console.log(LOG_MESSAGE, "Found %u spawn items." % len(process)) wolfpack.queuecode(processSpawns, (process, )) self.processed += process if len(self.unprocessed) == 0: self.unprocessed = self.processed self.processed = [] self.unlock() self.stopped.wait(SpawnGemsCheckTime) # Every 15 seconds default.