Skip to content
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

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 16 additions & 4 deletions server/area.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍


from collections import OrderedDict

Expand Down Expand Up @@ -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",
Expand All @@ -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)}'
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe just outward specify "hub" is a restricted value?

Copy link
Contributor Author

Choose a reason for hiding this comment

The 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"
Expand Down
2 changes: 1 addition & 1 deletion server/area_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pre-KFO Client might not display the right status color

Copy link
Contributor Author

@EstatoDeviato EstatoDeviato Jun 11, 2024

Choose a reason for hiding this comment

The 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

Copy link
Owner

Choose a reason for hiding this comment

The 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:
Expand Down
Loading