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

Commit b9dbd55

Browse files
committed
Merge pull request #163 from kharidiron/master
Pray to the bug gods, amend ye, source code, and work for thy peoples!
2 parents d17dd61 + fd3118d commit b9dbd55

File tree

10 files changed

+110
-113
lines changed

10 files changed

+110
-113
lines changed

README.md

+1-3
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22

33
StarryPy is Twisted-based plugin-driven Starbound server wrapper. It is currently in beta.
44

5-
# The build is currently broken while we are applying a PEP8 pull request.
6-
75
## Features
86

97
With the built-in plugins (which are removable):
@@ -16,7 +14,7 @@ With the built-in plugins (which are removable):
1614
* Join/quit announcements.
1715
* And more.
1816

19-
## Version 1.7.1 is here!
17+
## Version 1.7.2 is here!
2018

2119
With this most recent release, we are compatible with the current release of Starbound (Glad Giraffe - Protocol 710). Any bugs found in the process, please open an issue ticket, so we can squash them as quickly as possible.
2220

plugins/claims/claims_plugin.py

+3-7
Original file line numberDiff line numberDiff line change
@@ -222,13 +222,9 @@ def claim_list(self, data):
222222
)
223223
self.protocol.send_chat_message(
224224
'Players registered to this planet: ^yellow;{}'.format(
225-
'^green;, ^yellow;'.join(
226-
(
227-
self.player_planets[planet]
228-
.replace('[', '')
229-
.replace(']', '')
230-
)
231-
)
225+
'^green;, ^yellow;'.join(self.player_planets[planet])
226+
.replace('[', '')
227+
.replace(']', '')
232228
)
233229
)
234230
elif planet in self.unclaimable_planets:

plugins/core/admin_commands_plugin/admin_command_plugin.py

+22-22
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class UserCommandPlugin(SimpleCommandPlugin):
1616
name = 'admin_commands_plugin'
1717
depends = ['command_plugin', 'player_manager_plugin']
1818
commands = [
19-
'who', 'whoami', 'whois', 'promote', 'kick', 'ban', 'ban_list',
19+
'who', 'whois', 'promote', 'kick', 'ban', 'ban_list',
2020
'unban', 'item', 'planet', 'mute', 'unmute', 'passthrough', 'shutdown',
2121
'timestamps'
2222
]
@@ -61,27 +61,27 @@ def planet(self, data):
6161
)
6262
)
6363

64-
@permissions(UserLevels.GUEST)
65-
def whoami(self, data):
66-
"""
67-
Displays client data about yourself.
68-
Syntax: /whoami
69-
"""
70-
info = self.protocol.player
71-
self.protocol.send_chat_message(
72-
'Name: {} ^green;: ^gray;{}\nUserlevel: ^yellow;{}^green; '
73-
'(^gray;{}^green;)\nUUID: ^yellow;{}^green;\nIP address: '
74-
'^cyan;{}^green;\nCurrent planet: ^yellow;{}^green;'.format(
75-
info.colored_name(self.config.colors),
76-
info.org_name,
77-
UserLevels(info.access_level),
78-
info.last_seen.strftime('%c'),
79-
info.uuid,
80-
info.ip,
81-
info.planet
82-
)
83-
)
84-
return False
64+
# @permissions(UserLevels.GUEST)
65+
# def whoami(self, data):
66+
# """
67+
# Displays client data about yourself.
68+
# Syntax: /whoami
69+
# """
70+
# info = self.protocol.player
71+
# self.protocol.send_chat_message(
72+
# 'Name: {} ^green;: ^gray;{}\nUserlevel: ^yellow;{}^green; '
73+
# '(^gray;{}^green;)\nUUID: ^yellow;{}^green;\nIP address: '
74+
# '^cyan;{}^green;\nCurrent planet: ^yellow;{}^green;'.format(
75+
# info.colored_name(self.config.colors),
76+
# info.org_name,
77+
# UserLevels(info.access_level),
78+
# info.last_seen.strftime('%c'),
79+
# info.uuid,
80+
# info.ip,
81+
# info.planet
82+
# )
83+
# )
84+
# return False
8585

8686
@permissions(UserLevels.REGISTERED)
8787
def whois(self, data):

