Commit a97fd532 authored by rswindell's avatar rswindell
Browse files

Moved BBS startup ptr from scfg_t to sbbs_t.

parent d8ddf6f1
......@@ -87,7 +87,7 @@ bool sbbs_t::answer()
str2[i]=0;
lprintf("Node %d RLogin: '%s' / '%s'",cfg.node_num,str,str2);
strcpy(rlogin_name
,cfg.startup->options&BBS_OPT_USE_2ND_RLOGIN ? str2 : str);
,startup->options&BBS_OPT_USE_2ND_RLOGIN ? str2 : str);
useron.number=userdatdupe(0, U_ALIAS, LEN_ALIAS, rlogin_name, 0);
if(useron.number)
getuserdat(&cfg,&useron);
......@@ -177,7 +177,7 @@ bool sbbs_t::answer()
/* AutoLogon via IP or Caller ID here */
if(!useron.number && !(sys_status&SS_RLOGIN)
&& cfg.startup->options&BBS_OPT_AUTO_LOGON && cid[0]) {
&& startup->options&BBS_OPT_AUTO_LOGON && cid[0]) {
useron.number=userdatdupe(0, U_NOTE, LEN_NOTE, cid, 0);
if(useron.number) {
getuserdat(&cfg, &useron);
......
......@@ -537,7 +537,7 @@ void sbbs_t::chatsection()
break;
case 'C':
no_rip_menu=1;
if(cfg.startup->options&BBS_OPT_SYSOP_AVAILABLE
if(startup->options&BBS_OPT_SYSOP_AVAILABLE
|| (cfg.sys_chat_ar[0] && chk_ar(cfg.sys_chat_ar,&useron))
|| useron.exempt&FLAG('C')) {
sysop_page();
......
......@@ -283,7 +283,7 @@ int sbbs_t::exec_function(csi_t *csi)
CRLF; }
return(0);
case CS_PAGE_SYSOP:
if(cfg.startup->options&BBS_OPT_SYSOP_AVAILABLE
if(startup->options&BBS_OPT_SYSOP_AVAILABLE
|| (cfg.sys_chat_ar[0] && chk_ar(cfg.sys_chat_ar,&useron))
|| useron.exempt&FLAG('C')) {
sysop_page();
......
......@@ -67,7 +67,7 @@ int sbbs_t::exec_net(csi_t* csi)
SOCKADDR_IN addr;
memset(&addr,0,sizeof(addr));
addr.sin_addr.s_addr = htonl(cfg.startup->telnet_interface);
addr.sin_addr.s_addr = htonl(startup->telnet_interface);
addr.sin_family = AF_INET;
if((i=bind(sock, (struct sockaddr *) &addr, sizeof (addr)))!=0) {
......@@ -546,7 +546,7 @@ SOCKET sbbs_t::ftp_data_sock(csi_t* csi, SOCKET ctrl_sock, SOCKADDR_IN* addr)
}
memset(addr,0,sizeof(addr));
addr->sin_addr.s_addr = htonl(cfg.startup->telnet_interface);
addr->sin_addr.s_addr = htonl(startup->telnet_interface);
addr->sin_family = AF_INET;
if(bind(data_sock, (struct sockaddr *)addr,sizeof(SOCKADDR_IN))!= 0) {
......@@ -690,8 +690,8 @@ bool sbbs_t::ftp_get(csi_t* csi, SOCKET ctrl_sock, char* src, char* dest, bool d
return(false);
}
if(cfg.startup->socket_open!=NULL)
cfg.startup->socket_open(TRUE);
if(startup->socket_open!=NULL)
startup->socket_open(TRUE);
close_socket(data_sock);
data_sock=accept_sock;
......@@ -817,8 +817,8 @@ bool sbbs_t::ftp_put(csi_t* csi, SOCKET ctrl_sock, char* src, char* dest)
return(false);
}
if(cfg.startup->socket_open!=NULL)
cfg.startup->socket_open(TRUE);
if(startup->socket_open!=NULL)
startup->socket_open(TRUE);
close_socket(data_sock);
data_sock=accept_sock;
......
......@@ -426,7 +426,7 @@ bool sbbs_t::logon()
,cfg.level_timeperday[useron.level]+useron.min);
bprintf(text[LiMailWaiting],mailw);
strcpy(str,text[LiSysopIs]);
if(cfg.startup->options&BBS_OPT_SYSOP_AVAILABLE
if(startup->options&BBS_OPT_SYSOP_AVAILABLE
|| (cfg.sys_chat_ar[0] && chk_ar(cfg.sys_chat_ar,&useron)))
strcat(str,text[LiSysopAvailable]);
else
......
......@@ -1451,6 +1451,8 @@ sbbs_t::sbbs_t(ushort node_num, DWORD addr, char* name, SOCKET sd,
lprintf("%s constructor using socket %d", nodestr, sd);
startup = ::startup; // Convert from global to class member
memcpy(&cfg, global_cfg, sizeof(cfg));
cfg.node_num=node_num;
......@@ -3005,7 +3007,6 @@ void DLLCALL bbs_thread(void* arg)
lprintf("!ERROR changing directory to: %s", startup->ctrl_dir);
/* Initial configuration and load from CNF files */
scfg.startup=startup;
sprintf(scfg.ctrl_dir, "%.*s", (int)sizeof(scfg.ctrl_dir)-1
,startup->ctrl_dir);
lprintf("Loading configuration files from %s", scfg.ctrl_dir);
......
......@@ -294,8 +294,6 @@ typedef struct
#endif
bbs_startup_t* startup;
} scfg_t;
#endif /* Don't add anything after this line */
\ No newline at end of file
......@@ -77,7 +77,7 @@ void sbbs_t::telnet_gate(char* destaddr, ulong mode)
}
memset(&addr,0,sizeof(addr));
addr.sin_addr.s_addr = htonl(cfg.startup->telnet_interface);
addr.sin_addr.s_addr = htonl(startup->telnet_interface);
addr.sin_family = AF_INET;
if((i=bind(remote_socket, (struct sockaddr *) &addr, sizeof (addr)))!=0) {
......
......@@ -793,7 +793,7 @@ void sbbs_t::maindflts(user_t* user)
if(cfg.sys_misc&SM_FWDTONET)
bprintf(text[UserDefaultsNetMail]
,user->misc&NETMAIL ? text[On] : text[Off]);
if(cfg.startup->options&BBS_OPT_AUTO_LOGON && user->exempt&FLAG('V'))
if(startup->options&BBS_OPT_AUTO_LOGON && user->exempt&FLAG('V'))
bprintf(text[UserDefaultsAutoLogon]
,user->misc&AUTOLOGON ? text[On] : text[Off]);
if(useron.exempt&FLAG('Q') || user->misc&QUIET)
......@@ -819,7 +819,7 @@ void sbbs_t::maindflts(user_t* user)
strcat(str,"E");
if(cfg.sys_misc&SM_FWDTONET)
strcat(str,"M");
if(cfg.startup->options&BBS_OPT_AUTO_LOGON && user->exempt&FLAG('V'))
if(startup->options&BBS_OPT_AUTO_LOGON && user->exempt&FLAG('V'))
strcat(str,"I");
if(cfg.total_shells>1)
strcat(str,"K");
......
......@@ -428,7 +428,7 @@ int sbbs_t::external(char* cmdline, long mode, char* startup_dir)
,cfg.node_num);
startup_info.lpTitle=title;
}
if(cfg.startup->options&BBS_OPT_XTRN_MINIMIZED) {
if(startup->options&BBS_OPT_XTRN_MINIMIZED) {
startup_info.wShowWindow=SW_SHOWMINNOACTIVE;
startup_info.dwFlags|=STARTF_USESHOWWINDOW;
}
......
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