Skip to content
This repository has been archived by the owner on Jul 28, 2022. It is now read-only.

Commit

Permalink
Improved error reporting
Browse files Browse the repository at this point in the history
  • Loading branch information
Sleitnick committed Jan 30, 2019
1 parent 415c970 commit 54b9bff
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
13 changes: 8 additions & 5 deletions src/ServerScriptService/Aero/AeroServer.script.lua
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,16 @@ local AeroServer = {

local mt = {__index = AeroServer}

local servicesFolder = game:GetService("ServerStorage"):WaitForChild("Aero"):WaitForChild("Services")
local modulesFolder = game:GetService("ServerStorage"):WaitForChild("Aero"):WaitForChild("Modules")
local sharedFolder = game:GetService("ReplicatedStorage"):WaitForChild("Aero"):WaitForChild("Shared")
local servicesFolder = game:GetService("ServerStorage").Aero.Services
local modulesFolder = game:GetService("ServerStorage").Aero.Modules
local sharedFolder = game:GetService("ReplicatedStorage").Aero.Shared
local internalFolder = game:GetService("ReplicatedStorage").Aero.Internal

local remoteServices = Instance.new("Folder")
remoteServices.Name = "AeroRemoteServices"

local FastSpawn = require(internalFolder.FastSpawn)


function AeroServer:RegisterEvent(eventName)
local event = self.Shared.Event.new()
Expand Down Expand Up @@ -90,7 +93,7 @@ function AeroServer:WrapModule(tbl)
tbl:Init()
end
if (type(tbl.Start) == "function" and not tbl.__aeroPreventStart) then
coroutine.wrap(tbl.Start)(tbl)
FastSpawn(tbl.Start, tbl)
end
end

Expand Down Expand Up @@ -155,7 +158,7 @@ function StartService(service)

-- Start services on separate threads:
if (type(service.Start) == "function") then
coroutine.wrap(service.Start)(service)
FastSpawn(service.Start, service)
end

end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ local mt = {__index = Aero}
local controllersFolder = script.Parent:WaitForChild("Controllers")
local modulesFolder = script.Parent:WaitForChild("Modules")
local sharedFolder = game:GetService("ReplicatedStorage"):WaitForChild("Aero"):WaitForChild("Shared")
local internalFolder = game:GetService("ReplicatedStorage").Aero:WaitForChild("Internal")

local FastSpawn = require(internalFolder:WaitForChild("FastSpawn"))


function Aero:RegisterEvent(eventName)
Expand Down Expand Up @@ -49,7 +52,7 @@ function Aero:WrapModule(tbl)
tbl:Init()
end
if (type(tbl.Start) == "function" and not tbl.__aeroPreventStart) then
coroutine.wrap(tbl.Start)(tbl)
FastSpawn(tbl.Start, tbl)
end
end

Expand Down Expand Up @@ -118,12 +121,10 @@ end


function StartController(controller)

-- Start controllers on separate threads:
if (type(controller.Start) == "function") then
coroutine.wrap(controller.Start)(controller)
FastSpawn(controller.Start, controller)
end

end


Expand Down

0 comments on commit 54b9bff

Please sign in to comment.