Mqtt based cloud variables

for those who don't know what nick os is it is my os for a ton of fun games and to make multiplayer easer i am using mqtt to make cloud variables by having a project open every time someone plays a game on nick os that manages the cloud variables
link: Snap! Build Your Own Blocks

mqtt cant store data

i know that's where the database library comes in

That's not cloud

it sends it with mqtt than stores it using database ok

thats not how that works

mqtt doesnt store things, think of it like a cross project broadcast, and you cant broadcast data with it either still so you cant do that

by "database" i think he means the local browser storage blocks. i kinda see how that could work, but the storage is handled by the client so that could lead to security issues

true but its not like im sending privete info im just sending a number

Security issues, as in any project can change the value of the database; not privacy issues. But that's something you should be worried about as well. What if someone sends personal info through cloud variables? It's not hard to turn text into numbers and back.

Again, these aren't cloud variables. No backend is storing the data.
Sure, you are sending the received data from the MQTT broker to the browser's local storage; but what if no one is online to send/receive the stored values from one PC to another? The data will never be kept in circulation. In case you didn't know: the database library doesn't store any data in the project itself; it stores it to the hard drive of the computer. No one else can access these values from another computer without sending the value over the internet. For these to be called cloud variables, you need to make a secure cloud variable server that Snap! can access at any time, regardless if anyone is using the project or not. Nice idea, but it just won't work.

i dont think you can send numbers at all using mqtt

mqtt is not cloud and doesnt have any storage. as i said before its really just cross project broadcasts

I'm going to put together some information on some of the options available in using MQTT

But for the moment, MQTT messages can be stored on a broker and then retrieved later on and you can send numbers but they are sent as a string of digits.

e.g 34 is sent as two character length string "34"

Do you know about p2p connections? Peer to Peer networking does not use a backend, and is a pretty well known method of online multiplayer. The biggest downside is that it depends on the players network speeds.

Thread started

i have nick-os-cloud-var- before every cloud variable i don't think someone is going to accidently use that

but it isnt

Yeah, peer to peer online multiplayer only needs to send data between computers, it doesn't need to store data.

someone could still change it and potentially cause damage

You can't stop a bad actor on a open, public broker from interfering with your topic data but a good, unique topic name does prevent accidental interference