Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Synchronet
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Main
Synchronet
Commits
6202dc0a
Commit
6202dc0a
authored
23 years ago
by
rswindell
Browse files
Options
Downloads
Patches
Plain Diff
Added 'uptime' member to JS System object.
parent
c8a8180f
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/sbbs3/js_system.c
+6
-1
6 additions, 1 deletion
src/sbbs3/js_system.c
src/sbbs3/main.cpp
+4
-1
4 additions, 1 deletion
src/sbbs3/main.cpp
src/sbbs3/sbbs.h
+2
-1
2 additions, 1 deletion
src/sbbs3/sbbs.h
with
12 additions
and
3 deletions
src/sbbs3/js_system.c
+
6
−
1
View file @
6202dc0a
...
@@ -722,7 +722,8 @@ static JSClass js_node_class = {
...
@@ -722,7 +722,8 @@ static JSClass js_node_class = {
extern
const
char
*
beta_version
;
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
];
char
str
[
256
];
uint
i
;
uint
i
;
...
@@ -802,6 +803,10 @@ JSObject* DLLCALL js_CreateSystemObject(JSContext* cx, JSObject* parent, scfg_t*
...
@@ -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
))
if
(
!
JS_DefineProperties
(
cx
,
sysobj
,
js_system_properties
))
return
(
NULL
);
return
(
NULL
);
...
...
This diff is collapsed.
Click to expand it.
src/sbbs3/main.cpp
+
4
−
1
View file @
6202dc0a
...
@@ -82,6 +82,7 @@ static bool scfg_reloaded=true;
...
@@ -82,6 +82,7 @@ static bool scfg_reloaded=true;
static
char
*
text
[
TOTAL_TEXT
];
static
char
*
text
[
TOTAL_TEXT
];
static
WORD
first_node
;
static
WORD
first_node
;
static
WORD
last_node
;
static
WORD
last_node
;
static
time_t
uptime
;
#ifdef JAVASCRIPT
#ifdef JAVASCRIPT
JSRuntime
*
js_runtime
=
NULL
;
JSRuntime
*
js_runtime
=
NULL
;
...
@@ -314,7 +315,7 @@ bool sbbs_t::js_initcx()
...
@@ -314,7 +315,7 @@ bool sbbs_t::js_initcx()
break
;
break
;
/* System Object */
/* System Object */
if
(
js_CreateSystemObject
(
js_cx
,
js_glob
,
&
cfg
)
==
NULL
)
if
(
js_CreateSystemObject
(
js_cx
,
js_glob
,
&
cfg
,
uptime
)
==
NULL
)
break
;
break
;
/* Client Object */
/* Client Object */
...
@@ -2971,6 +2972,8 @@ void DLLCALL bbs_thread(void* arg)
...
@@ -2971,6 +2972,8 @@ void DLLCALL bbs_thread(void* arg)
thread_up
();
thread_up
();
uptime
=
time
(
NULL
);
status
(
"Initializing"
);
status
(
"Initializing"
);
/* Defeat the lameo hex0rs - the name and copyright must remain intact */
/* Defeat the lameo hex0rs - the name and copyright must remain intact */
...
...
This diff is collapsed.
Click to expand it.
src/sbbs3/sbbs.h
+
2
−
1
View file @
6202dc0a
...
@@ -791,7 +791,8 @@ extern "C" {
...
@@ -791,7 +791,8 @@ extern "C" {
DLLEXPORT
JSObject
*
DLLCALL
js_CreateGlobalObject
(
JSContext
*
cx
,
scfg_t
*
cfg
);
DLLEXPORT
JSObject
*
DLLCALL
js_CreateGlobalObject
(
JSContext
*
cx
,
scfg_t
*
cfg
);
/* js_system.c */
/* 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 */
/* js_client.c */
DLLEXPORT
JSObject
*
DLLCALL
js_CreateClientObject
(
JSContext
*
cx
,
JSObject
*
parent
DLLEXPORT
JSObject
*
DLLCALL
js_CreateClientObject
(
JSContext
*
cx
,
JSObject
*
parent
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment