-- Compiled with roblox-ts v1.2.7 local TS = _G[script] local RunService = TS.import(script, TS.getModule(script, "@rbxts", "services")).RunService local Remotes = TS.import(script, script.Parent, "Shared", "Remotes").default local GetCommandService = TS.import(script, script.Parent, "Services").GetCommandService local Lazy = TS.import(script, script.Parent, "Shared", "Lazy") local ZirconLogLevel = TS.import(script, script.Parent, "Client", "Types").ZirconLogLevel local ZirconDebug = TS.import(script, script.Parent, "Shared", "Debugging").ZirconDebug local IsServer = RunService:IsServer() local ZirconServer = {} do local _container = ZirconServer --[[ * * The server registry for Zircon ]] local Registry = Lazy(function() assert(IsServer, "Zircon Service only accessible on server") return GetCommandService("RegistryService") end) _container.Registry = Registry --[[ * * The server dispatch for Zircon ]] local Dispatch = Lazy(function() assert(IsServer, "Zircon Service only accessible on server") return GetCommandService("DispatchService") end) _container.Dispatch = Dispatch local Log = Lazy(function() assert(IsServer, "Zircon Service only accessible on server") return GetCommandService("LogService") end) _container.Log = Log if RunService:IsServer() then local StandardOutput = Remotes.Server:Create("ZrSiO4/StandardOutput") local StandardError = Remotes.Server:Create("ZrSiO4/StandardError") local DispatchToServer = Remotes.Server:Create("ZrSiO4/DispatchToServer") local dispatch = TS.async(function(player, text) local _exp = Dispatch.ExecuteScript(player, text) local _arg0 = function(result) return result:execute() end return _exp:andThen(_arg0) end) DispatchToServer:Connect(function(player, message) local _exp = dispatch(player, message) local _arg0 = function(output) for _, message in ipairs(output) do StandardOutput:SendToPlayer(player, { type = "ZrStandardOutput", time = DateTime.now().UnixTimestamp, script = "zr", message = message, }) end end _exp:andThen(_arg0):catch(function(err) for _, zrError in ipairs(err) do local errStruct = ZirconDebug.GetMessageForError(message, zrError) StandardError:SendToPlayer(player, errStruct) end end) end) local GetPlayerOptions = Remotes.Server:Create("ZrSiO4/GetPlayerPermissions") GetPlayerOptions:SetCallback(function(player) local group = Registry.GetHighestPlayerGroup(player) if group then return group:GetPermissions() else Log.Write(ZirconLogLevel.Wtf, "GetPlayerPermissions", "Could not fetch permissions for player {}", { Variables = { player }, }) return {} end end) end end local default = ZirconServer return { default = default, }