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

Commit

Permalink
Update DataService.lua
Browse files Browse the repository at this point in the history
  • Loading branch information
ThoughtSpinnr authored Mar 24, 2019
1 parent 80fe858 commit bdc063f
Showing 1 changed file with 6 additions and 13 deletions.
19 changes: 6 additions & 13 deletions src/ServerStorage/Aero/Services/DataService.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,16 @@
--[[
Server:
PLAYER DATA METHODS:
DataService:Set(player, key, value)
DataService:Get(player, key)
DataService:Remove(player, key)
DataService:OnUpdate(player, key, callback)
DataService:Flush(player)
DataService:FlushKey(player, key)
DataService:FlushAll()
DataService:FlushAllConcurrent()
GLOBAL DATA METHODS:
DataService:SetGlobal(key, value)
Expand All @@ -25,8 +23,6 @@
DataService:OnUpdateGlobal(key, callback)
DataService:FlushGlobal(key)
DataService:FlushAllGlobal()
CUSTOM DATA METHODS:
DataService:SetCustom(name, scope, key, value)
Expand All @@ -36,14 +32,9 @@
DataService:FlushCustom(name, scope, key)
DataService:FlushAllCustom(name, scope, key)
GAME CLOSING CALLBACK:
DataService:BindToClose(callbackFunction)
EVENTS:
DataService.PlayerFailed(player, method, key, errorMessage)
DataService.GlobalFailed(method, key, errorMessage)
DataService.CustomFailed(name, scope, method, key, errorMessage)
Expand All @@ -52,7 +43,6 @@
Client:
DataService:Get(key)
DataService.Failed(method, key, errorMessage)
--]]
Expand Down Expand Up @@ -130,6 +120,11 @@ function DataService:Remove(player, key)
end


function DataService:OnUpdate(player, key, callback)
self:GetPlayerCache(player):OnUpdate(key, callback)
end


function DataService:SetGlobal(key, value)
globalCache:Set(key, value)
end
Expand Down Expand Up @@ -271,7 +266,6 @@ function DataService:Start()
local function FireBoundToCloseCallbacks()

--[[ CONCURRENCY DISABLED DUE TO BINDTOCLOSE YIELDING BUG
local thread = coroutine.running()
local numBinded = #boundToCloseFuncs
if (numBinded == 0) then return end
Expand All @@ -288,7 +282,6 @@ function DataService:Start()
end)()
end
coroutine.yield()
]]

-- Temporary patch using BindableEvent instead of coroutines:
Expand Down

0 comments on commit bdc063f

Please sign in to comment.