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

Singleplayer Mode #47

Open
AwesomestCode opened this issue Mar 2, 2021 · 13 comments
Open

Singleplayer Mode #47

AwesomestCode opened this issue Mar 2, 2021 · 13 comments

Comments

@AwesomestCode
Copy link
Member

  1. Browserify flying-squid for a singleplayer server
  2. Use WebRTC to open to LAN
@rom1504
Copy link
Member

rom1504 commented Mar 3, 2021 via email

@rom1504
Copy link
Member

rom1504 commented Mar 14, 2021

How:

  • socketProvider option in nmp createServer
  • use it with a fake local socket for single player
  • use it with a simple-peer webrtc socket for crazy experiments

@rom1504
Copy link
Member

rom1504 commented Mar 14, 2021

anvil may need to be adapted by using indexeddb

@KaffinPX
Copy link

I think its useless

@rom1504
Copy link
Member

rom1504 commented Mar 16, 2021

Another idea here is to use a reverse websocket proxy

@zardoy
Copy link
Contributor

zardoy commented Sep 4, 2023

Hey! I'm currently working on this feature and wanted to report the progress. Currently, support implemented for the following backends (this all is possible only with the latest version of browserFS):

  • localstorage - just hit & play (5mb cap) - can be exported with /export
  • ZIP loading - just dragndrop (not really effective, but still can load any size, though there is ~400mb limit on ios)
  • Folder loading - best option, but available only in Chrome: dragndrop or via folder picker (read/write to real fs)
  • Download & play from link - link example - downloads map from server & uses ZIP FS later

I have used PeerJS previously for small projects and I think I'll also use it here for multiplayer.

I could test almost any 1.8 save, however, it seems that saves for 1.14+ are not supported by prismarine-chunk? (PrismarineJS/flying-squid#632, PrismarineJS/flying-squid#545)

Also will work to improve zipFS later.

@rom1504
Copy link
Member

rom1504 commented Sep 4, 2023 via email

@rom1504
Copy link
Member

rom1504 commented Sep 4, 2023 via email

@dimaxiton-max
Copy link

finally found it! though i wonder why it wasnt done before? btw do you have any plans to improve support like chests? i was looking for mcedit on mobile and couldnt find absolutely anything on the web,, also any plans for it?

@zardoy
Copy link
Contributor

zardoy commented Sep 8, 2023

though i wonder why it wasnt done before?

IMO it's weird to ask why something wasn't done before, however I can actually explain why I had to do it now. I've been using pojav to play mc on ios (I don't really like bedrock version, also had to load java worlds, mods etc) on jb idevice, without jb it requires JIT on the air (to be connected to anything), and I don't think jb it's coming to new devices.

btw do you have any plans to improve support like chests?

I think this is off-topic to ask here what is planned and what is not, but yes this will be done eventually (will first try to resolve rendering issues when have time). The current priority is command blocks to make adventure maps playable, only then survival things...

mcedit...

I'm really not sure about this one. I don't really need it, but still would be great to have! If I don't come up with any ideas in other projects, I think world edit mode will be added here eventually (I was thinking about it a week ago)...

@zardoy
Copy link
Contributor

zardoy commented Sep 16, 2023

Great you're working on this!

hey! added peerjs (p2p wan) multiplayer support (feels more like actual flying-squid server in the browser). I thought it would be harder to do, though it was fun. However, I noticed a few issues with minecraft-protocol package (there are definitely issues with handling disconnect and keepAlive packages)

@rom1504
Copy link
Member

rom1504 commented Sep 16, 2023

@zardoy could you please open pull requests to add features from your fork here ?

@zardoy zardoy mentioned this issue Sep 19, 2023
5 tasks
@K1FFDAME
Copy link

K1FFDAME commented Sep 29, 2023

Great you're working on this!

hey! added pee
Usdollar100front
rjs (p2p wan) multiplayer support (feels more like actual flying-squid server in the browser). I thought it would be harder to do, though it was fun. However, I noticed a few issues with minecraft-protocol package (there are definitely issues with handling disconnect and keepAlive packages)

who asked bobby? its your yearly salary

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants