Skip to content

Commit

Permalink
Merge pull request #159 from Chrezm/4.3.4-dev
Browse files Browse the repository at this point in the history
4.3.4
  • Loading branch information
Chrezm authored Aug 21, 2022
2 parents 5a8ee5c + f1f74aa commit af2182e
Show file tree
Hide file tree
Showing 14 changed files with 542 additions and 250 deletions.
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -779,3 +779,17 @@

### 220723a (4.3.3-post2)
* Fixed /zone_ambient not allowing tracks with spaces

### 220821a (4.3.4)
* Added /sneakself, which sneaks all of your active multiclients that are not currently sneaked but can be sneaked
* GMs and zone watchers now see thoughts in IC if the thinker is in the same area
* Added /mindreader, which allows GMs to let mind readers to see players using /think just like GMs now do
* GMs are no longer subject to the duplicate showname checks
* Players using Danganronpa Online 1.2.2 now properly adjust to new character lists if the server is refreshed and the character list is changed
* Added an extra parameter to /clock_period, allowing GMs to set the hour length of all hours within a period
* Added an explicit /clock_period_end to delete a clock period, rather than relying on an undocumented 1-parameter call to /clock_period
* Ding sound effects are no longer included with "Something catches your attention" IC messages, except those that are triggered because an area was marked as noteworthy
* Fixed area validator not properly handling areas with empty names or backgrounds
* Fixed typo in area_templates.yaml field
* Fixed /think messages not showing the last sent sprite
* Fixed IC-via-OOC commands sending an empty position if the sender never spoke IC before sending the command
39 changes: 23 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,22 +52,22 @@ It is highly recommended you read through all the installation steps first befor
* If everything was set up correctly, you will see something like this appear:

```
[2022-07-17T10:20:20]: Starting...
[2022-07-17T10:20:20]: Launching TsuserverDR 4.3.3 (220717a)...
[2022-07-17T10:20:20]: Loading server configurations...
[2022-07-17T10:20:20]: Server configurations loaded successfully!
[2022-07-17T10:20:20]: Starting a nonlocal server...
[2022-07-17T10:20:20]: Server started successfully!
[2022-07-17T10:20:21]: Server should be now accessible from 192.0.2.0:50000:My First DR Server
[2022-08-21T10:20:20]: Starting...
[2022-08-21T10:20:20]: Launching TsuserverDR 4.3.4 (220821a)...
[2022-08-21T10:20:20]: Loading server configurations...
[2022-08-21T10:20:20]: Server configurations loaded successfully!
[2022-08-21T10:20:20]: Starting a nonlocal server...
[2022-08-21T10:20:20]: Server started successfully!
[2022-08-21T10:20:21]: Server should be now accessible from 192.0.2.0:50000:My First DR Server
```

* If you are listing your server in the Attorney Online master server, make sure its details are set up correctly. In particular, make sure that your server name and description are correct, as that is how players will find your server. If everything was set up correctly, you will see something like this appear:

```
[2022-07-17T10:20:21]: Attempting to connect to the master server at https://servers.aceattorneyonline.com/servers with the following details:
[2022-07-17T10:20:21]: *Server name: My First DR Server
[2022-07-17T10:20:21]: *Server description: This is my flashy new DR server
[2022-07-17T10:20:22]: Connected to the master server.
[2022-08-21T10:20:21]: Attempting to connect to the master server at https://servers.aceattorneyonline.com/servers with the following details:
[2022-08-21T10:20:21]: *Server name: My First DR Server
[2022-08-21T10:20:21]: *Server description: This is my flashy new DR server
[2022-08-21T10:20:22]: Connected to the master server.
```

