Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main'
Browse files Browse the repository at this point in the history
  • Loading branch information
BlastSlimey committed Dec 2, 2024
2 parents ea5b518 + fbb1e6d commit eb86f08
Show file tree
Hide file tree
Showing 181 changed files with 1,195 additions and 405 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
Expand All @@ -58,7 +58,7 @@ jobs:
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v2
uses: github/codeql-action/autobuild@v3

# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl
Expand All @@ -72,4 +72,4 @@ jobs:
# make release

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
uses: github/codeql-action/analyze@v3
2 changes: 1 addition & 1 deletion .github/workflows/unittests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,4 +89,4 @@ jobs:
run: |
source venv/bin/activate
export PYTHONPATH=$(pwd)
python test/hosting/__main__.py
timeout 600 python test/hosting/__main__.py
4 changes: 4 additions & 0 deletions BaseClasses.py
Original file line number Diff line number Diff line change
Expand Up @@ -1264,6 +1264,10 @@ def useful(self) -> bool:
def trap(self) -> bool:
return ItemClassification.trap in self.classification

@property
def excludable(self) -> bool:
return not (self.advancement or self.useful)

@property
def flags(self) -> int:
return self.classification.as_flag()
Expand Down
2 changes: 1 addition & 1 deletion Generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ def main(args=None) -> Tuple[argparse.Namespace, int]:
player_files = {}
for file in os.scandir(args.player_files_path):
fname = file.name
if file.is_file() and not fname.startswith(".") and \
if file.is_file() and not fname.startswith(".") and not fname.lower().endswith(".ini") and \
os.path.join(args.player_files_path, fname) not in {args.meta_file_path, args.weights_file_path}:
path = os.path.join(args.player_files_path, fname)
try:
Expand Down
12 changes: 6 additions & 6 deletions Launcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,15 @@
from shutil import which
from typing import Callable, Optional, Sequence, Tuple, Union

import Utils
import settings
from worlds.LauncherComponents import Component, components, Type, SuffixIdentifier, icon_paths

if __name__ == "__main__":
import ModuleUpdate
ModuleUpdate.update()

from Utils import is_frozen, user_path, local_path, init_logging, open_filename, messagebox, \
is_windows, is_macos, is_linux
import settings
import Utils
from Utils import (init_logging, is_frozen, is_linux, is_macos, is_windows, local_path, messagebox, open_filename,
user_path)
from worlds.LauncherComponents import Component, components, icon_paths, SuffixIdentifier, Type


def open_host_yaml():
Expand Down Expand Up @@ -104,6 +103,7 @@ def update_settings():
Component("Open host.yaml", func=open_host_yaml),
Component("Open Patch", func=open_patch),
Component("Generate Template Options", func=generate_yamls),
Component("Archipelago Website", func=lambda: webbrowser.open("https://archipelago.gg/")),
Component("Discord Server", icon="discord", func=lambda: webbrowser.open("https://discord.gg/8Z65BR2")),
Component("Unrated/18+ Discord Server", icon="discord", func=lambda: webbrowser.open("https://discord.gg/fqvNCCRsu4")),
Component("Browse Files", func=browse_files),
Expand Down
6 changes: 4 additions & 2 deletions MultiServer.py
Original file line number Diff line number Diff line change
Expand Up @@ -1960,8 +1960,10 @@ def _cmd_status(self, tag: str = "") -> bool:

def _cmd_exit(self) -> bool:
"""Shutdown the server"""
self.ctx.server.ws_server.close()
self.ctx.exit_event.set()
try:
self.ctx.server.ws_server.close()
finally:
self.ctx.exit_event.set()
return True

@mark_raw
Expand Down
4 changes: 2 additions & 2 deletions Options.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
from schema import And, Optional, Or, Schema
from typing_extensions import Self

from Utils import get_fuzzy_results, is_iterable_except_str, output_path
from Utils import get_file_safe_name, get_fuzzy_results, is_iterable_except_str, output_path

