Initial Release of IGNCore version 2.5

This commit is contained in:
2021-08-09 13:18:56 +02:00
commit a83d98c47e
910 changed files with 224171 additions and 0 deletions
+22
View File
@@ -0,0 +1,22 @@
from core.command_param_types import Any, Character
from core.decorators import instance, command
@instance()
class RunasController:
def inject(self, registry):
self.command_service = registry.get_instance("command_service")
self.access_service = registry.get_instance("access_service")
self.getresp = registry.get_instance("translation_service").get_response
@command(command="runas", params=[Character("character"), Any("command")], access_level="superadmin",
description="Run a command as another character")
def runas_cmd(self, request, char, command_str):
if not char.char_id:
return self.getresp("global", "char_not_found", {"char": char.name})
elif not self.access_service.has_sufficient_access_level(request.sender.char_id, char.char_id):
return self.getresp("module/system", "runas_fail", {"char": char.name})
else:
command_str = self.command_service.trim_command_symbol(command_str)
self.command_service.process_command(command_str, request.channel,
char.char_id, request.reply, request.conn)