Exemple #1
0
 def _access_check(self, connection):
     yield from asyncio.sleep(.5)
     if str(connection.player.location) in self.storage["access"]:
         access = self.storage["access"][str(connection.player.location)]
         if connection.player.perm_check("planet_protect.bypass"):
             return
         elif connection.player.uuid in access["list"] and not \
                 access["whitelist"]:
             wp = PlayerWarp.build({"warp_action": {"warp_type": 3,
                                                    "alias_id": 2}})
             full = build_packet(packets.packets['player_warp'], wp)
             yield from connection.client_raw_write(full)
         elif connection.player.uuid not in access["list"] and \
                 access["whitelist"]:
             wp = PlayerWarp.build({"warp_action": {"warp_type": 3,
                                                    "alias_id": 2}})
             full = build_packet(packets.packets['player_warp'], wp)
             yield from connection.client_raw_write(full)
Exemple #2
0
 def warp_player_to_player(self, from_player, to_player):
     """
     Warps a player to another player.
     :param from_player: Player: The player being warped.
     :param to_player: Player: The player being warped to.
     :return: None
     """
     wp = PlayerWarp.build(dict(warp_action=dict(warp_type=2,
                                                 player_id=to_player.uuid)))
     full = build_packet(packets.packets['player_warp'], wp)
     yield from from_player.connection.client_raw_write(full)
Exemple #3
0
 def warp_player_to_player(self, from_player, to_player):
     """
     Warps a player to another player.
     :param from_player: Player: The player being warped.
     :param to_player: Player: The player being warped to.
     :return: None
     """
     wp = PlayerWarp.build(dict(warp_action=dict(warp_type=2,
                                                 player_id=to_player.uuid)))
     full = build_packet(packets.packets['player_warp'], wp)
     yield from from_player.connection.client_raw_write(full)
Exemple #4
0
 def warp_player_to_ship(self, from_player, to_player):
     """
     Warps a player to another player's ship.
     :param from_player: Player: The player being warped.
     :param to_player: Player: The player whose ship is being warped to.
     :return: None
     """
     wp = PlayerWarp.build(dict(warp_action=dict(warp_type=1, world_id=2,
                                                 ship_id=to_player.uuid,
                                                 flag=0)))
     full = build_packet(packets.packets['player_warp'], wp)
     yield from from_player.connection.client_raw_write(full)
Exemple #5
0
 def warp_player_to_ship(self, from_player, to_player):
     """
     Warps a player to another player's ship.
     :param from_player: Player: The player being warped.
     :param to_player: Player: The player whose ship is being warped to.
     :return: None
     """
     wp = PlayerWarp.build(dict(warp_action=dict(warp_type=1, world_id=2,
                                                 ship_id=to_player.uuid,
                                                 flag=0)))
     full = build_packet(packets.packets['player_warp'], wp)
     yield from from_player.connection.client_raw_write(full)
 def warp_player_to_player(self, from_player, to_player):
     """
     Warps a player to another player's ship.
     :param from_player: Player
     :param to_player: Player
     :return: None
     """
     coords = dict(x=0, y=0, z=0, planet=0, satellite=0)
     wp = PlayerWarp.build(dict(warp_type=3, coordinate=coords,
                                 player=to_player.name, x=0, y=0,
                                 z=0, planet=0, satellite=0))
     full = build_packet(id=packets.packets['player_warp'], data=wp)
     yield from from_player.connection.client_raw_write(full)