Discuss Scratch

Chiroyce
Scratcher
1000+ posts

☁️ Cloud Pinger v0.3

Ping other scratchers in real time!

You can send a ping to a Scratcher who is using this project in real time and they'll AUTOMATICALLY reply to your ping.

All made by @Chiroyce
Thanks to @griffpatch for the encoding and decoding scripts.


Version History

____________________________________

v0.3 Beta | 27th September, 5:21AM GMT —
Added a sound called "notification" that plays whenever you get a ping.
____________________________________

v0.2 Beta | 27th September, 3:21AM GMT —
In beta version 2 as beta 1 had no bugs as per the people :D
____________________________________

v0.1 Beta | 26th September, 2:34PM GMT —
Shared the beta version.
____________________________________

Last edited by Chiroyce (Sept. 27, 2021 05:24:29)

ScratchTheCoder12345
Scratcher
500+ posts

☁️ Cloud Pinger v0.3

This is really awesome! How does this work?
Chiroyce
Scratcher
1000+ posts

☁️ Cloud Pinger v0.3

ScratchTheCoder12345 wrote:

This is really awesome! How does this work?
Whenever you send a ping, it encodes these values and sets it to a cloud variable
ping | {sender_name} | {receiver_name} | {time of sending}
and other people who are using the project, are constantly looking for cloud variables with their name as the receiver, if it's like that, then they send a pong back with same data, and we can calculate the delay. It currently is using 3 cloud variables.
ScratchTheCoder12345
Scratcher
500+ posts

☁️ Cloud Pinger v0.3

Chiroyce wrote:

ScratchTheCoder12345 wrote:

This is really awesome! How does this work?
Whenever you send a ping, it encodes these values and sets it to a cloud variable
ping | {sender_name} | {receiver_name} | {time of sending}
and other people who are using the project, are constantly looking for cloud variables with their name as the receiver, if it's like that, then they send a pong back with same data, and we can calculate the delay. It currently is using 3 cloud variables.

ahh that makes lots of sense! It very cool!
Srinivaasan
Scratcher
100+ posts

☁️ Cloud Pinger v0.3

Cool!
Srinivaasan
Scratcher
100+ posts

☁️ Cloud Pinger v0.3

It sends a ping in milliseconds! This is the feature which I like the most. Vey fast!!!
-ScratchNewsDaily-
Scratcher
24 posts

☁️ Cloud Pinger v0.3

So you're not able to send messages?
Chiroyce
Scratcher
1000+ posts

☁️ Cloud Pinger v0.3

-ScratchNewsDaily- wrote:

So you're not able to send messages?
Nope, that would be unmoderated chat and wouldn't be allowed as per scratch's policies.

Srinivaasan wrote:

It sends a ping in milliseconds! This is the feature which I like the most. Vey fast!!!
Glad you like it

Last edited by Chiroyce (Sept. 27, 2021 03:19:16)

JethreeH
Scratcher
2 posts

☁️ Cloud Pinger v0.3

Hey, couldn't a user clash occur? For example if there are 4 people on the project A, B, C, & D. A pings B and C pings D at the same time. Whose ping does it store?
Chiroyce
Scratcher
1000+ posts

☁️ Cloud Pinger v0.3

JethreeH wrote:

Hey, couldn't a user clash occur? For example if there are 4 people on the project A, B, C, & D. A pings B and C pings D at the same time. Whose ping does it store?
B and C can never ping at the same time, this is a restriction put by the Scratch Websocket server, it can only send one packet of data at once.

So if B and C send it at the same time, the Scratch Cloud server will receive one ping before the other, and that will be sent to D's project first, and then the other.

I cannot prevent this as this is a limitation enforced by websockets and how scratch's cloud vars work.

JethreeH wrote:

Whose ping does it store?
No pings are stored, as soon as they're sent, a reply is received within ~600ms, and that data packet is no longer required. If the user isn't online, a ping will persist for a maximum of 3000ms (3 seconds)

A kind-of way to tackle this is by adding more variables, I added 3 now and it seems enough, the packet is first sent through a random var.

