本文整理汇总了Python中bravo.location.Location.load_from_packet方法的典型用法代码示例。如果您正苦于以下问题:Python Location.load_from_packet方法的具体用法?Python Location.load_from_packet怎么用?Python Location.load_from_packet使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类bravo.location.Location
的用法示例。
在下文中一共展示了Location.load_from_packet方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: OnPlayerLocationUpdate
# 需要导入模块: from bravo.location import Location [as 别名]
# 或者: from bravo.location.Location import load_from_packet [as 别名]
def OnPlayerLocationUpdate(self, packet):
self.bot.update_location_from_packet(packet)
print packet
# everytime the player spawns, it must send back the location that it was given
# this is a check for the server. not entirely part of authentication, but
# the bot won't run without it
if self.confirmed_spawn == False:
location = Location()
location.load_from_packet(packet)
p = location.save_to_packet()
self.transport.write(p)
self.confirmed_spawn = True
self.bot.set_location(location)
self.bot.OnReady()