diff --git a/sql/players.sql b/sql/players.sql new file mode 100644 index 0000000..70e5aea --- /dev/null +++ b/sql/players.sql @@ -0,0 +1,7 @@ +CREATE TABLE players ( + id integer primary key, + login varchar(50) not null unique, + password varchar(50), + email varchar(150) not null unique +); + diff --git a/src/Makefile.am b/src/Makefile.am index 1cc5b09..84fa832 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,5 +1,5 @@ bin_PROGRAMS = wmud AM_CFLAGS = $(MEMCACHED_CFLAGS) $(GLIB_CFLAGS) $(GIO_CFLAGS) $(GTHREAD_CFLAGS) $(SQLITE3_CFLAGS) -wmud_SOURCES = main.c networking.c interpreter.c +wmud_SOURCES = main.c networking.c interpreter.c db.c wmud_LDADD = $(MEMCACHED_LIBS) $(GLIB_LIBS) $(GIO_LIBS) $(GTHREAD_LIBS) $(SQLITE3_LIBS) diff --git a/src/db.c b/src/db.c new file mode 100644 index 0000000..6bfa2db --- /dev/null +++ b/src/db.c @@ -0,0 +1,12 @@ +#include + +#include "db.h" + +sqlite3 *dbh = NULL; + +gboolean +wmud_db_init(void) +{ + sqlite3_open( +} + diff --git a/src/db.h b/src/db.h new file mode 100644 index 0000000..f380041 --- /dev/null +++ b/src/db.h @@ -0,0 +1,11 @@ +#ifndef __WMUD_DB_H__ +#define __WMUD_DB_H__ + +#include + +gboolean wmud_db_init(Gerror ** error); +gboolean wmud_load_players(GError **err); +gboolean wmud_save_player(wmudPlayer *player, GError **err); + +#endif /* __WMUD__DB_H__ */ +