Area numbers replaced by area abbreviations.
This commit is contained in:
parent
c22606b5a7
commit
3759131a8f
@ -603,15 +603,13 @@ class AOProtocol(asyncio.Protocol):
|
|||||||
current_time = strftime("%H:%M", localtime())
|
current_time = strftime("%H:%M", localtime())
|
||||||
|
|
||||||
if len(args) < 1:
|
if len(args) < 1:
|
||||||
self.server.send_all_cmd_pred('ZZ', '[{}] {} ({}) in {} ({}) without reason (not using the Case Café client?)'
|
self.server.send_all_cmd_pred('ZZ', '[{}] {} ({}) in {} without reason (not using the Case Café client?)'
|
||||||
.format(current_time, self.client.get_char_name(), self.client.get_ip(), self.client.area.name,
|
.format(current_time, self.client.get_char_name(), self.client.get_ip(), self.client.area.name), pred=lambda c: c.is_mod)
|
||||||
self.client.area.id), pred=lambda c: c.is_mod)
|
|
||||||
self.client.set_mod_call_delay()
|
self.client.set_mod_call_delay()
|
||||||
logger.log_server('[{}][{}]{} called a moderator.'.format(self.client.get_ip(), self.client.area.id, self.client.get_char_name()))
|
logger.log_server('[{}][{}]{} called a moderator.'.format(self.client.get_ip(), self.client.area.id, self.client.get_char_name()))
|
||||||
else:
|
else:
|
||||||
self.server.send_all_cmd_pred('ZZ', '[{}] {} ({}) in {} ({}) with reason: {}'
|
self.server.send_all_cmd_pred('ZZ', '[{}] {} ({}) in {} with reason: {}'
|
||||||
.format(current_time, self.client.get_char_name(), self.client.get_ip(), self.client.area.name,
|
.format(current_time, self.client.get_char_name(), self.client.get_ip(), self.client.area.name, args[0][:100]), pred=lambda c: c.is_mod)
|
||||||
self.client.area.id, args[0][:100]), pred=lambda c: c.is_mod)
|
|
||||||
self.client.set_mod_call_delay()
|
self.client.set_mod_call_delay()
|
||||||
logger.log_server('[{}][{}]{} called a moderator: {}.'.format(self.client.get_ip(), self.client.area.id, self.client.get_char_name(), args[0]))
|
logger.log_server('[{}][{}]{} called a moderator: {}.'.format(self.client.get_ip(), self.client.area.id, self.client.get_char_name(), args[0]))
|
||||||
|
|
||||||
|
@ -188,6 +188,18 @@ class AreaManager:
|
|||||||
for client in self.clients:
|
for client in self.clients:
|
||||||
client.send_command('LE', *self.get_evidence_list(client))
|
client.send_command('LE', *self.get_evidence_list(client))
|
||||||
|
|
||||||
|
def get_abbreviation(self):
|
||||||
|
if self.name.lower().startswith("courtroom"):
|
||||||
|
return "CR" + self.name.split()[-1]
|
||||||
|
elif self.name.lower().startswith("area"):
|
||||||
|
return "A" + self.name.split()[-1]
|
||||||
|
elif len(self.name.split()) > 1:
|
||||||
|
return "".join(item[0].upper() for item in self.name.split())
|
||||||
|
elif len(self.name) > 3:
|
||||||
|
return self.name[:3].upper()
|
||||||
|
else:
|
||||||
|
return self.name.upper()
|
||||||
|
|
||||||
|
|
||||||
def __init__(self, server):
|
def __init__(self, server):
|
||||||
self.server = server
|
self.server = server
|
||||||
|
@ -203,7 +203,7 @@ class ClientManager:
|
|||||||
for client in [x for x in area.clients if x.is_cm]:
|
for client in [x for x in area.clients if x.is_cm]:
|
||||||
owner = 'MASTER: {}'.format(client.get_char_name())
|
owner = 'MASTER: {}'.format(client.get_char_name())
|
||||||
break
|
break
|
||||||
msg += '\r\nArea {}: {} (users: {}) [{}][{}]{}'.format(i, area.name, len(area.clients), area.status, owner, lock[area.is_locked])
|
msg += '\r\nArea {}: {} (users: {}) [{}][{}]{}'.format(area.get_abbreviation(), area.name, len(area.clients), area.status, owner, lock[area.is_locked])
|
||||||
if self.area == area:
|
if self.area == area:
|
||||||
msg += ' [*]'
|
msg += ' [*]'
|
||||||
self.send_host_message(msg)
|
self.send_host_message(msg)
|
||||||
@ -214,7 +214,7 @@ class ClientManager:
|
|||||||
area = self.server.area_manager.get_area_by_id(area_id)
|
area = self.server.area_manager.get_area_by_id(area_id)
|
||||||
except AreaError:
|
except AreaError:
|
||||||
raise
|
raise
|
||||||
info += '= Area {}: {} =='.format(area.id, area.name)
|
info += '=== {} ==='.format(area.name)
|
||||||
sorted_clients = []
|
sorted_clients = []
|
||||||
for client in area.clients:
|
for client in area.clients:
|
||||||
if (not mods) or client.is_mod:
|
if (not mods) or client.is_mod:
|
||||||
|
@ -593,7 +593,7 @@ def ooc_cmd_invite(client, arg):
|
|||||||
c = client.server.client_manager.get_targets(client, TargetType.ID, int(arg), False)[0]
|
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.ipid] = None
|
||||||
client.send_host_message('{} is invited to your area.'.format(c.get_char_name()))
|
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 area {}.'.format(client.area.id))
|
c.send_host_message('You were invited and given access to {}.'.format(client.area.name))
|
||||||
except:
|
except:
|
||||||
raise ClientError('You must specify a target. Use /invite <id>')
|
raise ClientError('You must specify a target. Use /invite <id>')
|
||||||
|
|
||||||
|
@ -232,7 +232,7 @@ class TsuServer3:
|
|||||||
|
|
||||||
def broadcast_global(self, client, msg, as_mod=False):
|
def broadcast_global(self, client, msg, as_mod=False):
|
||||||
char_name = client.get_char_name()
|
char_name = client.get_char_name()
|
||||||
ooc_name = '{}[{}][{}]'.format('<dollar>G', client.area.id, char_name)
|
ooc_name = '{}[{}][{}]'.format('<dollar>G', client.area.get_abbreviation(), char_name)
|
||||||
if as_mod:
|
if as_mod:
|
||||||
ooc_name += '[M]'
|
ooc_name += '[M]'
|
||||||
self.send_all_cmd_pred('CT', ooc_name, msg, pred=lambda x: not x.muted_global)
|
self.send_all_cmd_pred('CT', ooc_name, msg, pred=lambda x: not x.muted_global)
|
||||||
@ -243,7 +243,7 @@ class TsuServer3:
|
|||||||
def broadcast_need(self, client, msg):
|
def broadcast_need(self, client, msg):
|
||||||
char_name = client.get_char_name()
|
char_name = client.get_char_name()
|
||||||
area_name = client.area.name
|
area_name = client.area.name
|
||||||
area_id = client.area.id
|
area_id = client.area.get_abbreviation()
|
||||||
self.send_all_cmd_pred('CT', '{}'.format(self.config['hostname']),
|
self.send_all_cmd_pred('CT', '{}'.format(self.config['hostname']),
|
||||||
'=== Advert ===\r\n{} in {} [{}] needs {}\r\n==============='
|
'=== Advert ===\r\n{} in {} [{}] needs {}\r\n==============='
|
||||||
.format(char_name, area_name, area_id, msg), pred=lambda x: not x.muted_adverts)
|
.format(char_name, area_name, area_id, msg), pred=lambda x: not x.muted_adverts)
|
||||||
|
Loading…
Reference in New Issue
Block a user