if typing.TYPE_CHECKING:
from BaseClasses import MultiWorld, PlandoOptions
Expand Down Expand Up @@ -1531,7 +1531,7 @@ def yaml_dump_scalar(scalar) -> str:

del file_data

with open(os.path.join(target_folder, game_name + ".yaml"), "w", encoding="utf-8-sig") as f:
with open(os.path.join(target_folder, get_file_safe_name(game_name) + ".yaml"), "w", encoding="utf-8-sig") as f:
f.write(res)


Expand Down
16 changes: 14 additions & 2 deletions SNIClient.py
Original file line number Diff line number Diff line change
Expand Up @@ -633,7 +633,13 @@ async def game_watcher(ctx: SNIContext) -> None:
if not ctx.client_handler:
continue

rom_validated = await ctx.client_handler.validate_rom(ctx)
try:
rom_validated = await ctx.client_handler.validate_rom(ctx)
except Exception as e:
snes_logger.error(f"An error occurred, see logs for details: {e}")
text_file_logger = logging.getLogger()
text_file_logger.exception(e)
rom_validated = False

if not rom_validated or (ctx.auth and ctx.auth != ctx.rom):
snes_logger.warning("ROM change detected, please reconnect to the multiworld server")
Expand All @@ -649,7 +655,13 @@ async def game_watcher(ctx: SNIContext) -> None:

perf_counter = time.perf_counter()

await ctx.client_handler.game_watcher(ctx)
try:
await ctx.client_handler.game_watcher(ctx)
except Exception as e:
snes_logger.error(f"An error occurred, see logs for details: {e}")
text_file_logger = logging.getLogger()
text_file_logger.exception(e)
await snes_disconnect(ctx)


async def run_game(romfile: str) -> None:
Expand Down
3 changes: 2 additions & 1 deletion WebHost.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
# in case app gets imported by something like gunicorn
import Utils
import settings
from Utils import get_file_safe_name

if typing.TYPE_CHECKING:
from flask import Flask
Expand Down Expand Up @@ -71,7 +72,7 @@ def create_ordered_tutorials_file() -> typing.List[typing.Dict[str, typing.Any]]
shutil.rmtree(base_target_path, ignore_errors=True)
for game, world in worlds.items():
# copy files from world's docs folder to the generated folder
target_path = os.path.join(base_target_path, game)
target_path = os.path.join(base_target_path, get_file_safe_name(game))
os.makedirs(target_path, exist_ok=True)

if world.zip_path:
Expand Down
3 changes: 2 additions & 1 deletion WebHostLib/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from pony.flask import Pony
from werkzeug.routing import BaseConverter

from Utils import title_sorted
from Utils import title_sorted, get_file_safe_name

UPLOAD_FOLDER = os.path.relpath('uploads')
LOGS_FOLDER = os.path.relpath('logs')
Expand All @@ -20,6 +20,7 @@

app.jinja_env.filters['any'] = any
app.jinja_env.filters['all'] = all
app.jinja_env.filters['get_file_safe_name'] = get_file_safe_name

app.config["SELFHOST"] = True # application process is in charge of running the websites
app.config["GENERATORS"] = 8 # maximum concurrent world gens
Expand Down
2 changes: 1 addition & 1 deletion WebHostLib/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
flask>=3.0.3
werkzeug>=3.0.4
werkzeug>=3.0.6
pony>=0.7.19
waitress>=3.0.0
Flask-Caching>=2.3.0
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file modified WebHostLib/static/static/backgrounds/cliffs/grass/cliff-left.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file modified WebHostLib/static/static/backgrounds/cliffs/grass/cliff-top.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added WebHostLib/static/static/backgrounds/dirt.webp
Binary file not shown.
Binary file modified WebHostLib/static/static/backgrounds/footer/footer-0001.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file modified WebHostLib/static/static/backgrounds/footer/footer-0002.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file modified WebHostLib/static/static/backgrounds/footer/footer-0003.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file modified WebHostLib/static/static/backgrounds/footer/footer-0004.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file modified WebHostLib/static/static/backgrounds/footer/footer-0005.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Binary file added WebHostLib/static/static/backgrounds/grass.webp
Binary file not shown.
Binary file modified WebHostLib/static/static/backgrounds/header/dirt-header.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file modified WebHostLib/static/static/backgrounds/header/grass-header.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file modified WebHostLib/static/static/backgrounds/header/ocean-header.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file modified WebHostLib/static/static/backgrounds/header/stone-header.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file added WebHostLib/static/static/backgrounds/ice.webp
Binary file not shown.
Binary file not shown.
Binary file modified WebHostLib/static/static/backgrounds/ocean.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added WebHostLib/static/static/backgrounds/ocean.webp
Binary file not shown.
Binary file not shown.
Binary file added WebHostLib/static/static/backgrounds/stone.webp
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified WebHostLib/static/static/button-images/island-button-a.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file modified WebHostLib/static/static/button-images/island-button-b.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file modified WebHostLib/static/static/button-images/island-button-c.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Binary file modified WebHostLib/static/static/decorations/island-a.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file modified WebHostLib/static/static/decorations/island-b.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file modified WebHostLib/static/static/decorations/island-c.png
Binary file not shown.
Binary file not shown.
Binary file not shown.
2 changes: 1 addition & 1 deletion WebHostLib/templates/gameInfo.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

{% block body %}
{% include 'header/'+theme+'Header.html' %}
<div id="game-info" class="markdown" data-lang="{{ lang }}" data-game="{{ game }}">
<div id="game-info" class="markdown" data-lang="{{ lang }}" data-game="{{ game | get_file_safe_name }}">
<!-- Populated my JS / MD -->
</div>
{% endblock %}
2 changes: 1 addition & 1 deletion WebHostLib/templates/playerOptions/playerOptions.html
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ <h1>Player Options</h1>
A list of all games you have generated can be found on the <a href="/user-content">User Content Page</a>.
<br />
You may also download the
<a href="/static/generated/configs/{{ world_name }}.yaml">template file for this game</a>.
<a href="/static/generated/configs/{{ world_name | get_file_safe_name }}.yaml">template file for this game</a>.
</p>

<form id="options-form" method="post" enctype="application/x-www-form-urlencoded" action="generate-yaml">
Expand Down
2 changes: 1 addition & 1 deletion WebHostLib/templates/tutorial.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
{% endblock %}

{% block body %}
<div id="tutorial-wrapper" class="markdown" data-game="{{ game }}" data-file="{{ file }}" data-lang="{{ lang }}">
<div id="tutorial-wrapper" class="markdown" data-game="{{ game | get_file_safe_name }}" data-file="{{ file | get_file_safe_name }}" data-lang="{{ lang }}">
<!-- Content generated by JavaScript -->
</div>
{% endblock %}
20 changes: 14 additions & 6 deletions WebHostLib/tracker.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from uuid import UUID
from email.utils import parsedate_to_datetime

from flask import render_template, make_response, Response, request
from flask import make_response, render_template, request, Request, Response
from werkzeug.exceptions import abort

from MultiServer import Context, get_saving_second
Expand Down Expand Up @@ -298,17 +298,25 @@ def get_spheres(self) -> List[List[int]]:
return self._multidata.get("spheres", [])


def _process_if_request_valid(incoming_request, room: Optional[Room]) -> Optional[Response]:
def _process_if_request_valid(incoming_request: Request, room: Optional[Room]) -> Optional[Response]:
if not room:
abort(404)

if_modified = incoming_request.headers.get("If-Modified-Since", None)
if if_modified:
if_modified = parsedate_to_datetime(if_modified)
if_modified_str: Optional[str] = incoming_request.headers.get("If-Modified-Since", None)
if if_modified_str:
if_modified = parsedate_to_datetime(if_modified_str)
if if_modified.tzinfo is None:
abort(400) # standard requires "GMT" timezone
# database may use datetime.utcnow(), which is timezone-naive. convert to timezone-aware.
last_activity = room.last_activity
if last_activity.tzinfo is None:
last_activity = room.last_activity.replace(tzinfo=datetime.timezone.utc)
# if_modified has less precision than last_activity, so we bring them to same precision
if if_modified >= room.last_activity.replace(microsecond=0):
if if_modified >= last_activity.replace(microsecond=0):
return make_response("", 304)