- The server will make a single ping to [ipify](https://api.ipify.org) in order to obtain its public IP address. If it fails to do that, it will let you know that, as it means there is probably something wrong with your internet connection and that other players may not be able to connect to your server.
Expand All @@ -76,9 +76,9 @@ It is highly recommended you read through all the installation steps first befor
* To stop the server, press Ctrl+C once from your terminal. This will initiate a shutdown sequence and notify you when it is done. If the shutdown finished successfully, you will see something like this appear:

```
[2022-07-17T22:23:04]: You have initiated a server shut down.
[2022-07-17T22:23:04]: Kicking 12 remaining clients.
[2022-07-17T22:23:04]: Server has successfully shut down.
[2022-08-21T22:23:04]: You have initiated a server shut down.
[2022-08-21T22:23:04]: Kicking 12 remaining clients.
[2022-08-21T22:23:04]: Server has successfully shut down.
```

* If you do not see anything after a few seconds of starting a shutdown, you can try spamming Ctrl+C to try and force a shutdown or directly close out your terminal. This is not recommended due to the cleanup process not finishing correctly but it is doable.
Expand Down Expand Up @@ -369,16 +369,19 @@ GMs can:
* **charlog** "ID"
- Lists all character changes (including iniswaps and character name changes) a target has gone through since connecting, including the time they were changed.
* **clock** "area range start" "area range end" "hour length" "hour start" "hours in a day"
- Sets up a day cycle that, starting from the given hour, will tick one hour every given number of seconds and provide a time announcement to a given range of areas.
- Sets up a day cycle that, starting from the given hour, will tick one hour every given number of seconds (main hour length) and provide a time announcement to a given range of areas.
- Hours go from 0 inclusive to the number of hours in a day given exclusive, or 0 to 23 inclusive if not given a number of hours in a day.
* **clock_end** "ID"
- Ends the day cycle initiated by the target or yourself if not given a target.
* **clock_pause** "ID"
- Pauses the day cycle initiated by the target or yourself if not given a target.
* **clock_period** "name" "hour start"
* **clock_period** "name" "hour length" "hour start"
- Initializes a clock period that starts at the given hour for your day cycle.
- Whenever the clock ticks into the period, players in the clock range will be ordered to switch to that time of day's version of their theme.
- If only two arguments are given, the second argument is assumed to be hour start, and hour length is the main hour length.
- Clock period names are automatically made all lowercase.
* **clock_period_end** "name"
- Deletes a clock period for your day cycle.
* **clock_set** "hour length" "hour"
- Modifies the hour length and current hour of your day cycle without restarting it. This is the way to move the day cycle out of unknown time if needed as well.
- Acts just like doing /clock again, but does not erase already set periods.
Expand Down Expand Up @@ -446,6 +449,8 @@ GMs can:
- Ends the area's lurk callout timer if there is one active.
* **make_gm** "ID"
- Makes the target a GM, provided the target is a multiclient of the player.
* **mindreader** "ID"
- Changes a player's ability to see thoughts of other players made with /think. By default it is off.
* **multiclients** "ID"
- Lists all the clients opened by a target and the areas they are in.
* **notecard_check**
Expand Down Expand Up @@ -541,6 +546,8 @@ GMs can:
- Sets a target to be sneaking if they were visible.
- If the target was subject to a handicap shorter than the server's automatic sneak handicap length, they will be imposed this handicap.
- If no ID is given, target is yourself.
* **sneakself**
- Sneaks all opened multiclients that can be sneaked.
* **st** "message"
- Sends a message to all active staff members.
* **status_set_other** "ID/char name/edited-to character/showname/char showname/OOC name" "status"
Expand Down
6 changes: 3 additions & 3 deletions config_sample/area_templates.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
locking_allowed: true
iniswap_allowed: true
rp_getarea_allowed: false
- template_name: AO_Courtroom
- template_name: AO_Courtroom
area: Courtroom No. <AN>
background: gs4
bglock: true
Expand All @@ -28,5 +28,5 @@
- template_name: OOC_Stuff
area: OOC
background: Principal's Room_HD
eivdence_mod: HiddenCM
iniswap_allowed: true
evidence_mod: HiddenCM
iniswap_allowed: true
15 changes: 9 additions & 6 deletions server/area_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,8 @@ def broadcast_ooc(self, msg: str):
for client in self.clients:
client.send_ooc(msg)

def broadcast_ic_attention(self, cond: Callable[[ClientManager.Client], bool] = None):
def broadcast_ic_attention(self, cond: Callable[[ClientManager.Client], bool] = None,
ding: bool = True):
"""
Send an IC message with a ding to everyone in the area indicating something catches
their attention, *except* if the player is blind or deaf, or if the area is a lobby
Expand All @@ -253,6 +254,8 @@ def broadcast_ic_attention(self, cond: Callable[[ClientManager.Client], bool] =
cond : types.LambdaType: ClientManager.Client -> bool, optional
Custom condition each player in the area must also satisfy to receive the
attention message.
ding : bool, optional
If the accompanying IC message should also include the "ding" effect.
Returns
-------
Expand All @@ -264,13 +267,13 @@ def broadcast_ic_attention(self, cond: Callable[[ClientManager.Client], bool] =
return

if cond is None:
cond = lambda client: True
cond = lambda _: True
for player in self.clients:
if player.is_deaf and player.is_blind:
continue

if cond(player):
player.send_ic_attention()
player.send_ic_attention(ding=ding)

def get_background_tod(self) -> Dict[str, str]:
if not self.lights:
Expand Down Expand Up @@ -643,10 +646,10 @@ def change_lights(self, new_lights: bool, initiator: ClientManager.Client = None
party.check_lights()

for c in self.clients:
found_something = c.area_changer.notify_me_rp(self, changed_visibility=True,
changed_hearing=False)
found_something, ding_something = c.area_changer.notify_me_rp(
self, changed_visibility=True, changed_hearing=False)
if found_something and new_lights:
c.send_ic_attention()
c.send_ic_attention(ding=ding_something)

def set_next_msg_delay(self, msg_length: int):
"""
Expand Down
47 changes: 28 additions & 19 deletions server/client_changearea.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ def check_change_area(self, area: AreaManager.Area,

def notify_change_area(self, area: AreaManager.Area, old_dname: str,
ignore_bleeding: bool = False, ignore_autopass: bool = False,
just_me: bool = False) -> bool:
just_me: bool = False) -> Tuple[bool, bool]:
"""
Send all OOC notifications that come from switching areas.
Right now there is
Expand All @@ -133,20 +133,23 @@ def notify_change_area(self, area: AreaManager.Area, old_dname: str,
If just_me is True, no notifications are sent to other players in the area.
Returns True if any RP related notifications are sent to the player who changed areas,
False otherwise.
Returns a tuple of two bool arguments:
0. True if any RP related notifications are sent to the player who changed areas, False
otherwise.
1. True if such RP related notifications to be sent should include a "ding" effect, False
otherwise.
"""

found_something = self.notify_me(area, old_dname, ignore_bleeding=ignore_bleeding)
found_something, ding_something = self.notify_me(area, old_dname,
ignore_bleeding=ignore_bleeding)
if not just_me:
self.notify_others(area, old_dname, ignore_bleeding=ignore_bleeding,
ignore_autopass=ignore_autopass)

return found_something
return found_something, ding_something

def notify_me(self, area: AreaManager.Area, old_dname: str,
ignore_bleeding: bool = False) -> bool:
ignore_bleeding: bool = False) -> Tuple[bool, bool]:
client = self.client

