_________ __ __ / _____// |_____________ _/ |______ ____ __ __ ______ \_____ \\ __\_ __ \__ \\ __\__ \ / ___\| | \/ ___/ / \| | | | \// __ \| | / __ \_/ /_/ > | /\___ \ /_______ /|__| |__| (____ /__| (____ /\___ /|____//____ > \/ \/ \//_____/ \/ ______________________ ______________________ T H E W A R B E G I N S Stratagus - A free fantasy real time strategy game engine
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include "stratagus.h"
#include "sqlite3.h"
#include "games.h"
db.cpp - Database routines. | |
#define | SQLCreatePlayersTable |
#define | SQLCreateGamesTable |
#define | SQLCreateGameDataTable |
#define | SQLCreateRankingsTable |
#define | SQLCreateMapsTable |
#define | SQLCreateTables |
static const char * | dbfile = "metaserver.db" |
static sqlite3 * | DB |
static int | DBMaxIDCallback (void *password, int argc, char **argv, char **colname) |
int | DBInit (void) |
void | DBQuit (void) |
static int | DBFindUserCallback (void *password, int argc, char **argv, char **colname) |
int | DBFindUser (char *username, char *password) |
int | DBAddUser (char *username, char *password) |
int | DBUpdateLoginDate (char *username) |
#define SQLCreateGameDataTable |
#define SQLCreateGamesTable |
#define SQLCreateMapsTable |
#define SQLCreatePlayersTable |
#define SQLCreateRankingsTable |
#define SQLCreateTables |
int DBAddUser | ( | char * | username, |
char * | password | ||
) |
Add a user
username | User name |
password | Password |
int DBFindUser | ( | char * | username, |
char * | password | ||
) |
Find a user and return the password
username | User name to find |
password | If the user is found the password will be returned here |
|
static |
Find user callback
int DBInit | ( | void | ) |
Initialize the database
|
static |
Max id callback
void DBQuit | ( | void | ) |
Close the database
int DBUpdateLoginDate | ( | char * | username | ) |
Log in a user
username | User name |
|
static |
|
static |