本文整理汇总了Python中cuwo.bytes.ByteWriter.write_uint32方法的典型用法代码示例。如果您正苦于以下问题:Python ByteWriter.write_uint32方法的具体用法?Python ByteWriter.write_uint32怎么用?Python ByteWriter.write_uint32使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类cuwo.bytes.ByteWriter
的用法示例。
在下文中一共展示了ByteWriter.write_uint32方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: write
# 需要导入模块: from cuwo.bytes import ByteWriter [as 别名]
# 或者: from cuwo.bytes.ByteWriter import write_uint32 [as 别名]
def write(self, writer):
data = ByteWriter()
write_list(data, self.block_actions)
write_list(data, self.player_hits)
write_list(data, self.particles)
write_list(data, self.sound_actions)
write_list(data, self.shoot_actions)
write_list(data, self.static_entities)
write_list(data, self.chunk_items)
data.write_uint32(len(self.items_8))
for item in self.items_8:
something, sub_items = item
data.write_uint64(something)
data.write_uint32(len(sub_items))
for item in sub_items:
data.write(item)
write_list(data, self.pickups)
write_list(data, self.kill_actions)
write_list(data, self.damage_actions)
write_list(data, self.passive_actions)
write_list(data, self.missions)
compressed_data = zlib.compress(data.get())
writer.write_uint32(len(compressed_data))
writer.write(compressed_data)
示例2: write_debug
# 需要导入模块: from cuwo.bytes import ByteWriter [as 别名]
# 或者: from cuwo.bytes.ByteWriter import write_uint32 [as 别名]
def write_debug(self):
if self.debug_fp is None:
return
writer = ByteWriter()
writer.write_uint32(len(self.entities))
for entity in self.entities.values():
writer.write_uint8(int(entity.is_tgen))
entity.write(writer)
self.debug_fp.write(writer.get())
示例3: write
# 需要导入模块: from cuwo.bytes import ByteWriter [as 别名]
# 或者: from cuwo.bytes.ByteWriter import write_uint32 [as 别名]
def write(self, writer):
data = ByteWriter()
write_list(data, self.items_1)
write_list(data, self.player_hits)
data.write_uint32(len(self.items_3))
for item in self.items_3:
data.write(item)
write_list(data, self.sound_actions)
write_list(data, self.shoot_actions)
data.write_uint32(len(self.items_6))
for item in self.items_6:
data.write(item)
write_list(data, self.chunk_items)
data.write_uint32(len(self.items_8))
for item in self.items_8:
something, sub_items = item
data.write_uint64(something)
data.write_uint32(len(sub_items))
for item in sub_items:
data.write(item)
write_list(data, self.pickups)
write_list(data, self.kill_actions)
write_list(data, self.damage_actions)
data.write_uint32(len(self.items_12))
for item in self.items_12:
data.write(item)
write_list(data, self.items_13)
compressed_data = zlib.compress(data.get())
writer.write_uint32(len(compressed_data))
writer.write(compressed_data)
示例4: write_packet
# 需要导入模块: from cuwo.bytes import ByteWriter [as 别名]
# 或者: from cuwo.bytes.ByteWriter import write_uint32 [as 别名]
def write_packet(packet):
writer = ByteWriter()
writer.write_uint32(packet.packet_id)
packet.write(writer)
return writer.get()