cloudlink: various fixes#2458
Conversation
This is my (hopefully) final PR relating to Classic CloudLink. This is a slightly altered variant of CloudLink Improved, created by @Mistium (https://github.com/Mistium/extensions.mistium/blob/main/files%2FCloudlink4_Improved.js). This addresses various bugs encountered since the last major PR and enhances QoL.
This comment was marked as outdated.
This comment was marked as outdated.
| @@ -1,11 +1,20 @@ | |||
| // Name: CloudLink V4 | |||
| // Name: Cloudlink | |||
There was a problem hiding this comment.
the version number seems somewhat important? since there are others
|
@MikeDev101 ive made some upstream changes for cl4 improved, commit here: Mistium/extensions.mistium@3d88928 i decided to clean up some of the issues raised, but some stuff like the local server list are things that i see as less than necessary to implement but i understand the requirement so ill leave them to mike to copy over from the original version of the extension |
Merged changes from Mistium/extensions.mistium@3d88928 and restored the static serverlist property.
This comment was marked as outdated.
This comment was marked as outdated.
|
!format |
|
@MikeDev101 you still have some reviews that you need to address |
just finished addressing them 🦆 |
|
I could be wrong, but as of b0d4615 it should be safe now. |
Brackets-Coder
left a comment
There was a problem hiding this comment.
These are just a few clarifying questions so I can understand better what's going on. I'll have to do more looking later
| console.warn( | ||
| "[CloudLink] Ignoring attempt to send a packet while disconnected." | ||
| ); | ||
| //console.warn("[CloudLink] Ignoring attempt to send a packet while disconnected."); |
There was a problem hiding this comment.
Why did we comment out the warnings? I personally find them helpful for debugging
There was a problem hiding this comment.
They're annoying for normal users and kinda affect performance
| clVars.recentlyJoinedUser = packet.val; | ||
| Scratch.vm.runtime.startHats("cloudlink_whenuserconnects"); | ||
| break; | ||
| case "remove": | ||
| clVars.ulist.slice(clVars.ulist.indexOf(packet.val), 1); | ||
| case "remove": { | ||
| let index = -1; | ||
| for (let i = 0; i < clVars.ulist.length; i++) { | ||
| let user = clVars.ulist[i]; | ||
| if (user.uuid == packet.val.uuid) { | ||
| index = i; | ||
| break; | ||
| } | ||
| } | ||
| clVars.ulist.splice(index, 1); | ||
| clVars.recentlyLeftUser = packet.val; | ||
| Scratch.vm.runtime.startHats("cloudlink_whenuserdisconnects"); | ||
| break; | ||
| } |
There was a problem hiding this comment.
I'll have to look at this more later
There was a problem hiding this comment.
this was one of my changes, the original code used slice, which i can only assume was a typo for splice. the new version properly handles the remove command and actually removes the user from the ulist array
|
This is ready for merge |
|
Ok |
This is my (hopefully) final PR relating to Classic CloudLink.
This is a slightly altered variant of "CloudLink Improved", created by @Mistium.
https://github.com/Mistium/extensions.mistium/blob/main/files%2FCloudlink4_Improved.js
This addresses miscellaneous bugs encountered since the last major PR and "shuts up" the logs.
I do not take credit for the many wonderful contributions provided by Mist.