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

Make the invite link work for html bundles #647

Merged
merged 3 commits into from
Jul 4, 2023
Merged

Make the invite link work for html bundles #647

merged 3 commits into from
Jul 4, 2023

Conversation

leighmcculloch
Copy link
Contributor

What

Make the invite link the same URL that the game is being displayed from with the netplay peer ID parameter, instead of a link to wasm4.org/netplay.

Why

When bundling wasm4 games as HTML, it's an odd user experience that invite links take players off to another website.

@leighmcculloch leighmcculloch marked this pull request as ready for review May 30, 2023 01:39
leighmcculloch added a commit to leighmcculloch/wasm4-snake that referenced this pull request May 30, 2023
@leighmcculloch leighmcculloch changed the title Make the invite link local to the game url Make the invite link work for html bundles May 30, 2023
@leighmcculloch
Copy link
Contributor Author

@aduros What do you think?

@leighmcculloch
Copy link
Contributor Author

@aduros If there's an alternative way you'd like addressing this issue approached, I'm happy to have a go of that too.

@aduros
Copy link
Owner

aduros commented Jun 19, 2023

This sounds good to me, but I think we need a special case for the games hosted on https://wasm4.org/play.

@leighmcculloch
Copy link
Contributor Author

What's the best way to signal that to the code generating the bundle?

@leighmcculloch
Copy link
Contributor Author

A command line option?

@aduros
Copy link
Owner

aduros commented Jun 20, 2023

I don't think we need a new param. The easiest way might be to branch on location.host/location.protocol in getInviteLink. If hosted on file://*, wasm4.org, or localhost it should use the original wasm4.org/netplay link, otherwise it can use the same URL with the netplay param.

@leighmcculloch
Copy link
Contributor Author

That's a trivial change. I can make that.

@leighmcculloch
Copy link
Contributor Author

I've made the change so that the original URL is preserved for file, localhost, and wasm4.org. On other domains it uses the existing URL.

@leighmcculloch
Copy link
Contributor Author

I'm not sure if something is up with the signal server, but this was working a little while ago, but today the netplay URL is just a blank screen. There's no errors. I see the connection to the signal server is the last thing to happen and then the game never starts 🤔. Did anything change on the backend side?

@aduros
Copy link
Owner

aduros commented Jun 22, 2023

PR looks great, but is the new link not working on the connecting side? Nothing should have changed on the backend. Can you share a link? If you think it was just a network hiccup, I can just merge this 🙂

@leighmcculloch
Copy link
Contributor Author

I think it was just a network hiccup, or environmental issue, as I hadn't changed anything meaningful relating to netplay.

@leighmcculloch
Copy link
Contributor Author

leighmcculloch commented Jun 24, 2023

It must be my network, because the netplay on wasm4.org with games hosted there is broken for me too. But it was working a couple weeks ago. But regardless, this change is independent of that issue I'm seeing.

@leighmcculloch
Copy link
Contributor Author

@aduros Wdyt, mergeable?

@aduros
Copy link
Owner

aduros commented Jul 4, 2023

Sounds good! Thanks.

@aduros aduros merged commit 4521d4d into aduros:main Jul 4, 2023
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants