Skip to content

Commit 36c20bb

Browse files
authored
Merge pull request #7 from threeandthreee/sync/Update-to-0.5.0
Sync/Updated to 0.5.0
2 parents cfc07b5 + ede5542 commit 36c20bb

File tree

610 files changed

+247622
-11458
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

610 files changed

+247622
-11458
lines changed

.github/workflows/build.yml

Lines changed: 54 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,15 @@ jobs:
3636
run: |
3737
Invoke-WebRequest -Uri https://github.com/Ijwu/Enemizer/releases/download/${Env:ENEMIZER_VERSION}/win-x64.zip -OutFile enemizer.zip
3838
Expand-Archive -Path enemizer.zip -DestinationPath EnemizerCLI -Force
39+
choco install innosetup --version=6.2.2 --allow-downgrade
3940
- name: Build
4041
run: |
4142
python -m pip install --upgrade pip
4243
python setup.py build_exe --yes
44+
if ( $? -eq $false ) {
45+
Write-Error "setup.py failed!"
46+
exit 1
47+
}
4348
$NAME="$(ls build | Select-String -Pattern 'exe')".Split('.',2)[1]
4449
$ZIP_NAME="Archipelago_$NAME.7z"
4550
echo "$NAME -> $ZIP_NAME"
@@ -49,12 +54,6 @@ jobs:
4954
Rename-Item "exe.$NAME" Archipelago
5055
7z a -mx=9 -mhe=on -ms "../dist/$ZIP_NAME" Archipelago
5156
Rename-Item Archipelago "exe.$NAME" # inno_setup.iss expects the original name
52-
- name: Store 7z
53-
uses: actions/upload-artifact@v4
54-
with:
55-
name: ${{ env.ZIP_NAME }}
56-
path: dist/${{ env.ZIP_NAME }}
57-
retention-days: 7 # keep for 7 days, should be enough
5857
- name: Build Setup
5958
run: |
6059
& "${env:ProgramFiles(x86)}\Inno Setup 6\iscc.exe" inno_setup.iss /DNO_SIGNTOOL
@@ -65,11 +64,38 @@ jobs:
6564
$contents = Get-ChildItem -Path setups/*.exe -Force -Recurse
6665
$SETUP_NAME=$contents[0].Name
6766
echo "SETUP_NAME=$SETUP_NAME" >> $Env:GITHUB_ENV
67+
- name: Check build loads expected worlds
68+
shell: bash
69+
run: |
70+
cd build/exe*
71+
mv Players/Templates/meta.yaml .
72+
ls -1 Players/Templates | sort > setup-player-templates.txt
73+
rm -R Players/Templates
74+
timeout 30 ./ArchipelagoLauncher "Generate Template Options" || true
75+
ls -1 Players/Templates | sort > generated-player-templates.txt
76+
cmp setup-player-templates.txt generated-player-templates.txt \
77+
|| diff setup-player-templates.txt generated-player-templates.txt
78+
mv meta.yaml Players/Templates/
79+
- name: Test Generate
80+
shell: bash
81+
run: |
82+
cd build/exe*
83+
cp Players/Templates/Clique.yaml Players/
84+
timeout 30 ./ArchipelagoGenerate
85+
- name: Store 7z
86+
uses: actions/upload-artifact@v4
87+
with:
88+
name: ${{ env.ZIP_NAME }}
89+
path: dist/${{ env.ZIP_NAME }}
90+
compression-level: 0 # .7z is incompressible by zip
91+
if-no-files-found: error
92+
retention-days: 7 # keep for 7 days, should be enough
6893
- name: Store Setup
6994
uses: actions/upload-artifact@v4
7095
with:
7196
name: ${{ env.SETUP_NAME }}
7297
path: setups/${{ env.SETUP_NAME }}
98+
if-no-files-found: error
7399
retention-days: 7 # keep for 7 days, should be enough
74100

75101
build-ubuntu2004:
@@ -110,23 +136,44 @@ jobs:
110136
echo -e "setup.py dist output:\n `ls dist`"
111137
cd dist && export APPIMAGE_NAME="`ls *.AppImage`" && cd ..
112138
export TAR_NAME="${APPIMAGE_NAME%.AppImage}.tar.gz"
113-
(cd build && DIR_NAME="`ls | grep exe`" && mv "$DIR_NAME" Archipelago && tar -czvf ../dist/$TAR_NAME Archipelago && mv Archipelago "$DIR_NAME")
139+
(cd build && DIR_NAME="`ls | grep exe`" && mv "$DIR_NAME" Archipelago && tar -cv Archipelago | gzip -8 > ../dist/$TAR_NAME && mv Archipelago "$DIR_NAME")
114140
echo "APPIMAGE_NAME=$APPIMAGE_NAME" >> $GITHUB_ENV
115141
echo "TAR_NAME=$TAR_NAME" >> $GITHUB_ENV
116142
# - copy code above to release.yml -
117143
- name: Build Again
118144
run: |
119145
source venv/bin/activate
120146
python setup.py build_exe --yes
147+
- name: Check build loads expected worlds
148+
shell: bash
149+
run: |
150+
cd build/exe*
151+
mv Players/Templates/meta.yaml .
152+
ls -1 Players/Templates | sort > setup-player-templates.txt
153+
rm -R Players/Templates
154+
timeout 30 ./ArchipelagoLauncher "Generate Template Options" || true
155+
ls -1 Players/Templates | sort > generated-player-templates.txt
156+
cmp setup-player-templates.txt generated-player-templates.txt \
157+
|| diff setup-player-templates.txt generated-player-templates.txt
158+
mv meta.yaml Players/Templates/
159+
- name: Test Generate
160+
shell: bash
161+
run: |
162+
cd build/exe*
163+
cp Players/Templates/Clique.yaml Players/
164+
timeout 30 ./ArchipelagoGenerate
121165
- name: Store AppImage
122166
uses: actions/upload-artifact@v4
123167
with:
124168
name: ${{ env.APPIMAGE_NAME }}
125169
path: dist/${{ env.APPIMAGE_NAME }}
170+
if-no-files-found: error
126171
retention-days: 7
127172
- name: Store .tar.gz
128173
uses: actions/upload-artifact@v4
129174
with:
130175
name: ${{ env.TAR_NAME }}
131176
path: dist/${{ env.TAR_NAME }}
177+
compression-level: 0 # .gz is incompressible by zip
178+
if-no-files-found: error
132179
retention-days: 7

.github/workflows/ctest.yml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# Run CMake / CTest C++ unit tests
2+
3+
name: ctest
4+
5+
on:
6+
push:
7+
paths:
8+
- '**.cc?'
9+
- '**.cpp'
10+
- '**.cxx'
11+
- '**.hh?'
12+
- '**.hpp'
13+
- '**.hxx'
14+
- '**.CMakeLists'
15+
- '.github/workflows/ctest.yml'
16+
pull_request:
17+
paths:
18+
- '**.cc?'
19+
- '**.cpp'
20+
- '**.cxx'
21+
- '**.hh?'
22+
- '**.hpp'
23+
- '**.hxx'
24+
- '**.CMakeLists'
25+
- '.github/workflows/ctest.yml'
26+
27+
jobs:
28+
ctest:
29+
runs-on: ${{ matrix.os }}
30+
name: Test C++ ${{ matrix.os }}
31+
32+
strategy:
33+
fail-fast: false
34+
matrix:
35+
os: [ubuntu-latest, windows-latest]
36+
37+
steps:
38+
- uses: actions/checkout@v4
39+
- uses: ilammy/msvc-dev-cmd@v1
40+
if: startsWith(matrix.os,'windows')
41+
- uses: Bacondish2023/setup-googletest@v1
42+
with:
43+
build-type: 'Release'
44+
- name: Build tests
45+
run: |
46+
cd test/cpp
47+
mkdir build
48+
cmake -S . -B build/ -DCMAKE_BUILD_TYPE=Release
49+
cmake --build build/ --config Release
50+
ls
51+
- name: Run tests
52+
run: |
53+
cd test/cpp
54+
ctest --test-dir build/ -C Release --output-on-failure

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ jobs:
6969
echo -e "setup.py dist output:\n `ls dist`"
7070
cd dist && export APPIMAGE_NAME="`ls *.AppImage`" && cd ..
7171
export TAR_NAME="${APPIMAGE_NAME%.AppImage}.tar.gz"
72-
(cd build && DIR_NAME="`ls | grep exe`" && mv "$DIR_NAME" Archipelago && tar -czvf ../dist/$TAR_NAME Archipelago && mv Archipelago "$DIR_NAME")
72+
(cd build && DIR_NAME="`ls | grep exe`" && mv "$DIR_NAME" Archipelago && tar -cv Archipelago | gzip -8 > ../dist/$TAR_NAME && mv Archipelago "$DIR_NAME")
7373
echo "APPIMAGE_NAME=$APPIMAGE_NAME" >> $GITHUB_ENV
7474
echo "TAR_NAME=$TAR_NAME" >> $GITHUB_ENV
7575
# - code above copied from build.yml -

.github/workflows/unittests.yml

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ on:
2424
- '.github/workflows/unittests.yml'
2525

2626
jobs:
27-
build:
27+
unit:
2828
runs-on: ${{ matrix.os }}
2929
name: Test Python ${{ matrix.python.version }} ${{ matrix.os }}
3030

@@ -60,3 +60,32 @@ jobs:
6060
- name: Unittests
6161
run: |
6262
pytest -n auto
63+
64+
hosting:
65+
runs-on: ${{ matrix.os }}
66+
name: Test hosting with ${{ matrix.python.version }} on ${{ matrix.os }}
67+
68+
strategy:
69+
matrix:
70+
os:
71+
- ubuntu-latest
72+
python:
73+
- {version: '3.11'} # current
74+
75+
steps:
76+
- uses: actions/checkout@v4
77+
- name: Set up Python ${{ matrix.python.version }}
78+
uses: actions/setup-python@v5
79+
with:
80+
python-version: ${{ matrix.python.version }}
81+
- name: Install dependencies
82+
run: |
83+
python -m venv venv
84+
source venv/bin/activate
85+
python -m pip install --upgrade pip
86+
python ModuleUpdate.py --yes --force --append "WebHostLib/requirements.txt"
87+
- name: Test hosting
88+
run: |
89+
source venv/bin/activate
90+
export PYTHONPATH=$(pwd)
91+
python test/hosting/__main__.py

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ Output Logs/
6262
/installdelete.iss
6363
/data/user.kv
6464
/datapackage
65+
/custom_worlds
6566

6667
# Byte-compiled / optimized / DLL files
6768
__pycache__/
@@ -177,6 +178,7 @@ dmypy.json
177178
cython_debug/
178179

179180
# Cython intermediates
181+
_speedups.c
180182
_speedups.cpp
181183
_speedups.html
182184

AHITClient.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
from worlds.ahit.Client import launch
2+
import Utils
3+
import ModuleUpdate
4+
ModuleUpdate.update()
5+
6+
if __name__ == "__main__":
7+
Utils.init_logging("AHITClient", exception_logger="Client")
8+
launch()

AdventureClient.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ def __init__(self, server_address, password):
8080
self.local_item_locations = {}
8181
self.dragon_speed_info = {}
8282

83-
options = Utils.get_options()
83+
options = Utils.get_settings()
8484
self.display_msgs = options["adventure_options"]["display_msgs"]
8585

8686
async def server_auth(self, password_requested: bool = False):
@@ -102,7 +102,7 @@ def _set_message(self, msg: str, msg_id: int):
102102
def on_package(self, cmd: str, args: dict):
103103
if cmd == 'Connected':
104104
self.locations_array = None
105-
if Utils.get_options()["adventure_options"].get("death_link", False):
105+
if Utils.get_settings()["adventure_options"].get("death_link", False):
106106
self.set_deathlink = True
107107
async_start(self.get_freeincarnates_used())
108108
elif cmd == "RoomInfo":
@@ -112,7 +112,7 @@ def on_package(self, cmd: str, args: dict):
112112
if ': !' not in msg:
113113
self._set_message(msg, SYSTEM_MESSAGE_ID)
114114
elif cmd == "ReceivedItems":
115-
msg = f"Received {', '.join([self.item_names[item.item] for item in args['items']])}"
115+
msg = f"Received {', '.join([self.item_names.lookup_in_game(item.item) for item in args['items']])}"
116116
self._set_message(msg, SYSTEM_MESSAGE_ID)
117117
elif cmd == "Retrieved":
118118
if f"adventure_{self.auth}_freeincarnates_used" in args["keys"]:
@@ -415,8 +415,8 @@ async def atari_sync_task(ctx: AdventureContext):
415415

416416

417417
async def run_game(romfile):
418-
auto_start = Utils.get_options()["adventure_options"].get("rom_start", True)
419-
rom_args = Utils.get_options()["adventure_options"].get("rom_args")
418+
auto_start = Utils.get_settings()["adventure_options"].get("rom_start", True)
419+
rom_args = Utils.get_settings()["adventure_options"].get("rom_args")
420420
if auto_start is True:
421421
import webbrowser
422422
webbrowser.open(romfile)

0 commit comments

Comments
 (0)