Data Storage: Difference between revisions

From Citizens Wiki

No edit summary
Line 1: Line 1:
Data storage in Citizens2 is handled in one of two ways: [[#Saves.yml|YAML flatfile]], or a [[#Database|SQL database]].
Data storage in Citizens2 is handled in one of two ways: [[#Saves.yml|YAML flatfile]], or a [[#Database|SQL database]].


==Saves.yml==
==saves.yml==
Saves.yml is used by default to store all data on created NPCs.
''saves.yml'' is used by default to store all data on created NPCs.


===Structure===
===Structure===

Revision as of 23:02, 13 March 2012

Data storage in Citizens2 is handled in one of two ways: YAML flatfile, or a SQL database.

saves.yml

saves.yml is used by default to store all data on created NPCs.

Structure

Mouseover to view info:

# Citizens NPC Storage
npc:
  '0':
   name: My_First_NPC
   traits:
     spawned: true
     type: PLAYER
     owner: Steve
     location:
       world: world
       x: '92.65002360423462'
       y: '3.0'
       z: '-264.5621058817138'
       yaw: '87.90003967285156'
       pitch: '21.14999008178711'

Database

Database usage can be configured inside of the config.yml. Database usage requires more setup, but runs quicker when dealing with large numbers of NPCs.

Configuration

A quote from the config.yml (mouseover to view info):

database:
 password: 
 username: 
 url: 
 driver: 

See also: Configuration