Synchronet now requires the libarchive development package (e.g. libarchive-dev on Debian-based Linux distros, libarchive.org for more info) to build successfully.

Commit 6202dc0a authored by rswindell's avatar rswindell

Added 'uptime' member to JS System object.

parent c8a8180f
......@@ -722,7 +722,8 @@ static JSClass js_node_class = {
extern const char* beta_version;
JSObject* DLLCALL js_CreateSystemObject(JSContext* cx, JSObject* parent, scfg_t* cfg)
JSObject* DLLCALL js_CreateSystemObject(JSContext* cx, JSObject* parent
,scfg_t* cfg, time_t uptime)
{
char str[256];
uint i;
......@@ -802,6 +803,10 @@ JSObject* DLLCALL js_CreateSystemObject(JSContext* cx, JSObject* parent, scfg_t*
/***********************/
val = INT_TO_JSVAL(uptime);
if(!JS_SetProperty(cx, sysobj, "uptime", &val))
return(NULL);
if(!JS_DefineProperties(cx, sysobj, js_system_properties))
return(NULL);
......
......@@ -82,6 +82,7 @@ static bool scfg_reloaded=true;
static char * text[TOTAL_TEXT];
static WORD first_node;
static WORD last_node;
static time_t uptime;
#ifdef JAVASCRIPT
JSRuntime* js_runtime=NULL;
......@@ -314,7 +315,7 @@ bool sbbs_t::js_initcx()
break;
/* System Object */
if(js_CreateSystemObject(js_cx, js_glob, &cfg)==NULL)
if(js_CreateSystemObject(js_cx, js_glob, &cfg, uptime)==NULL)
break;
/* Client Object */
......@@ -2971,6 +2972,8 @@ void DLLCALL bbs_thread(void* arg)
thread_up();
uptime=time(NULL);
status("Initializing");
/* Defeat the lameo hex0rs - the name and copyright must remain intact */
......
......@@ -791,7 +791,8 @@ extern "C" {
DLLEXPORT JSObject* DLLCALL js_CreateGlobalObject(JSContext* cx, scfg_t* cfg);
/* js_system.c */
DLLEXPORT JSObject* DLLCALL js_CreateSystemObject(JSContext* cx, JSObject* parent, scfg_t* cfg);
DLLEXPORT JSObject* DLLCALL js_CreateSystemObject(JSContext* cx, JSObject* parent
,scfg_t* cfg, time_t uptime);
/* js_client.c */
DLLEXPORT JSObject* DLLCALL js_CreateClientObject(JSContext* cx, JSObject* parent
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment