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


Python Header.Processed类代码示例

本文整理汇总了Python中Header.Processed的典型用法代码示例。如果您正苦于以下问题:Python Processed类的具体用法?Python Processed怎么用?Python Processed使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: __init__

	def __init__(self, sequence, id, modify_time, categories, name, desc, used, owner, components, feedback, properties):
		Processed.__init__(self, sequence)

		# Length is:
		#
		self.length = 4 + 8 + \
				4 + len(categories)*4 + \
				4 + len(name) + \
				4 + len(desc) + \
				4 + 4 + \
				4 + len(components)*8 + \
				4 + len(feedback) + \
				4

		for x, s in properties:
			self.length += 4 + 4 + len(s)

		self.id = id
		self.modify_time = modify_time
		self.categories = categories
		self.name = name
		self.desc = desc
		self.used = used
		self.owner = owner
		self.components = components
		self.feedback = feedback
		self.properties = properties
开发者ID:StupidIncarnate,项目名称:libtpproto-py,代码行数:27,代码来源:Design.py

示例2: __init__

	def __init__(self, sequence, key, start, amount):
		Processed.__init__(self, sequence)

		self.length = 4 + 4 + 4
	
		self.key = key
		self.start = start
		self.amount = amount
开发者ID:StupidIncarnate,项目名称:libtpproto-py,代码行数:8,代码来源:Base.py

示例3: __init__

	def __init__(self, sequence, time):
		Processed.__init__(self, sequence)

		# Length is:
		#  * 4 bytes UInt32
		#
		self.length = 4
		self.time = time
开发者ID:StupidIncarnate,项目名称:libtpproto-py,代码行数:8,代码来源:TimeRemaining.py

示例4: __init__

	def __init__(self, sequence, ids):
		Processed.__init__(self, sequence)

		# Length is:
		#  * 4 bytes (uint32 - id)
		#
		self.length = 4 + 4 * len(ids)

		self.ids = ids
开发者ID:jmingtan,项目名称:tpclient-ogre,代码行数:9,代码来源:Base.py

示例5: __init__

	def __init__(self, sequence):
		Processed.__init__(self, sequence)

		# Length is:
		#  * 4 bytes (uint32 - error code
		#  * 4 bytes (uint32 - string length)
		#  * the string
		#  * null terminator
		#
		self.length = 0
开发者ID:StupidIncarnate,项目名称:libtpproto-py,代码行数:10,代码来源:Games_Get.py

示例6: __init__

	def __init__(self, sequence, s=""):
		Processed.__init__(self, sequence)

		# Length is:
		#  * 4 bytes (uint32 - string length)
		#  * the string
		#  * null terminator
		#
		self.length = 4 + len(s)
		self.s = s
开发者ID:StupidIncarnate,项目名称:libtpproto-py,代码行数:10,代码来源:Connect.py

示例7: __init__

	def __init__(self, sequence, posx, posy, posz, size):
		if sequence != 0:
			raise ValueError("Object_Get is a normal packet so needs a zero sequence number (%i)" % sequence)
		Processed.__init__(self, sequence)

		# Length is:
		#  * 24 bytes (position)
		#  * 8 bytes (radius)
		self.length = 32

		self.pos = [posx, posy, posz]
		self.size = size
开发者ID:StupidIncarnate,项目名称:libtpproto-py,代码行数:12,代码来源:Object_GetID_ByPos.py

示例8: __init__

	def __init__(self, sequence, id, name, race_name):
		Processed.__init__(self, sequence)

		# Length is:
		#
		self.length = 4 + \
			4 + len(name) + \
			4 + len(race_name)
			
		self.id = id
		self.name = name
		self.race_name = race_name
开发者ID:StupidIncarnate,项目名称:libtpproto-py,代码行数:12,代码来源:Player.py

示例9: __init__

	def __init__(self, sequence, s=""):
		if 1 > sequence:
			raise ValueError("OK is a reply packet so needs a valid sequence number (%i)" % sequence)
		Processed.__init__(self, sequence)

		# Length is:
		#  * 4 bytes (32 bit integer)
		#  * the string
		#  * null terminator
		#
		self.length = 4 + len(s) 
		self.s = s
开发者ID:StupidIncarnate,项目名称:libtpproto-py,代码行数:12,代码来源:OK.py

示例10: __init__

	def __init__(self, sequence, id, modify_time, name, description):
		Processed.__init__(self, sequence)

		# Length is:
		#
		self.length = 4 + 8 + \
				4 + len(name) + \
				4 + len(description)

		self.id = id
		self.modify_time = modify_time
		self.name = name
		self.description = description
开发者ID:StupidIncarnate,项目名称:libtpproto-py,代码行数:13,代码来源:Category.py

示例11: __init__

	def __init__(self, sequence, number):
		if 1 > sequence:
			raise ValueError("Sequence is a reply packet so needs a valid sequence number (%i)" % sequence)
		Processed.__init__(self, sequence)

		# Length is:
		#  * 4 bytes (uint32 - error code
		#  * 4 bytes (uint32 - string length)
		#  * the string
		#  * null terminator
		#
		self.length = 4

		self.number = number
开发者ID:StupidIncarnate,项目名称:libtpproto-py,代码行数:14,代码来源:Sequence.py

示例12: __init__

    def __init__(self, sequence, time, reason, turn_num, turn_name):
        Processed.__init__(self, sequence)

        # Length is:
        #  * 4 bytes UInt32
        #  * 4 bytes UInt32
        #  * 4 bytes UInt32
        #  * length of string
        #
        self.length = 4 + 4 + 4 + 4 + len(turn_name)
        self.time = time
        self.reason = reason
        self.turn_num = turn_num
        self.turn_name = turn_name
开发者ID:jmingtan,项目名称:tpclient-ogre,代码行数:14,代码来源:TimeRemaining.py

示例13: __init__

	def __init__(self, sequence, name, key, \
			tp, server, sertype, rule, rulever, \
			locations, optional, media):
		Processed.__init__(self, sequence)

		# Length is:
		#
		self.length = \
				4 + len(name) + \
				4 + len(key) + \
				4 + len(server) + \
				4 + len(sertype) + \
				4 + len(rule) + \
				4 + len(rulever) 

		self.length += 4
		for version in tp:
			self.length += 4 + len(version)

		self.length += 4
		for location in locations:
			self.length += \
				4 + len(location[0]) + \
				4 + len(location[1]) + \
				4 + len(location[2]) + \
				4

		self.length += 4
		if isinstance(optional, list):
			for option in optional:
				self.length += 4 + 4 + len(option[1]) + 4
		else:
			for option in optional.values():
				if isinstance(option, (str, unicode)):
					self.length += 4 + 4 + len(option) + 4
				else:
					self.length += 4 + 4 + 0 + 4
		self.length += 4 + len(media)

		self.name    = name
		self.key     = key
		self.tp      = tp
		self.server  = server
		self.sertype = sertype
		self.rule    = rule
		self.rulever = rulever
		self.locations = locations
		self._optional = optional
		self.media   = media
开发者ID:jmingtan,项目名称:tpclient-ogre,代码行数:49,代码来源:Game.py

示例14: __init__

	def __init__(self, sequence, errno, s=""):
		if errno != 0 and sequence < 1:
			raise ValueError("Fail is a reply packet so needs a valid sequence number (%i)" % sequence)
		Processed.__init__(self, sequence)

		# Length is:
		#  * 4 bytes (uint32 - error code
		#  * 4 bytes (uint32 - string length)
		#  * the string
		#  * null terminator
		#
		self.length = 4 + 4 + len(s)

		self.errno = errno
		self.s = s
开发者ID:StupidIncarnate,项目名称:libtpproto-py,代码行数:15,代码来源:Fail.py

示例15: __init__

    def __init__(self, sequence, username, password):
        Processed.__init__(self, sequence)

        # Length is:
        #  * 4 bytes (uint32 - string length)
        #  * the string
        #  * null terminator
        #  * 4 bytes (uint32 - string length)
        #  * the string
        #  * null terminator
        #
        self.length = 4 + len(username) + 4 + len(password)

        self.username = username
        self.password = password
开发者ID:jmingtan,项目名称:tpclient-ogre,代码行数:15,代码来源:Login.py


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