persistence

Serialize Oxidus LPC objects and daemon data across restarts.

8|3|Updated Sep 29, 2021
One-click install
npx skills add https://github.com/gesslar/oxidus-mudlib --skill persistence-gesslar
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: persistence
Source: https://github.com/gesslar/oxidus-mudlib/tree/main/.claude/skills/persistence
Command: npx skills add https://github.com/gesslar/oxidus-mudlib --skill persistence-gesslar

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

The Persistence skill provides a structured approach to saving and restoring Oxidus game state, ensuring object variables and inventories survive restarts and sessions.

Core Features & Use Cases

  • Object-level persistence using std/object/persist.c with save_var-marked variables and recursive inventory serialization
  • Daemon-level persistence via std/modules/persist_data.c and the PERSIST_D daemon for file-based saves with save_object/restore_object
  • Convenience APIs: setPersistent, saveData, restore_data, and automatic restoration during setup
  • Use cases include saving player state, container inventories, and daemon configuration data across sessions

Quick Start

Enable persistence on an object or daemon with setPersistent(1) and call saveData() after modifying persistent state.

Frequently Asked Questions about persistence

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I save and restore LPC game state across server restarts?

Object-level persistence in LPC uses save_var-marked variables for recursive inventory serialization, while daemon-level persistence uses save_object and restore_object through the PERSIST_D daemon for file-based configuration saves.

How do I serialize container inventories in an LPC mudlib?

Daemon persistence is managed via std/modules/persist_data.c and the PERSIST_D daemon, which handle file-based save_object and restore_object operations for configuration data that must survive sessions.

What is the best way to automatically restore player state on login?

Periodic saves are triggered via a heartbeat mechanism with built-in error handling and guards, ensuring persistent state is written safely and reliably without crashing the LPC server.

Why does my LPC object lose its variables after a server restart?

Yes, string-based serialization is available using save_to_string and load_from_string, allowing you to capture and restore object state without relying solely on file-based daemon persistence.