PrismarineJS / prismarine-web-client

Minecraft web client running in your browser
https://prismarinejs.github.io/prismarine-web-client/
MIT License
444 stars 138 forks source link

Error when connect to flying-squid server #201

Open codingwatching opened 3 years ago

codingwatching commented 3 years ago

Hi everyone, Please help me to find out why this is error, thank you so much

image

image

Here is the script to start the server:

const mcServer = require('flying-squid')

mcServer.createMCServer({
  'motd': 'A Minecraft Server \nRunning flying-squid',
  'port': 25565,
  'max-players': 10,
  'online-mode': false,
  'logging': true,
  'gameMode': 1,
  'difficulty': 1,
  'worldFolder':'world',
  'generation': {
    'name': 'diamond_square',
    'options':{
      'worldHeight': 80
    }
  },
  'kickTimeout': 10000,
  'plugins': {

  },
  'modpe': false,
  'view-distance': 10,
  'player-list-text': {
    'header':'Flying squid',
    'footer':'Test server'
  },
  'everybody-op': true,
  'max-entities': 100,
  'version': '1.8'
})
u9g commented 3 years ago

How did you access pwebclient?

codingwatching commented 3 years ago

@u9g by open http://localhost:8080/ I run the npm install then npm start

image

Some logs

Last login: Fri Jul 30 10:08:31 on ttys000
apple@Apples-iMac FlyingSquid % node main.js 
July 30th 2021, 10:10:31 [INFO]: Server listening on port 25565
July 30th 2021, 10:10:31 seed: 1879398677
July 30th 2021, 10:12:00 [INFO]: pviewer927 (::ffff:127.0.0.1) connected
July 30th 2021, 10:12:00 [INFO]: position written, player spawning...
July 30th 2021, 10:12:09 [INFO]: pviewer927 disconnected

The error on the Inspect console here

Encountered error! Error: Cannot call write after a stream was destroyed
    at new NodeError (errors-browser.js:26)
    at doWrite (_stream_writable.js:409)
    at writeOrBuffer (_stream_writable.js:398)
    at Socket.Writable.write (_stream_writable.js:307)
    at Socket.write (browser.js:265)
    at Framer.ondata (_stream_readable.js:681)
    at Framer.emit (events.js:153)
    at addChunk (_stream_readable.js:298)
    at readableAddChunk (_stream_readable.js:280)
    at Framer.Readable.push (_stream_readable.js:241)
index.js:199 disconnected for undefined

image

image

image

AwesomestCode commented 3 years ago

Hello. First of all, sorry for the late reply. I didn't notice this until now.

Does this issue happen only when connecting to a flying-squid based server or does it happen also when connecting to other servers (e.g., our public test server)?

As a sidenote, I'd heavily recommend joining our Discord for help, as we can respond faster there.

codingwatching commented 3 years ago

Hi @AwesomestCode Thank you for the help Yes I can connect client with server.jar (1.12.2) from Minecraft server The error only happens when connecting to flying-squid based server. I update pwebclient to the latest version (1.3.0) but still have that error

codingwatching commented 3 years ago

image