Ejemplo n.º 1
0
 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()
Ejemplo n.º 2
0
    def __init__(self, air):
        DistributedObjectAI.__init__(self, air)

        self.bits = Globals.AllDirs
        self.needsUpdateBits = 0
        self.updateCellTask = None
        self.sx = 0
        self.sy = 0
        self.geom = None

        # The player that owns the poster in this cell, if any.
        self.posterPlayerId = None
        self.posterDir = 0
        self.posterData = ('', 0)

        self.updateLock = threading.Lock()
        self.paintedLock = threading.Lock()
        self.playersLock = threading.Lock()

        # A set of zoneIds, representing the zones that may be seen
        # from this cell.
        self.visibleZoneIds = set()

        # The same set, representing the union of visibleZoneIds from
        # all of our eight neighbors as well.
        self.expandedZoneIds = set()

        # A nested dictionary of player -> { dir -> count }, showing
        # the number of pixels each player has on the wall.
        self.players = {}

        # A dictionary of dir -> player, the player who has "won" each
        # wall.
        self.wonPlayers = {}

        # Walls that have been painted, and their generated images.
        self.painted = {}
        self.userPaintData = {}

        # The "score" of the painted wall.
        self.artScore = {}
Ejemplo n.º 3
0
    def __init__(self, qt, q, em):
        self.queueLock = threading.Lock()
        self.qt = qt
        self.q = q
        self.em = em

        self.connectToAddModel()
        self.connectToSetX()
        self.connectToSetY()
        self.connectToSetZ()
        self.connectToSetH()
        self.connectToSetP()
        self.connectToSetR()
        self.connectToSetScale()
        self.connectToLoadScene()
        self.connectToSetRelX()
        self.connectToSetRelY()
        self.connectToSetRelZ()
Ejemplo n.º 4
0
 def __init__(self, string):
     self.string = string
     self.updateLock = threading.Lock()
     self.updateNumber = 0