Skip to content
This repository was archived by the owner on Apr 19, 2025. It is now read-only.

Commit 571637f

Browse files
author
Mike J. Renaker / "MikeDEV
committed
Merge branch '0.2.0'
2 parents 28805e5 + 5a0e6fd commit 571637f

37 files changed

+5717
-3786
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
__pycache__
22
.vscode
3-
*.bak
3+
*.bak
4+
.idea

README.md

Lines changed: 74 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -1,66 +1,79 @@
11
![CLOUDLINK 4 BANNER](https://user-images.githubusercontent.com/12957745/188282246-a221e66a-5d8a-4516-9ae2-79212b745d91.png)
2-
##### CL4 banner(s) made by [@zedthehedgehog](https://github.com/zedthehedgehog)
32

4-
# CloudLink
5-
CloudLink is a free and open-source, websocket-powered API optimized for Scratch 3.0. CloudLink comes with several powerful utilities and features:
6-
* Multicast and unicasting messages - Perfect for high-speed projects
7-
* Friendly software suite for implementing project-specific features - Multi-project save files and more
8-
* Advanced packet queuing system - Messages are handled browser-level so your Scratch code doesn't need to do extra work
9-
* Support for sandboxed/unsandboxed extension modes
10-
* Proven reliability - Extensively tested and utilized in [The Meower Project](https://github.com/meower-media-co/)
11-
* Unique project identifiers to allow frictionless communication between projects and app servers over a single CloudLink Server
12-
13-
CloudLink is now powered by [aaugustin/websockets!](https://github.com/aaugustin/websockets) CloudLink will perform better and more reliably than before.
14-
15-
## Get started with CloudLink
16-
For full documentation of CloudLink, please visit CloudLink's [Documentation](https://hackmd.io/g6BogABhT6ux1GA2oqaOXA) page.
17-
18-
There are several publically-hosted CloudLink instances available, which can be found in [serverlist.json](https://github.com/MikeDev101/cloudlink/blob/master/serverlist.json) or through the Server List block.
19-
20-
CloudLink was originally created for Scratch 3.0. You can view the latest version of CloudLink in any of these Scratch editors:
21-
- [TurboWarp](https://turbowarp.org/editor?extension=https://mikedev101.github.io/cloudlink/S4-0-nosuite.js)
22-
- [SheepTester's E 羊 icques](https://sheeptester.github.io/scratch-gui/?url=https://mikedev101.github.io/cloudlink/S4-0-nosuite.js)
3+
# Cloudlink
4+
CloudLink is a free and open-source websocket solution optimized for Scratch.
5+
Originally created as a cloud variables alternative, it can function as a multipurpose websocket framework for other projects.
6+
7+
# 💡 Features 💡
8+
9+
### 🪶 Fast and lightweight
10+
CloudLink can run on minimal resources. At least 25MB of RAM and any reasonably capable CPU can run a CloudLink server.
11+
12+
### 🌐 Essential networking tools
13+
* Unicast and multicast packets across clients
14+
* Expandable functionality with a built-in method loader
15+
16+
### 📦 Minimal dependencies
17+
All dependencies below can be installed using `pip install -r requirements.txt`.
18+
* 🐍 Python >=3.11
19+
* 🧵 asyncio (Built-in)
20+
* 📃 ["ujson" ultrajson](https://github.com/ultrajson/ultrajson)
21+
* 🔍 [pyeve/cerberus](https://github.com/pyeve/cerberus)
22+
* ❄️ ["snowflake-id" vd2org/snowflake](https://github.com/vd2org/snowflake)
23+
* 🌐 [aaugustin/websockets](https://github.com/aaugustin/websockets)
24+
25+
### 🔋Batteries included
26+
The CloudLink Python server comes with full support for the CL4 protocol and the Scratch cloud variable protocol.
27+
Just download, setup, and start!
28+
29+
### 🧱 Plug-and-play modularity
30+
You can easily extend the functionality of the server using classes and decorators.
31+
Here's an example of a simple plugin that displays "Foobar!" in the console
32+
when a client sends the message `{ "cmd": "foo" }` to the server.
33+
34+
```python
35+
# Import the server
36+
from cloudlink import server
37+
38+
# Import default protocol
39+
from cloudlink.server.protocols import clpv4
40+
41+
# Instantiate the server object
42+
server = server()
43+
44+
# Set logging level
45+
server.logging.basicConfig(
46+
level=server.logging.DEBUG
47+
)
48+
49+
# Load default CL protocol
50+
clpv4 = clpv4(server)
51+
52+
# Define the functions your plugin executes
53+
class myplugin:
54+
def __init__(self, server, protocol):
55+
56+
# Example command - client sends { "cmd": "foo" } to the server, this function will execute
57+
@server.on_command(cmd="foo", schema=protocol.schema)
58+
async def foobar(client, message):
59+
print("Foobar!")
60+
61+
# Load the plugin!
62+
myplugin(server, clpv4)
63+
64+
# Start the server!
65+
server.run()
66+
```
67+
68+
# 🐈 A powerful extension for Scratch 3.0
69+
You can learn about the protocol using the original Scratch 3.0 client extension.
70+
Feel free to test-drive the extension in any of these Scratch mods:
71+
72+
- [TurboWarp](https://turbowarp.org/editor?extension=url=https://mikedev101.github.io/cloudlink/S4-1-nosuite.js)
73+
- [SheepTester's E羊icques](https://sheeptester.github.io/scratch-gui/?url=https://mikedev101.github.io/cloudlink/S4-1-nosuite.js)
2374
- [Ogadaki's Adacraft](https://adacraft.org/studio/)
2475
- [Ogadaki's Adacraft (Beta)](https://beta.adacraft.org/studio/)
25-
- [PenguinMod](https://studio.penguinmod.site/editor.html?extension=https://extensions.turbowarp.org/cloudlink.js)
26-
27-
CloudLink is also available as a Python module, which comes bundled with the CloudLink Server.
28-
There is even a web-friendly version of CloudLink available as CLJS.
29-
30-
### [Discussion Forum (Archive)](https://scratch.mit.edu/discuss/topic/398473)
31-
### [CloudLink JS "CLJS"](https://www.npmjs.com/package/@williamhorning/cloudlink)
32-
33-
## FAQ
34-
> Will my CloudLink 3.0/TURBO projects support CloudLink 4.0 Servers?
35-
36-
Yes, there will be no compatibility-breaking changes to how CloudLink 4.0 handles messages. However, the new custom command handler will bind all custom commands to use: `{"cmd": "(custom command here)"}` instead of using the Direct command, `{"cmd": "direct", "val": {"cmd": "(custom command here)"}}`
37-
38-
> Will my Server (v0.1.7.x and older) need to be rewritten entirely to support CloudLink 4.0?
39-
40-
No, you will only need to rewrite your custom packet handlers as CloudLink 4.0 will reimplement custom commands.
41-
42-
> Where can I find old versions of CloudLink?
43-
44-
You can check the releases tab in Github for older versions, or you can download a complete archive of all old versions here (LINK TBD).
45-
46-
> Will CloudLink 4.0 work with my project made for CloudLink TURBO?
47-
48-
No, CloudLink 4.0 serves as a replacement of CloudLink TURBO. While CloudLink 4.0 is built upon CloudLink TURBO, it does not have the same blocks as CloudLink TURBO. In favor or retaining compatibility with CloudLink 3.0, CloudLink TURBO should not be used and will be retired.
49-
50-
> Will my older projects (prior to CloudLink 3.0) work with CloudLink 4.0?
51-
52-
No, only projects built with CloudLink 3.0 will work with CloudLink 4.0.
53-
54-
> Does CloudLink 4.0 have the CloudLink Suite?
55-
56-
Yes. CloudLink 4.0 will be a complete reimplementation of the original CloudLink Suite.
57-
58-
> What is the CloudLink Suite?
59-
60-
The Cloudlink Suite is a set of extra features built into the Cloudlink Extension. It provides extra features for Scratch developers to implement in projects that would normally add extra bloat, but can be implemented in a few blocks. These features include:
61-
* CloudDisk: Completely free cloud storage (Up to 10 KB, or 10^4 Bytes, per account), and a cross-project, cross-platform save file system (Up to 1 KB, or 10^3 Bytes, per save file with a maximum of 10 save files).
62-
* CloudCoin: Simple per-project, per-user currency system and supports cross-project trading.
63-
* CloudAccount: Extremely easy-to-use username/password system as an alternative to the username block for user identification, and protects your CloudCoin and CloudDisk data from unwanted users.
76+
- [PenguinMod](https://studio.penguinmod.site/editor.html?extension=url=https://mikedev101.github.io/cloudlink/S4-1-nosuite.js)
6477

65-
## Found an issue?
66-
Please report any bugs, glitches, and/or security vulnerabilities [here](https://github.com/MikeDev101/cloudlink/issues).
78+
# 📃 The CloudLink Protocol 📃
79+
Documentation of the CL4 protocol can be found in the CloudLink Repository's Wiki page.

S4-0-nosuite.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1707,4 +1707,4 @@ class CloudLink {
17071707
window.vm.extensionManager._loadedExtensions.set(extensionInstance.getInfo().id, serviceName);
17081708
console.log("CloudLink 4.0 loaded. Detecting unsandboxed mode.");
17091709
};
1710-
})()
1710+
})()

0 commit comments

Comments
 (0)