mirror of
https://github.com/nikdoof/test-auth.git
synced 2025-12-22 14:19:28 +00:00
Added character information passthrough to update_groups, also enabled per corp groups in TS3
This commit is contained in:
@@ -142,7 +142,7 @@ class TS3Service(BaseService):
|
||||
|
||||
return outlist
|
||||
|
||||
def update_groups(self, uid, groups):
|
||||
def update_groups(self, uid, groups, character=None):
|
||||
""" Update the UID's groups based on the provided list """
|
||||
|
||||
cldbid = self._get_userid(uid)
|
||||
@@ -165,6 +165,15 @@ class TS3Service(BaseService):
|
||||
if g.name in usrgrplist:
|
||||
del usrgrplist[g.name]
|
||||
|
||||
# Add to corporation groups
|
||||
if character and character.corporation:
|
||||
if character.corporation.name in usrgrplist:
|
||||
del usrgrplist[character.corporation.name]
|
||||
else:
|
||||
if not character.corporation.name in tsgrplist:
|
||||
tsgrplist[g.name] = self._create_group(character.corporation.name)
|
||||
self.conn.send_command('servergroupaddclient', {'sgid': tsgrplist[character.corporation.name], 'cldbid': cldbid })
|
||||
|
||||
# Remove ignored and admin groups
|
||||
for k, v in usrgrplist.items():
|
||||
if not int(v) == self.settings['authed_sgid'] and not int(v) in self.settings['ignore_groups']:
|
||||
|
||||
Reference in New Issue
Block a user