Skip to content

Commit

Permalink
v4 rc-2 commit
Browse files Browse the repository at this point in the history
  • Loading branch information
James committed Oct 6, 2023
1 parent e73fd19 commit 2f7c1ec
Show file tree
Hide file tree
Showing 18 changed files with 253 additions and 356 deletions.
5 changes: 2 additions & 3 deletions docs/.vitepress/config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { defineConfig } from 'vitepress'

// https://vitepress.dev/reference/site-config
export default defineConfig({
head: [['link', { rel: 'icon', href: 'static/images/logo.png' }]],
head: [['link', { rel: 'icon', href: 'static/images/logo' }]],
base: "/CanaryEngine/",
title: "CanaryEngine",
titleTemplate: "Canary Docs",
Expand All @@ -15,7 +15,7 @@ export default defineConfig({
text: 'Guides',
items: [
{ text: 'Get Started', link: '/start/intro'},
{ text: 'Usage', link: '/tutorial/update' },
{ text: 'Usage', link: '/tutorial/packages' },
{ text: 'Libraries', link: '/tutorial/libraries/benchmark' }
]
},
Expand Down Expand Up @@ -67,7 +67,6 @@ export default defineConfig({
{
text: 'Management',
items: [
{ text: 'Update', link: '/tutorial/update' },
{ text: 'Packages', link: '/tutorial/packages' },
{ text: 'Structure', link: '/tutorial/structure' },
{ text: 'Style Guide', link: '/tutorial/styleguide' },
Expand Down
10 changes: 9 additions & 1 deletion docs/api/controllers/network/client.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,14 @@ The name of the the network controller.

* **string**

---

### IsListening <Badge type="tip" text="read only" />

Whether or not the network controller is subscribed to an event.

* **boolean**

## Methods

### Fire
Expand Down Expand Up @@ -52,7 +60,7 @@ The data to invoke the server with

### Listen

Listens for the network controller to be fired by the server, then runs the provided function.
Listens for the network controller to be fired by the server, then runs the provided function. Note that this can only be run once, it will error if run more than once.

**Parameters**

Expand Down
41 changes: 39 additions & 2 deletions docs/api/controllers/network/server.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,22 @@ The name of the the network controller.

* **string**

---

### IsListening <Badge type="tip" text="read only" />

Whether or not the network controller is subscribed to an event.

* **boolean**

---

### IsBinded <Badge type="tip" text="read only" />

Whether or not the network controller is binded to any invocations.

* **boolean**

## Methods

### Fire
Expand Down Expand Up @@ -92,6 +108,24 @@ The data that should be sent to each player within `maximumRange`

---

### FireFilter

Fires an event with a filter function, and runs the provided filter on every player in the server.

**Parameters**

* **filter:** `(Player) -> (boolean)`\
The filter to run on each player, return a boolean to indicate that the player meets the threshold

* **data:** `(Array<any> | any)?`\
The data that should be sent to each player that meets the threshold for `filter`

**Returns**

* **void**

---

### Listen

Listens for the network controller to be fired by the client, then runs the provided function.
Expand Down Expand Up @@ -128,8 +162,11 @@ Sets a rate limit that is applied when invoking or firing a network controller f

**Parameters**

* **maxInvokesPerSecond:** `number`\
The maximum amount of invokes allowed per second, set to -1 to disable the rate limit
* **maxCalls:** `number`\
The maximum amount of invokes allowed every `interval` seconds; set to -1 to disable the rate limit

* **interval:** `number?`\
The interval of which `maxCalls` is reset

* **invokeOverflowCallback:** `((sender: Player) -> ())?`\
The callback function to run when the player has exceeded the current rate limit
Expand Down
5 changes: 4 additions & 1 deletion docs/start/features.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,12 @@ The API is aimed to be completely separate the server and the client, which allo
The entire framework is documented, along with tutorials on each subject.

* **Optimized** 🏃‍♀️
Extremely optimized, with most internal functions running fast along with custom signal and network implementations.
Extremely optimized, with most internal functions running fast along with the custom signal and network implementations.

* **Secure** 🔐
The networking system that CanaryEngine uses can actually partially prevent exploits like RemoteSpy from being easily useable.

* **Ordered** 🔄
You can import modules from a main script, which will then execute in order. Can prevent issues like race conditions which come up a lot in multi-threaded architectures.

... and much more!
10 changes: 6 additions & 4 deletions docs/start/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,10 @@ keywords: [roblox, game, framework, install, tutorial, github, node]
3. Open Roblox Studio, and drag `CanaryStudioPlugin.rbxm` from your download directory into studio.
4. Right click the plugin, and choose `Save as Local Plugin`

### NPM (rbxts)
### Rojo

1. Open the command line of your choice, set the directory to the project folder that you wish.
2. Install Node if you haven't already, you can find that [here](https://nodejs.org/en/download)
3. After installing Node, enter the following in your command line: `npm i @rbxts/canaryengine`
Rojo support is being looked into!

### TypeScript

We're currently working on definition files; we will not be publishing a package on roblox-ts.
4 changes: 2 additions & 2 deletions docs/tutorial/networking.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Now lets continue this code and make it so it can recieve info from the server:
```lua
local SendInfoNetwork = CanaryEngineClient.CreateNetworkController("SendInfoNetwork")

SendInfoNetwork:Connect(function(data)
SendInfoNetwork:Listen(function(data)
print(data)
end)
```
Expand Down Expand Up @@ -71,7 +71,7 @@ The [RemoteFunction](https://create.roblox.com/docs/reference/engine/classes/Rem
```lua
local ValueGetNetwork = CanaryEngineServer.CreateNetworkController("ValueGetNetwork")

ValueGetNetwork:OnInvoke(function(sender, data)
ValueGetNetwork:BindToInvocation(function(sender, data)
print(sender.Name) -- The player who sent the invoke's name
if data[1] then
return "yes" -- We must return a value here, or it will error
Expand Down
23 changes: 0 additions & 23 deletions docs/tutorial/update.md

This file was deleted.

2 changes: 1 addition & 1 deletion plugin/settings/settings.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"Files": 14,
"Files": 21,
"FrameworkName": ["Framework", "CanaryEngineFramework"],
"CanaryStudioChangelog": "Need help? You can refer to our help articles at https://canary-development.github.io/CanaryEngine.\nFrom there, you can view our documentation on libraries the plugin itself."
}
53 changes: 48 additions & 5 deletions plugin/src/json/structure.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,50 @@
"NetworkController": {
"Events": { },
"Vendor": {
"BridgeNet2": "BridgeNet2Package"
"Ratelimit": {
"$className": "ModuleScript",
"$properties": {
"Source": "https://raw.githubusercontent.com/red-blox/Util/62037a647038af2b92129435957bace986452ff1/libs/Ratelimit/Ratelimit.luau"
}
},
"Guard": {
"$className": "ModuleScript",
"$properties": {
"Source": "https://raw.githubusercontent.com/red-blox/Util/1f9216713d15579bdf1744235448fbac702aa54c/libs/Guard/Guard.luau"
}
},
"Future": {
"$className": "ModuleScript",
"$properties": {
"Source": "https://raw.githubusercontent.com/red-blox/Util/76281011d28f083d2d659ef4c1b567270192aeb3/libs/Future/Future.luau"
}
},
"Spawn": {
"$className": "ModuleScript",
"$properties": {
"Source": "https://raw.githubusercontent.com/red-blox/Util/fd238ef1d4771a7aaa83b2f0650527f01337ce24/libs/Spawn/Spawn.luau"
}
},
"Red": {
"ClientEvent": {
"$className": "ModuleScript",
"$properties": {
"Source": "https://raw.githubusercontent.com/red-blox/Red/ffd21a7a776873751c24e7e1ed4cf517564cd5f7/lib/ClientEvent.luau"
}
},
"ServerEvent": {
"$className": "ModuleScript",
"$properties": {
"Source": "https://raw.githubusercontent.com/red-blox/Red/ffd21a7a776873751c24e7e1ed4cf517564cd5f7/lib/ServerEvent.luau"
}
},
"Identifier": {
"$className": "ModuleScript",
"$properties": {
"Source": "https://raw.githubusercontent.com/red-blox/Red/ffd21a7a776873751c24e7e1ed4cf517564cd5f7/lib/Identifier.luau"
}
}
}
},
"Init": {
"$className": "ModuleScript",
Expand Down Expand Up @@ -97,24 +140,24 @@
}
}
}
},
},
"RedbloxUtils": {
"Future": {
"$className": "ModuleScript",
"$properties": {
"Source": "https://raw.githubusercontent.com/canary-development/CanaryEngine/main/src/lua/framework/Vendor/Libraries/RedbloxUtils/Future.luau"
"Source": "https://raw.githubusercontent.com/red-blox/Util/76281011d28f083d2d659ef4c1b567270192aeb3/libs/Future/Future.luau"
}
},
"Signal": {
"$className": "ModuleScript",
"$properties": {
"Source": "https://raw.githubusercontent.com/canary-development/CanaryEngine/main/src/lua/framework/Vendor/Libraries/RedbloxUtils/Signal.luau"
"Source": "https://raw.githubusercontent.com/red-blox/Util/406727b68d204058ed385f0055a5508dfdd71733/libs/Signal/Signal.luau"
}
},
"Spawn": {
"$className": "ModuleScript",
"$properties": {
"Source": "https://raw.githubusercontent.com/canary-development/CanaryEngine/main/src/lua/framework/Vendor/Libraries/RedbloxUtils/Spawn.luau"
"Source": "https://raw.githubusercontent.com/red-blox/Util/fd238ef1d4771a7aaa83b2f0650527f01337ce24/libs/Spawn/Spawn.luau"
}
}
}
Expand Down

This file was deleted.

Loading

0 comments on commit 2f7c1ec

Please sign in to comment.