plugins/core/player_manager_plugin/manager.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -505,7 +505,7 @@ def wrapped_function(self, *args, **kwargs):
505505

506506
if self.protocol.player.access_level >= level:
507507
if level >= UserLevels.MODERATOR:
508-
if not self.protocol.player.admin_logged_in:
508+
if self.protocol.player.admin_logged_in == 0:
509509
self.protocol.send_chat_message(
510510
'^red;You\'re not logged in, so I can\'t '
511511
'let you do that.^yellow;'

plugins/core/player_manager_plugin/plugin.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -256,9 +256,10 @@ def nick_set(self, data):
256256
Changes player nickname.
257257
Syntax: /nick_set (name) (new name)
258258
"""
259-
if data:
259+
if not data:
260260
self.protocol.send_chat_message(self.nick_set.__doc__)
261261
return
262+
262263
try:
263264
first_name, rest = extract_name(data)
264265

@@ -271,8 +272,10 @@ def nick_set(self, data):
271272
'please surround it by quotes!'
272273
)
273274
return
275+
274276
if not rest:
275277
self.protocol.send_chat_message(self.nick_set.__doc__)
278+
return
276279
else:
277280
try:
278281
second_name = extract_name(rest)[0]
@@ -286,10 +289,12 @@ def nick_set(self, data):
286289
'please surround it by quotes!'
287290
)
288291
return
292+
289293
player = self.player_manager.get_by_name(str(first_name))
290294
player2 = self.player_manager.get_by_name(str(second_name))
291295
org_player = self.player_manager.get_by_org_name(str(first_name))
292296
org_player2 = self.player_manager.get_by_org_name(str(second_name))
297+
293298
if player:
294299
first_uuid = player.uuid
295300
elif org_player:

plugins/partychat_plugin/partychat_plugin.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ class PartyChatPlugin(SimpleCommandPlugin):
1010
Party chat.
1111
"""
1212
name = 'partychat_plugin'
13-
commands = ['party', 'p', 'party_check']
13+
commands = ['party', 'p']
1414
depends = ['command_plugin', 'player_manager_plugin']
1515

1616
def activate(self):

plugins/planet_protect/planet_protect_plugin.py

+4-8
Original file line numberDiff line numberDiff line change
@@ -173,14 +173,10 @@ def protect_list(self, data):
173173
return
174174
if planet in self.player_planets:
175175
self.protocol.send_chat_message(
176-
'Players registered to this planet: ^yellow;{}'.format(
177-
'^green;, ^yellow;'.join(
178-
(
179-
self.player_planets[planet]
180-
.replace('[', '')
181-
.replace(']', '')
182-
)
183-
)
176+
'Players registered to this planet: ^green;{}'.format(
177+
'^yellow;, ^green;'.join(self.player_planets[planet])
178+
.replace('[', '')
179+
.replace(']', '')
184180
)
185181
)
186182
else:

plugins/plugin_manager_plugin/plugin_manager_plugin.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ def plugin_list(self, data):
2727
]
2828

2929
self.protocol.send_chat_message(
30-
'Currently loaded plugins: ^yellow;%s'.format(
31-
'^green;, ^yellow;'.join(
30+
'Currently loaded plugins: ^green; {}'.format(
31+
'^yellow;, ^green;'.join(
3232
[
3333
plugin
3434
for plugin in self.plugin_manager.plugins.iterkeys()
@@ -39,8 +39,8 @@ def plugin_list(self, data):
3939

4040
if len(inactive_plugins) > 0:
4141
self.protocol.send_chat_message(
42-
'Inactive plugins: ^red;%s'.format(
43-
'^green;, ^red;'.join(inactive_plugins)
42+
'Inactive plugins: ^red; {}'.format(
43+
'^yellow;, ^red;'.join(inactive_plugins)
4444
)
4545
)
4646

plugins/teleport_plugin/teleport_plugin.py

+67-65
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):

server.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
from plugin_manager import PluginManager, route, FatalPluginError
3535
from utility_functions import build_packet
3636

37-
VERSION = '1.7'
37+
VERSION = '1.7.2'
3838

3939

4040
VDEBUG_LVL = 9

0 commit comments

Comments
 (0)