Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Archipelago WIP #31

Open
wants to merge 243 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 192 commits
Commits
Show all changes
243 commits
Select commit Hold shift + click to select a range
a98cab5
Added Archipelago module, currently has no function
Crazycolbster Jun 8, 2023
3c992f5
Merge pull request #1 from Die4Ever/main
Crazycolbster Jun 9, 2023
d646d8a
Colby learns how Commit works. Several changes
Crazycolbster Jun 19, 2023
4548ff6
Created UI for locations. Fixed small bugs on startup
Crazycolbster Jun 19, 2023
e4cb574
Added onto the UI for the unlocks with multiple tabs
Crazycolbster Jun 19, 2023
027a9e7
Bugfixes. Added lists of locations for Archipelago
Crazycolbster Jun 20, 2023
bffb161
Updated the Location function.
Crazycolbster Jun 20, 2023
5e49b5a
Finished display code for location checks
Crazycolbster Jun 22, 2023
1c2c3d2
Prettied up some code, fixed some bugs
Crazycolbster Jun 24, 2023
5462c4a
Improved Unlock Shop by limiting locations shown
Crazycolbster Jun 24, 2023
27398bd
Created function to move from Locked to Unlocked lists
Crazycolbster Jun 25, 2023
41c48cf
Implemented function to explode guests when used as a currency
Crazycolbster Jun 26, 2023
2e399c4
Finished implementing prereq checks
Crazycolbster Jun 26, 2023
4d248c8
Prettied up some code
Crazycolbster Jun 26, 2023
537ad3f
Forgot to credit Gymnasiast earlier
Crazycolbster Jun 26, 2023
69e444d
Created display code for modular objective system
Crazycolbster Jun 27, 2023
d26cb7c
Improved Check function to handle roller coasters
Crazycolbster Jun 29, 2023
fadab6b
Bug fixes and code improvement
Crazycolbster Jun 29, 2023
98f9b51
Arch proxy program
Die4Ever Jul 9, 2023
f54c46e
try fix workflow, remove tsc
Die4Ever Jul 9, 2023
dec3d90
Merge pull request #3 from Die4Ever/fix_workflow
Crazycolbster Jul 10, 2023
0e9b84a
try fix workflow, remove tsc
Die4Ever Jul 10, 2023
9e6b414
fix errors
Die4Ever Jul 10, 2023
6aff5fa
Merge pull request #4 from Die4Ever/fix_workflow
Crazycolbster Jul 10, 2023
abb8038
Quick bugfix for deathlink on loading a file
Crazycolbster Jul 10, 2023
3d2dba4
Fixed Merge Conflicts
Crazycolbster Jul 10, 2023
26341e8
socket library
Die4Ever Jul 10, 2023
2b05a63
Merge pull request #5 from Die4Ever/socket_library
Crazycolbster Jul 10, 2023
bed4ab5
Fixed a small bug in onStart
Crazycolbster Jul 10, 2023
1f1c0c7
All those dumble little bugs fixed
Crazycolbster Jul 10, 2023
44f84e0
Added a proxy client to let OpenRCT2 connect to the internet
Crazycolbster Jul 11, 2023
2f3df74
Began Interpretation functions.
Crazycolbster Jul 17, 2023
33b0b1a
Further JSON parsing implemented
Crazycolbster Jul 19, 2023
b11eec6
Finished Message list.
Crazycolbster Jul 20, 2023
6c78149
More archipelago function interpretation
Crazycolbster Jul 20, 2023
66f11cc
Added more JSON interpretation.
Crazycolbster Jul 24, 2023
d0cf68d
Added more JSON interpretation
Crazycolbster Jul 24, 2023
72f5467
Made DeathLink run on Tick to work in Multiplayer
Crazycolbster Jul 24, 2023
1ec768d
Added parsing function for park rule checks
Crazycolbster Jul 29, 2023
e408dd7
Set park rules on the start of Archipelago
Crazycolbster Jul 30, 2023
c22c329
Added a send message function to the in-game chat
Crazycolbster Jul 30, 2023
30792f3
Fixed a bug in AddRide
Crazycolbster Aug 7, 2023
2b2fc66
Added checks for land and construction right discounts
Crazycolbster Aug 7, 2023
0792177
Further Arcihpelago message interpretation
Crazycolbster Aug 14, 2023
c08f291
Added further debug functions
Crazycolbster Aug 17, 2023
c22375a
Let chat be sent out to Archipelago game
Crazycolbster Aug 17, 2023
13d7644
Updated DeathLink to notify Archipelago on vehicle crash
Crazycolbster Aug 17, 2023
c1a81d4
fix assignment when intended to chech value
ltsSmitty Aug 18, 2023
5fd4678
add changes to tsconfig
ltsSmitty Aug 18, 2023
b0bbeb2
update tsconfig rules
ltsSmitty Aug 18, 2023
fd889e9
add eslint with "recommended" config
ltsSmitty Aug 18, 2023
0e81da2
Merge pull request #8 from Die4Ever/main
Crazycolbster Aug 22, 2023
4ffd127
Merge pull request #9 from Crazycolbster/main
Crazycolbster Aug 22, 2023
e28445e
Added Location ID to Locked/Unlocked Lists
Crazycolbster Aug 20, 2023
095322e
Broke Archipelago settings into seperate variable
Crazycolbster Aug 22, 2023
7d9929d
Added "Furry Convention" trap. No regrets
Crazycolbster Aug 22, 2023
0e9f21d
Added Spam trap
Crazycolbster Aug 22, 2023
ecda737
Added Monopoly Objective
Crazycolbster Sep 2, 2023
7019f57
Improved Objectives to Include Completion Status
Crazycolbster Sep 2, 2023
a077492
Worked on Networking
Crazycolbster Sep 3, 2023
aee22b7
Merge pull request #6 from ltsSmitty/smitty
Crazycolbster Sep 4, 2023
b9df067
Added receive functions for cash checks
Crazycolbster Sep 5, 2023
0ea821c
Added functions for guests and weather events
Crazycolbster Sep 20, 2023
1b27102
Testing and Debugging the network code
Crazycolbster Sep 24, 2023
3d1616b
Massive improvements to Archipelago communications
Crazycolbster Sep 25, 2023
d494da9
Created function to set settings received from Archipelago
Crazycolbster Sep 27, 2023
da103e9
Minor bugfixes
Crazycolbster Sep 28, 2023
a2ddb8f
Merge remote-tracking branch 'ltsSmitty/linter' into linter-minimal
Die4Ever Sep 30, 2023
8391f1d
Merge pull request #10 from Die4Ever/linter-minimal
Crazycolbster Sep 30, 2023
929c32a
tsconfig.json tweak warnings
Die4Ever Sep 30, 2023
297bbbc
Merge pull request #11 from Die4Ever/linter-minimal
Crazycolbster Sep 30, 2023
8b119b7
api chained receive test
Die4Ever Oct 1, 2023
dd47555
Merge pull request #12 from Die4Ever/api.ts-chained-receive
Crazycolbster Oct 1, 2023
ac94319
Improvements to code readability
Crazycolbster Sep 30, 2023
0180149
Minor readability improvements
Crazycolbster Oct 1, 2023
cfaa309
RecieveArchipelagoItem no longer duplicates already received items
Crazycolbster Oct 1, 2023
55d376e
Fixed tab animations
Crazycolbster Oct 2, 2023
b5f1a13
Started send_location
Crazycolbster Oct 2, 2023
bba7a73
Fix minor issues on location_prices list
Crazycolbster Oct 2, 2023
ebff71f
Started tracking games in multiworld for lists
Crazycolbster Oct 2, 2023
d18476c
Fixed ID_to_Location/Item_Name
Crazycolbster Oct 3, 2023
f12f02f
Fixed issue with purchaseitem where packets were dropped when the sho…
Crazycolbster Oct 3, 2023
da1c9a5
Shop now sends/receives items from server
Crazycolbster Oct 6, 2023
e753d98
Fixed several issues with enums
Crazycolbster Oct 7, 2023
6f11931
Fixed several Issues in the PurchaseItem function
Crazycolbster Oct 8, 2023
4a393f6
Added delay between purchasing items to not break socket
Crazycolbster Oct 8, 2023
e656e81
api.ts packet separators
Die4Ever Oct 9, 2023
84e3710
Merge pull request #13 from Die4Ever/api.ts-packet-separators
Crazycolbster Oct 9, 2023
295b387
Added delay to sending packets while receiving packets
Crazycolbster Oct 10, 2023
94dea55
Fixed error in checking park value
Crazycolbster Oct 10, 2023
f4fd0f1
Sending Deathlink now shows proper player name for cause
Crazycolbster Oct 10, 2023
b039765
Fixed hint text
Crazycolbster Oct 10, 2023
856b53a
Implemented option for preferred intensity.
Crazycolbster Oct 10, 2023
137c773
Attempts to fix runNextTick
Crazycolbster Oct 11, 2023
6661105
Fixed issue with symbols in ScenarioName
Crazycolbster Oct 11, 2023
3c88406
cleanup and fix build
Die4Ever Oct 11, 2023
edf2d97
api.ts callback functions for error and connect
Die4Ever Oct 11, 2023
4c2138e
Merge pull request #14 from Die4Ever/arch-cleanup-fix-build
Crazycolbster Oct 13, 2023
a908d5b
Changed rules to be individualy toggleable
Crazycolbster Oct 13, 2023
2d7e116
Moved preferred_intensity from a universal variable into Archipelago …
Crazycolbster Oct 13, 2023
08a3216
Fixed enum to prevent transport rides from incorrectly returning false
Crazycolbster Oct 16, 2023
42ffb31
Throw shade at games without a built in text client
Crazycolbster Oct 16, 2023
db3991e
Easter eggs and bugfixes
Crazycolbster Oct 18, 2023
4952984
Fixed chat messages from Archipelago update
Crazycolbster Oct 19, 2023
215ba1f
Fixed bug where Deathlink would always activate, regardless of setting
Crazycolbster Oct 21, 2023
ace8ef3
Fixed typos in enums
Crazycolbster Oct 22, 2023
77518cf
Improved PurchaseItem to not lag on ride checks
Crazycolbster Oct 23, 2023
7d645a0
Fixed PurchaseItem to not lag on guest purchases
Crazycolbster Oct 23, 2023
be41ec6
Fixed rule settings to change rules on park with preestablished rules
Crazycolbster Oct 23, 2023
5ae8521
We do a little trolling with the spam traps
Crazycolbster Oct 23, 2023
2c25e84
Fixed bug that considered coasters complete if the condition was ever…
Crazycolbster Oct 26, 2023
a2182ab
Added messages to Deathlink if not provided by sending game
Crazycolbster Oct 28, 2023
b2fb735
Update archipelago_enums.ts
dontjoome Nov 1, 2023
6a543e6
Merge pull request #15 from dontjoome/patch-1
Crazycolbster Nov 2, 2023
0f991d5
some cleanup
Die4Ever Nov 16, 2023
f104792
research items shuffle rides separately from scenery
Die4Ever Nov 16, 2023
56845f9
Update archipelago_enums.ts
dontjoome Nov 26, 2023
6f15c2e
Merge pull request #18 from dontjoome/General_Killmore
Crazycolbster Nov 26, 2023
cb84f96
Merge pull request #17 from Die4Ever/arch-some-cleanup-11-16
Crazycolbster Nov 26, 2023
df12270
Quick fix for a death message color
Crazycolbster Dec 3, 2023
af7a91a
Fixed issue for exceptionally large games where lists wouldn't send
Crazycolbster Dec 4, 2023
f9975f0
Added messages to the unlock shop when items are still downloading
Crazycolbster Dec 4, 2023
b4a2a5c
Added text commands to chat for toggling deathlink. Added censor for …
Crazycolbster Dec 4, 2023
e614c91
Color coded items in the unlock shop for easy identification for hints
Crazycolbster Dec 6, 2023
10a749b
Added Unique Rides objective type
Crazycolbster Dec 11, 2023
8d045e1
Added progress bar for initial unlock shop setup to help with debugging
Crazycolbster Dec 25, 2023
bfe85e1
Fixed a bug where ghosts would count for unique ride objective
Crazycolbster Dec 25, 2023
0f36a1c
Fixed bug where unique rides would display as an objective even if di…
Crazycolbster Dec 26, 2023
77fe706
Added option to only display item received messages directly related …
Crazycolbster Dec 26, 2023
98b2c6f
Added feature for Furry removal
Crazycolbster Dec 31, 2023
4c4ab9a
Added explodeFurries function
Crazycolbster Dec 31, 2023
741c6b9
Improved code on explodeFurries.
Crazycolbster Jan 2, 2024
427cca0
Added option to request all games at once or split for larger multiwo…
Crazycolbster Jan 2, 2024
a621988
New quiz question
Crazycolbster Jan 9, 2024
a04beb6
New trivia
Crazycolbster Jan 11, 2024
4f5aa9a
Attempting to purchase checks without enough rides will now show you …
Crazycolbster Jan 11, 2024
9138398
Added funny effects to furries being sent to Shadow Realm
Crazycolbster Jan 15, 2024
c9f44b9
New Quiz Question
Crazycolbster Jan 15, 2024
b354982
New Quiz question
Crazycolbster Jan 15, 2024
8e406d7
Quick fix for those not on latest develop of OpenRCT2
Crazycolbster Jan 15, 2024
170c9e7
Finished progressive game speed checks
Crazycolbster Jan 16, 2024
f6a607c
Fixed overlap of wrong park message and split item requests
Crazycolbster Jan 16, 2024
de3be86
New Quiz Question
Crazycolbster Jan 16, 2024
961a34c
Quick fix because Past Colby forgot half of the programming
Crazycolbster Jan 16, 2024
2065347
Past Colby Really needs to quit programming distracted under a time c…
Crazycolbster Jan 16, 2024
4983239
Bug fix where Spam Trap wasn't occuring
Crazycolbster Jan 16, 2024
0025e06
Added command to set maximum speed
Crazycolbster Jan 23, 2024
2de040f
Fixed a bug where Spiral Roller Coaster wouldn't register as a ride
Crazycolbster Jan 29, 2024
f717ecf
Stupid Typing in TypeScript
Crazycolbster Jan 29, 2024
5c7b103
Updated API Target
Crazycolbster Feb 5, 2024
9c1b500
Fixed bug where starting Archipelago on a no money park would have to…
Crazycolbster Feb 6, 2024
721bb52
Fixed an error where checkObjectives would read the wrong values for …
Crazycolbster Feb 8, 2024
7284a9c
Added a value to players to track if they've completed their goal.
Crazycolbster Feb 13, 2024
0c05f4f
Added redundancy to ensure victory guarantees the compeleted goal sig…
Crazycolbster Feb 13, 2024
bc510ca
Deathlink message now displays the correct player name and ride name
Crazycolbster Feb 14, 2024
aced274
Universal item notifications disabled by default
Crazycolbster Feb 14, 2024
caa5f2d
All games now have multiple requests since the connectors working better
Crazycolbster Feb 14, 2024
65c16f4
Added command to resend every check
Crazycolbster Feb 17, 2024
8813adc
Added "None" option to randomization range, with Archipelago support
Crazycolbster Feb 18, 2024
2ba9c2a
Fixed glitch when client disconnects and reconnects to server mid-game
Crazycolbster Feb 19, 2024
04c8dab
Hopefully fixed issue when reconnecting
Crazycolbster Feb 22, 2024
9054c70
P*ck off typing checks
Crazycolbster Feb 22, 2024
17f9ce2
New quiz question! :D
Crazycolbster Feb 26, 2024
f9e4c51
Set unlock all prices on Archipelago games
Crazycolbster Feb 26, 2024
3bd519e
Typescript you faltu. Fixed a little comma
Crazycolbster Feb 26, 2024
1563d26
Included option to totally ignore ride stat changes
Crazycolbster Feb 26, 2024
1fc3fcd
Converted no money scenarios now give guests cash
Crazycolbster Feb 27, 2024
a09e06d
Improved Death Link Rain Check
Crazycolbster Feb 27, 2024
b11b0af
Added Archipelago Madness Scenarios
Crazycolbster Feb 27, 2024
1d275ae
Nothing. I've added nothing
Crazycolbster Feb 29, 2024
ba25ca6
Added new scenarios
Crazycolbster Feb 29, 2024
dd5db2a
Improved gamestart. Hopefully won't break as often.
Crazycolbster Mar 3, 2024
329b7c7
Added location hints if full visibility is on
Crazycolbster Mar 3, 2024
081d42f
It would appear that my checking for duplicating rides was...duplicat…
Crazycolbster Mar 4, 2024
708c492
Possibly a fix for starting ride not appearing on Windows
Crazycolbster Mar 4, 2024
634d5fe
Added hint tracking to the Unlock shop
Crazycolbster Mar 5, 2024
8fb7516
Fixed typo in Schneider Cup
Crazycolbster Mar 5, 2024
8cb7b07
New quiz question
Crazycolbster Mar 5, 2024
9374099
Added Skip button to unlock shop
Crazycolbster Mar 10, 2024
51714df
New quiz question/Spam messages
Crazycolbster Mar 11, 2024
0b2eca7
Added optional code functionality onto spam ads.
Crazycolbster Mar 11, 2024
b7efb67
Added 'HOME' as a shortcut to the Unlock shop
Crazycolbster Mar 11, 2024
067108c
Possible fix to items appearing as "Undefined"
Crazycolbster Mar 11, 2024
99a0442
Skips are now usable even when guest/cash prereqs aren't met
Crazycolbster Mar 11, 2024
9c6bfc0
Added option to include Cash Machine and First Aid Room to parks tha…
Crazycolbster Mar 15, 2024
532ceae
!!resendChecks now syncs on both ends
Crazycolbster Mar 16, 2024
e67b1c5
Removed buggy DataPackage code
Crazycolbster Mar 18, 2024
371b853
Added custom sprites for Archipelago
Crazycolbster Mar 23, 2024
56d13b2
Plastered the Archipelago logo everywhere on the UI
Crazycolbster Mar 24, 2024
5f21fc5
Slight change in hints (Need to improve further)
Crazycolbster Apr 28, 2024
5b085a8
Past Colby forgot to add the new coaster to the ride list
Crazycolbster Apr 28, 2024
5649f57
Quick fix for games getting stuck at 4/4 requests or whatever. Now an…
Crazycolbster Apr 30, 2024
3836ad8
less extreme ride type stats rando
Die4Ever May 5, 2024
b3647a5
update to OpenRCT2 v0.4.11, improved pause game detection
Die4Ever May 5, 2024
0309124
Merge branch 'General_Killmore' into openrct2-v0.4.11
Die4Ever May 5, 2024
64dbecd
tweak ride type excitement rando strength
Die4Ever May 5, 2024
041da9e
Fixed Issue of hints not reading (hopefully)
Crazycolbster May 6, 2024
13d167a
Merge pull request #19 from Die4Ever/openrct2-v0.4.11
Crazycolbster May 6, 2024
262b498
Networking Updates
Crazycolbster May 6, 2024
2e9f929
api.ts send queue
Die4Ever May 7, 2024
1305409
Merge pull request #20 from Die4Ever/api.ts-send-queue
Crazycolbster May 7, 2024
83098fa
GetRideTypeMultipliers function
Die4Ever May 8, 2024
aaca47b
Improved Connection
Crazycolbster May 13, 2024
47b0ed4
Added new popups
Crazycolbster May 14, 2024
2e1723a
Changed start order to at least let something be playable on large games
Crazycolbster May 19, 2024
098daba
Merge pull request #21 from Die4Ever/GetRideTypeMultipliers
Crazycolbster May 22, 2024
7787af2
Fixed deathlink and made it more potent
Crazycolbster May 20, 2024
93424df
Fixed game-breaking typo. Create unlocked list now uses the unlocked …
Crazycolbster May 25, 2024
804d5b7
archipelago ping command for testing, respond with pong
Die4Ever May 27, 2024
07458c9
Merge pull request #22 from Die4Ever/arch-cmd-ping
Crazycolbster May 27, 2024
327963f
Added better error checking for future debugging
Crazycolbster May 26, 2024
7fd5e07
Improved inital request for game data, hopefully improving stability,…
Crazycolbster May 27, 2024
0b6fae4
api.ts cleanup logging
Die4Ever May 27, 2024
0c1ec2d
Merge pull request #23 from Die4Ever/arch-cmd-ping
Crazycolbster May 27, 2024
4192ca4
Improved initial game start by only requesting 1 games information at…
Crazycolbster May 27, 2024
58e574b
Fixed bug where new games wouldn't properly receive item lists
Crazycolbster May 27, 2024
4d4cfec
If progress has been made on the server, it will be reflected in any …
Crazycolbster May 28, 2024
7693e65
fix automated tests
Die4Ever May 28, 2024
59b9e18
Added better error checking for future debugging
Crazycolbster May 26, 2024
9af1e75
Improved inital request for game data, hopefully improving stability,…
Crazycolbster May 27, 2024
2a0309e
Improved initial game start by only requesting 1 games information at…
Crazycolbster May 27, 2024
89eaf0b
Fixed bug where new games wouldn't properly receive item lists
Crazycolbster May 27, 2024
fa24f83
If progress has been made on the server, it will be reflected in any …
Crazycolbster May 28, 2024
c97eedd
Merge branch 'General_Killmore' into arch-cmd-ping
Die4Ever May 28, 2024
5adf4e3
Merge pull request #24 from Die4Ever/arch-cmd-ping
Crazycolbster May 28, 2024
7cf0a9d
Added Trace Function
Crazycolbster May 28, 2024
706ef4b
Added safety to sent packages.
Crazycolbster May 28, 2024
69f78ea
Put OpenRCT2 on the list of received games, since we already have all…
Crazycolbster Jun 1, 2024
4356406
Accidentally put item list under full_location_id_to_name instead of …
Crazycolbster Jun 1, 2024
09411c6
Added location_name_to_id dictionary for OpenRCT2 in the code
Crazycolbster Jun 3, 2024
8349811
Added check to make sure unlock shop was properly received. Resends r…
Crazycolbster Jun 3, 2024
5d69e8f
Upgraded bonuses for guests represtenting players that have beaten th…
Crazycolbster Jun 4, 2024
0d836a5
Fixed bug where receiving a deathlink could send one in turn if the g…
Crazycolbster Jun 9, 2024
a56491f
Fixed bug where players collecting their items causes multiple items …
Crazycolbster Jun 10, 2024
b83c5f5
Added color coding to signify if a ride is unlocked or has been built…
Crazycolbster Jun 10, 2024
1d5eca8
Highlight ride status for uncompleted requirements for checks
Crazycolbster Jun 11, 2024
e39aab6
Changed Red Branch to Black Branch
Crazycolbster Jun 11, 2024
fecbec6
Ignore this commit
Crazycolbster Jun 11, 2024
7534d46
New ads
Crazycolbster Jun 25, 2024
d78ad7a
Added Quizzes
Crazycolbster Jul 8, 2024
ac4ddad
Changed the Seret Word
Crazycolbster Jul 9, 2024
cd08b30
Fixed a bug where a Chairlift with only 1 station doesn't count as a …
Crazycolbster Jul 23, 2024
c70345b
Fixed a glitch where guest intensity preferences would change to one …
Crazycolbster Jul 23, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"env": {
"browser": true,
"es2021": true
},
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended"
],
"overrides": [
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": "latest",
"sourceType": "module"
},
"plugins": [
"@typescript-eslint"
],
"rules": {
}
}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -105,3 +105,4 @@ dist

# TernJS port file
.tern-port
FormatCodes.cpp
2,607 changes: 2,583 additions & 24 deletions package-lock.json

Large diffs are not rendered by default.

6 changes: 5 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,15 @@
"scripts": {
"build": "tsc",
"watch": "tsc --watch --outFile %USERPROFILE%/Documents/OpenRCT2/plugin/rctrando.js",
"watchLinux": "tsc --watch --outFile ~/.config/OpenRCT2/plugin/rctrando.js",
"minify": "uglifyjs --compress --mangle --output out/rctrando.min.js -- out/rctrando.js",
"build-release": "npm run build"
},
"devDependencies": {
"typescript": "^4.6.3",
"@typescript-eslint/eslint-plugin": "^6.4.0",
"@typescript-eslint/parser": "^6.4.0",
"eslint": "^8.47.0",
"typescript": "^4.9.5",
"uglify-js": "^3.15.3"
}
}
Binary file added src/Archipelago Madness (Expansions).park
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we need these .park files in the repo? what are they for?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can probably move these to the release. They're the custom maps specifically made for Archipelago

Binary file not shown.
Binary file added src/Archipelago Madness (RCT2 Vanilla).park
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this .park file too

Binary file not shown.
55 changes: 53 additions & 2 deletions src/OpenRCT2-CrowdControl/CCAds.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ interface Ad {
title: string,
header: string,
message: string,
button: string
button: string,
onClick?: Function
}

const adPool: Ad[] = [
Expand Down Expand Up @@ -126,6 +127,55 @@ const adPool: Ad[] = [
header: "Here is your download:",
message: "openrct3.dat (43.5 mB)",
button: "DOWNLOAD"
},
{
title: "CLOSE THIS WINDOW!",
header: "Tired of the buttons not closing these windows?",
message: "Fix it today!",
button: "Click here!"
},
{
title: "Archipelago",
header: "Have you checked your tracker?",
message: "do it.",
button: "Finish Sphere 1"
},
{
title: "",
header: "",
message: "",
button: ""
},
{
title: "DANGER",
header: "Don't click this button!",
message: "It's extremely hazardous!",
button: "SEND DEATHLINK",
onClick: () =>
{try{
var DeathLink = GetModule("RCTRArchipelago") as RCTRArchipelago;
DeathLink.SendDeathLink(null,"A popup window with the text \"SEND DEATHLINK\"");}
catch{ui.showError("Archipelago not open", "You should try this while playing Archipelago!")}
ui.closeAllWindows()}//We don't know the ID, so close everything. Besides, it "Crashed"
},
{
title: "Freedom!",
header: "This game is sponsored by Linux Mint!",
message: "Linux is vastly superior to Windows!",
button: "Upgrade today!",
onClick: () => {archipelago_print_message("Go to LinuxMint.com and click \"Download\"")}
},
{
title: "Lorem ipsum",
header: "Aliquam euismod, risus vel ultricies ornare",
message: "Nam feugiat est in diam maximus consectetur.",
button: "Phasellus imperdiet auctor nisi."
},
{
title: "Uh oh!",
header: "Something broke!",
message: "TELL COLBY RIGHT NOW!",
button: "CALL 1-800-FIX-IT-4-U!"
}
]

