forked from github/server
bindings for gamedb_update, run after turn.
This commit is contained in:
parent
4e5240628e
commit
74aa4bdaf3
5 changed files with 21 additions and 9 deletions
|
@ -95,8 +95,9 @@ local function write_htpasswd()
|
||||||
end
|
end
|
||||||
|
|
||||||
local function write_files(locales)
|
local function write_files(locales)
|
||||||
|
write_database()
|
||||||
write_passwords()
|
write_passwords()
|
||||||
write_htpasswd()
|
-- write_htpasswd()
|
||||||
write_reports()
|
write_reports()
|
||||||
write_summary()
|
write_summary()
|
||||||
end
|
end
|
||||||
|
|
|
@ -4,15 +4,16 @@
|
||||||
|
|
||||||
#include "bindings.h"
|
#include "bindings.h"
|
||||||
|
|
||||||
#include "magic.h"
|
|
||||||
#include "skill.h"
|
|
||||||
#include "helpers.h"
|
|
||||||
#include "console.h"
|
#include "console.h"
|
||||||
|
#include "gamedb.h"
|
||||||
|
#include "helpers.h"
|
||||||
|
#include "laws.h"
|
||||||
|
#include "magic.h"
|
||||||
#include "reports.h"
|
#include "reports.h"
|
||||||
|
#include "skill.h"
|
||||||
#include "study.h"
|
#include "study.h"
|
||||||
#include "summary.h"
|
#include "summary.h"
|
||||||
#include "teleport.h"
|
#include "teleport.h"
|
||||||
#include "laws.h"
|
|
||||||
|
|
||||||
#include "kernel/calendar.h"
|
#include "kernel/calendar.h"
|
||||||
#include "kernel/config.h"
|
#include "kernel/config.h"
|
||||||
|
@ -437,7 +438,14 @@ static int tolua_write_passwords(lua_State * L)
|
||||||
{
|
{
|
||||||
int result = writepasswd();
|
int result = writepasswd();
|
||||||
lua_pushinteger(L, result);
|
lua_pushinteger(L, result);
|
||||||
return 0;
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int tolua_write_database(lua_State * L)
|
||||||
|
{
|
||||||
|
int result = gamedb_update();
|
||||||
|
lua_pushinteger(L, result);
|
||||||
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int tolua_write_summary(lua_State * L)
|
static int tolua_write_summary(lua_State * L)
|
||||||
|
@ -949,6 +957,7 @@ int tolua_bindings_open(lua_State * L, const dictionary *inifile)
|
||||||
tolua_function(L, TOLUA_CAST "write_report", tolua_write_report);
|
tolua_function(L, TOLUA_CAST "write_report", tolua_write_report);
|
||||||
tolua_function(L, TOLUA_CAST "write_summary", tolua_write_summary);
|
tolua_function(L, TOLUA_CAST "write_summary", tolua_write_summary);
|
||||||
tolua_function(L, TOLUA_CAST "write_passwords", tolua_write_passwords);
|
tolua_function(L, TOLUA_CAST "write_passwords", tolua_write_passwords);
|
||||||
|
tolua_function(L, TOLUA_CAST "write_database", tolua_write_database);
|
||||||
tolua_function(L, TOLUA_CAST "message_unit", tolua_message_unit);
|
tolua_function(L, TOLUA_CAST "message_unit", tolua_message_unit);
|
||||||
tolua_function(L, TOLUA_CAST "message_faction", tolua_message_faction);
|
tolua_function(L, TOLUA_CAST "message_faction", tolua_message_faction);
|
||||||
tolua_function(L, TOLUA_CAST "message_region", tolua_message_region);
|
tolua_function(L, TOLUA_CAST "message_region", tolua_message_region);
|
||||||
|
|
|
@ -4,9 +4,11 @@
|
||||||
|
|
||||||
#include "gamedb.h"
|
#include "gamedb.h"
|
||||||
|
|
||||||
#include "kernel/db/driver.h"
|
#include "kernel/config.h"
|
||||||
|
#include "kernel/calendar.h"
|
||||||
#include "kernel/database.h"
|
#include "kernel/database.h"
|
||||||
#include "kernel/faction.h"
|
#include "kernel/faction.h"
|
||||||
|
#include "kernel/db/driver.h"
|
||||||
|
|
||||||
int gamedb_update(void)
|
int gamedb_update(void)
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
void gamedb_update(void);
|
int gamedb_update(void);
|
||||||
|
|
|
@ -96,7 +96,7 @@ static const char * valid_keys[] = {
|
||||||
"game.era",
|
"game.era",
|
||||||
"game.sender",
|
"game.sender",
|
||||||
"game.dbname",
|
"game.dbname",
|
||||||
"game.db.",
|
"game.dbswap",
|
||||||
"game.dbbatch",
|
"game.dbbatch",
|
||||||
"editor.color",
|
"editor.color",
|
||||||
"editor.codepage",
|
"editor.codepage",
|
||||||
|
|
Loading…
Reference in a new issue