当前位置: 首页>>代码示例>>Python>>正文


Python Client.__init__方法代码示例

本文整理汇总了Python中Client.Client.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python Client.__init__方法的具体用法?Python Client.__init__怎么用?Python Client.__init__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Client.Client的用法示例。


在下文中一共展示了Client.__init__方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __init__

# 需要导入模块: from Client import Client [as 别名]
# 或者: from Client.Client import __init__ [as 别名]
 def __init__(self, connectID,server):
     try:
         Client.__init__(self, connectID,server)
         self.__initData()
     except BaseException,e:
         print "Player Init Error"
         print e
开发者ID:kelvict,项目名称:Online-GoBang-Center,代码行数:9,代码来源:Player.py

示例2: __init__

# 需要导入模块: from Client import Client [as 别名]
# 或者: from Client.Client import __init__ [as 别名]
	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 = 'ChanServ'
		self.password = 'ChanServ'
		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))
开发者ID:Opensoftware,项目名称:uberserver,代码行数:19,代码来源:ChanServ.py

示例3: __init__

# 需要导入模块: from Client import Client [as 别名]
# 或者: from Client.Client import __init__ [as 别名]
    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)
开发者ID:kotas,项目名称:reflec,代码行数:20,代码来源:XMLClient.py

示例4: __init__

# 需要导入模块: from Client import Client [as 别名]
# 或者: from Client.Client import __init__ [as 别名]
    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 = "ChanServ"
        self.password = "ChanServ"
        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)
        )
开发者ID:yiminlong,项目名称:uberserver,代码行数:21,代码来源:ChanServ.py

示例5: __init__

# 需要导入模块: from Client import Client [as 别名]
# 或者: from Client.Client import __init__ [as 别名]
	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 = 'ChanServ'
		self.password = 'ChanServ'
		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))
开发者ID:spring,项目名称:uberserver,代码行数:22,代码来源:ChanServ.py

示例6: __init__

# 需要导入模块: from Client import Client [as 别名]
# 或者: from Client.Client import __init__ [as 别名]
 def __init__(self, host, port, board, name):
     Client.__init__(self, host, port, name)
     self.init_board(board)
     self.reserve = 0
     self.player_id = 0
开发者ID:bpa,项目名称:gamed,代码行数:7,代码来源:SpeedRisk.py

示例7: __init__

# 需要导入模块: from Client import Client [as 别名]
# 或者: from Client.Client import __init__ [as 别名]
 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
开发者ID:rswhiting,项目名称:gamed,代码行数:8,代码来源:SpeedRisk.py


注:本文中的Client.Client.__init__方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。