aboutsummaryrefslogtreecommitdiff
path: root/server/client_manager.py
diff options
context:
space:
mode:
authorCerapter <cerap@protonmail.com>2018-08-15 23:30:46 +0200
committerCerapter <cerap@protonmail.com>2018-08-15 23:30:46 +0200
commit9ce1d3fa40b48fb55ea94f7d833ee029e7d23a7b (patch)
treea50cd83c9c28298bfd9ba7b5253c988fdd836068 /server/client_manager.py
parent8c859398f1b1308633584103c334bb103bf6cf2c (diff)
Jukebox + Area abbreviation finetuning.
- An area can now have a custom `abbreviation: XXX` set in `areas.yaml`. - Areas can have jukebox mode on by `jukebox: true` in `areas.yaml`. - When this mode is on, music changing is actually voting for the next music. - If no music is playing, or there is only your vote in there, it behaves as normal music changing. - In case of multiple votes, your vote gets added to a list, and may have a chance of being picked. - Check this list with `/jukebox`. - If not your music is picked, your voting power increases, making your music being picked next more likely. - If yours is picked, your voting power is reset to 0. - No matter how many people select the same song, if the song gets picked, all of them will have their voting power reset to 0. - Leaving an area, or picking a not-really-a-song (like 'PRELUDE', which is a category marker, basically), will remove your vote. - If there are no votes left (because every left, for example), the jukebox stops playing songs. - Mods can force a skip by `/jukebox_skip`. - Mods can also toggle an area's jukebox with `/jukebox_toggle`. - Mods can also still play songs with `/play`, though they might get cucked by the Jukebox.
Diffstat (limited to 'server/client_manager.py')
-rw-r--r--server/client_manager.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/server/client_manager.py b/server/client_manager.py
index e127880c..62e141dd 100644
--- a/server/client_manager.py
+++ b/server/client_manager.py
@@ -106,6 +106,8 @@ class ClientManager:
return True
def disconnect(self):
+ if self.area.jukebox:
+ self.area.remove_jukebox_vote(self, True)
self.transport.close()
def change_character(self, char_id, force=False):
@@ -171,6 +173,10 @@ class ClientManager:
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.')
raise ClientError("That area is locked!")
+
+ if self.area.jukebox:
+ self.area.remove_jukebox_vote(self, True)
+
old_area = self.area
if not area.is_char_available(self.char_id):
try:
@@ -203,7 +209,7 @@ class ClientManager:
for client in [x for x in area.clients if x.is_cm]:
owner = 'MASTER: {}'.format(client.get_char_name())
break
- msg += '\r\nArea {}: {} (users: {}) [{}][{}]{}'.format(area.get_abbreviation(), area.name, len(area.clients), area.status, owner, lock[area.is_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 += ' [*]'
self.send_host_message(msg)