Skip to content

Commit

Permalink
final v4 commit
Browse files Browse the repository at this point in the history
  • Loading branch information
James committed Sep 25, 2023
1 parent d6c60e0 commit c4cc6c9
Show file tree
Hide file tree
Showing 33 changed files with 381 additions and 1,396 deletions.
10 changes: 10 additions & 0 deletions docs/.vitepress/config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ export default defineConfig({
items: [
{
text: 'Framework',
collapsed: true,
items: [
{ text: 'CanaryEngine', link: '/api/engine/framework/canaryengine' },
{ text: 'CanaryEngineServer', link: '/api/engine/framework/canaryengineserver' },
Expand All @@ -119,6 +120,7 @@ export default defineConfig({

{
text: 'Dependencies',
collapsed: true,
items: [
{ text: 'EngineDebugger', link: '/api/engine/dependencies/enginedebugger' },
{ text: 'EngineLoader', link: '/api/engine/dependencies/engineloader' },
Expand All @@ -128,6 +130,7 @@ export default defineConfig({

{
text: 'Runtime',
collapsed: true,
items: [
{ text: 'EngineRuntime', link: '/api/engine/runtime/engineruntime' },
{ text: 'EngineRuntimeContext', link: '/api/engine/runtime/engineruntimecontext' },
Expand All @@ -144,13 +147,15 @@ export default defineConfig({
items: [
{
text: 'Signal',
collapsed: true,
items: [
{ text: 'SignalController', link: '/api/controllers/signal/signalcontroller' }
]
},

{
text: 'Network',
collapsed: true,
items: [
{ text: 'NetworkControllerServer', link: '/api/controllers/network/server' },
{ text: 'NetworkControllerClient', link: '/api/controllers/network/client' }
Expand All @@ -166,6 +171,7 @@ export default defineConfig({
items: [
{
text: 'EasyProfile',
collapsed: true,
items: [
{ text: 'EasyProfile', link: '/api/libraries/data/easyprofile' },
{ text: 'ProfileStoreObject', link: '/api/libraries/data/profilestoreobject' },
Expand All @@ -175,6 +181,7 @@ export default defineConfig({

{
text: 'UIShelf',
collapsed: true,
items: [
{ text: 'UIShelf', link: '/api/libraries/uishelf' },
{ text: 'TopBarIconObject', link: '/api/libraries/topbariconobject' },
Expand All @@ -184,6 +191,7 @@ export default defineConfig({

{
text: 'Benchmark',
collapsed: true,
items: [
{ text: 'Benchmark', link: '/api/libraries/benchmark' },
{ text: 'BenchmarkObject', link: '/api/libraries/benchmarkobject' }
Expand All @@ -199,6 +207,8 @@ export default defineConfig({
]
},

outline: [2, 3],

search: {
provider: 'local'
},
Expand Down
6 changes: 3 additions & 3 deletions docs/Tutorials/packages.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
# Package System

One of Canary's greatest strengths is the built in package system, which allows for many more oppurtunities. Coming in later updates, we will be adding a type generator for package intellisense support!
One of Canary's greatest strengths is the built in package system, which allows for many more oppurtunities. It allows for intellisense support along with easy organization for your package needs.

### Inserting Packages

To insert a new package, simply use the 'Create New Instance' function of the plugin, then from there you can insert a new package, for either the client, to be replicated, or the server. From there, you can reference the module in your script and start using it! Here's an example of how you would grab a package from the server.
To insert a new package, simply use the 'Create New Instance' function of the plugin, then from there you can insert a new package, for either the client, to be replicated, or the server. From there, you can reference the module in your script and start using it!

### Inserting Scripts

Inserting new scripts is also a very straightforward process and very similar to packages. First, create a new instance, then select either client script or server script from the dropdown menu. In order to reference a server-sided package, you must create a server script. Here's an example of how you would get your package from the script we just created:

```lua
local Packages = CanaryEngineServer.Packages.Server
local Packages = EngineServer.Packages
local MyPackage = require(Packages.MyPackage)

MyPackage.MyFunction()
Expand Down
30 changes: 10 additions & 20 deletions docs/api/controllers/network/client.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# NetworkControllerClient <Badge type="danger" text="client" />

A client-sided network controller.
A client-sided network controller, based on [this](/api/engine/types#networkcontrollerclient) type.

## Properties

Expand All @@ -24,12 +24,12 @@ NetworkController:Fire("Hello, world!")
```
:::

#### Parameters
**Parameters**

* **data:** `Array<any> | any`\
The data that should be sent to the server

#### Returns
**Returns**

* **void**

Expand All @@ -39,36 +39,26 @@ The data that should be sent to the server

Invokes the server, equivalent to [RemoteFunction:InvokeServer](https://create.roblox.com/docs/reference/engine/classes/RemoteFunction#InvokeServer). Returns a promise.

#### Parameters
**Parameters**

* **data:** `Array<any> | any`\
The data to invoke the server with

#### Returns
**Returns**

* **[Future](https://util.redblox.dev/future.html#methods)**

---

### Connect
### Listen

Connects a function to the event that is fired when the server fires the network controller.
Listens for the network controller to be fired by the server, then runs the provided function.

#### Parameters
**Parameters**

* **func:** `(data: Array<any>) -> ()`\
The function to call when data is recieved

#### Returns
**Returns**

* **void**

---

### Wait

Yields the current thread until the server fires the network controller. Returns a promise.

#### Returns

* **[Future](https://util.redblox.dev/future.html#methods)**
* **void**
46 changes: 18 additions & 28 deletions docs/api/controllers/network/server.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# NetworkControllerServer <Badge type="danger" text="server" />

A server-sided network controller.
A server-sided network controller, based on [this](/api/engine/types#networkcontrollerserver) type.

## Properties

Expand All @@ -24,15 +24,15 @@ NetworkController:Fire({Player1, Player2, Player3}, {1, 2, 3})
```
:::

#### Parameters
**Parameters**

* **recipients:** `{ Player } | Player`\
The players who should recieve the data and/or call

* **data:** `(Array<any> | any)?`\
The data that should be sent to the client

#### Returns
**Returns**

* **void**

Expand All @@ -42,12 +42,12 @@ The data that should be sent to the client

Fires an event which sends data to every client connected to the server, equivalent [RemoteEvent:FireAllClients](https://create.roblox.com/docs/reference/engine/classes/RemoteEvent#FireAllClients).

#### Parameters
**Parameters**

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

#### Returns
**Returns**

* **void**

Expand All @@ -57,15 +57,15 @@ The data that should be sent to each player

Fires an event which sends data to every client connected to the server, except for players defined in the `except` parameter.

#### Parameters
**Parameters**

* **except:** `Array<Player> | Player`\
The players which the call should not be sent to

* **data:** `(Array<any> | any)?`\
The data that should be sent to each player except `except`

#### Returns
**Returns**

* **void**

Expand All @@ -75,7 +75,7 @@ The data that should be sent to each player except `except`

Fires an event which sends data to every client that is within `maximumRange` studs from `comparePoint`.

#### Parameters
**Parameters**

* **comparePoint:** `Vector3`\
The point to compare from, can be a standalone `Vector3`
Expand All @@ -86,47 +86,37 @@ The maximum range of which the player's characters have to be within to recieve
* **data:** `(Array<any> | any)?`\
The data that should be sent to each player within `maximumRange`

#### Returns
**Returns**

* **void**

---

### Wait
### Listen

Yields the current thread until the client fires the network controller. Returns a promise.
Listens for the network controller to be fired by the client, then runs the provided function.

#### Returns

* **[Future](https://util.redblox.dev/future.html#methods)**

---

### Connect

Connects a function to the event that is fired when the client fires the network controller.

#### Parameters
**Parameters**

* **func:** `(sender: Player, data: Array<any>?) -> ()`\
The function to call when data is recieved

#### Returns
**Returns**

* **void**

---

### OnInvoke

Recieves an invoke from the server, and runs the callback function which returns some data. Equivalent to [RemoteFunction.OnServerInvoke](https://create.roblox.com/docs/reference/engine/classes/RemoteFunction#OnServerInvoke).
Recieves an invoke from the client, and runs the callback function which returns some data. Equivalent to [RemoteFunction.OnServerInvoke](https://create.roblox.com/docs/reference/engine/classes/RemoteFunction#OnServerInvoke).

#### Parameters
**Parameters**

* **callback:** `(sender: Player, data: Array<any>?) -> (Array<any> | any)`\
The callback function to run on invoke, must return at least 1 value.

#### Returns
**Returns**

* **void**

Expand All @@ -136,14 +126,14 @@ The callback function to run on invoke, must return at least 1 value.

Sets a rate limit that is applied when invoking or firing a network controller from the client.

#### Parameters
**Parameters**

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

* **invokeOverflowCallback:** `((sender: Player) -> ())?`\
The callback function to run when the player has exceeded the current rate limit

#### Returns
**Returns**

* **void**
18 changes: 9 additions & 9 deletions docs/api/controllers/signal/signalcontroller.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# SignalController

A lua-based signal implementation.
A lua-based signal implementation, based on [this](/api/engine/types#signalcontroller) type.

## Properties

Expand All @@ -24,12 +24,12 @@ SignalController:Fire("Hello, world!")
```
:::

#### Parameters
**Parameters**

* **data:** `(Array<any> | any)?`\
The data that should be sent the other script

#### Returns
**Returns**

* **void**

Expand All @@ -39,12 +39,12 @@ The data that should be sent the other script

Connects a function to the event that is fired when another script fires the controller.

#### Parameters
**Parameters**

* **func:** `(data: Array<any>?) -> ()`\
The function to call when data is recieved

#### Returns
**Returns**

* **[ControllerConnection](/api/engine/types#controllerconnection)**

Expand All @@ -54,12 +54,12 @@ The function to call when data is recieved

Connects a function to the event that is fired when another script fires the controller. When using `:Once`, the function is only run the first time and then the connection is disconnected automatically.

#### Parameters
**Parameters**

* **func:** `(data: Array<any>?) -> ()`\
The function to call when data is recieved

#### Returns
**Returns**

* **[ControllerConnection](/api/engine/types#controllerconnection)**

Expand All @@ -69,7 +69,7 @@ The function to call when data is recieved

Yields the current thread until another script fires the signal controller.

#### Returns
**Returns**

* **[Array](/api/engine/types#array)\<any\>**

Expand All @@ -79,6 +79,6 @@ Yields the current thread until another script fires the signal controller.

Disconnects all listeners from the current signal controller.

#### Returns
**Returns**

* **void**
Loading

0 comments on commit c4cc6c9

Please sign in to comment.