Updated MSA
27
ModuleApiGameLibRuntimeStorage.md
Normal file
27
ModuleApiGameLibRuntimeStorage.md
Normal file
@@ -0,0 +1,27 @@
|
||||
# ModuleApi - Runtime Storage
|
||||
|
||||
Simple object used to perform time calculations for sychronized rendering across clients.
|
||||
|
||||
## Structure
|
||||
|
||||
```javascript
|
||||
{
|
||||
@readonly "_lastSnapshot": 1754754260809,
|
||||
@readonly "_keys": [
|
||||
"variable1",
|
||||
"variable2"
|
||||
],
|
||||
@readonly "_size": 2,
|
||||
|
||||
"variable1": "Hello world",
|
||||
"variable2": 10
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
| Attribute | Type | Description |
|
||||
| ------------------------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
||||
| (READONLY) \_lastSnapshot | number | Unix timestamp when the last snapshot was made. |
|
||||
| (READONLY) \_keys | number | List of all variable keys inside the storage. |
|
||||
| (READONLY) \_size | number | The amount of variables inside the storage. |
|
||||
| [ key:string ] | any | Variables inside the runtime storage. Using the storage without an interface will work but is not generally advised. Please extent storage interface with an interface containing specific properties. |
|
||||
@@ -382,11 +382,39 @@ api.hasReferenceProperty(sceneId, propertyId);
|
||||
|
||||
## Snapshots
|
||||
|
||||
### onSnapshotRestore **(TODO)**
|
||||
### onSnapshotRestore
|
||||
|
||||
### onSnapshotCreate **(TODO)**
|
||||
Register a listener that will be called when a snapshot is recalled and the runtime storage is restored.
|
||||
|
||||
### getRuntimeStorage **(TODO)**
|
||||
```javascript
|
||||
api.ononSnapshotRestore(callback);
|
||||
```
|
||||
|
||||
| Argument | Type | Description |
|
||||
| -------- | -------- | ---------------------------------------------------- |
|
||||
| callback | Function | Callback will be called when a snapshot is restored. |
|
||||
|
||||
### onSnapshotCreate
|
||||
|
||||
Register a listener that will be called before a snapshot is taken, this makes it possible to add variable to the storage before the snapshot happens.
|
||||
|
||||
```javascript
|
||||
api.onSnapshotCreate(callback);
|
||||
```
|
||||
|
||||
| Argument | Type | Description |
|
||||
| -------- | -------- | ------------------------------------------------------- |
|
||||
| callback | Function | Callback will be called before the snapshot is created. |
|
||||
|
||||
### getRuntimeStorage
|
||||
|
||||
Get the variable storage object.
|
||||
|
||||
```javascript
|
||||
api.getRuntimeStorage();
|
||||
```
|
||||
|
||||
**Returns** [RuntimeStorage](./ModuleApiGameLibRuntimeStorage) _The runtime storage object._
|
||||
|
||||
## Last State
|
||||
|
||||
|
||||
12
_Sidebar.md
12
_Sidebar.md
@@ -35,11 +35,13 @@
|
||||
- [Axios](https://axios-http.com/docs/instance)
|
||||
|
||||
- ModuleApi Shared
|
||||
- [GameLib GameDetails](./ModuleApiGameLibGameDetails)
|
||||
- [GameLib EndScreen](./ModuleAPIGameLibEndScreen)
|
||||
- [GameLib TimeSpan](./ModuleApiGameLibTimeSpan)
|
||||
- [GameLib FrameCycle](./ModuleApiGameLibFrameCycle)
|
||||
- [GameLib Ratio](./ModuleAPIGameLibRatio)
|
||||
- [RuntimeStorage](./ModuleApiGameLibRuntimeStorage)
|
||||
- Gamelib
|
||||
- [GameLib GameDetails](./ModuleApiGameLibGameDetails)
|
||||
- [GameLib EndScreen](./ModuleAPIGameLibEndScreen)
|
||||
- [GameLib TimeSpan](./ModuleApiGameLibTimeSpan)
|
||||
- [GameLib FrameCycle](./ModuleApiGameLibFrameCycle)
|
||||
- [GameLib Ratio](./ModuleAPIGameLibRatio)
|
||||
- [Module Debugging](./ModuleDebugging)
|
||||
- [ModuleStore](./ModuleStore)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user