Exemple #1
0
void VbExError(const char *format, ...)
{
	va_list ap;
	va_start(ap, format);
	vprintf(format, ap);
	va_end(ap);
	system_abort();
}
Exemple #2
0
void test_application_main(void)
{
	//test_SPI();
	//test_analogToDigital();

	//test_SPI_framework();
	//test_SPI_framework_2();
	//int i;
	//for (i = 0;i < 10000;i++)
	//{
	//	test_realTimeClock();
	//}
	//int i;
	//for (i = 0;i < 10000;i++)
	//{
		//test_sdCard();
	//}
	

	//test_COMmain();

	//test_thermocouple();
	
	//test_digitalToAnalog();
	//test_radio();
	//test_PSK();
	//test_toneGenerator();

	#if DebugMode
		
		#if RTC_CONNECTED
			test_realTimeClock();
			test_BinaryCodedDecimal();
		#endif
		
		#if SD_CONNECTED
			test_sdCard();
		#endif
	#endif

		//test_SPI_framework();
		//test_SPI_framework_2();
		//test_COMmain();
		//test_thermocouple();
		//test_digitalToAnalog();
		//test_radio();
		//test_PSK();
		//test_toneGenerator();

		//test_SPI();
		//test_analogToDigital();
	
	test_packetGrabbing();
	
	logLine("");
	logLine("All tests complete! --------------------");
	system_abort();
}
Exemple #3
0
static void multi_user_check() {
    register userinfo_t *ui;
    register pid_t pid;
    char genbuf[3];

    if(HAS_PERM(PERM_SYSOP))
	return;		/* don't check sysops */
    
    if(cuser.userlevel) {
	if(!(ui = (userinfo_t *)search_ulist(cmpuids, usernum)))
	    return;	/* user isn't logged in */
	
	pid = ui->pid;
	if(!pid /*|| (kill(pid, 0) == -1)*/)
	    return;	/* stale entry in utmp file */
	
	getdata(b_lines - 1, 0, "您想刪除其他重複的 login (Y/N)嗎?[Y] ",
		genbuf, 3, LCECHO);

	if(genbuf[0] != 'n') {
	    if(pid > 0) kill(pid, SIGHUP);
	    log_usies("KICK ", cuser.username);
	} else {
	    if(count_multi() >= 3)
		system_abort();		/* Goodbye(); */
	}
    } else {
	/* allow multiple guest user */
	if(count_multi() > 32) {
	    outs("\n抱歉,目前已有太多 guest, 請稍後再試。\n");
	    pressanykey();
	    oflush();
	    exit(1);
	}
    }
}
Exemple #4
0
static void 
multi_user_check()
{
	register user_info *ui;
	register pid_t	pid;
	int		cmpuids    ();

	if (HAS_PERM(PERM_SYSOP))
		return;		/* wildcat:站長不限制 */

	if (cuser.userlevel) {
		if (!(ui = (user_info *) search_ulist(cmpuids, usernum)))
			return;	/* user isn't logged in */

		pid = ui->pid;
		if (!pid || (kill(pid, 0) == -1))
			return;	/* stale entry in utmp file */

		if (getans2(b_lines, 0, "您想刪除其他重複的 login 嗎?", 0, 2, 'y') != 'n') {
			kill(pid, SIGHUP);
			log_usies("KICK ", cuser.username);
		} else {
			int		nums = MULTI_NUMS;
			if (HAS_PERM(PERM_BM))
				nums += 2;
			if (count_multi() >= nums)
				system_abort();
		}
	} else {		/* guest的話 */
		if (count_multi() > 512) {
			pressanykey("抱歉,目前已有太多 guest, 請稍後再試。");
			oflush();
			exit(1);
		}
	}
}
Exemple #5
0
void start_client(void)
{
	extern char currmaildir[];

	initialize_mdb();
#ifndef ENABLE_SSH
	initialize_db();
#endif

	initialize_convert_env();
	system_init();

	if (setjmp(byebye)) {
		system_abort();
	}

	strlcpy(BoardName, BBSNAME, sizeof(BoardName));

	if (login_query() == -1) {
		terminal_flush();
		sleep(3);
		exit(1);
	}
#ifndef ENABLE_SSH
	screen_negotiate_size();
#endif // ENABLE_SSH
	screen_init(0);

	user_login();

	setmdir(currmaildir, currentuser.userid);
	RMSG = NA;
	screen_clear();
	editor_restore();
#ifdef TALK_LOG
	tlog_recover();
#endif

	if (strcmp(currentuser.userid, "guest")) {
		if (check_maxmail())
			pressanykey();
		screen_move(9, 0);
		screen_clrtobot();
		if (!DEFINE(DEF_NOLOGINSEND))
			if (session_visible())
				login_msg();
		screen_clear();
		set_numofsig();
	}

	active_board_init(false);
	fill_date();

	if (DEFINE(DEF_LOGFRIEND)
			&& session_count_online_followed(!HAS_PERM(PERM_SEECLOAK)) > 0)
		show_online_followings();

	menu_load("menu.img");
	while (1) {
		if (DEFINE(DEF_NORMALSCR))
			menu_loop("TOPMENU");
		else
			menu_loop("TOPMENU2");
		Goodbye();
	}
}