]> git.lizzy.rs Git - dragonblocks_alpha.git/blob - src/server/database.h
Use different database files
[dragonblocks_alpha.git] / src / server / database.h
1 #ifndef _DATABASE_H_
2 #define _DATABASE_H_
3
4 #include <stdbool.h>
5 #include "map.h"
6 #include "types.h"
7
8 bool database_init();                                     // open and initialize world SQLite3 database
9 void database_deinit();                                   // close database
10 bool database_load_block(MapBlock *block);                // load a block from map database (initializes state, mgs buffer and data), returns false on failure
11 void database_save_block(MapBlock *block);                // save a block to database
12 bool database_load_meta(const char *key, s64 *value_ptr); // load a meta entry
13 void database_save_meta(const char *key, s64 value);      // save / update a meta entry
14 bool database_load_player(char *name, v3f64 *pos_ptr);    // load player data from database
15 void database_create_player(char *name, v3f64 pos);       // insert new player into database
16 void database_update_player_pos(char *name, v3f64 pos);   // update player position
17
18 #endif