diff options
| author | Cerapter <cerap@protonmail.com> | 2018-08-12 02:17:07 +0200 |
|---|---|---|
| committer | Cerapter <cerap@protonmail.com> | 2018-08-12 02:17:07 +0200 |
| commit | 00b5af9b60aaeeb26511f29a6f839210ee9c8234 (patch) | |
| tree | 0ee1abf19155650d1e541ed8613f290a5478d11f | |
| parent | d444eb6dceb47123940baed5a255572d24567dc8 (diff) | |
Fixed the `/invite` and `/uninvite` commands so they work as they claim they do.
- You can now invite and uninvite by IDs.
| -rw-r--r-- | server/client_manager.py | 2 | ||||
| -rw-r--r-- | server/commands.py | 8 |
2 files changed, 5 insertions, 5 deletions
diff --git a/server/client_manager.py b/server/client_manager.py index 00301735..e127880c 100644 --- a/server/client_manager.py +++ b/server/client_manager.py @@ -168,7 +168,7 @@ class ClientManager: def change_area(self, area): if self.area == area: raise ClientError('User already in specified area.') - if area.is_locked and not self.is_mod and not self.ipid in area.invite_list: + if area.is_locked and not self.is_mod and not self.id in area.invite_list: #self.send_host_message('This area is locked - you will be unable to send messages ICly.') raise ClientError("That area is locked!") old_area = self.area diff --git a/server/commands.py b/server/commands.py index b8748eda..853a37d9 100644 --- a/server/commands.py +++ b/server/commands.py @@ -577,7 +577,7 @@ def ooc_cmd_area_lock(client, arg): client.area.is_locked = True client.area.send_host_message('Area is locked.') for i in client.area.clients: - client.area.invite_list[i.ipid] = None + client.area.invite_list[i.id] = None return else: raise ClientError('Only CM can lock the area.') @@ -599,7 +599,7 @@ def ooc_cmd_invite(client, arg): raise ClientError('You must be authorized to do that.') try: c = client.server.client_manager.get_targets(client, TargetType.ID, int(arg), False)[0] - client.area.invite_list[c.ipid] = None + client.area.invite_list[c.id] = None client.send_host_message('{} is invited to your area.'.format(c.get_char_name())) c.send_host_message('You were invited and given access to {}.'.format(client.area.name)) except: @@ -620,7 +620,7 @@ def ooc_cmd_uninvite(client, arg): client.send_host_message("You have removed {} from the whitelist.".format(c.get_char_name())) c.send_host_message("You were removed from the area whitelist.") if client.area.is_locked: - client.area.invite_list.pop(c.ipid) + client.area.invite_list.pop(c.id) except AreaError: raise except ClientError: @@ -653,7 +653,7 @@ def ooc_cmd_area_kick(client, arg): c.change_area(area) c.send_host_message("You were kicked from the area to area {}.".format(output)) if client.area.is_locked: - client.area.invite_list.pop(c.ipid) + client.area.invite_list.pop(c.id) except AreaError: raise except ClientError: |
