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

Commit f0c3150

Browse files
committed
[142] Fixed problem with logging commands
1 parent 934972e commit f0c3150

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

plugins/core/command_plugin/command_plugin.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,18 @@ def activate(self):
1313
def on_chat_sent(self, data):
1414
data = chat_sent().parse(data.data)
1515
data.message = data.message.decode('utf-8')
16-
if data.message[0] == self.command_prefix:
16+
if data.message.startswith(self.command_prefix):
1717
split_command = data.message[1:].split()
1818
command = split_command[0]
1919
try:
2020
if command in self.commands:
2121
self.commands[command].__self__.protocol = self.protocol
2222
self.commands[command](split_command[1:])
23+
self.logger.info(
24+
'Command sent: <%s> %s',
25+
self.protocol.player.name,
26+
data.message
27+
)
2328
else:
2429
return True
2530
return False

plugins/core/player_manager_plugin/manager.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -500,6 +500,9 @@ def wrapper(f):
500500

501501
@wraps(f)
502502
def wrapped_function(self, *args, **kwargs):
503+
if self.protocol is None:
504+
return False
505+
503506
if self.protocol.player.access_level >= level:
504507
if level >= UserLevels.MODERATOR:
505508
if not self.protocol.player.admin_logged_in:

0 commit comments

Comments
 (0)