コード例 #1
0
 def after_world_start(self, data):
     world_start = packets.world_start().parse(data.data)
     if 'fuel.max' in world_start['world_properties']:
         self.logger.info("Player %s is now on a ship.", self.protocol.player.name)
         self.protocol.player.on_ship = True
     else:
         coords = world_start.planet['celestialParameters']['coordinate']
         parent_system = coords
         location = parent_system['location']
         l = location
         self.protocol.player.on_ship = False
         planet = Planet(parent_system['sector'], l[0], l[1], l[2],
                         coords['planet'], coords['satellite'])
         self.protocol.player.planet = str(planet)
コード例 #2
0
ファイル: plugin.py プロジェクト: Actionchip/StarryPy
 def after_world_start(self, data):
     world_start = packets.world_start().parse(data.data)
     coords = world_start.planet['config']['coordinate']
     if coords is not None:
         parent_system = coords['parentSystem']
         location = parent_system['location']
         l = location
         self.protocol.player.on_ship = False
         planet = Planet(parent_system['sector'], l[0], l[1], l[2],
                         coords['planetaryOrbitNumber'], coords['satelliteOrbitNumber'])
         self.protocol.player.planet = str(planet)
         self.logger.debug("Player %s is now at planet: %s", self.protocol.player.name, str(planet))
     else:
         self.logger.info("Player %s is now on a ship.", self.protocol.player.name)
         self.protocol.player.on_ship = True
コード例 #3
0
ファイル: plugin.py プロジェクト: 8r2y5/StarryPy
 def after_world_start(self, data):
     world_start = packets.world_start().parse(data.data)
     if "ship.maxFuel" in world_start["world_properties"]:
         self.logger.info("Player %s is now on a ship.", self.protocol.player.name)
         self.protocol.player.on_ship = True
         self.protocol.player.planet = "On ship"
     elif world_start.planet["celestialParameters"] is None:
         self.protocol.player.on_ship = False
         self.protocol.player.planet = "On Outpost"
     else:
         coords = world_start.planet["celestialParameters"]["coordinate"]
         parent_system = coords
         l = parent_system["location"]
         self.protocol.player.on_ship = False
         planet = Planet(l[0], l[1], l[2], coords["planet"], coords["satellite"])
         self.protocol.player.planet = str(planet)
コード例 #4
0
ファイル: plugin.py プロジェクト: Asmodeyby/StarryPy
 def after_world_start(self, data):
     world_start = packets.world_start().parse(data.data)
     if 'ship.maxFuel' in world_start['world_properties']:
         self.logger.info("Player %s is now on a ship.", self.protocol.player.name)
         self.protocol.player.on_ship = True
         self.protocol.player.planet = "On ship"
     elif world_start.planet['celestialParameters'] is None:
         self.protocol.player.on_ship = False
         self.protocol.player.planet = "On Outpost"
     else:
         coords = world_start.planet['celestialParameters']['coordinate']
         parent_system = coords
         l = parent_system['location']
         self.protocol.player.on_ship = False
         planet = Planet(l[0], l[1], l[2],
                         coords['planet'], coords['satellite'])
         self.protocol.player.planet = str(planet)
コード例 #5
0
 def after_world_start(self, data):
     world_start = packets.world_start().parse(data.data)
     if 'ship.maxFuel' in world_start['world_properties']:
         self.logger.info('Player %s is now on a ship.',
                          self.protocol.player.name)
         self.protocol.player.on_ship = True
         self.protocol.player.planet = 'On ship'
     elif world_start.planet['celestialParameters'] is None:
         self.protocol.player.on_ship = False
         self.protocol.player.planet = 'On Outpost'
     else:
         coords = world_start.planet['celestialParameters']['coordinate']
         parent_system = coords
         l = parent_system['location']
         self.protocol.player.on_ship = False
         planet = Planet(l[0], l[1], l[2], coords['planet'],
                         coords['satellite'])
         self.protocol.player.planet = str(planet)
コード例 #6
0
ファイル: plugin.py プロジェクト: TinCow/StarryPy
 def after_world_start(self, data):
     world_start = packets.world_start().parse(data.data)
     coords = world_start.planet['config']['coordinate']
     if coords is not None:
         parent_system = coords['parentSystem']
         location = parent_system['location']
         l = location
         self.protocol.player.on_ship = False
         planet = Planet(parent_system['sector'], l[0], l[1], l[2],
                         coords['planetaryOrbitNumber'],
                         coords['satelliteOrbitNumber'])
         self.protocol.player.planet = str(planet)
         self.logger.debug("Player %s is now at planet: %s",
                           self.protocol.player.name, str(planet))
     else:
         self.logger.info("Player %s is now on a ship.",
                          self.protocol.player.name)
         self.protocol.player.on_ship = True