diff --git a/docs/.vitepress/config.mts b/docs/.vitepress/config.mts index 1caec215..1b2926d7 100644 --- a/docs/.vitepress/config.mts +++ b/docs/.vitepress/config.mts @@ -41,7 +41,7 @@ export default defineConfig({ { text: 'Engine Recaps', items: [ - { text: 'May 2024', link: '/recaps/' }, + { text: 'April 2024', link: '/recaps/' }, { text: 'February 2024', link: '/recaps/february2024' }, { text: 'December 2023', link: '/recaps/december2023' }, { text: 'November 2023', link: '/recaps/november2023' }, @@ -79,20 +79,7 @@ export default defineConfig({ { text: 'ClientFunction', link: '/api/network/client/function' }, { text: 'ServerFunction', link: '/api/network/server/function' } ] - }, - - { - text: 'Runtime', - collapsed: true, - items: [ - { text: 'Runtime', link: '/api/runtime' }, - { text: 'RuntimeSettings', link: '/api/runtime/settings' }, - { text: 'RuntimeObjects', link: '/api/runtime/objects' } - ] - }, - - { text: 'Debugger', link: '/api/debugger' }, - { text: 'Event', link: '/api/event' } + } ] }, ], diff --git a/docs/api/dependencies/engineloader.md b/docs/api/dependencies/engineloader.md deleted file mode 100644 index 83c9e928..00000000 --- a/docs/api/dependencies/engineloader.md +++ /dev/null @@ -1,53 +0,0 @@ -# FrameworkLoader - -Responsible for distibuting the framework's loading screen to players, along with customization. - -## Properties - -### IsClientLoaded - -A boolean that is true if the client is loaded. - -* **boolean** - -## Functions - -### StartLoad - -Starts up the loader, this should be run as soon as the player joins in a client script inside `ReplicatedFirst/Scripts`. - -**Parameters** - -* **objectsToLoad:** `{ any }`\ -The objects to load, can be a list of asset id strings or instances - -* **loadingMessages:** `{ [string]: Color3 }?`\ -The messages to display after the loading is finished, the key is the message and the value is the color of the message - -* **coreGuiEnabled:** `boolean?`\ -Decides whether the CoreGui is enabled during loading - -* **afterLoadWait:** `number?`\ -The amount of time to wait after the load, this is before the messages in loadingMessages are shown and the loading stats are shown - -* **loadingText:** `{ loadingAssetsText: string, loadedAssetsText: string }?`\ -The text that should be shown when loading assets and after loading assets - -**Returns** - -* **void** - ---- - -### CustomizeInterface - -Allows you to customize the interface, giving you the ability to change the relevant properties. `Container` is the main frame. - -**Parameters** - -* **interfaceProperties:** `{ [string]: { [string]: any } }`\ -The objects to load, can be a list of asset id strings or instances - -**Returns** - -* **void** \ No newline at end of file diff --git a/docs/api/index.md b/docs/api/index.md index 5d5afb21..265c3f3b 100644 --- a/docs/api/index.md +++ b/docs/api/index.md @@ -4,11 +4,11 @@ The main class of LuminFramework. ## Properties -### Runtime +### Promise -The runtime property contains settings that are set during runtime, and the current context of the server/client. +A reference to evaera's Promise module. -* [**Runtime**](/api/runtime/) +* [**Promise**](https://eryn.io/roblox-lua-promise/) ## Functions @@ -34,15 +34,15 @@ Gets the client-sided interface of LuminFramework. ### Load -Imports the provided packages in chronological order, also allowing for you to import descendants aswell. Non-modules will be filtered out automatically. +Imports any modules of the parent provided. Non-modules will be filtered out automatically. **Parameters** -* **importList:** `{ModuleScript}`\ -A list of packages to import +* **parent:** `Instance`\ +The parent of which the modules are located -* **importDeep:** `boolean?`\ -Whether or not to import the package's descendants, defaults to `false` +* **filter:** `(module: ModuleScript) -> boolean?`\ +Allows you to filter through a module, return `false` for it to not be imported **Returns** @@ -52,13 +52,13 @@ Whether or not to import the package's descendants, defaults to `false` ### Signal -Creates/reference a event of the given name, create a new anonymous event by leaving the name blank. +Creates/references a signal of the given name, create a new anonymous signal by leaving the name blank. **Parameters** * **name:** `string?`\ -The name of the event +The name of the signal **Returns** -* [**Event**](/api/event) \ No newline at end of file +* [**Signal**](https://sleitnick.github.io/RbxUtil/api/Signal/) \ No newline at end of file diff --git a/docs/guides/debugging.md b/docs/guides/debugging.md deleted file mode 100644 index d137967e..00000000 --- a/docs/guides/debugging.md +++ /dev/null @@ -1,22 +0,0 @@ -# Debugging - -Debugging is a great feature of LuminFramework. We have provided a debugger packasge which allows you to debug your games with almost no effort required. This does not clutter the output and allows you to easily keep track of logs and other things. - -### Logging Events - -Logging events is similar to calling the debug function, but a bit different. `LogEvent` does two things differently: - -1. Events are only printed to the output in studio -2. Introduces a session logs table which an entry gets added to upon a call - -You can actually see this being used internally when creating new signals/networkcontrollers. It is a meant to be used alongside debug, but instead of debugging this will log the event in a table so you can verify it happened via code. This also has it's own dedicated setting called `ShowLoggedEvents`, which if disabled will disable the printing of events regardless of your client type. - -### Call Stacks - -The debugger has a pretty nice feature of generating clean callstacks. `GetCallStack` returns a table of info pertaining to the callstack of the source, which has been neatly sorted into a couple of keys. These allow you to: - -1. Get the exact line number of where the code was called from -2. Get a table of every ancestor from the source -3. Get a string of the full name along with the function name if provided - -This is mainly used for testing scenarios and doesn't really have any use outside of that unless you have an internal developer panel of some sort. \ No newline at end of file diff --git a/docs/guides/events.md b/docs/guides/events.md deleted file mode 100644 index fa46d8df..00000000 --- a/docs/guides/events.md +++ /dev/null @@ -1,52 +0,0 @@ -# Events - -LuminFramework's event system works just as a [BindableEvent](https://create.roblox.com/docs/reference/engine/classes/BindableEvent) would, except, this method relies on the task scheduler to work which means garbage collection is easier. - -### Events - -Firing and connecting to events should be as simple as possible. If you are familiar with the [RBXScriptSignal](https://create.roblox.com/docs/reference/engine/datatypes/RBXScriptSignal), then it should be easy enough to learn `Events`. As common knowledge, firing + listening is identical across both the `Network` library and `Event` library. Here's an example of an event being fired and connected to: - -```lua -local TestEvent = LuminFramework.Event("NewEvent") - -TestEvent:Connect(function(data1, data2) -- NetworkControllers use Listen instead of Connect! - print(data1, data2) -- Output: "Hello, player" -end) - -TestEvent:Fire( - "Hello,", - "player" -) -``` - -`Events` also share identical methods with the [RBXScriptSignal](https://create.roblox.com/docs/reference/engine/datatypes/RBXScriptSignal), such as including `Event:Once` and even a `Event:Wait` method. - -### AnonymousEvents -Anonymous events are a special type of events that can be only used from this refrence. These are events that are not stored in any way by default compared to `Event`, and are meant to be used for objects and events, and not for script communcation. They are created by using the `LuminFramework.Event` method with no name parameter. Here's an example of an anonymous event being used: - -```lua -local AnonymousEvent = LuminFramework.Event() -local AnonymousEvent2 = LuminFramework.Event() -- no name conflicts! - -AnonymousEvent:Connect(function(data) - print(data) -- Output: "Signal 1" -end) - -AnonymousEvent:Fire( - "Event 1" -) - -AnonymousEvent2:Connect(function(data) - print(data) -- Output: "Signal 2" -end) - -AnonymousEvent2:Fire( - "Event 2" -) -``` - -Anonymous events share identical methods with `Event` so there is nothing new to learn here. - -### Connections - -`Connections` are what is returned by `Events`, and it is simply a function you can call to disconnect. You can do this either by using `Signal:Connect` or `Signal:Once`, then calling the returned function which essentially acts as a `Connection:Disconnect` method. \ No newline at end of file diff --git a/docs/guides/index.md b/docs/guides/index.md index 2211eaae..565b41ee 100644 --- a/docs/guides/index.md +++ b/docs/guides/index.md @@ -8,10 +8,4 @@ You must you use a server script to start the framework or else unexpected event ### Initialize the Framework -Initializing the framework is as simple as requiring the main module and you are done. Once you do this, you may see a few things in the output. - -![Setup example image](images/setupexample.png) - -You will see the above for both the client and the server. This is the amount of time it took for the framework to start up, in milliseconds. If you want to benchmark further, this API is available on the main module, `LoadTime`. - -And that's about it! Moving on to the next guides should be easy from here. \ No newline at end of file +Initializing the framework is as simple as requiring the main module and you are done. Moving on to the next guides should be easy from here. \ No newline at end of file diff --git a/docs/installation.md b/docs/installation.md index 07f8e880..490b8736 100644 --- a/docs/installation.md +++ b/docs/installation.md @@ -9,5 +9,5 @@ ### Wally 1. Create a new Git project or open one -2. Add `lumin/framework@^7.0.0` to your `wally.toml` file +2. Add `lumin/framework@^8.0.0` to your `wally.toml` file 3. Run `wally install` and LuminFramework should be inside of your `/Packages` directory. \ No newline at end of file diff --git a/docs/recaps/august2023.md b/docs/recaps/august2023.md index 20046dfc..7eb1b23b 100644 --- a/docs/recaps/august2023.md +++ b/docs/recaps/august2023.md @@ -1,4 +1,4 @@ -# Engine Recap - August 2023 +# Recap - August 2023 August 24, 2023 · 2 min read by **[James - Lead Programmer](https://github.com/lolmansReturn)** diff --git a/docs/recaps/december2023.md b/docs/recaps/december2023.md index f7741db6..2fc97f2f 100644 --- a/docs/recaps/december2023.md +++ b/docs/recaps/december2023.md @@ -1,4 +1,4 @@ -# Engine Recap - December 2023 +# Recap - December 2023 December 27, 2023 · 1 min read by **[James - Lead Programmer](https://github.com/lolmansReturn)** diff --git a/docs/recaps/february2024.md b/docs/recaps/february2024.md new file mode 100644 index 00000000..2cebf208 --- /dev/null +++ b/docs/recaps/february2024.md @@ -0,0 +1,30 @@ +# Recap - February 2024 +March 1, 2024 · 1 min read + +by **[James - Lead Programmer](https://github.com/lolmansReturn)** + +--- + +**Hi developers,** + +With framework update 7.0.0, we have been working on a upgraded networking system and a better API naming scheme. + +### New Networking System + +Here we bring you another new networking system once again, completely rethought from the ground up. What it is doing is this time it is separating events and functions, no longer making specific controllers. This makes more sense for newer users and also has some performance gains. + +### Rename Older API + +We renamed a fair bit of the older API to make more sense with the latest standards. This includes renaming `Signal` to `Event` to have parity with our networking system. + +### Docs Overhaul + +We completely overhauled the docs fixing any issues with grammar or using older API examples. We also fixed up the changelog by updating links and fixing wrong information. + +### New Automation Features + +New automation scripts have been added to the Git repository, featuring automatically created releases and automatically published wally packages. This is now standard with the rest of our packages as well! + +--- + +If you're interested in contributing, please make a PR on our GitHub! \ No newline at end of file diff --git a/docs/recaps/index.md b/docs/recaps/index.md index 6ca92b57..ae8fb52a 100644 --- a/docs/recaps/index.md +++ b/docs/recaps/index.md @@ -1,29 +1,29 @@ -# Engine Recap - February 2024 -March 1, 2024 · 1 min read +# Recap - April 2024 +April 28, 2024 · 1 min read -by **[James - Lead Programmer](https://github.com/lolmansReturn)** +by **[James - Lead Programmer](https://github.com/2jammers)** --- **Hi developers,** -With framework update 7.0.0, we have been working on a upgraded networking system and a better API naming scheme. +With update 8.0.0, you recieve a totally refreshed and rethought framework -### New Networking System +### Custom Networking System -Here we bring you another new networking system once again, completely rethought from the ground up. What it is doing is this time it is separating events and functions, no longer making specific controllers. This makes more sense for newer users and also has some performance gains. +Instead of relying on an external package, we have made our own custom networking system with similar performance gains. Some improvements include the addition of the `FireNow` API. This allows you to skip batching and not fire the next frame, and we also introduced batching for unreliable events. If the collected data is under 840 bytes by the time it is batched, you will see performance gains. -### Rename Older API +### Better Module Loading -We renamed a fair bit of the older API to make more sense with the latest standards. This includes renaming `Signal` to `Event` to have parity with our networking system. +We improved the module loader API, now allowing for a filter and a parent instance instead of a list. We highly encourage a single-script architecture in light of this change, and this makes it much easier. -### Docs Overhaul +### Better Documentation -We completely overhauled the docs fixing any issues with grammar or using older API examples. We also fixed up the changelog by updating links and fixing wrong information. +We have rewritten the tutorials in the documentation to include better wording and they are now much easier to follow along with. We also introduced more tutorials for each API area. -### New Automation Features +### Branding Changes -New automation scripts have been added to the Git repository, featuring automatically created releases and automatically published wally packages. This is now standard with the rest of our packages as well! +We changed the framework name from CanaryEngine to LuminFramework in light of the organization changing. We hope that it is much easier to distinguish the framework from a game engine now! --- diff --git a/docs/recaps/july2023.md b/docs/recaps/july2023.md index 9b40de78..93c39556 100644 --- a/docs/recaps/july2023.md +++ b/docs/recaps/july2023.md @@ -1,4 +1,4 @@ -# Engine Recap - July 2023 +# Recap - July 2023 July 31, 2023 · 2 min read by **[James - Lead Programmer](https://github.com/lolmansReturn)** diff --git a/docs/recaps/june2023.md b/docs/recaps/june2023.md index 0af2e615..efbe9178 100644 --- a/docs/recaps/june2023.md +++ b/docs/recaps/june2023.md @@ -1,4 +1,4 @@ -# Engine Recap - June 2023 +# Recap - June 2023 June 28, 2023 · 2 min read by **[James - Lead Programmer](https://github.com/lolmansReturn)** diff --git a/docs/recaps/november2023.md b/docs/recaps/november2023.md index e7198fad..5fd5e988 100644 --- a/docs/recaps/november2023.md +++ b/docs/recaps/november2023.md @@ -1,4 +1,4 @@ -# Engine Recap - November 2023 +# Recap - November 2023 November 21, 2023 · 1 min read by **[James - Lead Programmer](https://github.com/lolmansReturn)** diff --git a/docs/recaps/october2023.md b/docs/recaps/october2023.md index d68ec7b7..d9eaaf3b 100644 --- a/docs/recaps/october2023.md +++ b/docs/recaps/october2023.md @@ -1,4 +1,4 @@ -# Engine Recap - October 2023 +# Recap - October 2023 October 27, 2023 · 1 min read by **[James - Lead Programmer](https://github.com/lolmansReturn)** diff --git a/docs/recaps/september2023.md b/docs/recaps/september2023.md index 8d9ea6eb..f93b4e49 100644 --- a/docs/recaps/september2023.md +++ b/docs/recaps/september2023.md @@ -1,4 +1,4 @@ -# Engine Recap - September 2023 +# Recap - September 2023 September 23, 2023 · 1 min read by **[James - Lead Programmer](https://github.com/lolmansReturn)** diff --git a/src/Network/Interface.luau b/src/Network/Interface.luau index 2965846d..d3d90989 100644 --- a/src/Network/Interface.luau +++ b/src/Network/Interface.luau @@ -174,7 +174,7 @@ function ServerEvent:SetRateLimit( ) if maxCalls <= -1 then self._Ratelimit = nil - self._InvokeOverflow = nil + self._CallOverflow = nil end if not (resetInterval and fireOverflowCallback) then @@ -182,25 +182,25 @@ function ServerEvent:SetRateLimit( end self._Ratelimit = Ratelimit(maxCalls, resetInterval or 1) :: any - self._InvokeOverflow = fireOverflowCallback :: any + self._CallOverflow = fireOverflowCallback :: any end function ServerFunction:SetRateLimit( maxCalls: number, resetInterval: number?, - invokeOverflowCallback: (sender: Player) -> ()? + callOverflowCallback: (sender: Player) -> ()? ) if maxCalls <= -1 then self._Ratelimit = nil - self._InvokeOverflow = nil + self._CallOverflow = nil end - if not (resetInterval and invokeOverflowCallback) then + if not (resetInterval and callOverflowCallback) then return end self._Ratelimit = Ratelimit(maxCalls, resetInterval or 1) :: any - self._InvokeOverflow = invokeOverflowCallback :: any + self._InvokeOverflow = callOverflowCallback :: any end function ServerFunction:OnInvoke( @@ -237,4 +237,4 @@ end return { new = new, -} +} \ No newline at end of file diff --git a/src/Network/init.luau b/src/Network/init.luau index 2100cb88..621ce934 100644 --- a/src/Network/init.luau +++ b/src/Network/init.luau @@ -1,3 +1,4 @@ +-- Credit to Redblox for the original code, this is a bit modified and improved local ReplicatedStorage = game:GetService("ReplicatedStorage") local RunService = game:GetService("RunService")