Added the "temp-leader" back (!leader set now raises the rank, and is not visual-only)
!loot add also works for players without accounts now (i.e. outside the alliance)
This commit is contained in:
@@ -16,6 +16,8 @@ from modules.core.accounting.services.access_service import AccessService
|
||||
|
||||
|
||||
# noinspection SqlCaseVsIf,SqlResolve,PyMethodMayBeStatic
|
||||
|
||||
|
||||
@instance()
|
||||
class AccountService:
|
||||
MAIN_CHANGED_EVENT_TYPE = "main_changed"
|
||||
@@ -37,6 +39,7 @@ class AccountService:
|
||||
self.pork: PorkService = registry.get_instance("pork_service")
|
||||
self.setting_service: SettingService = registry.get_instance("setting_service")
|
||||
self.text: Text = registry.get_instance("text")
|
||||
self.leader = registry.get_instance("leader_controller", is_optional=True)
|
||||
|
||||
def pre_start(self):
|
||||
self.db.exec("CREATE TABLE IF NOT EXISTS account ("
|
||||
@@ -433,6 +436,8 @@ class AccountService:
|
||||
return "council" in self.get_ranks(char_id)
|
||||
|
||||
def check_leader(self, char_id) -> bool:
|
||||
if self.leader and self.leader.leader and self.leader.leader.char_id == char_id:
|
||||
return True
|
||||
if self.simple_checks(self.get_account(char_id)):
|
||||
return "leader" in self.get_ranks(char_id)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user