return None


@app.route("/tracker/<suuid:tracker>/<int:tracked_team>/<int:tracked_player>")
def get_player_tracker(tracker: UUID, tracked_team: int, tracked_player: int, generic: bool = False) -> Response:
Expand Down
6 changes: 3 additions & 3 deletions data/options.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@
name: Player{number}

# Used to describe your yaml. Useful if you have multiple files.
description: Default {{ game }} Template
description: {{ yaml_dump("Default %s Template" % game) }}

game: {{ game }}
game: {{ yaml_dump(game) }}
requires:
version: {{ __version__ }} # Version of Archipelago required for this yaml to work as expected.

Expand All @@ -44,7 +44,7 @@ requires:
{%- endfor -%}
{% endmacro %}

{{ game }}:
{{ yaml_dump(game) }}:
{%- for group_name, group_options in option_groups.items() %}
# {{ group_name }}

Expand Down
2 changes: 1 addition & 1 deletion docs/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@
/worlds/shivers/ @GodlFire

# A Short Hike
/worlds/shorthike/ @chandler05
/worlds/shorthike/ @chandler05 @BrandenEK

# Sonic Adventure 2 Battle
/worlds/sa2b/ @PoryGone @RaspberrySpace
Expand Down
2 changes: 1 addition & 1 deletion docs/running from source.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,4 +85,4 @@ PyCharm has a built-in version control integration that supports Git.

## Running tests

Run `pip install pytest pytest-subtests`, then use your IDE to run tests or run `pytest` from the source folder.
Information about running tests can be found in [tests.md](https://github.com/ArchipelagoMW/Archipelago/blob/main/docs/tests.md#running-tests)
20 changes: 16 additions & 4 deletions docs/tests.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,19 @@ testing portions of your code that can be tested without relying on a multiworld

## Running Tests

In PyCharm, running all tests can be done by right-clicking the root `test` directory and selecting `run Python tests`.
If you do not have pytest installed, you may get import failures. To solve this, edit the run configuration, and set the
working directory of the run to the Archipelago directory. If you only want to run your world's defined tests, repeat
the steps for the test directory within your world.
#### Using Pycharm

In PyCharm, running all tests can be done by right-clicking the root test directory and selecting Run 'Archipelago Unittests'.
Unless you configured PyCharm to use pytest as a test runner, you may get import failures. To solve this, edit the run configuration,
and set the working directory to the Archipelago directory which contains all the project files.

If you only want to run your world's defined tests, repeat the steps for the test directory within your world.
Your working directory should be the directory of your world in the worlds directory and the script should be the
tests folder within your world.

You can also find the 'Archipelago Unittests' as an option in the dropdown at the top of the window
next to the run and debug buttons.

#### Running Tests without Pycharm

Run `pip install pytest pytest-subtests`, then use your IDE to run tests or run `pytest` from the source folder.
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
colorama>=0.4.6
websockets>=13.0.1
websockets>=13.0.1,<14
PyYAML>=6.0.2
jellyfish>=1.1.0
jinja2>=3.1.4
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -632,7 +632,7 @@ def find_lib(lib: str, arch: str, libc: str) -> Optional[str]:
"packages": ["worlds", "kivy", "cymem", "websockets"],
"includes": [],
"excludes": ["numpy", "Cython", "PySide2", "PIL",
"pandas"],
"pandas", "zstandard"],
"zip_include_packages": ["*"],
"zip_exclude_packages": ["worlds", "sc2", "orjson"], # TODO: remove orjson here once we drop py3.8 support
"include_files": [], # broken in cx 6.14.0, we use more special sauce now
Expand Down
1 change: 1 addition & 0 deletions test/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import settings

warnings.simplefilter("always")
warnings.filterwarnings(action="ignore", category=DeprecationWarning, module="s2clientprotocol")
settings.no_gui = True
settings.skip_autosave = True

Expand Down
24 changes: 12 additions & 12 deletions test/general/test_fill.py
Original file line number Diff line number Diff line change
Expand Up @@ -688,8 +688,8 @@ def test_non_excluded_local_items(self):
for item in multiworld.get_items():
item.classification = ItemClassification.useful

multiworld.local_items[player1.id].value = set(names(player1.basic_items))
multiworld.local_items[player2.id].value = set(names(player2.basic_items))
multiworld.worlds[player1.id].options.local_items.value = set(names(player1.basic_items))
multiworld.worlds[player2.id].options.local_items.value = set(names(player2.basic_items))
locality_rules(multiworld)

distribute_items_restrictive(multiworld)
Expand Down Expand Up @@ -795,8 +795,8 @@ def setUp(self) -> None:

def test_balances_progression(self) -> None:
"""Tests that progression balancing moves progression items earlier"""
self.multiworld.progression_balancing[self.player1.id].value = 50
self.multiworld.progression_balancing[self.player2.id].value = 50
self.multiworld.worlds[self.player1.id].options.progression_balancing.value = 50
self.multiworld.worlds[self.player2.id].options.progression_balancing.value = 50

self.assertRegionContains(
self.player1.regions[2], self.player2.prog_items[0])
Expand All @@ -808,8 +808,8 @@ def test_balances_progression(self) -> None:

def test_balances_progression_light(self) -> None:
"""Test that progression balancing still moves items earlier on minimum value"""
self.multiworld.progression_balancing[self.player1.id].value = 1
self.multiworld.progression_balancing[self.player2.id].value = 1
self.multiworld.worlds[self.player1.id].options.progression_balancing.value = 1
self.multiworld.worlds[self.player2.id].options.progression_balancing.value = 1

self.assertRegionContains(
self.player1.regions[2], self.player2.prog_items[0])
Expand All @@ -822,8 +822,8 @@ def test_balances_progression_light(self) -> None:

def test_balances_progression_heavy(self) -> None:
"""Test that progression balancing moves items earlier on maximum value"""
self.multiworld.progression_balancing[self.player1.id].value = 99
self.multiworld.progression_balancing[self.player2.id].value = 99
self.multiworld.worlds[self.player1.id].options.progression_balancing.value = 99
self.multiworld.worlds[self.player2.id].options.progression_balancing.value = 99

self.assertRegionContains(
self.player1.regions[2], self.player2.prog_items[0])
Expand All @@ -836,8 +836,8 @@ def test_balances_progression_heavy(self) -> None:

def test_skips_balancing_progression(self) -> None:
"""Test that progression balancing is skipped when players have it disabled"""
self.multiworld.progression_balancing[self.player1.id].value = 0
self.multiworld.progression_balancing[self.player2.id].value = 0
self.multiworld.worlds[self.player1.id].options.progression_balancing.value = 0
self.multiworld.worlds[self.player2.id].options.progression_balancing.value = 0

self.assertRegionContains(
self.player1.regions[2], self.player2.prog_items[0])
Expand All @@ -849,8 +849,8 @@ def test_skips_balancing_progression(self) -> None:

def test_ignores_priority_locations(self) -> None:
"""Test that progression items on priority locations don't get moved by balancing"""
self.multiworld.progression_balancing[self.player1.id].value = 50
self.multiworld.progression_balancing[self.player2.id].value = 50
self.multiworld.worlds[self.player1.id].options.progression_balancing.value = 50
self.multiworld.worlds[self.player2.id].options.progression_balancing.value = 50

self.player2.prog_items[0].location.progress_type = LocationProgressType.PRIORITY

Expand Down
Loading

0 comments on commit eb86f08

Please sign in to comment.