Data Storage: Difference between revisions

From Citizens Wiki

m (Reverted edits by Fullwall (talk) to last revision by Jrbudda)
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 an [#Saves.yml[NBT file]]
 
'''{{color|red|white| SQL storage is not currently functioning correctly}}


==saves.yml==
==saves.yml==
Line 53: Line 51:
               {{H:title|How long to wait at this point|delay: 0}}
               {{H:title|How long to wait at this point|delay: 0}}
         {{H:title|Which pathfinder code do we use? (probably linear)|provider: linear}}
         {{H:title|Which pathfinder code do we use? (probably linear)|provider: linear}}
==Database==
{{color|red|white| SQL storage is not currently functioning correctly}}
Database usage can be configured inside of the config.yml. Database usage requires more setup, but may be quicker, more secure and more resilient when dealing with large numbers of NPCs.
===Configuration===
A quote from the config.yml (mouseover to view info):
<nowiki></nowiki>{{H:title|The name of the database|database:}}
  {{H:title|The password for the database connection.|password: ''}}
  {{H:title|The username for the database connection.|username: ''}}
  {{H:title|The URL for connecting to the database.|url: ''}}
  {{H:title|The driver to use when connecting to the database. Eg. MySQL, SQLite, H2|driver: ''}}
''See also: [[Configuration]]''
<pre>
    - Database settings -
    driver: the database type - eg. mysql, sqlite, postgres, h2
    url: the database url - eg. sqlite://path/to/your/database.db
    MySQL uses the database IP address - eg. mysql://localhost:2222/database
    The username and password settings are required to connect to certain types of databases such as MySQL.
</pre>


{{NavBox}}
{{NavBox}}
[[Category:Configuration]]
[[Category:Configuration]]

Revision as of 09:47, 23 January 2014

Data storage in Citizens2 is handled in one of two ways: YAML flatfile or an [#Saves.yml[NBT file]]

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:
     age:
       age: 0
       locked: true
     spawned: true
     type: PLAYER
     owner: Steve
     lookclose: true
     location:
       world: world
       x: '92.65002360423462'
       y: '3.0'
       z: '-264.5621058817138'
       yaw: '87.90003967285156'
       pitch: '21.14999008178711'
     text:
       talk-close: true
       random-talker: true
       0: Hello, there. I'm My_First_NPC.
     waypoints:
       linear:
         points:
           '0':
             location:
               world: MyWorld
               x: 60
               y: 64
               z: 80
               pitch: 90
               yaw: 0
             delay: 0
           '1':
             location:
               world: MyWorld
               x: 65
               y: 64
               z: 82
               pitch: 45
               yaw: 0
             delay: 0
       provider: linear