Skip to content

Commit

Permalink
Master to M200807a (#85)
Browse files Browse the repository at this point in the history
* Fix bugs in /showname_freeze and /showname_nuke. (#37) (#38)

* Fix bugs in /showname_freeze and /showname_nuke.

* Update CHANGELOG.md

* Fix /bg turning lights on in previously dark areas. [#43](#44)

* Fix /bg turning on lights in previously dark rooms.

* Fix to pass test.py.

* Fix non-numerical music length tracks being allowed (#32)+Backport fixes in 037623f

* Fix #46+Readd /login to README.md

* Fix OS errors on loading area list or music list files not being properly caught (#51)

* Music lists that list no length for a track may be loaded again (are assumed to not loop)

* Fix /lights from keeping lights off if the background wasn't changed while they were off. [#53] (#52)

* Fix /bg turning on lights in previously dark rooms.

* Update segment and internal versions.

* Update CHANGELOG.md.

* Fix /lights issue(this time for real).

* 4.2.4 (#56)

* First commit for 4.2.4

* Start adding 4.3.0-dev features not related to main functions

All features come from RaveMaster073's contributions, namely
* cc340c6
* 7a58f00
* 70cb1d8
* 67456c5
* 12f927e
* 930367b
* ef0fcd0

* Finish adding 4.3.0-dev features not related to featured functions

All features come from RaveMaster073's contributions, namely
* c76cc82
* d458309

* Add /cid

* Add client IDs to login/logout/failed logins notifications

* Allow GMs to /make_gm their multiclients (and only their multiclients)

* Rewrite default daily passwords to properly reflect when they are valid

* Add /zone_lights. (#47)

* Add /zone_lights.

* Fix branch differences.

* Fix recommended changes.

* Fix recommended changes.

Co-authored-by: Chrezm <TheChrezm@gmail.com>

* Add /sa, /sas, /shout, /unsneak, /yell. (#48)

* Add /sa, /sas, /shout, /unsneak, /yell.

Co-authored-by: Chrezm <TheChrezm@gmail.com>

* Add best effort support for AO 2.7 clients. (#49)

* Add best effort support for AO 2.7 clients.

* Maintain 100 character limit for lines of code

Co-authored-by: Chrezm <TheChrezm@gmail.com>

* Forward-port 4.2.3-post9 changes in ea3f514

* Enforce Python 3.6+ requirement+Warn pending deprecation of Python 3.6.

* Forward-port 4.2.3-post10 changes in 054a88f

* Add parameter description for area list files

* Forward-port 4.2.3-post11 changes in 154c187

* Add OOC name, character/persona, and iniswaps to GM commands that only took client ID. (Unfinished)

* Add user ID support to commands.

* Revert changes on GM commands.

* Update CHANGELOG.md

* Include 4.2.3-post11 bugfix in changelog

Co-authored-by: Chrezm <TheChrezm@gmail.com>

* Update /time and /time12 to allow for custom UTC offset (first 4.2.4 beta)

* Add instructions to configuration files

* Properly reject webAO+Log abnormal connections+Fix DOS exploit

* Fix /toggle_allrolls outputing rolls from outside watched zone if roller was out of a zone

* Fix /multiclients failing if target was not staff and their area would not have been printed in /getareas

* Update (and fix!) README and Changelog for 4.2.4 (Release Candidate)

* Actually force port 0 for webAO+Undeprecate /showname_list+Fix Changelog

* 4.2.4 out

Co-authored-by: Toddler Howard <47868518+RaveMaster073@users.noreply.github.com>

* Fix no IC duplication management+Fix broken KFO compatiblity+Increase termination log size (#57)

* Fix no IC duplication management+Fix broken KFO compatiblity+Increase termination log

Remind me to be careful what branch I use next time.

* Fix turning lights on before party disbands raising TypeError [#58]

* 4.2.4-post3 (#63)

* OOC warn clients whose version cannot be recognized

* Support Case Cafe clients with Update 22 or higher

* Handle different MC packet protocols

* Allow 2.8 pairs+2.6 pairs

* Allow background with position packets for AO 2.8

* Improve error messages for missing config folder+invalid characters/areas+localhost joining

* Assume theoretical CC24 client uses AO 2.8 protocol

* Make /charselect send output messages

* Fix broken toggle_allpasses doc+Add doc for /gmlock and pending deprecation message

* Improve client termination messages+Add missing one for packet too short

* Update changelog and bump version

* Remove leftover code+Add deprecation warning to /gmlock

* Added fact that unrecognized clients are now warned in OOC when they join

* Fix servers not launching if they do not set some daily passwords. (#66) (#67)

* Check for password existence first, perform appropriate actions depending on type

* Remove server.config['passwords'] in favor of making it an internal server attribute

* Update documentation and bump version

* Fix improper clearing of paused clocks of disconnected players. (#68) (#69)

* Catch KeyError due to clock cancelation after a pause

* Remove leftover just_paused and properly cancel tasks from disconnecting players

* 4.2.5 (#76)

* Do not abort server launch if failing to obtain public IP (#70)

* Fix AO 2.8 not loading the music list properly

* Set working directory to start_server.py directory+Make all crashes require Enter input to exit (#71)

* GlobalIC prefix workaround, remove for 4.3

* Raised character limit to 1024 except for IC-commands (these remain at 256)

* Screams now display the scream in IC to the screamer

* Update README and bump up internal version to 4.2.5

* zone_play and zone_lights now send status messages to sender and zone watchers

* Dname and ID (#73)

* More dname and id

* More work

* Final ones

* Bump up version number

* Give /play and /rplay additional status messages

* Warn if track name for /play, /rplay and /zone_play is not recognized

* Forgot to fix /zone_play test

* Party whisper (#74)

* Basic /party_whisper (alias /pw and /huddle)

* Update README and changelog

* Update char list (#75)

* Move refresh char list code to separate method

* Start rewriting for future update (cannot be done with current client)

* Add /zone_info

* Update README with 4.2.5 nomenclature (bump to beta 1)

* Add /logingm as an alias to /loginrp

* Have /party_members and /zone_info list client IDs

* 4.2.5 out

* 4.2.5-post1 (#77) (#78)

* whois command now shows global IC and global IC prefix statuses

* Fix global IC areas and prefix not reseting on area list reload

* Cancel clock and remove global IC areas and prefixes if needed on /logout

* /logout and /cleargm cancel global IC, clocks and permission to use restricted characters

* Bump up version number

* 4.2.5-post2: Make /logingm filter out server passwords (#79) (#80)

* 4.2.5-post3: Fix /scream not showing default or custom shownames in IC (#81) (#82)

* Fix /scream not showing default or custom shownames in IC

* Standardize /scream for deaf players

* Missing bracket

* Remove merge artifacts

Co-authored-by: RaveMaster073 <47868518+RaveMaster073@users.noreply.github.com>
  • Loading branch information
Chrezm and RaveMaster073 authored Aug 8, 2020
1 parent 43ae3fa commit 1d468c3
Show file tree
Hide file tree
Showing 33 changed files with 1,270 additions and 787 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@
/.coverage
/.pylint.d/
/server/.pylint.d/
/server/__pycache__/
/server/__pycache__/
38 changes: 38 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -434,6 +434,44 @@
* Improved client termination messages for abnormal connections and packets
* Added best-effort support for (upcoming) Attorney Online 2.8 and similar clients. Unrecognized clients will now be warned in OOC when they join

### 200712a (4.2.4-post4)
* Fixed servers not launching if they did not set some daily gmpasses
* config.yaml now shows instructions on how to make daily gmpasses optional, as well as indications on password requirements

### 200720a (4.2.4-post5)
* Fixed situation where players that started a clock, paused it and disconnected did not have the clocks properly cleared

### 200731a (4.2.5)
* Added /party_whisper (aliases /pw and /huddle) so players in the same party may whisper to one another
* Added /zone_info (alias /zi) so zone watchers may quickly obtain details about their zone and a list of players in their zone.
* Added /logingm, alias to /loginrp.
* /play, /rplay, /zone_lights and /zone_play now send status messages to both the player executing the command as well as any player watching the zone if appropriate
* /play, /rplay and /zone_play now warn the player executing the command if the track name is not a recognized one and that it will not loop
* /scream now displays the scream in IC to the screamer
* Raised character limit in commands from 256 to 1024, except for IC-related commands (these remain at 256)
* (Temporarily) patched /globalic_pre so that GMs using /globalic with prefixes would have their client IC chatboxes and effects cleared once their message was sent
* All staff-privileged commands now send displayname and client ID rather than some combination of names
* /party_members and /zone_list now list client ID of members and zone watchers respectively
* Servers no longer stop launch if they are unable to obtain their public IP
* Improved wording in README
* Fixed /rplay failing if the reachable areas of an area was just the keyword '<ALL>'
* Fixed launching servers via double clicking start_server.py being unable to find configuration files and crashing immediately afterwards
* Fixed Attorney Online 2.8 not handling music and area list updates

### 200803a (4.2.5-post1)
* Fixed global IC areas and prefixes, as well as day cycle clocks not being canceled on /logout and /cleargm
* Fixed /cleargm not forcing GMs who were in an area that restricted some characters off their character if they were using one of those restricted characters
* Fixed global IC areas and prefixes not being reset on area list reloads, even when it would not make too much sense to keep them around
* /whois now shows global IC and global IC prefix status

### 200805a (4.2.5-post2)
* Fixed accidental uses of /logingm in IC or in OOC surrounded by spaces not filtering out server passwords like other login commands do

### 200807a (4.2.5-post3)
* Fixed /scream not showing default or custom shownames in IC for non-deaf players
* Reworded the /scream OOC notification so it is more in line with other OOC/IC notifications
* Deaf players now only see an IC notification for screams

### (4.3.0)
* Dropped Python 3.6 support
* Added lurk callouts to name players who have been idle some amount of time
Expand Down
73 changes: 47 additions & 26 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,52 +9,60 @@ Requires Python 3.7-3.8 and PyYAML (follow instructions below to install).

### Installing

It is highly recommended you read through all the installation steps first before going through them.

* Install the latest version of Python. **Python 2 will not work**.
- You can download Python from its official website [here](https://www.python.org/downloads/).
- If your system supports it, it is recommended that you use a separate virtual environment, such as [Anaconda](https://www.continuum.io/downloads) for Windows, or [virtualenv](https://virtualenv.pypa.io/en/stable/) for everyone else (it runs itself using Python).
- If prompted during the installation to add `python` as a PATH environment variable, accept this option.
- You can download Python from its official website [here](https://www.python.org/downloads/). If you already have Python installed, check that your Python version satisfies the version requirement listed above.
- If prompted during the installation to add `python` as a PATH environment variable, accept this option. You may see this option appear on the very first screen during the installation process.
- If you know what a virtual environment is and your system supports it, it is recommended that you use one, such as [Anaconda](https://www.continuum.io/downloads) for Windows, or [virtualenv](https://virtualenv.pypa.io/en/stable/) for everyone else (it runs itself using Python). If you do not know what a virtual environment is, you may skip this point.
- If you have Python 3.6 or lower, you will be prompted on server launch to update to a newer version of Python. That is because the server requires Python 3.7 or higher. Follow instructions under Updating to update your Python version.
* Open Command Prompt, PowerShell or your preferred terminal, and change to the directory where you downloaded TsuserverDR to. You can do this in two ways:
- Go up one folder above the TsuserverDR folder, Shift + right click the TsuserverDR folder, and click `Open PowerShell window here`. This is the easiest method.
- Copy the path of the TsuserverDR folder, open the terminal, and type in `cd "[paste here]"`, excluding the brackets, but including the quotation marks if the path contains spaces.
* To install PyYAML and dependencies, type in the following:
```bash
* Install PyYAML and dependencies by typing in the following in the terminal you just opened:
```
python -m pip install --user -r requirements.txt
```

If you are using Windows and have both Python 2 and 3 installed, you may do the following:
```batch
```
py -3 -m pip install --user -r requirements.txt
```

This operation should not require administrator privileges, unless you decide to remove the `--user` option.
* Rename `config_sample` to `config` and edit the values in the provided YAML files to your liking. Be sure to check the YAML files for syntax errors after you are done. *Use spaces only; do not use tabs.*
* Rename the folder `config_sample` to `config` and edit the values in the provided YAML files to your liking. Be sure to check the YAML files for syntax errors after you are done. *Use spaces only; do not use tabs.*

### Running

* Run by either double-clicking `start_server.py` or typing in cmd or your terminal `python start_server.py`, or `py -3 start_server.py` if you use both Python 2 and 3. If everything was set up correctly, you will see something like this appear:
* To launch a server, you may either
- Double-click `start_server.py` in your TsuserverDR folder.
- In PowerShell, Command Prompt or your preferred terminal, change directory to your TsuserverDR folder and type `python start_server.py`, or `py -3 start_server.py` if you use both Python 2 and 3. For instructions on how to launch any of the above programs or change directory, refer to the second point in the Installing section.

* If everything was set up correctly, you will see something like this appear:

\[2020-05-16T10:20:20\]: Starting...
\[2020-05-16T10:20:20\]: Launching TsuserverDR 4.2.4 (200516a)...
\[2020-05-16T10:20:20\]: Loading server configurations...
\[2020-05-16T10:20:20\]: Server configurations loaded successfully!
\[2020-05-16T10:20:20\]: Starting a nonlocal server...
\[2020-05-16T10:20:20\]: Server started successfully!
\[2020-05-16T10:20:21\]: Server should be now accessible from 192.0.2.0:50000:My First DR Server
\[2020-07-31T10:20:20\]: Starting...
\[2020-07-31T10:20:20\]: Launching TsuserverDR 4.2.5 (200731a)...
\[2020-07-31T10:20:20\]: Loading server configurations...
\[2020-07-31T10:20:20\]: Server configurations loaded successfully!
\[2020-07-31T10:20:20\]: Starting a nonlocal server...
\[2020-07-31T10:20:20\]: Server started successfully!
\[2020-07-31T10: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:

\[2020-05-16T10:20:21\]: Attempting to connect to the master server at master.aceattorneyonline.com:27016 with the following details:
\[2020-05-16T10:20:21\]: *Server name: My First DR Server
\[2020-05-16T10:20:21\]: *Server description: This is my flashy new DR server
\[2020-05-16T10:20:22\]: Connected to the master server.
\[2020-07-31T10:20:21\]: Attempting to connect to the master server at master.aceattorneyonline.com:27016 with the following details:
\[2020-07-31T10:20:21\]: *Server name: My First DR Server
\[2020-07-31T10:20:21\]: *Server description: This is my flashy new DR server
\[2020-07-31T10: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 during launch you get `urllib.error.URLError` or `socket.gaierror`, there is probably something wrong with your internet connection.
- 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.
- Successful connection or getting a spot in the master server list does not imply that your server will be accessible to other players. In particular, you must make sure that your external port in `config\config.yaml` is open and accepting connections, which usually involves a combination of router and firewall settings. In case of doubt, you can use websites such as [Can You See Me](https://canyouseeme.org) to check if your port is visible.

* 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:

\[2020-05-16T22:23:04\]: You have initiated a server shut down.
\[2020-05-16T22:23:04\]: Kicking 12 remaining clients.
\[2020-05-16T22:23:04\]: Server has successfully shut down.
\[2020-07-31T22:23:04\]: You have initiated a server shut down.
\[2020-07-31T22:23:04\]: Kicking 12 remaining clients.
\[2020-07-31T22: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 All @@ -74,7 +82,7 @@ Requires Python 3.7-3.8 and PyYAML (follow instructions below to install).
- In general, updating to a Python version beyond what is specified as supported may lead to unstable behavior, so for active servers try to keep your Python version among the ones specifically labeled as supported.

## Commands
Additional notes are listed at the end of the command list.
Additional notes are listed at the end of the command list. Unless otherwise specified, all command arguments have a character limit of 1024 characters, beyond which they will be cut off.

### User Commands

Expand Down Expand Up @@ -172,6 +180,10 @@ Additional notes are listed at the end of the command list.
- Revokes an invitation sent to a player to join your player.
* **party_unlead**
- Removes your party leader role.
* **party_whisper** "message"
- Sends an IC private message to everyone in the party.
- Other people in the area are warned that a whisper has taken place (but not the message content). However, staff members do get message contents, so this command should only be used in RP settings.
- Messages are limited to 256 characters.
* **ping**
- Returns "Pong", used to check for server connection.
* **play** "song.mp3"
Expand All @@ -190,7 +202,8 @@ Additional notes are listed at the end of the command list.
* **rollp** "number of dice"d"number of faces" "modifiers"
- Same as roll but other non-staff members in the area only are notified that someone rolled.
* **scream** "message"
- Sends a message visible to all players in the areas that are set to be able to listen to screams from the current area.
- Sends an IC message visible to all players in the areas that are set to be able to listen to screams from the current area.
- Messages are limited to 256 characters.
* **showname** "showname"
- Sets your showname to be the given one, or clears it if not given one.
* **showname_area**
Expand Down Expand Up @@ -234,6 +247,7 @@ Additional notes are listed at the end of the command list.
* **whisper** "ID/char name/edited-to character/showname/OOC name" "message"
- Sends an IC private message to the target, provided they are in the area.
- Other people in the area are warned that a whisper has taken place (but not the message content). However, staff members do get message contents, so this command should only be used in RP settings.
- Messages are limited to 256 characters.
* **zone_global**
- Sends a message to all players in the zone you are in.
* **8ball** "question"
Expand Down Expand Up @@ -311,6 +325,7 @@ GMs can:
* **guide** "ID/char name/edited-to character/showname/OOC name" "message"
- Sends an IC private 'guiding' message to the target.
- Unlike /whisper, other people in the area are not warned that a whisper has taken place. However, staff members do get message contents, so this command should only be used in RP settings.
- Messages are limited to 256 characters.
* **handicap** "ID" "length" "name" "announce if over"
- Sets a movement handicap on a client by ID so that they need to wait a set amount of time in seconds between changing areas.
- If name is given, the handicap announcement will use it as the name of the handicap.
Expand Down Expand Up @@ -401,6 +416,8 @@ GMs can:
- Adds an area by name or ID to the zone you are watching.
* **zone_delete**
- Deletes the zone you are watching.
* **zone_info**
- Lists brief description of the zone you are watching, as well as lists all players in areas part of the zone.
* **zone_lights** "on/off"
- Changes the light status of every area in a zone you are watching to on or off.
* **zone_list**
Expand Down Expand Up @@ -539,16 +556,20 @@ Commands without (D) are aliases to commands and can be freely used (subject to

#### Everyone

* **showname_list**: Same as /showname_areas.
* **huddle**: Same as /party_whisper.
* **pw**: Same as /party_whisper.
* **sa**: Same as /showname_area.
* **sas**: Same as /showname_areas.
* **shout**: Same as /scream.
* **showname_list**: Same as /showname_areas.
* **unsneak**: Same as /reveal.
* **yell**: Same as /scream.
* **zg**: Same as /zone_global.
* **zi**: Same as /zone_info.

#### GM+

* **logingm**: Same as /loginrp.
* **unsneak**: Same as /reveal.

### Notes
Expand Down
6 changes: 4 additions & 2 deletions config_sample/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,11 @@ masterserver_port: 27016 # Keep
# modpass: password for moderators
# cmpass: password for community managers
# gmpass: password for game masters
# gmpass1: password for game masters that is only good for Monday based on server time
# gmpass2: password for game masters that is only good for Tuesday based on server time
# gmpass1: password for game masters that is only good for Monday based on server time (daily password for Monday)
# gmpass2: password for game masters that is only good for Tuesday based on server time (daily password for Tuesday)
# ....
# If you do not want daily passwords, remove their lines completely from this configuration file.
# Every password you put here must be unique and non-empty.

modpass: Mod
cmpass: Community Manager
Expand Down
Loading

0 comments on commit 1d468c3

Please sign in to comment.