Esempio n. 1
0
 def __init__(self, connectID,server):
     try:
         Client.__init__(self, connectID,server)
         self.__initData()
     except BaseException,e:
         print "Player Init Error"
         print e
Esempio n. 2
0
 def __init__(self, connectID, server):
     try:
         Client.__init__(self, connectID, server)
         self.__initData()
     except BaseException, e:
         print "Player Init Error"
         print e
Esempio n. 3
0
 def __init__(self, event: threading.Event):
     Wrapper.__init__(self)
     Client.__init__(self, wrapper=self)
     self.started = False
     self.nextValidOrderId = None
     self.permId2ord = {}
     self.reqId2nErr = collections.defaultdict(int)
     self.globalCancelOnly = False
     self.simplePlaceOid = None
     self.event = event
     self.df = pd.DataFrame(columns=[
         "reqId", "bar.date", "bar.open", "bar.high", "bar.low",
         "bar.close", "bar.volume", "bar.barCount", "bar.average"
     ])
     self.idx = -1
Esempio n. 4
0
	def __init__(self, root, address, session_id):
		'initial setup for the connected client'
		
		Client.__init__(self, root, None, address, session_id)
		
		self.static = True # can't be removed... don't want to anyway :)
		self.logged_in = True
		self.access = 'admin'
		self.accesslevels = ['admin', 'mod', 'user', 'everyone']
		
		self.bot = 1
		self.username = '******'
		self.password = '******'
		self.cpu = '9001'
		self.lobby_id = 'ChanServ'
		self._root.usernames[self.username] = self
		self._root.console_write('Successfully logged in static user <%s> on session %s.'%(self.username, self.session_id))
Esempio n. 5
0
	def __init__(self, root, address, session_id):
		'initial setup for the connected client'
		
		Client.__init__(self, root, None, address, session_id)
		
		self.static = True # can't be removed... don't want to anyway :)
		self.logged_in = True
		self.access = 'admin'
		self.accesslevels = ['admin', 'mod', 'user', 'everyone']
		
		self.bot = 1
		self.username = '******'
		self.password = '******'
		self.cpu = '9001'
		self.lobby_id = 'ChanServ'
		self._root.usernames[self.username] = self
		self._root.console_write('Successfully logged in static user <%s> on session %s.'%(self.username, self.session_id))
Esempio n. 6
0
    def __init__(self, node):
        address = node.get("address")
        server  = node.get("server")
        max     = node.findtext("max")
        media   = node.find("media")

        try:
            max = int(max)
        except ValueError:
            max = None

        params = {}
        if address: params["address"] = address
        if server:  params["server"]  = server
        if max:     params["max"]     = int(max)
        if media:   params["media"]   = media.items()

        Client.__init__(self, **params)
Esempio n. 7
0
    def __init__(self, root, address, session_id):
        "initial setup for the connected client"

        Client.__init__(self, root, None, address, session_id)

        self.static = True  # can't be removed... don't want to anyway :)
        self.logged_in = True
        self.access = "admin"
        self.accesslevels = ["admin", "mod", "user", "everyone"]

        self.bot = 1
        self.username = "******"
        self.password = "******"
        self.cpu = "9001"
        self.lobby_id = "ChanServ"
        self._root.usernames[self.username] = self
        self._root.console_write(
            "Successfully logged in static user <%s> on session %s." % (self.username, self.session_id)
        )
Esempio n. 8
0
    def __init__(self, root, address, session_id):
        'initial setup for the connected client'
        Client.__init__(self, root, address, session_id)

        self.accesslevels = ['admin', 'mod', 'user', 'everyone']
        self.logged_in = True
        self.connected = True
        self.bot = 1
        self.db_id = None
        self.static = True

        self.username = '******'
        self.password = '******'
        self.lobby_id = 'ChanServ'
        self._root.usernames[self.username] = self
        self._root.clients[session_id] = self
        self._root = root

        logging.info('[%s] <%s> logged in (access=ChanServ)' %
                     (session_id, self.username))
Esempio n. 9
0
	def __init__(self, root, address, session_id):
		'initial setup for the connected client'
		Client.__init__(self, root, address, session_id)

		self.accesslevels = ['admin', 'mod', 'user', 'everyone']
		self.logged_in = True
		self.connected = True
		self.bot = True
		self.user_id = None
		self.static = True

		self.username = '******'
		self.password = '******'
		self.lobby_id = 'ChanServ'
		self._root.usernames[self.username] = self
		self._root.clients[session_id] = self
		self._root = root

		self._root.protocol._calc_status(self, self.status)
		logging.info('[%s] <%s> logged in (access=ChanServ)'%(session_id, self.username))
Esempio n. 10
0
    def __init__(self, root, address, session_id):
        'initial setup for the connected client'

        Client.__init__(self, root, address, session_id)

        self.static = True  # can't be removed... don't want to anyway :)
        self.logged_in = True
        self.access = 'admin'
        self.accesslevels = ['admin', 'mod', 'user', 'everyone']

        self.bot = 1
        self.username = '******'
        self.password = '******'
        self.cpu = '9001'
        self.lobby_id = 'ChanServ'
        self._root.usernames[self.username] = self
        self._root.clients[session_id] = self
        logging.info('[%s] <%s> logged in (access=ChanServ)' %
                     (self.session_id, self.username))
        self.reload()
Esempio n. 11
0
    def __init__(self, master, server_rtsp_port, server_plp_port, rtp_port,
                 plp_port):
        Client.__init__(self, server_rtsp_port, server_plp_port, rtp_port,
                        plp_port)
        self.play_end = False  # if a video is completely played, set this to True
        self.play_speed = 0  # play speed option
        self.cur_frame = 0  # current frame played
        self.record_file = 'record/record.txt'  # where to store the record file
        self.play_record = {}  # play record, used for transmission resume

        # initiates GUI
        self.master = master
        self.master.protocol("WM_DELETE_WINDOW", self.handler)
        self.createWidgets()

        # reads record
        if os.path.exists(self.record_file):
            with open(self.record_file, "r") as f:
                lines = f.read().split('\n')
            i = 0
            for line in lines[:-1]:
                self.historylist.insert(i, line.strip())
                i += 1
            last_movie = self.historylist.get(0)
            self.play_record[last_movie] = lines[-1].strip()
            print(last_movie)
            frame_memory = self.play_record[last_movie]
            if frame_memory != '':
                if tkMessageBox.askyesno("提示", "是否加载上次观看的位置?"):
                    self.setupMovie(last_movie)
                    frame_memory = int(frame_memory)
                    self.cur_frame = frame_memory
                    self.memory = frame_memory
            else:
                self.memory = ''
        else:
            self.memory = ''
    def __init__(self, ip_puerto):

        Client.__init__(self,
                        ip_puerto)  #con esto se abre el canal de comunicacion
        self.chunck = self.getChunck()
        print("tamaño de envio establecido,", self.chunck)
Esempio n. 13
0
 def __init__(self, i, websocket, x, y, a):
     Client.__init__(self,i, websocket)
     self.x = x
     self.y = y
     self.a = a
Esempio n. 14
0
 def __init__(self, host, port, board, name):
     Client.__init__(self, host, port, name)
     self.init_board(board)
     self.reserve = 0
     self.player_id = 0
Esempio n. 15
0
 def __init__(self, host, port, name):
     Client.__init__(self, host, port, name)
     self.init_countries()
     self.players = map(lambda x: Player(x), range(6))
     self.reserve = 0
     self.player_id = 0
    def __init__(self, ip_puerto):

        Client.__init__(self, ip_puerto)
        self.chunck = 1024 * 1024 * 10