-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Censor /status and allow for custom status to be set (requires KFO Client update) #141
base: master
Are you sure you want to change the base?
Changes from 4 commits
3e3228f
f1bdc27
0e68b4d
554a33b
2c2fe6e
35d07a4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
from server import commands | ||
from server.evidence import EvidenceList | ||
from server.exceptions import ClientError, AreaError, ArgumentError, ServerError | ||
from server.constants import MusicEffect, derelative | ||
from server.constants import MusicEffect, derelative, censor | ||
|
||
from collections import OrderedDict | ||
|
||
|
@@ -1711,7 +1711,7 @@ def change_status(self, value): | |
Set the status of the area. | ||
:param value: status code | ||
""" | ||
allowed_values = ( | ||
possible_values = ( | ||
"idle", | ||
"rp", | ||
"casing", | ||
|
@@ -1720,9 +1720,21 @@ def change_status(self, value): | |
"recess", | ||
"gaming", | ||
) | ||
if value.lower() not in allowed_values: | ||
value = censor( | ||
value, | ||
self.server.censors["whole"], | ||
self.server.censors["replace"], | ||
True, | ||
) | ||
value = censor( | ||
value, | ||
self.server.censors["partial"], | ||
self.server.censors["replace"], | ||
False, | ||
) | ||
Crystalwarrior marked this conversation as resolved.
Show resolved
Hide resolved
|
||
if value.lower() == "hub": | ||
raise AreaError( | ||
f'Invalid status. Possible values: {", ".join(allowed_values)}' | ||
f'Invalid status. Possible values: {", ".join(possible_values)}' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe just outward specify "hub" is a restricted value? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So just specify in ooc "Hub" is a restricted status? |
||
) | ||
if value.lower() == "lfp": | ||
value = "looking-for-players" | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -647,7 +647,7 @@ def send_arup_status(self, clients=None): | |
return | ||
status_list = [1] | ||
if len(self.server.hub_manager.hubs) > 1: | ||
status_list = [1, "GAMING"] | ||
status_list = [1, "HUB"] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Pre-KFO Client might not display the right status color There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What version KFO client will be? so I can diversify from the old one There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. any client that isn't KFO LOL |
||
if clients is None: | ||
clients = self.clients | ||
for client in clients: | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