Skip to content
Snippets Groups Projects
Commit 2c44024a authored by rswindell's avatar rswindell
Browse files

sbbs_t.js_init now creates the user objects (e.g. msg_area, file_area, etc.),

so now non-user threads (like the event thread) can still have access to these
objects.
parent b639ac65
No related branches found
No related tags found
No related merge requests found
......@@ -721,6 +721,14 @@ bool sbbs_t::js_init()
if(js_CreateFileClass(js_cx, js_glob)==NULL)
break;
/* User class */
if(js_CreateUserClass(js_cx, js_glob, &cfg)==NULL)
break;
/* Area Objects */
if(!js_CreateUserObjects(js_cx, js_glob, &scfg, NULL, NULL, NULL))
break;
/* Server Object */
if((server=JS_DefineObject(js_cx, js_glob, "server", &js_server_class
,NULL,JSPROP_ENUMERATE))==NULL)
......@@ -1205,12 +1213,6 @@ void event_thread(void* arg)
if(!sbbs->js_init()) /* This must be done in the context of the node thread */
lprintf("!JavaScript Initialization FAILURE");
}
if(sbbs->js_cx!=NULL) {
/* User class */
if(js_CreateUserClass(sbbs->js_cx, sbbs->js_glob, &scfg)==NULL)
lprintf("Node %d !JavaScript ERROR creating user class",sbbs->cfg.node_num);
}
#endif
while(!sbbs->terminated && telnet_socket!=INVALID_SOCKET) {
......@@ -2904,12 +2906,6 @@ void node_thread(void* arg)
if(!sbbs->js_init()) /* This must be done in the context of the node thread */
lprintf("Node %d !JavaScript Initialization FAILURE",sbbs->cfg.node_num);
}
if(sbbs->js_cx!=NULL) {
/* User class */
if(js_CreateUserClass(sbbs->js_cx, sbbs->js_glob, &scfg)==NULL)
lprintf("Node %d !JavaScript ERROR creating user class",sbbs->cfg.node_num);
}
#endif
if(sbbs->answer()) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment