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)
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
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)
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)
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)