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

Commit ea7ff43

Browse files
committed
Added /list_players and /delete_player to the player manager. Updated all plugins to correctly use the new plugin manager, and updated the plugin_settings column to use a mutable json dictionary and storage to reflect that fact. It is now a property.
1 parent 92c352d commit ea7ff43

29 files changed

Lines changed: 103 additions & 28 deletions

File tree

config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ def __init__(self):
5555
def save(self):
5656
try:
5757
with io.open("config/config.json", "w", encoding="utf-8") as config:
58-
self.logger.warning("Writing configuration file.")
58+
self.logger.debug("Writing configuration file.")
5959
config.write(json.dumps(self.config, indent=4, separators=(',', ': '), sort_keys=True, ensure_ascii = False))
6060
except Exception as e:
6161
self.logger.critical("Tried to save the configuration file, failed.\n%s", str(e))

config/config.json.default

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@
121121
"port_check": true,
122122
"reap_time": 10,
123123
"server_connect_timeout": 5,
124+
"starbound_path": "/opt/starbound/",
124125
"upstream_hostname": "localhost",
125126
"upstream_port": 21024
126127
}

plugin_manager.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,6 @@ def load_plugins(self, plugin_dir):
9393
sys.exit()
9494
try:
9595
dependencies = {x.name:set(x.depends) for x in seen_plugins}
96-
print dependencies
9796
classes = {x.name:x for x in seen_plugins}
9897
while len(dependencies) > 0:
9998
ready = [x for x, d in dependencies.iteritems() if len(d) == 0]
@@ -134,7 +133,11 @@ def reload_plugins(self):
134133
def activate_plugins(self):
135134
for plugin in [self.plugins[x] for x in self.load_order]:
136135
if plugin.auto_activate:
137-
plugin.activate()
136+
try:
137+
plugin.activate()
138+
except FatalPluginError as e:
139+
self.logger.critical("A plugin reported a fatal error. Error: %s", str(e))
140+
raise
138141

139142
def deactivate_plugins(self):
140143
for plugin in [self.plugins[x] for x in reversed(self.load_order)]:
@@ -208,4 +211,8 @@ def wrapped_function(self, data):
208211
def print_this_defered_failure(f):
209212
logger.error("Deferred function failure. %s", f)
210213

211-
return wrapped_function
214+
return wrapped_function
215+
216+
217+
class FatalPluginError(Exception):
218+
pass

plugins/__init__.py

Whitespace-only changes.

plugins/admin_commands_plugin/__init__.py

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

plugins/admin_messenger/admin_messenger.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
from base_plugin import BasePlugin
2-
from plugins.player_manager import permissions, UserLevels
2+
from plugins.core.player_manager import permissions, UserLevels
33
import packets
44

55

plugins/bouncer_plugin/bouncer_plugin.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
from base_plugin import BasePlugin
2-
from plugins.player_manager import UserLevels
2+
from plugins.core.player_manager import UserLevels
33

44

55
class BouncerPlugin(BasePlugin):

plugins/colored_names/__init__.py

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

plugins/command_plugin/__init__.py

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

plugins/core/__init__.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
from command_plugin import *
2+
from admin_commands_plugin import *
3+
from command_plugin import *
4+
from player_manager import *
5+
from starbound_config_manager import *

0 commit comments

Comments
 (0)