aboutsummaryrefslogtreecommitdiff
path: root/server/aoprotocol.py
diff options
context:
space:
mode:
authorCerapter <cerap@protonmail.com>2018-08-10 00:09:41 +0200
committerCerapter <cerap@protonmail.com>2018-08-10 00:09:41 +0200
commit84da730bcef71aeb0d0944261a44dc289949a74d (patch)
tree950351879eef599cfea17b9df1f17a2097a248d5 /server/aoprotocol.py
parent0280f42f6ea2443757f0aa483322d60a5b2c0b6f (diff)
Music changing now shows your custom showname, if set.
Diffstat (limited to 'server/aoprotocol.py')
-rw-r--r--server/aoprotocol.py11
1 files changed, 8 insertions, 3 deletions
diff --git a/server/aoprotocol.py b/server/aoprotocol.py
index 9b8822bb..d26afc9a 100644
--- a/server/aoprotocol.py
+++ b/server/aoprotocol.py
@@ -478,7 +478,7 @@ class AOProtocol(asyncio.Protocol):
if not self.client.is_dj:
self.client.send_host_message('You were blockdj\'d by a moderator.')
return
- if not self.validate_net_cmd(args, self.ArgType.STR, self.ArgType.INT):
+ 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:
return
@@ -487,8 +487,13 @@ class AOProtocol(asyncio.Protocol):
return
try:
name, length = self.server.get_song_data(args[0])
- self.client.area.play_music(name, self.client.char_id, length)
- self.client.area.add_music_playing(self.client, name)
+ if len(args) > 2:
+ showname = args[2]
+ self.client.area.play_music_shownamed(name, self.client.char_id, showname, length)
+ self.client.area.add_music_playing_shownamed(self.client, showname, name)
+ else:
+ self.client.area.play_music(name, self.client.char_id, length)
+ self.client.area.add_music_playing(self.client, name)
logger.log_server('[{}][{}]Changed music to {}.'
.format(self.client.area.id, self.client.get_char_name(), name), self.client)
except ServerError: