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

Add Squirrel code for HTTP requests #531

Merged
merged 25 commits into from
Dec 13, 2022

Conversation

Erlite
Copy link
Contributor

@Erlite Erlite commented Nov 27, 2022

Required by R2Northstar/NorthstarLauncher/#344, adds the Squirrel functions required to make HTTP requests for mods and gamemodes.

Available on client, servers and UI code.

Please check the launcher PR for more information.

Copy link
Contributor

@uniboi uniboi left a comment

Choose a reason for hiding this comment

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

the script itself is good but the formatting doesn't follow the respawn way

@Erlite
Copy link
Contributor Author

Erlite commented Dec 2, 2022

I hate you.

Copy link
Contributor

@ASpoonPlaysGames ASpoonPlaysGames left a comment

Choose a reason for hiding this comment

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

More formatting, just a couple things that got missed

Erlite and others added 3 commits December 2, 2022 17:37
Co-authored-by: Jack <66967891+ASpoonPlaysGames@users.noreply.github.com>
…tarMods into squirrel-http-main

# Conflicts:
#	Northstar.Custom/mod/scripts/vscripts/sh_northstar_http_requests.gnut
@Erlite
Copy link
Contributor Author

Erlite commented Dec 4, 2022

Changed the success callback to use the HttpRequestResponse struct now. It also parses raw headers into a table of key -> values for ease of use.

Most of the stuff I'll be pushing now are just QoL so merge whenever. I'm using Spyglass for testing and it runs fine.
image

Copy link
Contributor

@uniboi uniboi left a comment

Choose a reason for hiding this comment

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

this should be Northstar.Client as it doesn't provide custom content but client functionality. A server may be running without Northstar.Custom which could cause client mods that need http request to compile error

@Erlite
Copy link
Contributor Author

Erlite commented Dec 5, 2022

this should be Northstar.Client as it doesn't provide custom content but client functionality

Negative, it's both client, server and UI and I don't want to dupe code. We did have talks about a Northstar.Shared mod once, or rather lightly talked about it, for code that is shared between all realms. For now it might as well stick here unless I get given the green light to add a mod.

Copy link
Contributor

@uniboi uniboi left a comment

Choose a reason for hiding this comment

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

bro

@uniboi
Copy link
Contributor

uniboi commented Dec 5, 2022

Odd.Querschitt.zip
testing mod. call script_ui httpTest() in the console to request some data. The test script is in t_scripts.nut

image
it only prints the first few because the ones with children exceed the string char limit but I think it's clear that this works

Copy link
Contributor

@ASpoonPlaysGames ASpoonPlaysGames left a comment

Choose a reason for hiding this comment

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

boy do i love formatting

@Erlite
Copy link
Contributor Author

Erlite commented Dec 5, 2022

Boy do I hate you >:[

Erlite and others added 5 commits December 5, 2022 18:14
Co-authored-by: Jack <66967891+ASpoonPlaysGames@users.noreply.github.com>
…tarMods into squirrel-http-main

# Conflicts:
#	Northstar.Custom/mod/scripts/vscripts/sh_northstar_http_requests.gnut
@Erlite
Copy link
Contributor Author

Erlite commented Dec 8, 2022

Any more overzealous change requests or can I finally have this locked down for testing and merge.

@ASpoonPlaysGames
Copy link
Contributor

Idk if its your IDE or what but the formatting is still broken

Co-authored-by: Jack <66967891+ASpoonPlaysGames@users.noreply.github.com>
…ts.gnut

Co-authored-by: Jack <66967891+ASpoonPlaysGames@users.noreply.github.com>
Copy link
Contributor

@ASpoonPlaysGames ASpoonPlaysGames left a comment

Choose a reason for hiding this comment

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

Code looks good

Copy link
Contributor

@RoyalBlue1 RoyalBlue1 left a comment

Choose a reason for hiding this comment

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

Code looks good. Did not test though

Copy link
Member

@emma-miler emma-miler left a comment

Choose a reason for hiding this comment

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

Tested and working

@RoyalBlue1 RoyalBlue1 merged commit 52de846 into R2Northstar:main Dec 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

5 participants