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

Commit b9600b0

Browse files
committed
Fixed problem with announcer, removed unused args.
1 parent d1f8781 commit b9600b0

5 files changed

Lines changed: 12 additions & 18 deletions

File tree

plugins/announcer_plugin/announcer_plugin.py

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,19 +14,15 @@ def after_connect_success(self, data):
1414
self.factory.broadcast(
1515
'{} logged in.'.format(
1616
self.protocol.player.colored_name(self.config.colors),
17-
0,
18-
'Announcer'
19-
)
17+
),
18+
'Announcer'
2019
)
2120

2221
def on_client_disconnect_request(self, data):
2322
if self.protocol.player is not None:
2423
self.factory.broadcast(
25-
self.factory.broadcast(
26-
'{} logged out.'.format(
27-
self.protocol.player.colored_name(self.config.colors),
28-
0,
29-
'Announcer'
30-
)
31-
)
24+
'{} logged out.'.format(
25+
self.protocol.player.colored_name(self.config.colors),
26+
),
27+
'Announcer'
3228
)

plugins/core/player_manager_plugin/manager.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ def __init__(self, config):
282282
logger.info('Loading player database.')
283283
try:
284284
self.engine = create_engine(
285-
'sqlite:///'.format(
285+
'sqlite:///{}'.format(
286286
path.preauthChild(self.config.player_db).path
287287
)
288288
)

plugins/core/player_manager_plugin/plugin.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,8 @@ def nick(self, data):
246246
self.factory.broadcast(
247247
'{}^green;\'s name has been changed to {}'.format(
248248
old_name,
249-
self.protocol.player.colored_name(self.config.colors))
249+
self.protocol.player.colored_name(self.config.colors)
250+
)
250251
)
251252

252253
@permissions(UserLevels.ADMIN)

plugins/web_gui/web_gui.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ def post(self):
4646
)
4747
self.factory.broadcast(
4848
'An admin has joined the server through Web-GUI.',
49-
0, self.get_argument('name', strip=False)
49+
self.get_argument('name', strip=False)
5050
)
5151
self.failed_login = False
5252
self.redirect(self.get_argument('next', '/'))
@@ -353,9 +353,7 @@ def on_message(self, message):
353353
time=datetime.now().strftime('%H:%M'),
354354
user_name=self.web_gui_user.name,
355355
message=messagejson['message']
356-
),
357-
0,
358-
''
356+
)
359357
)
360358

361359
def update_chat(self):

server.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -702,13 +702,12 @@ def stopFactory(self):
702702
self.config.save()
703703
self.plugin_manager.die()
704704

705-
def broadcast(self, text, mode=1, name=''):
705+
def broadcast(self, text, name=''):
706706
"""
707707
Convenience method to send a broadcasted message to all clients on the
708708
server.
709709
710710
:param text: Message text
711-
:param mode: Channel to broadcast on. 0 is global, 1 is planet.
712711
:param name: The name to prepend before the message, format is <name>
713712
:return: None
714713
"""

0 commit comments

Comments
 (0)