aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCerapter <cerap@protonmail.com>2018-08-30 13:32:09 +0200
committerCerapter <cerap@protonmail.com>2018-08-30 13:32:09 +0200
commitc3e29d685079dd1090c305b84172983ed347a63c (patch)
tree513d5cc3e64c0a8a4bb0597caba0ff2098ec39ef
parent85ceb708f755aeacc6721dcaab2f791b60ccc04b (diff)
Stopped people from using Unicode format characters to pretend to be the server.
-rw-r--r--server/aoprotocol.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/server/aoprotocol.py b/server/aoprotocol.py
index 5bc94bb1..8313a36d 100644
--- a/server/aoprotocol.py
+++ b/server/aoprotocol.py
@@ -26,6 +26,7 @@ from .exceptions import ClientError, AreaError, ArgumentError, ServerError
from .fantacrypt import fanta_decrypt
from .evidence import EvidenceList
from .websocket import WebSocket
+import unicodedata
class AOProtocol(asyncio.Protocol):
@@ -440,6 +441,10 @@ class AOProtocol(asyncio.Protocol):
if len(self.client.name) > 30:
self.client.send_host_message('Your OOC name is too long! Limit it to 30 characters.')
return
+ for c in self.client.name:
+ if unicodedata.category(c) == 'Cf':
+ self.client.send_host_message('You cannot use format characters in your name!')
+ return
if self.client.name.startswith(self.server.config['hostname']) or self.client.name.startswith('<dollar>G'):
self.client.send_host_message('That name is reserved!')
return