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

Commit 2e8bda8

Browse files
committed
Fixed chat colors, warping, and some connection issues. Oodles and oodles of trace logging added, but not enabled by default.
1 parent 8df7fe8 commit 2e8bda8

File tree

7 files changed

+13
-10
lines changed

7 files changed

+13
-10
lines changed

packet_stream.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ def check_packet(self):
7676
self.logger.trace("Parsed packet:")
7777
self.logger.trace(pprint.pformat(p_parsed))
7878
self.logger.trace("Packet data:")
79-
self.logger.trace(pprint.pformat(p_parsed.original_data.enocde("hex")))
79+
self.logger.trace(pprint.pformat(p_parsed.original_data.encode("hex")))
8080
self.logger.trace("Following packet data:")
8181
self.logger.trace(pprint.pformat(self._stream.encode("hex")))
8282
raise
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
from plugins.core.admin_commands_plugin.admin_command_plugin import UserCommandPlugin, MuteManager
1+
from admin_command_plugin import UserCommandPlugin, MuteManager

plugins/core/admin_commands_plugin/admin_command_plugin.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ class UserCommandPlugin(SimpleCommandPlugin):
2020
def activate(self):
2121
super(UserCommandPlugin, self).activate()
2222
self.player_manager = self.plugins['player_manager'].player_manager
23-
self.godmode = {}
2423

2524
@permissions(UserLevels.GUEST)
2625
def who(self, data):

plugins/core/colored_names/colored_names.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,10 @@ def activate(self):
1818
def on_chat_received(self, data):
1919
try:
2020
p = chat_received().parse(data.data)
21-
print p
21+
if p.name == "server":
22+
return
2223
sender = self.player_manager.get_logged_in_by_name(p.name)
23-
print sender
2424
p.name = sender.colored_name(self.config.colors)
25-
print p.name
2625
self.protocol.transport.write(build_packet(Packets.CHAT_RECEIVED, chat_received().build(p)))
2726
except AttributeError as e:
2827
self.logger.warning("Received AttributeError in colored_name. %s", str(e))

plugins/core/player_manager/plugin.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ def after_world_start(self, data):
8989
if coords is not None:
9090
parent_system = coords['parentSystem']
9191
location = parent_system['location']
92-
l = location['data']
92+
l = location
9393
self.protocol.player.on_ship = False
9494
planet = Planet(parent_system['sector'], l[0], l[1], l[2],
9595
coords['planetaryOrbitNumber'], coords['satelliteOrbitNumber'])

plugins/core/starbound_config_manager/starbound_config_manager.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ def activate(self):
3434

3535
@permissions(UserLevels.GUEST)
3636
def spawn(self, data):
37-
"""Warps you to spawn. Syntax: /spawn"""
38-
self.plugins['warpy_plugin'].move_player_ship(self.protocol, self._spawn)
37+
"""Moves your ship to spawn. Syntax: /move_ship_to_spawn"""
38+
print self._spawn
39+
self.plugins['warpy_plugin'].move_player_ship(self.protocol, [x for x in self._spawn])
3940
self.protocol.send_chat_message("Moving your ship to spawn.")
40-

plugins/warpy_plugin/warpy_plugin.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,11 @@ def warp_player_to_player(self, from_string, to_string):
8383
self.protocol.send_chat_message(self.warp.__doc__)
8484

8585
def move_player_ship(self, protocol, location):
86+
if len(location) < 5:
87+
self.logger.warning("Couldn't derive a warp location in move_player_ship. Coordinates given: %s",
88+
":".join(location))
89+
self.protocol.send_chat_message("Sorry, an error occurred.")
90+
return
8691
if len(location) == 5:
8792
satellite = 0
8893
else:

0 commit comments

Comments
 (0)