Skip to content

Latest commit

 

History

History
141 lines (64 loc) · 2.15 KB

File metadata and controls

141 lines (64 loc) · 2.15 KB

Home > server > PersistenceManager

PersistenceManager class

Manages persistence of player and global data.

Signature:

export default class PersistenceManager 

Remarks

This class is a singleton accessible with the static property PersistenceManager.instance. Convenience methods are also available on the Player and GameServer classes.

The constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the PersistenceManager class.

Properties

Property

Modifiers

Type

Description

instance

static

readonly

PersistenceManager

Methods

Method

Modifiers

Description

getGlobalData(key)

Get global data from the data persistence service.

getPlayerData(player)

Get player data from the data persistence service.

setGlobalData(key, data)

Set global data in the data persistence service. This data is available and shared by all lobbies of your game.

setPlayerData(player, data)

Set player data in the data persistence service. This data is persisted even after a player disconnects, and is retrievable no matter the lobby for your game that they join.