diff options
| author | Cerapter <cerap@protonmail.com> | 2018-09-15 02:33:18 +0200 |
|---|---|---|
| committer | Cerapter <cerap@protonmail.com> | 2018-09-15 02:33:18 +0200 |
| commit | fcd8f5b5abb2329aded120007319d581908c8a69 (patch) | |
| tree | 5a3530435821555b51555768725bde1e267bd9a0 /server/client_manager.py | |
| parent | 86f91ba3e862b683becbc2d35539bc06a636c925 (diff) | |
Areas can now be spectatable, too.
- Makes it so that people can join, but can't type IC unless invited.
- The CM can set it with `/area_spectate`.
Diffstat (limited to 'server/client_manager.py')
| -rw-r--r-- | server/client_manager.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/server/client_manager.py b/server/client_manager.py index 5e6825bb..617bb69c 100644 --- a/server/client_manager.py +++ b/server/client_manager.py @@ -182,9 +182,10 @@ 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.id in area.invite_list: - #self.send_host_message('This area is locked - you will be unable to send messages ICly.') + if area.is_locked == area.Locked.LOCKED and not self.is_mod and not self.id in area.invite_list: raise ClientError("That area is locked!") + if area.is_locked == area.Locked.SPECTATABLE and not self.is_mod and not self.id in area.invite_list: + self.send_host_message('This area is spectatable, but not free - you will be unable to send messages ICly unless invited.') if self.area.jukebox: self.area.remove_jukebox_vote(self, True) @@ -215,13 +216,13 @@ class ClientManager: def send_area_list(self): msg = '=== Areas ===' - lock = {True: '[LOCKED]', False: ''} for i, area in enumerate(self.server.area_manager.areas): owner = 'FREE' if area.owned: for client in [x for x in area.clients if x.is_cm]: owner = 'CM: {}'.format(client.get_char_name()) break + lock = {area.Locked.FREE: '', area.Locked.SPECTATABLE: '[SPECTATABLE]', area.Locked.LOCKED: '[LOCKED]'} msg += '\r\nArea {}: {} (users: {}) [{}][{}]{}'.format(area.abbreviation, area.name, len(area.clients), area.status, owner, lock[area.is_locked]) if self.area == area: msg += ' [*]' @@ -236,7 +237,7 @@ class ClientManager: info += '=== {} ==='.format(area.name) info += '\r\n' - lock = {True: '[LOCKED]', False: ''} + lock = {area.Locked.FREE: '', area.Locked.SPECTATABLE: '[SPECTATABLE]', area.Locked.LOCKED: '[LOCKED]'} info += '[{}]: [{} users][{}]{}'.format(area.abbreviation, len(area.clients), area.status, lock[area.is_locked]) sorted_clients = [] |
