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

Commit 9669eb8

Browse files
committed
Merge pull request #139 from kharidiron/master
Bug fixes, yay. PLEASE DOUBLE CHECK YOUR CONFIG.JSON!!! Many configuration elements have changed.
2 parents 8e8d42a + 86d8afe commit 9669eb8

7 files changed

Lines changed: 42 additions & 71 deletions

File tree

config/config.json.default

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{
2+
"backup_db": "backups/backups.db",
23
"bind_address": "",
34
"bind_port": 21025,
45
"chat_prefix": "#",
@@ -16,6 +17,7 @@
1617
"admin_messenger",
1718
"afk_plugin",
1819
"announcer_plugin",
20+
"backups_plugin",
1921
"bookmarks_plugin",
2022
"brutus_whisper",
2123
"chat_logger",
@@ -30,6 +32,7 @@
3032
"players_plugin",
3133
"plugin_manager_plugin",
3234
"poi_plugin",
35+
"teleport_plugin",
3336
"udp_forwarder",
3437
"uptime_plugin"
3538
],
@@ -48,7 +51,7 @@
4851
"max_claims": 5,
4952
"unclaimable_planets": []
5053
},
51-
"irc": {
54+
"irc_plugin": {
5255
"bot_nickname": "StarryPyBot",
5356
"channel": "##test",
5457
"color": "^#e39313;",

packets/packet_types.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -167,10 +167,9 @@ def _decode(self, obj, context):
167167
Byte("world_id"),
168168
Switch("world_type", lambda ctx: ctx["world_id"],
169169
{
170-
1: star_string("unique_world_name"),
171-
2: LazyBound("next", lambda: warp_world_celestial),
172-
3: LazyBound("next", lambda: warp_world_player),
173-
4: LazyBound("next", lambda: warp_world_mission)
170+
1: LazyBound("next", lambda: warp_world_celestial),
171+
2: LazyBound("next", lambda: warp_world_player),
172+
3: LazyBound("next", lambda: warp_world_mission)
174173
},
175174
default = Pass
176175
)
@@ -204,7 +203,10 @@ def _decode(self, obj, context):
204203

205204
warp_world_mission = Struct("mission_world",
206205
star_string("mission_world_name"),
207-
HexAdapter(Field("instance", 16))
206+
Byte("check"),
207+
If(lambda ctx: ctx["check"] == 1,
208+
HexAdapter(Field("instance", 16))
209+
)
208210
)
209211

210212

plugins.disable/warpy_plugin/__init__.py

Lines changed: 0 additions & 1 deletion
This file was deleted.

plugins/backups_plugin/backups_plugin.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# -*- coding: UTF-8 -*-
22
from base_plugin import SimpleCommandPlugin
33
from utility_functions import path, extract_name, verify_path
4-
from plugins.core.player_manager import permissions, UserLevels
4+
from plugins.core.player_manager_plugin import permissions, UserLevels
55
from .database import DatabaseManager
66

77
import datetime
@@ -16,9 +16,8 @@ class BackupsPlugin(SimpleCommandPlugin):
1616
StarryPy Planet Backup System
1717
"""
1818
name = "backups_plugin"
19-
depends = ["command_dispatcher", "player_manager"]
19+
depends = ['command_plugin', 'player_manager_plugin']
2020
commands = ["backup"]
21-
auto_activate = True
2221

2322
def __init__(self):
2423
self._prep_path('./backups')
@@ -34,7 +33,7 @@ def __init__(self):
3433

3534
def activate(self):
3635
super(BackupsPlugin, self).activate()
37-
self.player_manager = self.plugins['player_manager'].player_manager
36+
self.player_manager = self.plugins['player_manager_plugin'].player_manager
3837
self.db = DatabaseManager("./backups/backups.db")
3938

4039
@permissions(UserLevels.REGISTERED)

plugins/teleport_plugin/teleport_plugin.py

Lines changed: 28 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
# -*- coding: UTF-8 -*-
22
from base_plugin import SimpleCommandPlugin
33
from utility_functions import build_packet, move_ship_to_coords, extract_name
4-
from plugins.core.player_manager import permissions, UserLevels
4+
from plugins.core.player_manager_plugin import permissions, UserLevels
5+
56

67
from packets import Packets, WarpAliasType, WarpWorldType, WarpActionType, player_warp, player_warp_touniqueworld_write, player_warp_toplayerworld_write, player_warp_toplayer_write, player_warp_toalias_write, fly_ship, fly_ship_write
78

@@ -11,9 +12,8 @@ class TeleportPlugin(SimpleCommandPlugin):
1112
Rapid transport via teleportation.
1213
"""
1314
name = "teleport_plugin"
14-
depends = ['command_dispatcher', 'player_manager']
15+
depends = ['command_plugin', 'player_manager_plugin']
1516
commands = ["teleport", "tp"]
16-
auto_activate = True
1717

1818
def __init__(self):
1919
self.subcommands = {'help': self.teleport_help,
@@ -26,11 +26,11 @@ def __init__(self):
2626

2727
def activate(self):
2828
super(TeleportPlugin, self).activate()
29-
self.player_manager = self.plugins['player_manager'].player_manager
29+
self.player_manager = self.plugins['player_manager_plugin'].player_manager
3030

3131
@permissions(UserLevels.REGISTERED)
3232
def teleport(self, data):
33-
"""Player teleportation system. By default, this system will telepor a player to another player. Use subcommands to modify this behavior. Available subcommands are:\n^cyan;player, ship, home, outpost, ^gray;bookmark, poi"""
33+
"""Player teleportation system. By default, this system will telepor a player to another player. Use subcommands to modify this behavior. Available subcommands are:\n^cyan;player, ship, home, ^gray;outpost, bookmark, poi"""
3434
self.logger.vdebug('Teleport command called')
3535
if not data:
3636
self.protocol.send_chat_message(self.teleport.__doc__)
@@ -44,12 +44,12 @@ def teleport(self, data):
4444

4545
@permissions(UserLevels.REGISTERED)
4646
def tp(self, data):
47-
"""Player teleportation system. By default, this system will teleport a player to another player. Use subcommands to modify this behavior. Available subcommands are:\n^cyan;player, ship, bookmark, poi"""
47+
"""Player teleportation system. By default, this system will teleport a player to another player. Use subcommands to modify this behavior. Available subcommands are:\n^cyan;player, ship, home"""
4848
self.teleport(data)
4949

5050
@permissions(UserLevels.REGISTERED)
5151
def teleport_help(self, data):
52-
"""Player teleportation system. By default, this system will teleport a player to another player. Use subcommands to modify this behavior. Available subcommands are:\n^cyan;player, ship, bookmark, poi"""
52+
"""Player teleportation system. By default, this system will teleport a player to another player. Use subcommands to modify this behavior. Available subcommands are:\n^cyan;player, ship, home"""
5353
self.protocol.send_chat_message(self.teleport.__doc__)
5454
return
5555

@@ -178,25 +178,27 @@ def teleport_to_own_ship(self, data):
178178
def teleport_to_outpost(self, data):
179179
"""Teleports a player to the outpost. If no source player is provided, we assume you mean yourself.\nSyntax: /teleport outpost [source player]"""
180180
usage = 'Syntax: /teleport outpost [source player]'
181-
if not data:
182-
source = self.protocol.player.name
183-
else:
184-
source, rest = extract_name(data)
185-
if not self._validate_player(source):
186-
self.protocol.send_chat_message(usage)
187-
return
188-
source = source.lower()
189-
190-
source_player = self.player_manager.get_logged_in_by_name(source)
191-
if source_player is None:
192-
self.logger.debug("Error: Player %s is not logged in.", source)
193-
self.protocol.send_chat_message("Error: Player %s is not logged in." % (source, ))
194-
return
195-
196-
source_protocol = self.factory.protocols[source_player.protocol]
197-
teleport_packet = build_packet(Packets.PLAYER_WARP, player_warp_touniqueworld_write(destination='outpost'))
198-
199-
source_protocol.client_protocol.transport.write(teleport_packet)
181+
#if not data:
182+
# source = self.protocol.player.name
183+
#else:
184+
# source, rest = extract_name(data)
185+
# if not self._validate_player(source):
186+
# self.protocol.send_chat_message(usage)
187+
# return
188+
#source = source.lower()
189+
190+
#source_player = self.player_manager.get_logged_in_by_name(source)
191+
#if source_player is None:
192+
# self.logger.debug("Error: Player %s is not logged in.", source)
193+
# self.protocol.send_chat_message("Error: Player %s is not logged in." % (source, ))
194+
# return
195+
196+
#source_protocol = self.factory.protocols[source_player.protocol]
197+
#teleport_packet = build_packet(Packets.PLAYER_WARP, player_warp_touniqueworld_write(destination='outpost'))
198+
199+
#source_protocol.client_protocol.transport.write(teleport_packet)
200+
self.protocol.send_chat_message('This is not yet implemented.')
201+
return
200202

201203
@permissions(UserLevels.REGISTERED)
202204
def teleport_to_bookmark(self, data):

plugins/udp_forwarder/UDPForwarder.py

Lines changed: 0 additions & 33 deletions
This file was deleted.

plugins/udp_forwarder/__init__.py

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)