A class in Root.Township, the global namespace.
Server: one player's postbox contents, saved items waiting to be taken out. Get it through PostboxManager.
Constructors
Fields
3 private and internal fields
| Member | What it is |
|---|
private bool isNew | True when the postbox file didn't exist at load, so InitializeIfNew adds the starting content once. |
private ChunkSaveFormat.Version latest | The save version that Push(NetworkEntity) adds to: the last stored version if it's current, otherwise a new one. |
private static Logger logger | NLog logger for this class. |
Events
Methods
| Member | What it is |
|---|
int GetCount() | How many items are in the postbox. |
void InitializeIfNew(PlayerPostboxStorage.InitialContent[] initialContent) | Fills a brand new postbox with starting items, each with its own chance. Does nothing for an existing one. |
override async Task LoadAsync(int playerIdentifier, IAltaFile file, IPlayer player = null) | Loads the file and remembers whether it was new. |
NetworkEntity Pop() | Spawns the oldest item as a server entity and removes it from the postbox. Returns null if empty or if spawning failed. |
void Push(SerializedSavedDynamicObject content) | Adds an item, from a saved object or a live entity. A live entity is saved without position and destroyed unless told not to. |
void Push(NetworkEntity entity, bool isDestroying = true) | Adds an item, from a saved object or a live entity. A live entity is saved without position and destroyed unless told not to. |
1 private and internal method
Used in
Members of other types that take, return or hold a PlayerPostboxStorage: