Skip to content
This repository was archived by the owner on Apr 27, 2019. It is now read-only.

Commit d7cae18

Browse files
committed
tp ship is broken. commenting it out for now
1 parent 69ff92d commit d7cae18

1 file changed

Lines changed: 67 additions & 65 deletions

File tree

plugins/teleport_plugin/teleport_plugin.py

Lines changed: 67 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ def teleport(self, data):
4242
Player teleportation system. By default, this system will teleport a
4343
player to another player. Use subcommands to modify this behavior.
4444
Available subcommands are:
45-
^cyan;player, ship, home, ^gray;outpost, bookmark, poi
45+
^cyan;player, home, ^gray;ship, outpost, bookmark, poi
4646
"""
4747
self.logger.vdebug('Teleport command called')
4848
if not data:
@@ -61,7 +61,7 @@ def tp(self, data):
6161
Player teleportation system. By default, this system will teleport a
6262
player to another player. Use subcommands to modify this behavior.
6363
Available subcommands are:
64-
^cyan;player, ship, home
64+
^cyan;player, home
6565
"""
6666
self.teleport(data)
6767

@@ -71,7 +71,7 @@ def teleport_help(self, data):
7171
Player teleportation system. By default, this system will teleport a
7272
player to another player. Use subcommands to modify this behavior.
7373
Available subcommands are:
74-
^cyan;player, ship, home
74+
^cyan;player, home
7575
"""
7676
self.protocol.send_chat_message(self.teleport.__doc__)
7777

@@ -159,69 +159,71 @@ def teleport_to_ship(self, data):
159159
Syntax: /teleport ship (destination player) [source player]
160160
"""
161161
usage = 'Syntax: /teleport ship (destination player) [source player]'
162-
if not data:
163-
self.protocol.send_chat_message(self.teleport_to_ship.__doc__)
164-
return
165-
166-
destination, rest = extract_name(data)
167-
if not self._validate_player(destination):
168-
self.protocol.send_chat_message(usage)
169-
return
170-
destination = destination.lower()
171-
172-
if not rest:
173-
source = self.protocol.player.name
174-
source = source.lower()
175-
else:
176-
source, rest = extract_name(rest)
177-
if not self._validate_player(source):
178-
self.protocol.send_chat_message(usage)
179-
return
180-
source = source.lower()
181-
182-
if source == destination:
183-
self.teleport_to_own_ship(None)
184-
return
185-
186-
destination_player = self.player_manager.get_logged_in_by_name(
187-
destination
188-
)
189-
if destination_player is None:
190-
self.logger.debug(
191-
'Error: Player %s is not logged in.', destination
192-
)
193-
self.protocol.send_chat_message(
194-
'Error: Player {} is not logged in.'.format(destination)
195-
)
196-
return
197-
198-
source_player = self.player_manager.get_logged_in_by_name(source)
199-
if source_player is None:
200-
self.logger.debug('Error: Player %s is not logged in.', source)
201-
self.protocol.send_chat_message(
202-
'Error: Player {} is not logged in.'.format(source)
203-
)
204-
return
205-
206-
source_protocol = self.factory.protocols[source_player.protocol]
207-
teleport_packet = build_packet(
208-
Packets.PLAYER_WARP,
209-
player_warp_toplayerworld_write(
210-
destination=destination_player.uuid
211-
)
212-
)
213-
214-
source_protocol.client_protocol.transport.write(teleport_packet)
162+
self.protocol.send_chat_message('This is not yet implemented.')
215163

216-
self.logger.debug(
217-
"Teleport command called by %s. Teleporting %s to %s's ship",
218-
self.protocol.player.name, source, destination
219-
)
220-
self.protocol.send_chat_message(
221-
"Teleported ^green;{}^yellow; to ^green;{}^yellow;'s ship.".format(
222-
source, destination
223-
)
224-
)
164+
# if not data:
165+
# self.protocol.send_chat_message(self.teleport_to_ship.__doc__)
166+
# return
167+
168+
# destination, rest = extract_name(data)
169+
# if not self._validate_player(destination):
170+
# self.protocol.send_chat_message(usage)
171+
# return
172+
# destination = destination.lower()
173+
174+
# if not rest:
175+
# source = self.protocol.player.name
176+
# source = source.lower()
177+
# else:
178+
# source, rest = extract_name(rest)
179+
# if not self._validate_player(source):
180+
# self.protocol.send_chat_message(usage)
181+
# return
182+
# source = source.lower()
183+
184+
# if source == destination:
185+
# self.teleport_to_own_ship(None)
186+
# return
187+
188+
# destination_player = self.player_manager.get_logged_in_by_name(
189+
# destination
190+
# )
191+
# if destination_player is None:
192+
# self.logger.debug(
193+
# 'Error: Player %s is not logged in.', destination
194+
# )
195+
# self.protocol.send_chat_message(
196+
# 'Error: Player {} is not logged in.'.format(destination)
197+
# )
198+
# return
199+
200+
# source_player = self.player_manager.get_logged_in_by_name(source)
201+
# if source_player is None:
202+
# self.logger.debug('Error: Player %s is not logged in.', source)
203+
# self.protocol.send_chat_message(
204+
# 'Error: Player {} is not logged in.'.format(source)
205+
# )
206+
# return
207+
208+
# source_protocol = self.factory.protocols[source_player.protocol]
209+
# teleport_packet = build_packet(
210+
# Packets.PLAYER_WARP,
211+
# player_warp_toplayerworld_write(
212+
# destination=destination_player.uuid
213+
# )
214+
# )
215+
216+
# source_protocol.client_protocol.transport.write(teleport_packet)
217+
218+
# self.logger.debug(
219+
# "Teleport command called by %s. Teleporting %s to %s's ship",
220+
# self.protocol.player.name, source, destination
221+
# )
222+
# self.protocol.send_chat_message(
223+
# "Teleported ^green;{}^yellow; to ^green;{}^yellow;'s ship.".format(
224+
# source, destination
225+
# )
226+
# )
225227

226228
@permissions(UserLevels.REGISTERED)
227229
def teleport_to_own_ship(self, data):

0 commit comments

Comments
 (0)