So if B and C send two packets via two different variables, both of them will be received. Otherwise if B sends is slightly before C, B's packet will be overwritten with C's data. That's kinda rare in my opinion, only a 33% chance of that happening given that 3 people are using the project at once.

Last edited by Chiroyce (Sept. 27, 2021 05:57:25)

Chiroyce
Scratcher
1000+ posts

☁️ Cloud Pinger v0.3

bump
chickenfingercoder
Scratcher
65 posts

☁️ Cloud Pinger v0.3

Chiroyce wrote:

bump
I love it i just wish u could send messages
Chiroyce
Scratcher
1000+ posts

☁️ Cloud Pinger v0.3

chickenfingercoder wrote:

I love it i just wish u could send messages
It would be against the guidelines and I would be banned for it!!
=> https://scratch.mit.edu/discuss/topic/357609/ <=
ScratchTheCoder12345
Scratcher
500+ posts

☁️ Cloud Pinger v0.3

Chiroyce wrote:

chickenfingercoder wrote:

I love it i just wish u could send messages
It would be against the guidelines and I would be banned for it!!
=> https://scratch.mit.edu/discuss/topic/357609/ <=
yeah that would be epic! Maybe morse code…
Chiroyce
Scratcher
1000+ posts

☁️ Cloud Pinger v0.3

ScratchTheCoder12345 wrote:

yeah that would be epic! Maybe morse code…
You can still send unmoderated stuff through it - any user generated content is not allowed, maybe I could add premade phrases in an update coming this weekend . . .
ScratchTheCoder12345
Scratcher
500+ posts

☁️ Cloud Pinger v0.3

Chiroyce wrote:

ScratchTheCoder12345 wrote:

yeah that would be epic! Maybe morse code…
You can still send unmoderated stuff through it - any user generated content is not allowed, maybe I could add premade phrases in an update coming this weekend . . .
ok yeah that would be good! Although if someone used. turbowarp they could use that as content for chatting…
Srinivaasan
Scratcher
100+ posts

☁️ Cloud Pinger v0.3

Chiroyce wrote:

ScratchTheCoder12345 wrote:

yeah that would be epic! Maybe morse code…
You can still send unmoderated stuff through it - any user generated content is not allowed, maybe I could add premade phrases in an update coming this weekend . . .
That will be cool!
Catzcute4
Scratcher
500+ posts

☁️ Cloud Pinger v0.3

Chiroyce wrote:

JethreeH wrote:

Hey, couldn't a user clash occur? For example if there are 4 people on the project A, B, C, & D. A pings B and C pings D at the same time. Whose ping does it store?
B and C can never ping at the same time, this is a restriction put by the Scratch Websocket server, it can only send one packet of data at once.

So if B and C send it at the same time, the Scratch Cloud server will receive one ping before the other, and that will be sent to D's project first, and then the other.

I cannot prevent this as this is a limitation enforced by websockets and how scratch's cloud vars work.

JethreeH wrote:

Whose ping does it store?
No pings are stored, as soon as they're sent, a reply is received within ~600ms, and that data packet is no longer required. If the user isn't online, a ping will persist for a maximum of 3000ms (3 seconds)

A kind-of way to tackle this is by adding more variables, I added 3 now and it seems enough, the packet is first sent through a random var.

So if B and C send two packets via two different variables, both of them will be received. Otherwise if B sends is slightly before C, B's packet will be overwritten with C's data. That's kinda rare in my opinion, only a 33% chance of that happening given that 3 people are using the project at once.
Yes, no information in this universe can even travel instantly, it’s limited by light speed.
Srinivaasan
Scratcher
100+ posts

☁️ Cloud Pinger v0.3

Chiroyce wrote:

ScratchTheCoder12345 wrote:

yeah that would be epic! Maybe morse code…
You can still send unmoderated stuff through it - any user generated content is not allowed, maybe I could add premade phrases in an update coming this weekend . . .
But will it affect the speed of the ping?
Chiroyce
Scratcher
1000+ posts

☁️ Cloud Pinger v0.3

Srinivaasan wrote:

But will it affect the speed of the ping?
Nope! It will only send 1 or 2 bytes of data extra - so it's fine.

Powered by DjangoBB