Commit Graph

309 Commits

Author SHA1 Message Date
Fabian Dill
f18f9e2dce Core: increment version (#5194) 2025-07-15 21:04:06 +02:00
qwint
f45410c917 Core: Update UUID handling to be more easily sharable between libraries (#5088)
moves uuid caching to appdata and uuid generation to be a random uuid instead of getnode's hardware address driven identifier and updates docs to point to the shared cache
2025-07-15 07:10:40 +02:00
NewSoupVi
7a6fb5e35b Revert "Core: Take Counter back out of RestrictedUnpickler" (#5184)
* Revert "Core: Take Counter back out of RestrictedUnpickler #5169"

This reverts commit 95e09c8e2a.

* Update Utils.py
2025-07-11 23:28:18 +02:00
NewSoupVi
95e09c8e2a Core: Take Counter back out of RestrictedUnpickler #5169 2025-07-07 16:24:35 +02:00
Katelyn Gigante
c2666bacd7 core: Don't attempt to write to the inside of an OSX App Bundle (#4380)
* core: Frozen OSX should also use Home Directory

* Use Application Support instead of homedir

* Suggested changes
2025-06-19 18:05:52 +02:00
black-sliver
694e6bcae3 Launcher/Utils: reset LD_LIBRARY_PATH for system EXEs (#5022) 2025-06-03 10:42:37 +00:00
black-sliver
3b8450036a core: don't reconfigure stdout if it's fake (#5020) 2025-05-22 01:22:55 +02:00
Katelyn Gigante
a409167f64 core: Reconfigure stdout to utf8 (#5017) 2025-05-21 20:27:03 +02:00
Katelyn Gigante
5f24da7e18 Core: Use the location of Utils.py rather than __main__ to determine the AP Folder (#4009) 2025-05-10 15:20:43 +02:00
Exempt-Medic
b217372fea Core: Make Perfect Fuzzy Match Prioritize Casing (#4956) 2025-05-05 19:18:20 -04:00
NewSoupVi
05c1751d29 Core: Add "OptionCounter", use it for generic "StartInventory" and Witness "TrapWeights" (#3756)
* CounterOption

* bring back the negative exception for ItemDict

* Backwards compatibility

* ruff on witness

* fix in calls

* move the contains

* comment

* comment

* Add option min and max values for CounterOption

* Use min 0 for TrapWeights

* This is safe now

* ruff

* This fits on one line again now

* OptionCounter

* Update Options.py

* Couple more typing things

* Update Options.py

* Make StartInventory work again, also make LocationCounter theoretically work

* Docs

* more forceful wording

* forced line break

* Fix unit test (that wasn't breaking?)

* Add trapweights to witness option presets to 'prove' that the unit test passes

* Make it so you can order stuff

* Update macros.html
2025-04-24 22:06:41 +02:00
Jérémie Bolduc
efe2b7c539 Core: Support default value with cache_self1 (#4667)
* add cache_self1_default and tests

* merge the two decorators

* just change the defaults of the wrap lol

* add test for default and default
2025-04-19 17:55:02 +02:00
Fabian Dill
215eb7e473 core: increment version (#4808) 2025-04-04 23:25:37 +02:00
Fabian Dill
d07f36dedd Core: increment version (#4787) 2025-04-02 05:35:39 +02:00
Silvris
04771fa4f0 Core: fix pickling plando texts (#4711) 2025-03-09 20:00:00 +01:00
NewSoupVi
c7810823e8 Core: Fix crash when trying to log an exception (#4313)
* Fix crash when trying to log an exception

In https://github.com/ArchipelagoMW/Archipelago/pull/3028, we added a new logging filter which checked `record.msg`. 

However, you can pass whatever you want into a logging call. In this case, what we missed was ecc3094c70/MultiServer.py (L530C1-L530C37), where we pass an Exception object as the message. This currently causes a crash with the new filter.

The logging module supports this. It has no typing and can handle passing objects as messages just fine.

What you're supposed to use, as far as I understand it, is `record.getMessage()` instead of `record.msg`.

* Update Utils.py

Co-authored-by: Doug Hoskisson <beauxq@users.noreply.github.com>

---------

Co-authored-by: Doug Hoskisson <beauxq@users.noreply.github.com>
2025-01-16 18:35:07 +01:00
Scipio Wright
0f3818e711 Utils: Visualize Regions showing the reachable regions in color (#4436)
* Utils with coloring

* Update example use

* Update Utils.py

Co-authored-by: Doug Hoskisson <beauxq@users.noreply.github.com>

---------

Co-authored-by: Doug Hoskisson <beauxq@users.noreply.github.com>
2025-01-14 10:45:59 +01:00
ruby0b
874197d940 Linux: move the user home Archipelago dir to $XDG_DATA_HOME (#4347)
This affects builds with non-writable installation directories.
Instead of saving data in ~/Archipelago we now use $XDG_DATA_HOME/Archipelago
(defaulting to ~/.local/share/Archipelago).
If ~/Archipelago still exists we move it to the new location and link ~/Archipelago to it.

Motivation: This follows the [XDG Base Directory Specification](https://specifications.freedesktop.org/basedir-spec/latest/)
to at least some degree and doesn't clutter the user's home directory.
2025-01-10 01:27:49 +01:00
Benjamin S Wolf
0fdc14bc42 Core: Deduplicate exception output (#4036)
When running Generate.py, uncaught exceptions are logged once to a file and twice to the console due to keeping the original excepthook. We can avoid this by filtering the file log out of the stream handler.
2024-12-15 22:29:56 +01:00
Fabian Dill
ffe0221deb Core: log process ID (#4290) 2024-12-03 03:00:56 +01:00
josephwhite
21dbfd2472 Multiserver: Add argument for timestamping STDOUT (#4266)
* core: add server arg for timestamping STDOUT

* Multiserver: Implicitly use default write_mode arg in init_logging

Co-authored-by: Exempt-Medic <60412657+Exempt-Medic@users.noreply.github.com>

---------

Co-authored-by: Exempt-Medic <60412657+Exempt-Medic@users.noreply.github.com>
2024-12-01 04:33:36 +01:00
Benjamin S Wolf
d36c983461 Core: Log warnings at call site, not Utils itself (#4229) 2024-11-29 20:40:02 +01:00
ken
91185f4f7c Core: Add timestamps to logging for seed generation (#3028)
* Add timestamps to logging for improved debugging

* Add datetime to general logging; particularly useful for large seeds.

* Move console timestamps from Main to Utils.init_logging (better location)

* Update Main.py

remove spurious blank line

Co-authored-by: Nicholas Saylor <79181893+nicholassaylor@users.noreply.github.com>

---------

Co-authored-by: Zach Parks <zach@alliware.com>
Co-authored-by: Nicholas Saylor <79181893+nicholassaylor@users.noreply.github.com>
2024-11-29 07:16:54 +01:00
Emily
b783eab1e8 Core: Introduce 'Hint Priority' concept (#3506)
* Introduce 'Hint Priority' concept

* fix error when sorting hints while not connected

* fix 'found' -> 'status' kivy stuff

* remove extraneous warning

this warning fired if you clicked to select or toggle priority of any hint, as you weren't clicking on the header...

* skip scanning individual header widgets when not clicking on the header

* update hints on disconnection

* minor cleanup

* minor fixes/cleanup

* fix: hints not updating properly for receiving player

* update re: review

* 'type() is' -> 'isinstance()'

* cleanup, re: Jouramie's review

* Change 'priority' to 'status', add 'Unspecified' and 'Avoid' statuses, update colors

* cleanup

* move dicts out of functions

* fix: new hints being returned when hint already exists

* fix: show `Found` properly when hinting already-found hints

* import `Hint` and `HintStatus` directly from `NetUtils`

* Default any hinted `Trap` item to be classified as `Avoid` by default

* add some sanity checks

* re: Vi's feedback

* move dict out of function

* Update kvui.py

* remove unneeded dismiss message

* allow lclick to drop hint status dropdown

* underline hint statuses to indicate clickability

* only underline clickable statuses

* Update kvui.py

* Update kvui.py

---------

Co-authored-by: Silvris <58583688+Silvris@users.noreply.github.com>
Co-authored-by: NewSoupVi <57900059+NewSoupVi@users.noreply.github.com>
2024-11-29 02:10:31 +01:00
Fabian Dill
334781e976 Core: purge py3.8 and py3.9 (#3973)
Co-authored-by: Remy Jette <remy@remyjette.com>
Co-authored-by: Jouramie <16137441+Jouramie@users.noreply.github.com>
Co-authored-by: Aaron Wagener <mmmcheese158@gmail.com>
2024-11-27 03:28:00 +01:00
black-sliver
3ae8992fb6 Clients: fix high CPU usage when launched via MultiProcessing (#4209)
* Core: make Utils.stream_input not consume all CPU for non-blocking streams

* Clients: ignore MultiProcessing pipe as input console
2024-11-18 15:59:17 +01:00
black-sliver
382a5df1d8 macos: fix crash when 'Open Patch' is used (#4108)
* macos: fix crash when 'Open Patch' is used

* Utils: fix error message in open_directory
2024-10-28 08:41:36 +01:00
Silvris
049a8780b5 Core: fix pickling plando connections (#4054)
* shift plando pickle hack

* Update Utils.py

Co-authored-by: Exempt-Medic <60412657+Exempt-Medic@users.noreply.github.com>

---------

Co-authored-by: Exempt-Medic <60412657+Exempt-Medic@users.noreply.github.com>
2024-10-22 21:08:25 +02:00
Fabian Dill
5530d181da Core: update version number (#3944) 2024-09-16 06:48:13 +02:00
Fabian Dill
c478e55d7a Generate: improve logging capture (#3484) 2024-06-09 03:13:27 +02:00
Zach Parks
cff7327558 Utils: Fix mistake made with KeyedDefaultDict from #1933 that broke tracker functionality. (#3433) 2024-06-03 03:45:01 -05:00
Ishigh1
3cb5452455 Core: Fix auto-fill in the text client when clicking on a hint suggestion (#3267) 2024-06-01 07:32:41 -05:00
Zach Parks
5aa6ad63ca Core: Remove Universally Unique ID Requirements (Per-Game Data Packages) (#1933) 2024-06-01 06:07:13 -05:00
Doug Hoskisson
d09b214309 Core: Utils.py typing (#3064)
* Core: Utils.py typing

`get_fuzzy_results` typing

There are places that this is called with a `word_list` that is not a `Sequence`, and it is valid (e.g., `set` or `dict`).

To decide the right type, we look at how `word_list` is used:
- the parameter to `len` - requires `__len__`
- the 2nd parameter to `map` - requires `__iter__`

Then we look at https://docs.python.org/3/library/collections.abc.html#collections-abstract-base-classes and ask what is the simplest type that includes both `__len__` and `__iter__`: `Collection`

(Python 3.8 requires using the alias in `typing`, instead of `collections.abc`)

* a bit more typing and cleaning

* fine, take away my fun for something that no one is ever going to see anyway...

Co-authored-by: black-sliver <59490463+black-sliver@users.noreply.github.com>

---------

Co-authored-by: black-sliver <59490463+black-sliver@users.noreply.github.com>
2024-05-23 19:55:45 +02:00
Fabian Dill
2f78860d8c Core/SNIClient/LttP/Factorio: switch to get_settings (#3208) 2024-04-24 06:24:44 +02:00
Fabian Dill
bb16fe284a Core: make open_filename log that it's asking (#3199) 2024-04-23 19:05:03 +02:00
Fabian Dill
feb62b4af2 Core: increment version (#3144) 2024-04-16 02:53:12 +02:00
Fabian Dill
e1038b4431 Core: increment version (#2958) 2024-03-15 13:58:08 +01:00
Silvris
fb9ef19c15 Core: add list/dict merging feature to triggers (#2793)
* proof of concept

* add dict support, block top/game level merge

* prevent key error when option being merged is new

* update triggers guide

* Add documentation about add/remove/replace

* move to trailing name instead of proper tag

* update docs

* confirm types

* Update Utils.py

* Update Generate.py

* pep8

* move to + syntax

* forgot to support sets

* specify received type of type error

* Update Generate.py

Co-authored-by: Fabian Dill <Berserker66@users.noreply.github.com>

* Apply suggestion from review

* add test for update weights

* move test to new test case

* Apply suggestions from code review

Co-authored-by: black-sliver <59490463+black-sliver@users.noreply.github.com>

---------

Co-authored-by: Fabian Dill <Berserker66@users.noreply.github.com>
Co-authored-by: black-sliver <59490463+black-sliver@users.noreply.github.com>
2024-03-12 22:08:12 +01:00
Jérémie Bolduc
a3125cb06e Core: Fix OptionList and OptionSet to allow Iterable of Iterable (#2911)
* fix, maybe

* typegard for iterable of any

* wow I'm so tired I just changed the method name without changing what it actually does...

* also exclude bytes in is_iterable_but_str

* apply pr comments

* Update Utils.py

Co-authored-by: Doug Hoskisson <beauxq@users.noreply.github.com>

* Revert "also exclude bytes in is_iterable_but_str"

This reverts commit cf087d2ee20727dbbe561c8c0f90aa85ef0a5d4b.

---------

Co-authored-by: Doug Hoskisson <beauxq@users.noreply.github.com>
2024-03-12 00:30:14 +01:00
Jérémie Bolduc
37a871eab1 Core: Allow common collections in OptionSet and OptionList constructors (#2874)
* allow common collection in set and list option constructors

* allow any iterable of strings

* add return None

---------

Co-authored-by: beauxq <beauxq@yahoo.com>
2024-03-03 22:30:51 +01:00
black-sliver
c126418f35 Utils: YAML goes brrrt (#2868)
Also tests to validate we dont break the API.
2024-02-27 08:44:34 +01:00
PoryGone
281fe01c25 Core: Purge the evil (world: MultiWorld) (#2749)
* Purge the evil

* Some files didn't save

* Fix a couple of missed string references

* multi_world -> multiworld
2024-02-05 00:38:00 +01:00
Aaron Wagener
7dff09dc1a Options: set old options api before the world is created (#2378) 2023-12-16 22:21:05 +01:00
Zach Parks
cfd2e9c47f Core: Increment Archipelago Version (#2483) 2023-11-22 10:04:10 -06:00
black-sliver
d2e9bfb196 AppImage: allow loading apworlds from ~/Archipelago and copy scripts (#2358)
also fixes some mypy and flake8 violations in worlds/__init__.py
2023-11-04 10:26:51 +01:00
black-sliver
5f5c48e17b Core: fix some memory leak sources without removing caching (#2400)
* Core: fix some memory leak sources

* Core: run gc before detecting memory leaks

* Core: restore caching in BaseClasses.MultiWorld

* SM: move spheres cache to MultiWorld._sm_spheres to avoid memory leak

* Test: add tests for world memory leaks

* Test: limit WorldTestBase leak-check to py>=3.11

---------

Co-authored-by: Fabian Dill <fabian.dill@web.de>
2023-10-31 02:08:56 +01:00
Fabian Dill
3e0d1d4e1c Core: change Region caching to on_change from on-miss-strategy (#2366) 2023-10-29 19:47:37 +01:00
black-sliver
bf46e0e60f Core: deprecate Utils.get_options and remove Utils.get_default_options (#2352)
* Core: deprecate Utils.get_options and remove Utils.get_default_options

* L2AC, Adventure: use settings instead of Utils.get_options
2023-10-28 19:32:12 +02:00
Fabian Dill
0d8a868ed9 Utils: support messagebox on windows without dependencies (#2224) 2023-10-08 22:14:28 +02:00