static int goodbye() { /* guessi.091228 減少畫面重繪 回傳XO_NONE */ if (vans("您確定要離開【 東方小城 】嗎? Y)再見 N)返回 [N] ") != 'y') return XO_NONE; #ifdef LOG_BMW /* lkchu.981201: 水球記錄處理 */ bmw_log(); #endif /* itoc.000407: 離站畫面一併簡化 */ if (!(cuser.ufo & UFO_MOTD)) { clear(); prints("親愛的 \033[32m%s(%s)\033[m,別忘了再度光臨【 %s 】\n以下是您在站內的註冊資料:\n", cuser.userid, cuser.username, str_site); acct_show(&cuser, 0); vmsg(NULL); } u_exit("EXIT "); /* guessi.060610 離站清空畫面 */ clear(); refresh(); exit(0); }
void abort_bbs() { if (currmode) u_exit("AXXED"); exit(0); }
void init() { /* Call sys_setup. This sets up the root nodes, and filedesc's 0, 1 and 2. */ sys_setup(); kprintf("Something stirs and something tries, and starts to climb towards the light.\n"); /* Set some basic environment variables. These allow simple root execution, * basic terminal access, and a shell to run from */ add_init_env("PATH=/bin/:/usr/bin/:/usr/sbin:"); add_init_env("TERM=seaos"); add_init_env("HOME=/"); add_init_env("SHELL=/bin/sh"); int ret=0; int pid; init_pid = current_task->pid+1; set_cpu_interrupt_flag(1); switch_to_user_mode(); /* We have to be careful now. If we try to call any kernel functions * without doing a system call, the processor will generate a GPF (or * a page fault) because you can't execute kernel code in ring 3! * So we write simple wrapper functions for common functions that * we will need */ ret = u_execve("/sh", (char **)stuff_to_pass, (char **)init_env); unset_ksf(KSF_HAVEEXECED); ret = u_execve("/bin/sh", (char **)stuff_to_pass, (char **)init_env); unset_ksf(KSF_HAVEEXECED); ret = u_execve("/usr/bin/sh", (char **)stuff_to_pass, (char **)init_env); unset_ksf(KSF_HAVEEXECED); printf("Failed to start the init process. Halting.\n"); u_exit(0); }
static void system_abort() { if(currmode) u_exit("ABORT"); clear(); refresh(); fprintf(stdout, "謝謝光臨, 記得常來喔 !\n"); exit(0); }
static void system_abort(void) { if (session_id()) { log_usies("ABORT", "", ¤tuser); u_exit(); } screen_clear(); screen_flush(); //% prints("谢谢光临, 记得常来喔 !\n"); prints("\xd0\xbb\xd0\xbb\xb9\xe2\xc1\xd9, \xbc\xc7\xb5\xc3\xb3\xa3\xc0\xb4\xe0\xb8 !\n"); exit(0); }
static void abort_bbs_debug(int sig) { static int reentrant = 0; if(!reentrant) { reentrant = 1; if(currmode) u_exit("AXXED"); // printpt("debug me!(%d)",sig); // sleep(3600); /* wait 60 mins for debug */ } exit(0); }
void system_abort() { if (currmode) u_exit("ABORT"); clear(); refresh(); printf("謝謝光臨, 記得常來喔 !\n"); sleep(1); exit(0); }
static int goodbye() { /* itoc.010803: 秀張離站的圖 */ clear(); film_out(FILM_GOODBYE, 0); switch (vans("G)隨風而逝 M)報告站長 N)留言板 Q)取消?[Q] ")) { /* lkchu.990428: 內定改為不離站 */ case 'g': case 'y': break; case 'm': m_sysop(); break; case 'n': /* if (cuser.userlevel) */ if (HAS_PERM(PERM_POST)) /* Thor.990118: 要能post才能留言, 提高門檻 */ pad_draw(); break; case 'q': default: /* return XEASY; */ return 0; /* itoc.010803: 秀了 FILM_GOODBYE 要重繪 */ } #ifdef LOG_BMW bmw_log(); /* lkchu.981201: 水球記錄處理 */ #endif if (!(cuser.ufo & UFO_MOTD)) /* itoc.000407: 離站畫面一併簡化 */ { clear(); prints("親愛的 \033[32m%s(%s)\033[m,別忘了再度光臨【 %s 】\n" "以下是您在站內的註冊資料:\n", cuser.userid, cuser.username, str_site); acct_show(&cuser, 0); vmsg(NULL); } u_exit("EXIT "); exit(0); }
static int goodbye() { /* itoc.010803: 秀張離站的圖 */ clear(); film_out(FILM_GOODBYE, 0); switch (vans("G)隨光而逝 M)報告站長 N)留言板 Q)取消?[Q] ")) { /* lkchu.990428: 內定改為不離站 */ case 'g': case 'y': break; case 'm': m_sysop(); break; case 'n': /* if (cuser.userlevel) */ if (HAS_PERM(PERM_POST)) /* Thor.990118: 要能post才能留言, 提高門檻 */ pad_draw(); break; case 'b': /* floatJ.090607: konami_code 彩蛋 */ if (konami_counter >= 6) more("etc/CharlieSP", MFST_NONE); case 'q': default: if(konami_counter >= 6) /* dust.091010: 在b這步按錯的話不必考慮嗎... */ konami_counter = 0; /* return XEASY; */ return 0; /* itoc.010803: 秀了 FILM_GOODBYE 要重繪 */ } #ifdef LOG_BMW bmw_log(); /* lkchu.981201: 水球記錄處理 */ #endif u_exit("EXIT "); exit(0); }
void abort_bbs(int nothing) { extern int child_pid; if (child_pid) { kill(child_pid, SIGKILL); } editor_dump(); if (session_id()) { time_t stay; stay = time(0) - login_start_time; snprintf(genbuf, sizeof(genbuf), "Stay: %3ld", stay / 60); log_usies("AXXED", genbuf, ¤tuser); u_exit(); } exit(0); }
static void user_mode_init(void) { /* We have to be careful now. If we try to call any kernel functions * without doing a system call, the processor will generate a GPF (or * a page fault) because you can't do fancy kernel stuff in ring 3! * So we write simple wrapper functions for common functions that * we will need */ char *init_env[5] = { "PATH=/bin/:/usr/bin/:/usr/sbin:", "TERM=seaos", "HOME=/", "SHELL=/bin/sh", NULL }; int ret; char *init_argv[3] = { "init", root_device, NULL }; ret = u_execve("/init", (char **)init_argv, (char **)init_env); printf("Failed to start the init process (err=%d). Halting.\n", -ret); u_exit(0); }
int Goodbye() { extern void movie(); char genbuf[200]; /* woju */ char ans[4]; setuserfile(genbuf, fn_writelog); if (more(genbuf, NA) != -1) { /* MH */ /* Àˬd¤ô²y°O¿ý®e¶q, ÁקK¦³¤H¡u¤Ù¿n¡v¤j¶q¤ô²y */ struct stat st; int writelog_limit; if (HAS_PERM(PERM_BM)) writelog_limit = MH_WRITELOGLIMIT_BM; else if (HAS_PERM(PERM_LOGINOK)) writelog_limit = MH_WRITELOGLIMIT_LOGINOK; else writelog_limit = MH_WRITELOGLIMIT_BASIC; do { char buf[80]; setuserfile(buf, fn_writelog); stat(buf, &st); if(!HAVE_PERM(PERM_SYSOP) && !HAVE_PERM(PERM_MAILLIMIT) && st.st_size / 1024 > writelog_limit) { my_outmsg_row("[1;41;37m±zªº¤ô²y°O¿ý¤w¶W¹L©w®e¶q¡AµLªk¿ï¾Ü¡u«O¯d¡v[0m", b_lines - 2); getdata(b_lines - 1, 0, "²M°£(C) ²¾¦Ü³Æ§Ñ¿ý(M) (C/M)?[M]", ans, 3, LCECHO, 0); } else { getdata(b_lines - 1, 0, "²M°£(C) ²¾¦Ü³Æ§Ñ¿ý(M) «O¯d(R) (C/M/R)?[R]", ans, 3, LCECHO, 0); } if (*ans == 'm') { fileheader mymail; char title[128], buf[80]; sethomepath(buf, cuser.userid); stampfile(buf, &mymail); mymail.savemode = 'H'; /* hold-mail flag */ mymail.filemode = FILE_READ; strcpy(mymail.owner, "[³Æ.§Ñ.¿ý]"); strcpy(mymail.title, "¼ö½u[37;41m°O¿ý[m"); if(mh_memoforward(cuser.userid, genbuf, &mymail, sizeof(mymail))) { sethomedir(title, cuser.userid); append_record(title, &mymail, sizeof(mymail)); /* MH: ³Æ§Ñ¿ý¥[¤W§@ªÌ¼ÐÃDµ¥¸ê°T...¤£µM¦b'x'Âà±H©Î¬Obuildirªº®ÉÔ ·|Äê±¼ */ #if 1 { FILE *src, *dst; char buf2[200]; time_t now; if((src = fopen(genbuf, "r")) == NULL) { sprintf(buf2, "errno: %d, genbuf:%s", errno, genbuf); log_usies("MH ", buf2); } if((dst = fopen(buf, "w")) == NULL) { sprintf(buf2, "errno: %d, buf:%s", errno, buf); log_usies("MH ", buf2); fclose(src); } now = time(NULL); sprintf(buf2, "§@ªÌ: %s\n¼ÐÃD: %s\n®É¶¡: %s\n", mymail.owner, mymail.title, ctime(&now)); fputs(buf2, dst); while(fgets(buf2, 199, src) != NULL) fputs(buf2, dst); fclose(src); fclose(dst); unlink(genbuf); } #else Rename(genbuf, buf); #endif } } else if (*ans == 'c') { char buf[80]; setuserfile(buf, fn_writelog); unlink(buf); } } while(!HAVE_PERM(PERM_SYSOP) && !HAVE_PERM(PERM_MAILLIMIT) && st.st_size / 1024 > writelog_limit && *ans != 'm' && *ans != 'c'); clear(); move(0, 0); prints("[1;44;33m °ª¶¯¤¤¾Ç-¬õ¼Ó¿v¹Ú [m"); movie(0); } /* */ getdata(b_lines - 1, 0, "±z½T©wnÂ÷¶}¡i " BOARDNAME " ¡j¶Ü(Y/N)¡H[N] ", genbuf, 3, LCECHO, 0); if (*genbuf != 'y') return 0; movie(999); if (cuser.userlevel) { getdata(b_lines - 1, 0, "(G)ÀH·¦Ó³u (M)¦«¹Ú¯¸ªø (N)¦X§@ªÀªº¨¥½×¼s³õ¡H[G] ", genbuf, 3, LCECHO, 0); if (genbuf[0] == 'm') mail_sysop(); else if (genbuf[0] == 'n') note(); } save_userrc(); #if 0 save_mailmsg(); #endif clear(); prints("[1;36m¿Ë·Rªº [33m%s(%s)[36m¡A§O§Ñ¤F¦A«×¥úÁ{[45;33m" " %s [40;36m¡I\n¥H¤U¬O±z¦b¯¸¤ºªºµù¥U¸ê®Æ:[0m\n", cuser.userid, cuser.username, BoardName); user_display(&cuser, 0); if (currmode) u_exit("EXIT "); pressanykey(); sleep(1); reset_tty(); exit(0); }
int igetch() { register int ch; while(ch = dogetch()) { switch (ch) { case Ctrl('L'): redoscr(); continue; case Ctrl('I'): if(currutmp != NULL && currutmp->mode == MMENU) { screenline* screen = (screenline *)calloc(t_lines, sizeof(screenline)); vs_save(screen); t_idle(); vs_restore(screen); continue; } else return(ch); case Ctrl('Q'): /* wildcat : 快速離站 :p */ if(currutmp->mode && currutmp->mode != READING) { if(answer("\033[0;30;47m 確定要離站?? (y/N) \033[m") != 'y') return(ch); update_data(); u_exit("ABORT"); pressanykey("謝謝光臨, 記得常來喔 !"); exit(0); } else return (ch); case Ctrl('U'): resetutmpent(); if(currutmp != NULL && currutmp->mode != EDITING && currutmp->mode != LUSERS && currutmp->mode) { int mode0 = currutmp->mode; int stat0 = currstat; screenline* screen = (screenline *)calloc(t_lines, sizeof(screenline)); vs_save(screen); t_users(); vs_restore(screen); currutmp->mode = mode0; currstat = stat0; continue; } else return (ch); case Ctrl('R'): { if(currutmp == NULL) return (ch); else if(watermode > 0) { watermode = (watermode + oldmsg_count)% oldmsg_count + 1; t_display_new(0); continue; } else if (!currutmp->mode && (currutmp->chatid[0] == 2 || currutmp->chatid[0] == 3) && oldmsg_count && !watermode) { watermode=1; t_display_new(1); continue; } else if (currutmp->msgs[0].last_pid && currutmp->mode) { screenline* screen = (screenline *)calloc(t_lines, sizeof(screenline)); vs_save(screen); watermode=1; t_display_new(1); my_write(currutmp->msgs[0].last_pid, "水球丟回去:"); vs_restore(screen); continue; } else return (ch); } case '\n': /* Ptt把 \n拿掉 */ continue; case Ctrl('T'): if(watermode > 0 ) { watermode = (watermode + oldmsg_count - 2 )% oldmsg_count + 1; t_display_new(0); continue; } default: return (ch); } } }