# Code here assumes successful area change, so it will be sending client notifications
Expand Down Expand Up @@ -217,11 +220,11 @@ def notify_me(self, area: AreaManager.Area, old_dname: str,
area.bleeds_to.add(old_area.name)
client.send_ooc('You are bleeding.')

found_something = self.notify_me_rp(area)
return found_something
found_something, ding_something = self.notify_me_rp(area)
return found_something, ding_something

def notify_me_rp(self, area: AreaManager.Area, changed_visibility: bool = True,
changed_hearing: bool = True) -> bool:
changed_hearing: bool = True) -> Tuple[bool, bool]:
###########
# Check bleeding status
blood = self.notify_me_blood(area, changed_visibility=changed_visibility,
Expand All @@ -238,7 +241,7 @@ def notify_me_rp(self, area: AreaManager.Area, changed_visibility: bool = True,
changed_visibility=changed_visibility,
changed_hearing=changed_hearing)

return blood or statuses or area_noteworthy
return blood or statuses or area_noteworthy, area_noteworthy

def notify_me_blood(self, area: AreaManager.Area, changed_visibility: bool = True,
changed_hearing: bool = True) -> bool:
Expand Down Expand Up @@ -485,7 +488,7 @@ def notify_others(self, area: AreaManager.Area, old_dname: str,
status_refreshed_clients = list() # Do not IC ping if client has no status

area.broadcast_ic_attention(cond=lambda c: (ic_attention_others or
c in status_refreshed_clients))
c in status_refreshed_clients), ding=False)

