Skip to content

Commit

Permalink
fix small issues
Browse files Browse the repository at this point in the history
  • Loading branch information
James committed Sep 26, 2023
1 parent a1aef73 commit 3e05583
Show file tree
Hide file tree
Showing 20 changed files with 150 additions and 330 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# CanaryEngine

CanaryEngine is a lightweight and performant game framework for beginners and power-users alike. View more info at [CanaryEngine | Docs](https://canary-development.github.io/CanaryEngine)
CanaryEngine is a lightweight and performant game framework for beginners and power-users alike. View more info at the [CanaryEngine documentation](https://canary-development.github.io/CanaryEngine)
4 changes: 3 additions & 1 deletion docs/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ keywords: [roblox, game, framework, changelog, updates]

# Changelog

## 4.0.0
This is the changelog which is changed every update, and we follow semver. To see what we're working on, head to our [Trello](https://trello.com/b/fTJOmMua/canaryengine) board.

## 4.0.0-rc1

### Added

Expand Down
8 changes: 1 addition & 7 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,10 @@ hero:
actions:
- theme: brand
text: Documentation
link: /tutorials/update
link: /tutorial/update
- theme: alt
text: API Reference
link: /api/engine/framework/canaryengine
- theme: alt
text: Trello Board
link: https://trello.com/b/fTJOmMua/canaryengine
- theme: alt
text: Roblox Plugin
link: https://create.roblox.com/marketplace/asset/12591143042

features:
- icon: 🎒
Expand Down
3 changes: 2 additions & 1 deletion plugin/settings/settings.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"Files": 14,
"CanaryStudioChangelog": "We've made some large changes since the last update to the plugin and have fixed lots of bugs!\n\nInstalling has been revamped - The process is now a lot quicker and more performant\nRedesigned Home Page - The home page now has a menu bar and shows this changelog\nInternal code rework - It's now a lot easier to fix issues and add new features"
"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."
}
14 changes: 10 additions & 4 deletions plugin/src/json/librarieslist.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,10 @@
"Source": "https://raw.githubusercontent.com/red-blox/Util/main/libs/Spawn/Spawn.luau"
}
},
"Promise": {
"Future": {
"$className": "ModuleScript",
"$properties": {
"Source": "https://raw.githubusercontent.com/red-blox/Util/main/libs/Promise/Promise.luau"
"Source": "https://raw.githubusercontent.com/red-blox/Util/main/libs/Future/Future.luau"
}
},
"Init": {
Expand All @@ -97,13 +97,19 @@
"Signal": {
"$className": "ModuleScript",
"$properties": {
"Source": "https://raw.githubusercontent.com/canary-development/CanaryEngine/master/src/lua/libraries/benchmark/Vendor/Signal.luau"
"Source": "https://raw.githubusercontent.com/canary-development/CanaryEngine/master/src/lua/libraries/signal/init.luau"
}
},
"Spawn": {
"$className": "ModuleScript",
"$properties": {
"Source": "https://raw.githubusercontent.com/canary-development/CanaryEngine/master/src/lua/libraries/signal/spawn.luau"
}
},
"Statistics": {
"$className": "ModuleScript",
"$properties": {
"Source": "https://raw.githubusercontent.com/canary-development/CanaryEngine/master/src/lua/libraries/benchmark/Vendor/Statistics.luau"
"Source": "https://raw.githubusercontent.com/canary-development/CanaryEngine/master/src/lua/libraries/statistics/init.luau"
}
}
},
Expand Down
3 changes: 1 addition & 2 deletions plugin/src/lua/templates/scripts/client-script.lua
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
-- // Engine

local ReplicatedStorage = game:GetService("ReplicatedStorage")

local CanaryEngine = require(ReplicatedStorage.Framework.Init)
local EngineClient = CanaryEngine.GetEngineClient()

Expand All @@ -9,8 +10,6 @@ local Media = ReplicatedStorage.EngineClient.Media

-- // Variables

local variable = 1

-- // Functions

-- // Connections
Expand Down
5 changes: 2 additions & 3 deletions plugin/src/lua/templates/scripts/server-script.lua
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
-- // Engine
-- // Script

local ReplicatedStorage = game:GetService("ReplicatedStorage")
local ServerStorage = game:GetService("ServerStorage")

local CanaryEngine = require(ReplicatedStorage.Framework.Init)
local EngineServer = CanaryEngine.GetEngineServer()

Expand All @@ -10,8 +11,6 @@ local Media = ServerStorage.EngineServer.Media

-- // Variables

local variable = 1

-- // Functions

-- // Connections
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
local Red = require(script.Parent.Red)
local Red = require(script.Parent.Parent.Vendor.Red)

return Red.Event(function()
return
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,51 +30,49 @@ function NetworkController.CreateController(name: string)
local self = setmetatable({ }, RunService:IsClient() and Indexes[1] or Indexes[2])

self.Name = name
self._Bridge = BridgeNet.ReferenceBridge(name)
self._Event = BridgeNet.ReferenceBridge(name)

return self
end

-- Network Controller Client

function NetworkControllerClient:Fire(data: ({any} | any)?)
self._Bridge:Fire(Sanitize(data))
self._Event:Fire(Sanitize(data))
end

function NetworkControllerClient:Listen(func: (data: {any}?) -> ())
local Connection = self._Bridge:Connect(func)

return Connection
self._Event:Connect(func)
end

function NetworkControllerClient:InvokeAsync(data: ({any} | any)?)
return Future.new(function()
return Sanitize(self._Bridge:InvokeServerAsync(Sanitize(data)))
return Sanitize(self._Event:InvokeServerAsync(Sanitize(data)))
end)
end

-- Network Controller Server

function NetworkControllerServer:Fire(recipients: Player | {Player}, data: ({any} | any)?)
if type(recipients) ~= "table" then
self._Bridge:Fire(recipients, Sanitize(data))
self._Event:Fire(recipients, Sanitize(data))
return
end

self._Bridge:Fire(BridgeNet.Players(recipients), Sanitize(data))
self._Event:Fire(BridgeNet.Players(recipients), Sanitize(data))
end

function NetworkControllerServer:FireAll(data: ({any} | any)?)
self._Bridge:Fire(BridgeNet.AllPlayers(), Sanitize(data))
self._Event:Fire(BridgeNet.AllPlayers(), Sanitize(data))
end

function NetworkControllerServer:FireExcept(except: Player | {Player}, data: ({any} | any)?)
if type(except) ~= "table" then
self._Bridge:Fire(BridgeNet.PlayersExcept({except}), Sanitize(data))
self._Event:Fire(BridgeNet.PlayersExcept({except}), Sanitize(data))
return
end

self._Bridge:Fire(BridgeNet.PlayersExcept(except), Sanitize(data))
self._Event:Fire(BridgeNet.PlayersExcept(except), Sanitize(data))
end

function NetworkControllerServer:FireInRange(comparePoint: Vector3, maximumRange: number, data: ({any} | any)?)
Expand All @@ -90,8 +88,7 @@ function NetworkControllerServer:FireInRange(comparePoint: Vector3, maximumRange
end

function NetworkControllerServer:Listen(func: (sender: Player, data: {any}?) -> ())
local Connection = self._Bridge:Connect(func)
return Connection
self._Event:Connect(func)
end

function NetworkControllerServer:SetRateLimit(maxInvokesPerSecond: number, invokeOverflowCallback: ((sender: Player) -> ())?)
Expand All @@ -104,13 +101,16 @@ function NetworkControllerServer:SetRateLimit(maxInvokesPerSecond: number, invok
return
end

self._Bridge:RateLimit(maxInvokesPerSecond, invokeOverflowCallback)
self._Event:RateLimit(maxInvokesPerSecond, invokeOverflowCallback)
end

function NetworkControllerServer:OnInvoke(callback: (sender: Player, data: {any}?) -> (({any} | any)))
self._Bridge.OnServerInvoke = callback
self._Event.OnServerInvoke = callback
end

-- // Actions

return NetworkController
table.freeze(NetworkControllerServer)
table.freeze(NetworkControllerClient)

return table.freeze(NetworkController)
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
-- // Package

local SignalController = { }
local SignalControllerObject = { }

SignalController.__index = SignalControllerObject
SignalController.__index = SignalController

-- // Variables

Expand All @@ -24,15 +22,15 @@ function SignalController.CreateController(name: string)
return self
end

function SignalControllerObject:Fire(data: ({any} | any)?)
function SignalController:Fire(data: ({any} | any)?)
self._Signal:Fire(Sanitize(data))
end

function SignalControllerObject:Connect(func: (data: {any}?) -> ())
function SignalController:Connect(func: (data: {any}?) -> ())
return self._Signal:Connect(func)
end

function SignalControllerObject:Once(func: (data: {any}?) -> ())
function SignalController:Once(func: (data: {any}?) -> ())
local Disconnect

Disconnect = self._Signal:Connect(function(data)
Expand All @@ -43,16 +41,16 @@ function SignalControllerObject:Once(func: (data: {any}?) -> ())
return Disconnect
end

function SignalControllerObject:Wait(): {any}?
function SignalController:Wait(): {any}?
return self._Signal:Wait()
end

function SignalControllerObject:DisconnectAll()
function SignalController:DisconnectAll()
self._Signal:DisconnectAll()
end

-- // Connections

-- // Actions

return SignalController
return table.freeze(SignalController)
2 changes: 1 addition & 1 deletion src/lua/framework/Vendor/Debugger.luau
Original file line number Diff line number Diff line change
Expand Up @@ -175,4 +175,4 @@ end

-- // Actions

return EngineDebugger
return table.freeze(EngineDebugger)
3 changes: 0 additions & 3 deletions src/lua/framework/Vendor/Libraries/RedbloxUtils/Signal.luau
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
-- // by jackdotink
-- // modded by lolmansReturn

local Spawn = require(script.Parent.Spawn)

type SignalNode<T...> = {
Expand Down
2 changes: 1 addition & 1 deletion src/lua/framework/Vendor/Runtime.luau
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ local EngineRuntimeSettings = {
EngineRuntime.Context = EngineRuntimeContext
EngineRuntime.Settings = EngineRuntimeSettings

return EngineRuntime
return table.freeze(EngineRuntime)
6 changes: 3 additions & 3 deletions src/lua/framework/init.luau
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ end
function CanaryEngine.GetEngineServer()
if RuntimeContext.Server then
CanaryEngineServer.Data = require(EngineVendor.Libraries.EasyProfile.Init)
return CanaryEngineServer
return table.freeze(CanaryEngineServer)
else
Debugger.Debug(error, "Failed to fetch 'EngineServer', context must be server.", nil, false)
return
Expand All @@ -71,7 +71,7 @@ function CanaryEngine.GetEngineClient()
CanaryEngineClient.PlayerGui = Player:WaitForChild("PlayerGui") :: typeof(game:GetService("StarterGui"))
CanaryEngineClient.PlayerBackpack = Player:WaitForChild("Backpack") :: typeof(game:GetService("StarterPack"))

return CanaryEngineClient
return table.freeze(CanaryEngineClient)
else
Debugger.Debug(error, "Failed to fetch 'EngineClient', context must be client.", nil, false)
return
Expand All @@ -80,7 +80,7 @@ end

-- Exclusive API for replicated will come soon
function CanaryEngine.GetEngineReplicated()
return CanaryEngineReplicated
return table.freeze(CanaryEngineReplicated)
end

-- Signal Creation
Expand Down
Loading

0 comments on commit 3e05583

Please sign in to comment.