Expand Down Expand Up @@ -163,7 +213,8 @@ function showAd(ad: Ad): void {
y: 75,
width: 300,
height: 25,
text: ad.button
text: ad.button,
onClick: ad.onClick as () => void || (() => { console.log("No button code provided"); })
}
]
});
Expand Down
219 changes: 219 additions & 0 deletions src/api.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,219 @@

class APIConnection
{
sock:Socket = null;
good: boolean = false;
reconnect_interval: number = null;
name:string = "API";
port:number;
callback:CallableFunction;
errorCallback:CallableFunction;
connectCallback:CallableFunction;
onCloseCallback: (hadError: any) => void;
onExpectedCloseCallback: (hadError: any) => void;
onErrorCallback: (hadError: any) => void;
onDataCallback: (hadError: any) => void;
buffer:string = "";

constructor(name:string, port:number, callback:CallableFunction, errorCallback?:CallableFunction, connectCallback?:CallableFunction) {
this.name = name;
this.port = port;
this.callback = callback;
this.errorCallback = errorCallback;
this.connectCallback = connectCallback;

var self = this;
this.onCloseCallback = function(hadError){self.onClose(hadError);};
this.onExpectedCloseCallback = function(hadError){self.onExpectedClose(hadError);}
this.onErrorCallback = function(hadError){self.onError(hadError);};
this.onDataCallback = function(hadError){self.onData(hadError);};

this.connect();
}

send(data:Object) {
try {
let r: string = JSON.stringify(data) + '\0';
info(this.name+' sending:', r.length, r);
this.end(r);
} catch(e) {
printException('error sending '+this.name, e);
}
}

destroy() {
if(!this.sock) return;

info(this.name+'.destroy()');
try {
this.sock.off('close', this.onCloseCallback);
} catch(e) {
printException('error closing event handlers in '+this.name+'.close', e);
}

try {
this.sock.off('close', this.onExpectedCloseCallback);
} catch(e) {
printException('error closing event handlers in '+this.name+'.close', e);
}

try {
this.sock.destroy(null);
} catch(e) {
printException('error destroying old '+this.name+' connection ', e);
}

this.sock = null;
}

private onError(hadError: boolean) {
info('error in '+this.name+' connection, will keep trying...');
if(this.good) {
park.postMessage(
{type: 'blank', text: 'error in '+this.name+' connection, will keep trying...'} as ParkMessageDesc
);
}
if(this.errorCallback) {
this.errorCallback();
}
this.good = false;
this.connect();
}

private onClose(hadError: boolean) {
info(this.name+' connection closed, will keep trying...');
if(this.good) {
park.postMessage(
{type: 'blank', text: this.name+' connection closed, will keep trying...'} as ParkMessageDesc
);
}
this.good = false;
this.connect();
}

private onExpectedClose(hadError: boolean) {
info(this.name+' connection closed cc_onExpectedClose, will keep trying...');
this.good = true;
this.connect();
}

private reconnect() {
debug(this.name+' reconnecting...');
this.connect();
}

private onData(message: string) {
let data: Object = null;
let resp: Object = null;

let packets = message.split('\0')
message = packets[0];

// try
try {
data = JSON.parse(message);
this.buffer = "";
} catch(e) {
try {
this.buffer += message;
data = JSON.parse(this.buffer);
this.buffer = "";
}
catch(e) {
printException('error parsing '+this.name+' request JSON: ' + message, e);
return;
}
}

try {
info(this.name+" received data: ", data);
resp = this.callback(data);
// this.send(resp);
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks like this needs to be uncommented? maybe checking if(resp)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It’s been a couple months, but to my memory, sending the response immediately seemed to break the connection and error out the client. Uncommenting it always seems to break the program the moment a package is received.

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// this.send(resp);
if(resp) this.send(resp);

} catch(e) {
printException('error handling '+this.name+' request: ' + message, e);
}

if(packets.length > 1) {
packets = packets.slice(1);
message = packets.join('\0');
if(message.length > 1) {
this.onData(message);
}
}
}

private reset_timeout() {
if(this.reconnect_interval !== null) {
context.clearInterval(this.reconnect_interval);
this.reconnect_interval = null;
}

//this.reconnect_interval = context.setInterval(this.end, 5000);
}

private end(data?:string) {
if(!this.sock) return;

info(this.name+'.end()');
try {
this.sock.off('close', this.onCloseCallback);
this.sock.on('close', this.onExpectedCloseCallback);
} catch(e) {
printException('error closing event handlers in '+this.name+'.close', e);
}

try {
data = data ? data : '{"id": 0, "status": 0}\0';
info(this.name+'.sock.end('+data+')');
this.sock.end(data);
} catch(e) {
printException('error closing old '+this.name+' connection ', e);
}

try {
this.sock.destroy(null);
} catch(e) {
printException('error destroying old '+this.name+' connection ', e);
}

this.reset_timeout();
this.good = true;
}

private connect() {
var self = this;

if (network.mode == "server") {
//info("This is a server...");
} else if (network.mode == "client") {
//info("This is a client...");
return;
} else {
//info("This is single player...");
}

this.reset_timeout();
this.destroy();

info(this.name+'.connect');
this.sock = network.createSocket();

this.sock.connect(this.port, '127.0.0.1', function() {
if(!self.good) {
info(self.name+' connected to port '+self.port);
park.postMessage(
{type: 'blank', text: self.name+' connected!'} as ParkMessageDesc
);
if(self.connectCallback) {
self.connectCallback();
}
}
self.good = true;
});
this.sock.setNoDelay(true);

this.sock.on('error', this.onErrorCallback);
this.sock.on('close', this.onCloseCallback);
this.sock.on('data', this.onDataCallback);
}
}
Loading