aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCerapter <cerap@protonmail.com>2018-09-15 15:00:41 +0200
committerCerapter <cerap@protonmail.com>2018-09-15 15:00:41 +0200
commitf3e9d691afbf70ec992fe4726865c9b9e83fac1b (patch)
tree7d1027072321819d946deff0133f0cd5dcef07e4
parent29c91e63ea44a5e27b90fcf409ad9e4dc1f3f5c2 (diff)
Forbade spectators from interacting IC.
-rw-r--r--server/aoprotocol.py9
-rw-r--r--server/area_manager.py5
2 files changed, 13 insertions, 1 deletions
diff --git a/server/aoprotocol.py b/server/aoprotocol.py
index 47126562..f07571dd 100644
--- a/server/aoprotocol.py
+++ b/server/aoprotocol.py
@@ -577,6 +577,9 @@ class AOProtocol(asyncio.Protocol):
if not self.client.is_dj:
self.client.send_host_message('You were blockdj\'d by a moderator.')
return
+ if area.cannot_ic_interact(self.client):
+ self.client.send_host_message("You are not on the area's invite list, and thus, you cannot change music!")
+ return
if not self.validate_net_cmd(args, self.ArgType.STR, self.ArgType.INT) and not self.validate_net_cmd(args, self.ArgType.STR, self.ArgType.INT, self.ArgType.STR):
return
if args[1] != self.client.char_id:
@@ -629,6 +632,9 @@ class AOProtocol(asyncio.Protocol):
if not self.client.can_wtce:
self.client.send_host_message('You were blocked from using judge signs by a moderator.')
return
+ if self.client.area.cannot_ic_interact(self.client):
+ self.client.send_host_message("You are not on the area's invite list, and thus, you cannot use the WTCE buttons!")
+ return
if not self.validate_net_cmd(args, self.ArgType.STR) and not self.validate_net_cmd(args, self.ArgType.STR, self.ArgType.INT):
return
if args[0] == 'testimony1':
@@ -658,6 +664,9 @@ class AOProtocol(asyncio.Protocol):
if self.client.is_muted: # Checks to see if the client has been muted by a mod
self.client.send_host_message("You have been muted by a moderator")
return
+ if self.client.area.cannot_ic_interact(self.client):
+ self.client.send_host_message("You are not on the area's invite list, and thus, you cannot change the Confidence bars!")
+ return
if not self.validate_net_cmd(args, self.ArgType.INT, self.ArgType.INT):
return
try:
diff --git a/server/area_manager.py b/server/area_manager.py
index 328a2316..68eea425 100644
--- a/server/area_manager.py
+++ b/server/area_manager.py
@@ -237,11 +237,14 @@ class AreaManager:
def can_send_message(self, client):
- if self.is_locked != self.Locked.FREE and not client.is_mod and not client.id in self.invite_list:
+ if self.cannot_ic_interact(client):
client.send_host_message('This is a locked area - ask the CM to speak.')
return False
return (time.time() * 1000.0 - self.next_message_time) > 0
+ def cannot_ic_interact(self, client):
+ return self.is_locked != self.Locked.FREE and not client.is_mod and not client.id in self.invite_list
+
def change_hp(self, side, val):
if not 0 <= val <= 10:
raise AreaError('Invalid penalty value.')