How to use your own networking implementationšŸ— Under construction

Hello peeps, so far its going great, except for when I deploy the collaborative sandbox to my server via ftp; the networking modules fail, or at least Iā€™m not getting updates from one client to the other. So im guessing my server is not running something or maybe blocking some scripts? Anyone who can help me with this?

Original Post on Discord

by user 710606458806337556

Hello, when you open the console in the deployed app do you get a log containing something like ā€œconnected to xyz with view only id abcā€ (or similar)?

You can modify where the backend is being hosted by e.g. adding a Networking component to your scene. This allows you to setup a custom websocket url that should be used instead of the default one (which is our template project on glitch)

For hosting your backend somewhere else you just need to install our networking package and add it to the server with a few lines of code (see the last few lines in server.js here as a reference: https://glitch.com/edit/#!/needle-tiny-starter)

Ah Marcel! Thank you! I was getting a bit hopeless, and mustve overlooked your answer before, but i found it now! I will start digging in what you said!

by user 710606458806337556

when i go in the console of the deployed app, i have two options, 1. i go through the domain and use https and i wil get:
Connecting to wss://ditism.com/socket index.b708acf1.js:3154 WebSocket connection to ā€˜wss://ditism.com/socketā€™ failed: I.tryConnect @ index.b708acf1.js:3270
And 2. i go throught the IP with http and i wil get Connecting to wss://needle-tiny-starter.glitch.me/socket Connected to websocket
index.b708acf1.js:3347 Your id is: ab3126a9-cf6a
index.b708acf1.js:3347 Room view id d1eb2aa4fbaf9e22
index.b708acf1.js:4272 Disconnected from networking backend - attempt reconnecting now
index.b708acf1.js:3347 Connecting to wss://needle-tiny-starter.glitch.me/socket
index.b708acf1.js:3347 Connected to websocket

by user 710606458806337556

So the glitch one is working, and apparently im not DEV enough to understand how I should build the websocket. I walked through this guide https://amartya.in/setting-up-secure-websockets/ to try to set one up but i had missed what youve pointed out server.js and that it is the fastify framework im a noob, i know, but sucking at something is the first step to being kinda good at it.

by user 710606458806337556

I looked at your profile, looks like you are engaged in needle to say the least, the lightmapping etc. have you build a game yet? are you about to build a game?

by user 710606458806337556