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

Commit cc47a9b

Browse files
committed
Brining teleport and backups plugins up to speed with new plugin system initialization schema.
1 parent d618c0c commit cc47a9b

3 files changed

Lines changed: 10 additions & 8 deletions

File tree

config/config.json.default

Lines changed: 3 additions & 0 deletions
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
],

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: 4 additions & 4 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,7 +26,7 @@ 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):

0 commit comments

Comments
 (0)