Renamed wmud_db_players_load() to wmud_db_load_players() to follow naming conventions.
This commit is contained in:
parent
df755de02c
commit
b148141200
@ -64,7 +64,7 @@ wmud_interpret_game_command
|
|||||||
WMUD_DB_ERROR
|
WMUD_DB_ERROR
|
||||||
wmudDbError
|
wmudDbError
|
||||||
wmud_db_init
|
wmud_db_init
|
||||||
wmud_db_players_load
|
wmud_db_load_players
|
||||||
wmud_db_save_player
|
wmud_db_save_player
|
||||||
</SECTION>
|
</SECTION>
|
||||||
|
|
||||||
|
@ -65,13 +65,13 @@ wmud_db_init(GError **err)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* wmud_db_players_load:
|
* wmud_db_load_players:
|
||||||
* @err: a GError to put error messages in it
|
* @err: a GError to put error messages in it
|
||||||
*
|
*
|
||||||
* Loads all player records from the database
|
* Loads all player records from the database
|
||||||
*/
|
*/
|
||||||
gboolean
|
gboolean
|
||||||
wmud_db_players_load(GError **err)
|
wmud_db_load_players(GError **err)
|
||||||
{
|
{
|
||||||
sqlite3_stmt *sth = NULL;
|
sqlite3_stmt *sth = NULL;
|
||||||
int sqlite_code;
|
int sqlite_code;
|
||||||
@ -86,7 +86,7 @@ wmud_db_players_load(GError **err)
|
|||||||
|
|
||||||
if ((sqlite_code = sqlite3_prepare_v2(dbh, "SELECT id, login, password, email FROM players", -1, &sth, NULL)) != SQLITE_OK)
|
if ((sqlite_code = sqlite3_prepare_v2(dbh, "SELECT id, login, password, email FROM players", -1, &sth, NULL)) != SQLITE_OK)
|
||||||
{
|
{
|
||||||
g_set_error(err, WMUD_DB_ERROR, WMUD_DB_ERROR_BADQUERY, "Bad query in wmud_db_players_load(): %s", sqlite3_errmsg(dbh));
|
g_set_error(err, WMUD_DB_ERROR, WMUD_DB_ERROR_BADQUERY, "Bad query in wmud_db_load_players(): %s", sqlite3_errmsg(dbh));
|
||||||
|
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
@ -112,7 +112,8 @@ wmud_db_players_load(GError **err)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
g_set_error(err, WMUD_DB_ERROR, WMUD_DB_ERROR_BADQUERY, "Query error in wmud_db_players_load(): %s", sqlite3_errmsg(dbh));
|
g_set_error(err, WMUD_DB_ERROR, WMUD_DB_ERROR_BADQUERY, "Query error in wmud_db_load_players(): %s", sqlite3_errmsg(dbh));
|
||||||
|
sqlite3_finalize(sth);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -26,7 +26,7 @@
|
|||||||
extern GQuark WMUD_DB_ERROR;
|
extern GQuark WMUD_DB_ERROR;
|
||||||
|
|
||||||
gboolean wmud_db_init(GError **err);
|
gboolean wmud_db_init(GError **err);
|
||||||
gboolean wmud_db_players_load(GError **err);
|
gboolean wmud_db_load_players(GError **err);
|
||||||
gboolean wmud_db_save_player(wmudPlayer *player, GError **err);
|
gboolean wmud_db_save_player(wmudPlayer *player, GError **err);
|
||||||
gboolean wmud_db_load_planes(GSList **planes, GError **err);
|
gboolean wmud_db_load_planes(GSList **planes, GError **err);
|
||||||
gboolean wmud_db_load_planets(GSList **planets, GError **err);
|
gboolean wmud_db_load_planets(GSList **planets, GError **err);
|
||||||
|
@ -175,7 +175,7 @@ main(int argc, char **argv)
|
|||||||
}
|
}
|
||||||
|
|
||||||
g_clear_error(&err);
|
g_clear_error(&err);
|
||||||
wmud_db_players_load(&err);
|
wmud_db_load_players(&err);
|
||||||
|
|
||||||
/* Initialization ends here */
|
/* Initialization ends here */
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user