@ecsframework/player-data-handler 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/flamework.build +23 -0
- package/out/decorators/saved.d.ts +12 -0
- package/out/decorators/saved.luau +16 -0
- package/out/index.d.ts +4 -0
- package/out/init.luau +13 -0
- package/out/profile-wrapper.d.ts +41 -0
- package/out/profile-wrapper.luau +199 -0
- package/out/systems/saving-system.d.ts +14 -0
- package/out/systems/saving-system.luau +82 -0
- package/out/tsconfig.tsbuildinfo +1 -0
- package/out/types.d.ts +10 -0
- package/package.json +49 -0
package/flamework.build
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 1,
|
|
3
|
+
"flameworkVersion": "1.3.1",
|
|
4
|
+
"identifiers": {
|
|
5
|
+
"@ecsframework/player-data-handler:out/profile-wrapper@ProfileWrapper": "$ecsframework:player-data-handler:profile-wrapper@ProfileWrapper",
|
|
6
|
+
"@ecsframework/player-data-handler:out/systems/saving-system@SavingSystem": "$ecsframework:player-data-handler:systems/saving-system@SavingSystem",
|
|
7
|
+
"@ecsframework/player-data-handler:out/decorators/saved@SavedTag": "$ecsframework:player-data-handler:decorators/saved@SavedTag"
|
|
8
|
+
},
|
|
9
|
+
"metadata": {},
|
|
10
|
+
"identifierPrefix": "$ecsframework:player-data-handler",
|
|
11
|
+
"classes": [
|
|
12
|
+
{
|
|
13
|
+
"filePath": "out\\systems\\saving-system.lua",
|
|
14
|
+
"internalId": "$ecsframework:player-data-handler:systems/saving-system@SavingSystem",
|
|
15
|
+
"decorators": [
|
|
16
|
+
{
|
|
17
|
+
"internalId": "$ecsframework:core:framework/decorators/system@ECSSystem",
|
|
18
|
+
"name": "ECSSystem"
|
|
19
|
+
}
|
|
20
|
+
]
|
|
21
|
+
}
|
|
22
|
+
]
|
|
23
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Tag } from "@ecsframework/core";
|
|
2
|
+
import { Modding } from "@flamework/core";
|
|
3
|
+
import { Constructor } from "@flamework/core/out/utility";
|
|
4
|
+
import { SavedOption } from "../types";
|
|
5
|
+
export interface SavedTag extends Tag {
|
|
6
|
+
}
|
|
7
|
+
type ConvertInObject<T> = {
|
|
8
|
+
[P in keyof T]: T[P];
|
|
9
|
+
};
|
|
10
|
+
/** @metadata macro */
|
|
11
|
+
export declare function Saved<T extends object>(options?: SavedOption<T>, guard?: Modding.Generic<ConvertInObject<T>, "guard">): (target: Constructor<T>) => void;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
-- Compiled with roblox-ts v3.0.0
|
|
2
|
+
local TS = _G[script]
|
|
3
|
+
local DefineClassComponentMeta = TS.import(script, TS.getModule(script, "@ecsframework", "core").out).DefineClassComponentMeta
|
|
4
|
+
--* @metadata macro
|
|
5
|
+
local function Saved(options, guard)
|
|
6
|
+
if options == nil then
|
|
7
|
+
options = {}
|
|
8
|
+
end
|
|
9
|
+
return function(target)
|
|
10
|
+
options.Guard = guard
|
|
11
|
+
DefineClassComponentMeta(target, options, "$ecsframework:player-data-handler:decorators/saved@SavedTag")
|
|
12
|
+
end
|
|
13
|
+
end
|
|
14
|
+
return {
|
|
15
|
+
Saved = Saved,
|
|
16
|
+
}
|
package/out/index.d.ts
ADDED
package/out/init.luau
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
-- Compiled with roblox-ts v3.0.0
|
|
2
|
+
local TS = _G[script]
|
|
3
|
+
local exports = {}
|
|
4
|
+
for _k, _v in TS.import(script, script, "profile-wrapper") or {} do
|
|
5
|
+
exports[_k] = _v
|
|
6
|
+
end
|
|
7
|
+
for _k, _v in TS.import(script, script, "decorators", "saved") or {} do
|
|
8
|
+
exports[_k] = _v
|
|
9
|
+
end
|
|
10
|
+
for _k, _v in TS.import(script, script, "systems", "saving-system") or {} do
|
|
11
|
+
exports[_k] = _v
|
|
12
|
+
end
|
|
13
|
+
return exports
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { BaseSystem } from "@ecsframework/core";
|
|
2
|
+
import { VoidCallback } from "@ecsframework/core/out/framework/utilities";
|
|
3
|
+
import { Entity, World } from "@rbxts/jecs";
|
|
4
|
+
import { t } from "@rbxts/t";
|
|
5
|
+
import { Constructor } from "@flamework/core/out/utility";
|
|
6
|
+
import { DependenciesContainer } from "@ecsframework/core/out/framework/dependencies-container";
|
|
7
|
+
export interface ComponentInfo {
|
|
8
|
+
Guard: t.check<unknown>;
|
|
9
|
+
Ctor: Constructor<unknown>;
|
|
10
|
+
OnCreateData?: (world: World, container: DependenciesContainer, system: BaseSystem) => object;
|
|
11
|
+
Migrations: ((data: unknown) => unknown)[];
|
|
12
|
+
}
|
|
13
|
+
export interface ComponentData {
|
|
14
|
+
Data: unknown;
|
|
15
|
+
Version: number;
|
|
16
|
+
}
|
|
17
|
+
export declare abstract class ProfileWrapper {
|
|
18
|
+
protected readonly player: Player;
|
|
19
|
+
protected readonly entity: Entity;
|
|
20
|
+
protected readonly system: BaseSystem;
|
|
21
|
+
protected readonly world: World;
|
|
22
|
+
protected readonly container: DependenciesContainer;
|
|
23
|
+
private onClose;
|
|
24
|
+
protected abstract readonly isSaveDataWhenClose: boolean;
|
|
25
|
+
private data;
|
|
26
|
+
private savedComponents;
|
|
27
|
+
private isLoaded;
|
|
28
|
+
private isClosed;
|
|
29
|
+
private connections;
|
|
30
|
+
constructor(player: Player, entity: Entity, system: BaseSystem, world: World, container: DependenciesContainer, onClose: VoidCallback);
|
|
31
|
+
protected abstract onLoadProfile(): Promise<Map<string, ComponentData>>;
|
|
32
|
+
protected abstract onSaveProfile(data: Map<string, ComponentData>): Promise<void>;
|
|
33
|
+
protected abstract onCloseProfile(): Promise<void>;
|
|
34
|
+
protected abstract onChangedData(data: Map<string, ComponentData>): void;
|
|
35
|
+
private changeData;
|
|
36
|
+
private createComponentData;
|
|
37
|
+
private subscribeToComponents;
|
|
38
|
+
LoadProfile(): Promise<Map<string, ComponentData>>;
|
|
39
|
+
SaveProfile(): Promise<void>;
|
|
40
|
+
CloseProfile(): Promise<void>;
|
|
41
|
+
}
|
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
-- Compiled with roblox-ts v3.0.0
|
|
2
|
+
local TS = _G[script]
|
|
3
|
+
local produce = TS.import(script, TS.getModule(script, "@rbxts", "immut").src).produce
|
|
4
|
+
local ProfileWrapper
|
|
5
|
+
do
|
|
6
|
+
ProfileWrapper = {}
|
|
7
|
+
function ProfileWrapper:constructor(player, entity, system, world, container, onClose)
|
|
8
|
+
self.player = player
|
|
9
|
+
self.entity = entity
|
|
10
|
+
self.system = system
|
|
11
|
+
self.world = world
|
|
12
|
+
self.container = container
|
|
13
|
+
self.onClose = onClose
|
|
14
|
+
self.data = {}
|
|
15
|
+
self.savedComponents = {}
|
|
16
|
+
self.isLoaded = false
|
|
17
|
+
self.isClosed = false
|
|
18
|
+
self.connections = {}
|
|
19
|
+
for componentId in system:Each("$ecsframework:player-data-handler:decorators/saved@SavedTag") do
|
|
20
|
+
local savedComponent = system:GetComponentKey(componentId)
|
|
21
|
+
local ctor = system:GetClassComponent(savedComponent)
|
|
22
|
+
local options = system:GetComponent(componentId, "$ecsframework:player-data-handler:decorators/saved@SavedTag")
|
|
23
|
+
if options.Guard == nil then
|
|
24
|
+
error(`No guard found for {savedComponent}`)
|
|
25
|
+
end
|
|
26
|
+
local _savedComponents = self.savedComponents
|
|
27
|
+
local _arg0 = `{ctor}`
|
|
28
|
+
local _arg1 = {
|
|
29
|
+
Guard = options.Guard,
|
|
30
|
+
OnCreateData = options.OnCreate,
|
|
31
|
+
Ctor = ctor,
|
|
32
|
+
Migrations = options.Migrations or {},
|
|
33
|
+
}
|
|
34
|
+
_savedComponents[_arg0] = _arg1
|
|
35
|
+
end
|
|
36
|
+
end
|
|
37
|
+
function ProfileWrapper:changeData(data)
|
|
38
|
+
self.data = data
|
|
39
|
+
self:onChangedData(data)
|
|
40
|
+
end
|
|
41
|
+
function ProfileWrapper:createComponentData(componentName)
|
|
42
|
+
local _savedComponents = self.savedComponents
|
|
43
|
+
local _componentName = componentName
|
|
44
|
+
local info = _savedComponents[_componentName]
|
|
45
|
+
if info == nil then
|
|
46
|
+
error(`No info found for {componentName}`)
|
|
47
|
+
end
|
|
48
|
+
local ctor = info.Ctor
|
|
49
|
+
local _addtitionalData = info.OnCreateData
|
|
50
|
+
if _addtitionalData ~= nil then
|
|
51
|
+
_addtitionalData = _addtitionalData(self.world, self.container, self.system)
|
|
52
|
+
end
|
|
53
|
+
local addtitionalData = _addtitionalData
|
|
54
|
+
local finalData = {}
|
|
55
|
+
ctor.constructor(finalData)
|
|
56
|
+
if addtitionalData ~= nil then
|
|
57
|
+
for key, _ in pairs(addtitionalData) do
|
|
58
|
+
finalData[key] = addtitionalData[key]
|
|
59
|
+
end
|
|
60
|
+
end
|
|
61
|
+
return finalData
|
|
62
|
+
end
|
|
63
|
+
function ProfileWrapper:subscribeToComponents()
|
|
64
|
+
for componentName, componentInfo in self.savedComponents do
|
|
65
|
+
local componentData = self.data[componentName]
|
|
66
|
+
if componentData == nil then
|
|
67
|
+
local data = self:createComponentData(componentName)
|
|
68
|
+
if not componentInfo.Guard(data) then
|
|
69
|
+
error(`Data for {componentName} is invalid`)
|
|
70
|
+
end
|
|
71
|
+
componentData = {
|
|
72
|
+
Data = data,
|
|
73
|
+
Version = #componentInfo.Migrations,
|
|
74
|
+
}
|
|
75
|
+
self:changeData(produce(self.data, function(draft)
|
|
76
|
+
local _draft = draft
|
|
77
|
+
local _componentData = componentData
|
|
78
|
+
_draft[componentName] = _componentData
|
|
79
|
+
end))
|
|
80
|
+
end
|
|
81
|
+
local key = self.system:GetComponentKeyByName(componentName)
|
|
82
|
+
if not (key ~= "" and key) then
|
|
83
|
+
warn(`No component key found for {componentName}`)
|
|
84
|
+
continue
|
|
85
|
+
end
|
|
86
|
+
self.system:SetComponent(self.entity, componentData.Data, key)
|
|
87
|
+
local guard = componentInfo.Guard
|
|
88
|
+
local _connections = self.connections
|
|
89
|
+
local _arg0 = self.system:Added(key):connect(function(entity, data)
|
|
90
|
+
if entity ~= self.entity then
|
|
91
|
+
return nil
|
|
92
|
+
end
|
|
93
|
+
if guard ~= nil and not guard(data) then
|
|
94
|
+
warn(`Trying to save invalid data for {componentName}`, data)
|
|
95
|
+
return nil
|
|
96
|
+
end
|
|
97
|
+
self:changeData(produce(self.data, function(draft)
|
|
98
|
+
draft[componentName].Data = data
|
|
99
|
+
end))
|
|
100
|
+
end)
|
|
101
|
+
table.insert(_connections, _arg0)
|
|
102
|
+
local _connections_1 = self.connections
|
|
103
|
+
local _arg0_1 = self.system:Changed(key):connect(function(entity, data)
|
|
104
|
+
if entity ~= self.entity then
|
|
105
|
+
return nil
|
|
106
|
+
end
|
|
107
|
+
if guard ~= nil and not guard(data) then
|
|
108
|
+
warn(`Trying to save invalid data for {componentName}`, data)
|
|
109
|
+
return nil
|
|
110
|
+
end
|
|
111
|
+
self:changeData(produce(self.data, function(draft)
|
|
112
|
+
draft[componentName].Data = data
|
|
113
|
+
end))
|
|
114
|
+
end)
|
|
115
|
+
table.insert(_connections_1, _arg0_1)
|
|
116
|
+
end
|
|
117
|
+
end
|
|
118
|
+
ProfileWrapper.LoadProfile = TS.async(function(self)
|
|
119
|
+
if self.isLoaded then
|
|
120
|
+
return self.data
|
|
121
|
+
end
|
|
122
|
+
self.isLoaded = true
|
|
123
|
+
local data = TS.await(self:onLoadProfile())
|
|
124
|
+
for componentName, componentData in data do
|
|
125
|
+
if not (type(componentData) == "table") then
|
|
126
|
+
error(`Data for {componentName} is not a table`)
|
|
127
|
+
end
|
|
128
|
+
if componentData.Version == nil then
|
|
129
|
+
self:changeData(produce(data, function(draft)
|
|
130
|
+
draft[componentName].Version = 0
|
|
131
|
+
end))
|
|
132
|
+
end
|
|
133
|
+
if componentData.Data == nil then
|
|
134
|
+
self:changeData(produce(data, function(draft)
|
|
135
|
+
draft[componentName].Data = {}
|
|
136
|
+
end))
|
|
137
|
+
end
|
|
138
|
+
local componentInfo = self.savedComponents[componentName]
|
|
139
|
+
if componentInfo == nil then
|
|
140
|
+
continue
|
|
141
|
+
end
|
|
142
|
+
local currentData = componentData.Data
|
|
143
|
+
local currentVersion = componentData.Version
|
|
144
|
+
if #componentInfo.Migrations > componentData.Version then
|
|
145
|
+
do
|
|
146
|
+
local i = componentData.Version
|
|
147
|
+
local _shouldIncrement = false
|
|
148
|
+
while true do
|
|
149
|
+
if _shouldIncrement then
|
|
150
|
+
i += 1
|
|
151
|
+
else
|
|
152
|
+
_shouldIncrement = true
|
|
153
|
+
end
|
|
154
|
+
if not (i < #componentInfo.Migrations) then
|
|
155
|
+
break
|
|
156
|
+
end
|
|
157
|
+
currentData = componentInfo.Migrations[i + 1](currentData)
|
|
158
|
+
currentVersion += 1
|
|
159
|
+
end
|
|
160
|
+
end
|
|
161
|
+
end
|
|
162
|
+
if not componentInfo.Guard(currentData) then
|
|
163
|
+
error(`Guard failed for {componentName}`)
|
|
164
|
+
end
|
|
165
|
+
self:changeData(produce(data, function(draft)
|
|
166
|
+
draft[componentName].Data = currentData
|
|
167
|
+
draft[componentName].Version = currentVersion
|
|
168
|
+
end))
|
|
169
|
+
end
|
|
170
|
+
self:subscribeToComponents()
|
|
171
|
+
return data
|
|
172
|
+
end)
|
|
173
|
+
ProfileWrapper.SaveProfile = TS.async(function(self)
|
|
174
|
+
return self:onSaveProfile(TS.await(self:LoadProfile()))
|
|
175
|
+
end)
|
|
176
|
+
ProfileWrapper.CloseProfile = TS.async(function(self)
|
|
177
|
+
if self.isClosed then
|
|
178
|
+
return nil
|
|
179
|
+
end
|
|
180
|
+
self.isClosed = true
|
|
181
|
+
if self.isSaveDataWhenClose then
|
|
182
|
+
TS.await(self:onSaveProfile(self.data))
|
|
183
|
+
end
|
|
184
|
+
TS.await(self:onCloseProfile())
|
|
185
|
+
local _exp = self.connections
|
|
186
|
+
-- ▼ ReadonlyArray.forEach ▼
|
|
187
|
+
local _callback = function(disconnect)
|
|
188
|
+
return disconnect()
|
|
189
|
+
end
|
|
190
|
+
for _k, _v in _exp do
|
|
191
|
+
_callback(_v, _k - 1, _exp)
|
|
192
|
+
end
|
|
193
|
+
-- ▲ ReadonlyArray.forEach ▲
|
|
194
|
+
self.onClose()
|
|
195
|
+
end)
|
|
196
|
+
end
|
|
197
|
+
return {
|
|
198
|
+
ProfileWrapper = ProfileWrapper,
|
|
199
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { BaseSystem } from "@ecsframework/core";
|
|
2
|
+
import { ProfileWrapper } from "../profile-wrapper";
|
|
3
|
+
import { Constructor } from "@flamework/core/out/utility";
|
|
4
|
+
import { Entity } from "@rbxts/jecs";
|
|
5
|
+
export declare class SavingSystem extends BaseSystem {
|
|
6
|
+
private container;
|
|
7
|
+
private loadedProfile;
|
|
8
|
+
private wrapper?;
|
|
9
|
+
SetProfileWrapper(wrapper: Constructor<ProfileWrapper>): void;
|
|
10
|
+
GetProfile(player: Player): ProfileWrapper | undefined;
|
|
11
|
+
LoadProfile(player: Player, entity: Entity): Promise<ProfileWrapper>;
|
|
12
|
+
SaveProfile(player: Player): void;
|
|
13
|
+
CloseProfile(player: Player): void;
|
|
14
|
+
}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
-- Compiled with roblox-ts v3.0.0
|
|
2
|
+
local TS = _G[script]
|
|
3
|
+
local Reflect = TS.import(script, TS.getModule(script, "@flamework", "core").out).Reflect
|
|
4
|
+
local _core = TS.import(script, TS.getModule(script, "@ecsframework", "core").out)
|
|
5
|
+
local BaseSystem = _core.BaseSystem
|
|
6
|
+
local ECSSystem = _core.ECSSystem
|
|
7
|
+
local InjectType = _core.InjectType
|
|
8
|
+
local SavingSystem
|
|
9
|
+
do
|
|
10
|
+
local super = BaseSystem
|
|
11
|
+
SavingSystem = setmetatable({}, {
|
|
12
|
+
__tostring = function()
|
|
13
|
+
return "SavingSystem"
|
|
14
|
+
end,
|
|
15
|
+
__index = super,
|
|
16
|
+
})
|
|
17
|
+
SavingSystem.__index = SavingSystem
|
|
18
|
+
function SavingSystem.new(...)
|
|
19
|
+
local self = setmetatable({}, SavingSystem)
|
|
20
|
+
return self:constructor(...) or self
|
|
21
|
+
end
|
|
22
|
+
function SavingSystem:constructor(...)
|
|
23
|
+
super.constructor(self, ...)
|
|
24
|
+
self.loadedProfile = {}
|
|
25
|
+
end
|
|
26
|
+
function SavingSystem:SetProfileWrapper(wrapper)
|
|
27
|
+
self.wrapper = wrapper
|
|
28
|
+
end
|
|
29
|
+
function SavingSystem:GetProfile(player)
|
|
30
|
+
local _loadedProfile = self.loadedProfile
|
|
31
|
+
local _player = player
|
|
32
|
+
return _loadedProfile[_player]
|
|
33
|
+
end
|
|
34
|
+
SavingSystem.LoadProfile = TS.async(function(self, player, entity)
|
|
35
|
+
if not self.wrapper then
|
|
36
|
+
error("No profile wrapper set")
|
|
37
|
+
end
|
|
38
|
+
local profile = self.wrapper.new(player, entity, self, self.world, self.container, (function()
|
|
39
|
+
local _loadedProfile = self.loadedProfile
|
|
40
|
+
local _player = player
|
|
41
|
+
_loadedProfile[_player] = nil
|
|
42
|
+
end))
|
|
43
|
+
local _loadedProfile = self.loadedProfile
|
|
44
|
+
local _player = player
|
|
45
|
+
_loadedProfile[_player] = profile
|
|
46
|
+
TS.await(profile:LoadProfile())
|
|
47
|
+
return profile
|
|
48
|
+
end)
|
|
49
|
+
function SavingSystem:SaveProfile(player)
|
|
50
|
+
local _loadedProfile = self.loadedProfile
|
|
51
|
+
local _player = player
|
|
52
|
+
local profile = _loadedProfile[_player]
|
|
53
|
+
if not profile then
|
|
54
|
+
error("No profile found")
|
|
55
|
+
end
|
|
56
|
+
profile:SaveProfile()
|
|
57
|
+
end
|
|
58
|
+
function SavingSystem:CloseProfile(player)
|
|
59
|
+
local _loadedProfile = self.loadedProfile
|
|
60
|
+
local _player = player
|
|
61
|
+
local profile = _loadedProfile[_player]
|
|
62
|
+
if not profile then
|
|
63
|
+
error("No profile found")
|
|
64
|
+
end
|
|
65
|
+
profile:CloseProfile()
|
|
66
|
+
local _loadedProfile_1 = self.loadedProfile
|
|
67
|
+
local _player_1 = player
|
|
68
|
+
_loadedProfile_1[_player_1] = nil
|
|
69
|
+
end
|
|
70
|
+
do
|
|
71
|
+
-- (Flamework) SavingSystem metadata
|
|
72
|
+
Reflect.defineMetadata(SavingSystem, "identifier", "$ecsframework:player-data-handler:systems/saving-system@SavingSystem")
|
|
73
|
+
-- (Flamework) SavingSystem.container metadata
|
|
74
|
+
Reflect.defineMetadata(SavingSystem, "flamework:type", "$ecsframework:core:framework/dependencies-container@DependenciesContainer", "container")
|
|
75
|
+
end
|
|
76
|
+
SavingSystem = ECSSystem()(SavingSystem) or SavingSystem
|
|
77
|
+
end
|
|
78
|
+
-- (Flamework) SavingSystem.container decorators
|
|
79
|
+
Reflect.decorate(SavingSystem, "$ecsframework:core:framework/decorators/inject-type@InjectType", InjectType, {}, "container", false)
|
|
80
|
+
return {
|
|
81
|
+
SavingSystem = SavingSystem,
|
|
82
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"program":{"fileNames":["../node_modules/@rbxts/t/lib/t.d.ts","../node_modules/@flamework/core/out/modding.d.ts","../node_modules/@flamework/core/out/utility.d.ts","../node_modules/@rbxts/jecs/jecs.d.ts","../node_modules/@flamework/core/out/reflect.d.ts","../node_modules/@flamework/core/out/flamework.d.ts","../node_modules/@flamework/core/out/index.d.ts","../node_modules/@ecsframework/core/out/framework/dependencies-container.d.ts","../node_modules/@ecsframework/core/out/framework/flamecs/signal.d.ts","../node_modules/@ecsframework/core/out/framework/index.d.ts","../node_modules/@ecsframework/core/out/framework/flamecs/registry.d.ts","../node_modules/@ecsframework/core/out/framework/flamecs/query.d.ts","../node_modules/@rbxts/immut/src/types-internal.d.ts","../node_modules/@rbxts/immut/src/types-external.d.ts","../node_modules/@ecsframework/core/out/framework/hooks/query-change.d.ts","../node_modules/@ecsframework/core/out/framework/base-system.d.ts","../node_modules/@ecsframework/core/out/framework/flamecs/topo.d.ts","../node_modules/@ecsframework/core/out/framework/flamecs/index.d.ts","../node_modules/@ecsframework/core/out/framework/utilities.d.ts","../node_modules/@ecsframework/core/out/framework/decorators/component.d.ts","../node_modules/@ecsframework/core/out/framework/decorators/system.d.ts","../node_modules/@ecsframework/core/out/framework/decorators/inject-type.d.ts","../node_modules/@ecsframework/core/out/framework/decorators/unaffectable.d.ts","../node_modules/@ecsframework/core/out/framework/decorators/tagged.d.ts","../node_modules/@ecsframework/core/out/framework/components/destroyed-component.d.ts","../node_modules/@ecsframework/core/out/framework/components/roblox-instance-component.d.ts","../node_modules/@ecsframework/core/out/framework/systems/roblox-instance-system.d.ts","../node_modules/@ecsframework/core/out/framework/hooks/use-added.d.ts","../node_modules/@ecsframework/core/out/framework/hooks/use-removed.d.ts","../node_modules/@ecsframework/core/out/framework/hooks/use-changed.d.ts","../node_modules/@ecsframework/core/out/framework/hooks/use-event.d.ts","../node_modules/@ecsframework/core/out/framework/hooks/use-throttle.d.ts","../node_modules/@ecsframework/core/out/index.d.ts","../src/types.d.ts","../src/decorators/saved.ts","../node_modules/@rbxts/immut/src/none.d.ts","../node_modules/@rbxts/immut/src/makedraftsafe.d.ts","../node_modules/@rbxts/immut/src/makedraftsafereadonly.d.ts","../node_modules/@rbxts/immut/src/table.d.ts","../node_modules/@rbxts/immut/src/index.d.ts","../src/profile-wrapper.ts","../src/systems/saving-system.ts","../src/index.ts","../node_modules/@rbxts/types/include/generated/enums.d.ts","../node_modules/@rbxts/types/include/generated/none.d.ts","../node_modules/@rbxts/types/include/lua.d.ts","../node_modules/@rbxts/types/include/macro_math.d.ts","../node_modules/@rbxts/types/include/roblox.d.ts","../node_modules/@rbxts/compiler-types/types/array.d.ts","../node_modules/@rbxts/compiler-types/types/callmacros.d.ts","../node_modules/@rbxts/compiler-types/types/iterable.d.ts","../node_modules/@rbxts/compiler-types/types/map.d.ts","../node_modules/@rbxts/compiler-types/types/promise.d.ts","../node_modules/@rbxts/compiler-types/types/set.d.ts","../node_modules/@rbxts/compiler-types/types/string.d.ts","../node_modules/@rbxts/compiler-types/types/symbol.d.ts","../node_modules/@rbxts/compiler-types/types/typeutils.d.ts","../node_modules/@rbxts/compiler-types/types/eslintignore.d.ts","../node_modules/@rbxts/compiler-types/types/core.d.ts","../node_modules/@rbxts/maid/maid.d.ts","../node_modules/@rbxts/object-utils/index.d.ts","../node_modules/@rbxts/services/index.d.ts","../node_modules/@rbxts/signal/index.d.ts"],"fileInfos":[{"version":"0b4867459e8a965a7d9ceef9fb0314f20ae2b224d0b281d70875df517d8228a3","signature":false},{"version":"ca313ec48ea6c4a9e6a43cfe56ee981de5e3cbf8d1e961a8caf60f734bffd066","signature":false},{"version":"6a9d1f275772d2e39321d5ab6bc25b61003fdc425bf45a50e59672bcb8218d7a","signature":false},{"version":"2a21843ede3063a695f54e5cb1ef4c76a0ab9cc310b13e2997faad64744a7f06","signature":false},{"version":"392ed5c8f5c689dc2993d68bbb71fe6d87c0b6a5ffebd898bd20a3a7a6fbc6d1","signature":false},{"version":"cd7b852febe45d3283329b14f48c3d51ec5beba9b0804880e471f8201fe33840","signature":false},{"version":"121cf23c36581721a12c7d7dd08bb539d5ac20c22a65f98f29a68fd91ef5279a","signature":false},{"version":"04038ad2cdbeac08c550b5ecd101f8115854612ab7aa1fb27e032217a5f4fab1","signature":false},{"version":"eecdccbeac3b47202823c2abd08ec0a03c85e5177b829476e40a43e3ea850552","signature":false},{"version":"a60e524a1609900eff2ba42db0a13627cb0c86576a0fb79823437eff2b886534","signature":false},{"version":"ba817340a8e27930de08730f21d40f96010cbaae8abe39648a443c12cef0d112","signature":false},{"version":"1908cddf0c57e5325a452e2c1ec410dbe8f13709d1e845e89e696ff662a780ab","signature":false},{"version":"c6e031ec1fd9753a27e1e7a4f1b61c5325f3ddb8a21d2c36c4a69a0c2879a84c","signature":false},{"version":"1f8c7c6a1cd951edf43bbe58cb1c9e2d1875a8054978652f9c1fc1ec3956c127","signature":false},{"version":"5503cc71485ad7884447668827c77b872fdc188c3368baac9ad74377133090ad","signature":false},{"version":"8745ae4610b8b6072138bf00323132c0d6d3bbe07c969d4d4d8ca7297349543c","signature":false},{"version":"819d6dc57f3528e82fdf1d71feb3831a44df86ce92a5b9948e5dd56926d8ed71","signature":false},{"version":"94a6cccb410352b81df2d14e66fcdf75c3ce80322530ff6c545a3715ac259ecc","signature":false},{"version":"0278bde4bbf792eac25e3a15561a828388d55c85b836db855a192591bdcf3b6a","signature":false},{"version":"2d9a3ccceed29fa8c57edfa3712e316c58ca695a4a39a038c643a785f993be09","signature":false},{"version":"67b827701649bf5ad5f536aefdf3a3f80f6b1db736e6ef585c874671b997f36b","signature":false},{"version":"697c293a4129b24446869db450decb5d5bfae2fb7f66d2e951e183c7405ec12c","signature":false},{"version":"39940a3bd7a0e2c5dc3f842f29e53a4390d5d20ff016edeed781c9f86bf7824f","signature":false},{"version":"4c9ae7898ad9e8bc01251c2407a4756f3c7ebe8f712c96a2a3220d3961667bab","signature":false},{"version":"a9e592d16ccce15de3f4f08f445a9172b8ce250ba6bbd97cc2aaa5f725e0cc1b","signature":false},{"version":"c3183153ffda128ff91931e0e560ef8881718951b06664174d89299e5cd8024a","signature":false},{"version":"21a6fba4a85d92577f3f8366fe4f8072c9a9821537cc9498499839a10248d079","signature":false},{"version":"4ab3f27f9e6e974e6eb6f879eb32d8c5c89d529a5d06a59d7ae0d0e5e77cd55e","signature":false},{"version":"9e5485dfe6f63fa905c5df28af37c4469aca65e0b1c0bc3182b0bab59e0b0513","signature":false},{"version":"62e220db4aaecbf30d99b77d3d390cd98af66131fa35021a8396013bad826678","signature":false},{"version":"18e4712e9b8919e14a10620f746d766c8075c1a9ae40a45946cf4054a8b1a0c6","signature":false},{"version":"6ae1129c084d8001b212f921c6ee08ae8a4df0c0bb27a546a384af9e4cc87d8f","signature":false},{"version":"11238a0bb5130a0152e6ba846ed930ec2a5fbd87f7d964159d9afd887889e6ad","signature":false},{"version":"129ee1fd1436f6656477fc7c903e72a6e625bf0cc8bd16ccb8faeb894a1a87e0","signature":false},{"version":"4d4f58beb10b81797c9f5142ec35cdd4bd403c6a8f6ece702f8f41c589283bf9","signature":false},{"version":"30d7eb05300ccd9f267a6429d4bfd2cd94fff2fecdb700dc9225b8ecac00b0a1","signature":false},{"version":"b1a1ff5a1bcfa15ea2ba6211d70eda25819c3facfc8c9ead19de1a54c31c906c","signature":false},{"version":"05d5380e8867b9c3dd765ecbcec1b7ef9aaea813a0e61b555f4ad9aeec7959fc","signature":false},{"version":"3a38f0b05b7240574731238ecb4ad75b184b556105696eba354dc67da90ba39b","signature":false},{"version":"49f569326a7121ba2fe447b415389bbf2f58e83f0da34248f86dfcef99c5981e","signature":false},{"version":"abee957e1ba216d783d3d28f92d229ce98beb621a47e0eb74d8fdd664224827e","signature":false},{"version":"edff1a4c75b00e8558ffaa7c4c3591bc6b385079578794c0a79a1f6358cc35da","signature":false},{"version":"fa419b10d671552124b827e88273954d28ffc9f6eebdcd5d2a0bf3fc5c90b918","signature":false},{"version":"ccbe8d79d7a81fe4e0cdbe9cd7883442e2b42d4382c2b62b3dbefff6ef211735","signature":false,"affectsGlobalScope":true},{"version":"64cc6db9f08d98a1f5c0ad61e748076c4ed86170e125246f955f961a145994b5","signature":false,"affectsGlobalScope":true},{"version":"f81be17e276811737d9bb20f5b2c3dad79d211ae594b9eeaadba6bf3902f5d50","signature":false,"affectsGlobalScope":true},{"version":"f52dcf788c4417a40b18121e940dcb54831db316594cdee8b7ce4e6e114cf5e6","signature":false,"affectsGlobalScope":true},{"version":"ae02a7833ef6e143fe12c5ef0a4cca4299562574455e6c12c0b69cc978b8351c","signature":false,"affectsGlobalScope":true},{"version":"6f764e82380d216bc49cd9b36917b8fc543686c290a5fed25360ea86bc91ee6f","signature":false,"affectsGlobalScope":true},{"version":"577a0e686ed07655d42d12a93432c523164c764c71db59bcd0551311d40e7b7e","signature":false,"affectsGlobalScope":true},{"version":"a6070671ab5ce7ad631488bbce101475cdd754b7d524944545637d6e7a0183a8","signature":false,"affectsGlobalScope":true},{"version":"5ae20e37704ceeefcb66efccd614cc04147170d2e6934aeca4ebbf827edf53c1","signature":false,"affectsGlobalScope":true},{"version":"1a5dfbb5c55a07d934e5d24fb5bbe4c37bfd9dc5d93c041bd9f253e3b59318a3","signature":false,"affectsGlobalScope":true},{"version":"cfc2ab2febb258cd1a0f412cd0c7569bf2c9d2ecacd8bda5bfd3ff02e7056802","signature":false,"affectsGlobalScope":true},{"version":"cc9864bd1dfb28bf95ac021610567d9bca6c351c429c807cd0ca674b4f480c8a","signature":false,"affectsGlobalScope":true},{"version":"37bc6d268b22917a95f410490c66c8ade4002e6c2c78086dfd91b804bbc87bf1","signature":false,"affectsGlobalScope":true},{"version":"442f50ea082839c98d9745db0a18c8d57e31f7271377dfa36eff6a49c45490a9","signature":false,"affectsGlobalScope":true},{"version":"8a9d48000f1e1d16ba08ec476bbef802abcd3b4d4e5e71d49a07cc9d5ab92a99","signature":false,"affectsGlobalScope":true},{"version":"1f1ba069246c6dd28669264f2ea01859db5c7d67dc00fe6fb1b661c080c64c0f","signature":false,"affectsGlobalScope":true},{"version":"804ba5edd8389cf1443d52797edcec64e0bb8d5122a44a5e3574f841e1dc547a","signature":false},{"version":"61ff336abf8628a43fc097ee0376e31d152e6992bc55fc39831f9586fda7e40d","signature":false},{"version":"182aebde6812e8c9812dcfbfb4af217c513d9368b56b91004a8f6a8bd0319966","signature":false},{"version":"4f341e6384f77d8fa06b6cd9d96de7e5189a8320c66473bd67ac2ca24a6271b6","signature":false}],"root":[34,35,[41,43]],"options":{"allowSyntheticDefaultImports":true,"declaration":true,"downlevelIteration":true,"experimentalDecorators":true,"jsx":2,"module":1,"outDir":"./","rootDir":"../src","strict":true,"target":99,"tsBuildInfoFile":"./tsconfig.tsbuildinfo"},"fileIdsList":[[3,4,7,9,11,14,15,18],[18],[19],[3,16,19],[3,4,8,18],[3,7],[11,12,17],[4,11],[4,7,9],[4,16],[4,7,11],[7,11],[7],[3,4,8,9],[3,11,18],[8,10,15,16,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32],[1,2,3],[2,5,6],[1,3],[3],[2],[48],[48,49,50,51,52,53,54,55,56,57,58],[13,14,36,39],[37,38],[13],[44,48],[45,59],[44,45,46,47,59],[3,7,33,34],[34,35,41,42],[1,3,4,8,19,33,34,35,40],[3,4,33,41],[1,4,33]],"referencedMap":[[16,1],[25,2],[20,3],[21,4],[24,5],[8,6],[18,7],[12,8],[11,9],[17,10],[15,11],[28,12],[30,12],[31,13],[29,12],[32,13],[10,14],[27,10],[19,15],[33,16],[6,17],[7,18],[2,19],[5,20],[3,21],[49,22],[50,22],[59,23],[58,22],[51,22],[52,22],[53,22],[54,22],[55,22],[56,22],[57,22],[40,24],[39,25],[14,26],[44,22],[45,27],[46,28],[48,29],[35,30],[43,31],[41,32],[42,33],[34,34]],"semanticDiagnosticsPerFile":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63]},"version":"5.5.3"}
|
package/out/types.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { BaseSystem } from "@ecsframework/core";
|
|
2
|
+
import { DependenciesContainer } from "@ecsframework/core";
|
|
3
|
+
import { World } from "@rbxts/jecs";
|
|
4
|
+
import { t } from "@rbxts/t";
|
|
5
|
+
|
|
6
|
+
export interface SavedOption<T extends object> {
|
|
7
|
+
Migrations?: ((data: unknown) => unknown)[];
|
|
8
|
+
Guard?: t.check<unknown>;
|
|
9
|
+
OnCreate?: (world: World, container: DependenciesContainer, system: BaseSystem) => T;
|
|
10
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@ecsframework/player-data-handler",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"description": "",
|
|
5
|
+
"main": "out/init.lua",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"build": "rbxtsc",
|
|
8
|
+
"watch": "rbxtsc -w",
|
|
9
|
+
"test:watch": "rbxtsc -w --type=game -p test -i test/include",
|
|
10
|
+
"serve": "rojo serve test/default.project.json",
|
|
11
|
+
"prepublishOnly": "npm run build"
|
|
12
|
+
},
|
|
13
|
+
"keywords": [],
|
|
14
|
+
"author": "",
|
|
15
|
+
"license": "ISC",
|
|
16
|
+
"types": "out/index.d.ts",
|
|
17
|
+
"files": [
|
|
18
|
+
"out",
|
|
19
|
+
"flamework.build"
|
|
20
|
+
],
|
|
21
|
+
"publishConfig": {
|
|
22
|
+
"access": "public"
|
|
23
|
+
},
|
|
24
|
+
"devDependencies": {
|
|
25
|
+
"@rbxts/compiler-types": "^3.0.0-types.0",
|
|
26
|
+
"@rbxts/types": "^1.0.876",
|
|
27
|
+
"@typescript-eslint/eslint-plugin": "^8.39.1",
|
|
28
|
+
"@typescript-eslint/parser": "^8.39.1",
|
|
29
|
+
"eslint": "^8.57.1",
|
|
30
|
+
"eslint-config-prettier": "^10.1.8",
|
|
31
|
+
"eslint-plugin-prettier": "^5.5.4",
|
|
32
|
+
"eslint-plugin-roblox-ts": "^1.1.0",
|
|
33
|
+
"prettier": "^3.6.2",
|
|
34
|
+
"roblox-ts": "^3.0.0",
|
|
35
|
+
"typescript": "^5.5.3"
|
|
36
|
+
},
|
|
37
|
+
"dependencies": {
|
|
38
|
+
"@rbxts/t": "^3.2.1"
|
|
39
|
+
},
|
|
40
|
+
"peerDependencies": {
|
|
41
|
+
"@ecsframework/core": "*",
|
|
42
|
+
"@flamework/core": "*",
|
|
43
|
+
"@rbxts/immut": ">=0.4.4-ts.0",
|
|
44
|
+
"@rbxts/services": ">=1.5.5",
|
|
45
|
+
"@rbxts/jecs": ">=0.9.0-rc.10",
|
|
46
|
+
"@rbxts/signal": ">=1.1.1",
|
|
47
|
+
"rbxts-transformer-flamework": "*"
|
|
48
|
+
}
|
|
49
|
+
}
|