def notify_others_moving(self, client: ClientManager.Client, area: AreaManager.Area,
autopass_mes: str, blind_mes: str):
Expand Down Expand Up @@ -777,9 +780,9 @@ def change_area(self, area: AreaManager.Area, override_all: bool = False,
# .format(client.get_char_name(), old_area.name, old_area.id,
# old_area.name, old_area.id), client)

found_something = client.notify_change_area(area, old_dname,
ignore_bleeding=ignore_bleeding,
ignore_autopass=ignore_autopass)
found_something, ding_something = client.notify_change_area(
area, old_dname, ignore_bleeding=ignore_bleeding,
ignore_autopass=ignore_autopass)

old_area.publisher.publish('area_client_left', {
'client': client,
Expand All @@ -799,7 +802,9 @@ def change_area(self, area: AreaManager.Area, override_all: bool = False,
client.area = area
client.new_area = area # Update again, as the above if may not have run
area.new_client(client)
self.post_area_changed(old_area, area, found_something=found_something,
self.post_area_changed(old_area, area,
found_something=found_something,
ding_something=ding_something,
old_dname=old_dname, override_all=override_all,
override_passages=override_passages,
override_effects=override_effects,
Expand All @@ -813,7 +818,9 @@ def change_area(self, area: AreaManager.Area, override_all: bool = False,
from_party=from_party)

def post_area_changed(self, old_area: Union[None, AreaManager.Area], area: AreaManager.Area,
found_something: bool = False, old_dname: str = '',
found_something: bool = False,
ding_something: bool = False,
old_dname: str = '',
override_all: bool = False,
override_passages: bool = False, override_effects: bool = False,
ignore_bleeding: bool = False, ignore_followers: bool = False,
Expand All @@ -834,11 +841,13 @@ def post_area_changed(self, old_area: Union[None, AreaManager.Area], area: AreaM
client.send_health(side=1, health=client.area.hp_def)
client.send_health(side=2, health=client.area.hp_pro)

new_area_clock_period = area.get_clock_period()
if old_area:
old_area_clock_period = old_area.get_clock_period()
new_area_clock_period = area.get_clock_period()
if old_area_clock_period != new_area_clock_period:
client.send_time_of_day(name=new_area_clock_period)
else:
client.send_time_of_day(name=new_area_clock_period)

if client.is_blind:
client.send_background(name=client.server.config['blackout_background'])
Expand All @@ -852,7 +861,7 @@ def post_area_changed(self, old_area: Union[None, AreaManager.Area], area: AreaM
client.send_ic_blankpost()

if found_something:
client.send_ic_attention()
client.send_ic_attention(ding=ding_something)

client.reload_music_list() # Update music list to include new area's reachable areas
# If new area has lurk callout timer, reset it to that, provided it makes sense
Expand Down
Loading

0 comments on commit af2182e

Please sign in to comment.