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