Ejemplo n.º 1
0
int
expand_esc_star(char *buf, const char *src, int szbuf)
{
    assert(*src == KEY_ESC && *(src+1) == '*');
    src += 2;
    switch(*src)
    {
        //
        // secure content
        //
        case 't':   // current time
            strlcpy(buf, Cdate(&now), szbuf);
            return 1;
        case 'u':   // current online users
            snprintf(buf, szbuf, "%d", SHM->UTMPnumber);
            return 1;
        //
        // insecure content
        //
        case 's':   // current user id
            strlcpy(buf, cuser.userid, szbuf);
            return 2;
        case 'n':   // current user nickname
            strlcpy(buf, cuser.nickname, szbuf);
            return 2;
    }

    // unknown characters, return from star.
    strlcpy(buf, src-1, szbuf);
    return 0;
}
Ejemplo n.º 2
0
void log_usies(char *mode, char *mesg) {
    char genbuf[200];
    time_t now = time(0);
    
    if (!mesg)
	sprintf(genbuf, cuser.userid[0] ? "%s %s %-12s Stay:%d (%s)" :
		"%s %s %s Stay:%d (%s)",
		Cdate(&now), mode, cuser.userid,
		(now - login_start_time) / 60, cuser.username);
    else
	sprintf(genbuf, cuser.userid[0] ? "%s %s %-12s %s" : "%s %s %s%s",
		Cdate(&now), mode, cuser.userid, mesg);
    log_file(FN_USIES, genbuf);

    /* 追蹤使用者 */
    if(HAS_PERM(PERM_LOGUSER))
	log_user(genbuf);
}
Ejemplo n.º 3
0
Archivo: chat.c Proyecto: wyat/kbs
void chat_date(chatcontext * pthis, const char *arg)
{
    time_t thetime;

    time(&thetime);
    sprintf(genbuf, " %s标准时间: \033[32m%s\033[m", BBS_FULL_NAME,
            Cdate(thetime));
    printchatline(pthis, genbuf);
}
Ejemplo n.º 4
0
Archivo: more.c Proyecto: clkao/pttbbs
static int
common_pager_exit_handler(int r, const char *fpath)
{
    // post processing
    switch(r)
    {
	case RET_DOSYSOPEDIT:
	    r = FULLUPDATE;
	    if (!check_sysop_edit_perm(fpath))
		break;
	    log_filef("log/security", LOG_CREAT,
		    "%u %s %d %s admin edit file=%s\n", 
		    (int)now, Cdate(&now), getpid(), cuser.userid, fpath);
	    veditfile(fpath);
	    break;

	case RET_COPY2TMP:
	    r = FULLUPDATE;
	    if (HasUserPerm(PERM_BASIC))
	    {
		char buf[PATHLEN];
		getdata(b_lines - 1, 0, "把這篇文章收入到暫存檔?[y/N] ",
			buf, 4, LCECHO);
		if (buf[0] != 'y')
		    break;
		setuserfile(buf, ask_tmpbuf(b_lines - 1));
		Copy(fpath, buf);
	    }
	    break;

	case RET_SELECTBRD:
	    r = FULLUPDATE;
	    if (currstat == READING)
		r = Select();
	    break;

	case RET_DOCHESSREPLAY:
	    r = FULLUPDATE;
	    if (HasUserPerm(PERM_BASIC))
		ChessReplayGame(fpath);
	    break;

#if defined(USE_BBSLUA) && !defined(DISABLE_BBSLUA_IN_PAGER)
	case RET_DOBBSLUA:
	    r = FULLUPDATE;
	    // check permission again
	    if (HasUserPerm(PERM_BASIC)) 
		bbslua(fpath);
	    break;
#endif
    }
    return r;
}
Ejemplo n.º 5
0
Archivo: stuff.c Proyecto: ptt/pttbbs
int
log_user(const char *fmt, ...)
{
    char msg[256], filename[256];
    va_list ap;

    va_start(ap, fmt);
    vsnprintf(msg , sizeof(msg), fmt, ap);
    va_end(ap);

    sethomefile(filename, cuser.userid, "USERLOG");
    return log_filef(filename, LOG_CREAT, "%s: %s %s", cuser.userid, msg,  Cdate(&now));
}
Ejemplo n.º 6
0
static void logattempt(char *uid, char type) {
    char fname[40];
    int fd, len;
    char genbuf[200];
    
    sprintf(genbuf, "%c%-12s[%s] %s@%s\n", type, uid,
	    Cdate(&login_start_time), remoteusername, fromhost);
    len = strlen(genbuf);
    if((fd = open(str_badlogin, O_WRONLY | O_CREAT | O_APPEND, 0644)) > 0) {
	write(fd, genbuf, len);
	close(fd);
    }
    if(type == '-') {
	sprintf(genbuf, "[%s] %s\n", Cdate(&login_start_time), fromhost);
	len = strlen(genbuf);
	sethomefile(fname, uid, str_badlogin);
	if((fd = open(fname, O_WRONLY | O_CREAT | O_APPEND, 0644)) > 0) {
	    write(fd, genbuf, len);
	    close(fd);
	}
    }
}
Ejemplo n.º 7
0
Archivo: xyz.c Proyecto: dk00/old-stuff
/* MH */
void
mh_note()
{
  static char *fn_note_tmp = "note.tmp";
  static char *fn_note_dat = "note.dat";
  int total, i, collect, len;
  struct stat st;
  char buf[256], buf2[80], *p;
  int fd, fx;
  FILE *fp, *foo,*outf;

  struct notedata
  {
    time_t date;
    char userid[IDLEN + 1];
    char username[19];
    char buf[3][80];
  };
  struct notedata myitem;

  do
  {
    myitem.buf[0][0] = myitem.buf[1][0] = myitem.buf[2][0] = '\0';
    move(12, 0);
    clrtobot();
    outs("\n½Ð¯d¨¥ (¦Ü¦h¤T¦æ)¡A«ö[Enter]µ²§ô");
    strcpy(myitem.buf[0], "¯¬¦Û¤v¥Í¤é§Ö¼Ö^^;;");
    strcpy(myitem.buf[1], "§Ö¼Ö§Ö¼Ö^o^");
    strcpy(myitem.buf[2], "");
    buf[0] = 's';
/*
woju
*/
    if (buf[0] == 'q' || i == 0 && *buf != 'e')
      return;
  } while (buf[0] == 'e');

  strcpy(myitem.userid, cuser.userid);
  strncpy(myitem.username, cuser.username, 18);
  myitem.username[18] = '\0';
  time(&(myitem.date));

  /* begin load file */

  if ((foo = fopen(".note", "a")) == NULL)
    return;

  if ((fp = fopen(fn_note_ans, "w")) == NULL)
    return;

  if ((fx = open(fn_note_tmp, O_WRONLY | O_CREAT, 0644)) <= 0)
    return;

  if ((fd = open(fn_note_dat, O_RDONLY)) == -1)
  {
    total = 1;
  }
  else if (fstat(fd, &st) != -1)
  {
    total = st.st_size / sizeof(struct notedata) + 1;
    if (total > MAX_NOTE)
      total = MAX_NOTE;
  }

  fputs("\t\t\t ¡´ ¦X §@ ªÀ ¨¥ ½× ¼s ³õ ¡´ \n\n", fp);
  collect = 1;

  while (total)
  {
    sprintf(buf, "£X %s (%s)",
      myitem.userid, myitem.username);
    len = strlen(buf);

    strcat(buf, " " + (len & 1));

    for (i = len >> 1; i < 41; i++)
      strcat(buf, "¢e");
    sprintf(buf2, " %.14s £X\n",
      Cdate(&(myitem.date)));
    strcat(buf, buf2);
    fputs(buf, fp);

    if (collect)
      fputs(buf, foo);

    sprintf(buf, "%s\n%s\n%s\n", myitem.buf[0], myitem.buf[1], myitem.buf[2]);
    fputs(buf, fp);

    if (collect)
    {
      fputs(buf, foo);
      fclose(foo);
      collect = 0;
    }

    write(fx, &myitem, sizeof(myitem));

    if (--total)
      read(fd, (char *) &myitem, sizeof(myitem));
  }
  fclose(fp);
  close(fd);
  close(fx);
  Rename(fn_note_tmp, fn_note_dat);
  strcpy(vetitle, "[¦X§@ªÀªº¨¥½×¼s³õ]");
}
Ejemplo n.º 8
0
Archivo: xyz.c Proyecto: dk00/old-stuff
static void
note()
{
  static char *fn_note_tmp = "note.tmp";
  static char *fn_note_dat = "note.dat";
#if 0
  static char *fn_note_dat2 = "note.dat2";
#endif
  int total, i, collect, len;
  struct stat st;
  char buf[256], buf2[80], *p;
  int fd, fx;
  FILE *fp, *foo,*outf;

  struct notedata
  {
    time_t date;
    char userid[IDLEN + 1];
    char username[19];
    char buf[3][80];
  };
  struct notedata myitem;

  do
  {
    myitem.buf[0][0] = myitem.buf[1][0] = myitem.buf[2][0] = '\0';
    move(12, 0);
    clrtobot();
    outs("\n½Ð¯d¨¥ (¦Ü¦h¤T¦æ)¡A«ö[Enter]µ²§ô");
    for (i = 0; (i < 3) &&
      getdata(16 + i, 0, "¡G", myitem.buf[i], 78, DOECHO, 0); i++);
    getdata(b_lines - 1, 0, "(S)Àx¦s (E)­«·s¨Ó¹L (Q)¨ú®ø¡H[S] ", buf, 3, LCECHO, 0);
/*
woju
*/
    if (buf[0] == 'q' || i == 0 && *buf != 'e')
      return;
  } while (buf[0] == 'e');

  strcpy(myitem.userid, cuser.userid);
  strncpy(myitem.username, cuser.username, 18);
  myitem.username[18] = '\0';
  time(&(myitem.date));

  /* begin load file */
  
#if 0
/* MH */
  if((fp = fopen(fn_note_dat2, "a")) == NULL)
    return;
  fwrite(&myitem, sizeof(myitem), 1, fp);
  fclose(fp);
/*    */
#endif

  if ((foo = fopen(".note", "a")) == NULL)
    return;

  if ((fp = fopen(fn_note_ans, "w")) == NULL)
    return;

  if ((fx = open(fn_note_tmp, O_WRONLY | O_CREAT, 0644)) <= 0)
    return;

  if ((fd = open(fn_note_dat, O_RDONLY)) == -1)
  {
    total = 1;
  }
  else if (fstat(fd, &st) != -1)
  {
    total = st.st_size / sizeof(struct notedata) + 1;
    if (total > MAX_NOTE)
      total = MAX_NOTE;
  }

  fputs("\t\t\t ¡´ ¦X §@ ªÀ ¨¥ ½× ¼s ³õ ¡´ \n\n", fp);
  collect = 1;

  while (total)
  {
    sprintf(buf, "£X %s (%s)",
      myitem.userid, myitem.username);
    len = strlen(buf);

    strcat(buf, " " + (len & 1));

    for (i = len >> 1; i < 41; i++)
      strcat(buf, "¢e");
    sprintf(buf2, " %.14s £X\n",
      Cdate(&(myitem.date)));
    strcat(buf, buf2);
    fputs(buf, fp);

    if (collect)
      fputs(buf, foo);

    sprintf(buf, "%s\n%s\n%s\n", myitem.buf[0], myitem.buf[1], myitem.buf[2]);
    fputs(buf, fp);

    if (collect)
    {
      fputs(buf, foo);
      fclose(foo);
      collect = 0;
    }

    write(fx, &myitem, sizeof(myitem));

    if (--total)
      read(fd, (char *) &myitem, sizeof(myitem));
  }
  fclose(fp);
  close(fd);
  close(fx);
  Rename(fn_note_tmp, fn_note_dat);

#if 0
/* MH */
  if ((fp = fopen(fn_note_ans2, "w")) == NULL)
    return;

  if ((fd = open(fn_note_dat2, O_RDONLY)) == -1)
    return;

  if (fstat(fd, &st) != -1)
  {
    total = st.st_size / sizeof(struct notedata);
  }
  else
    total = 0;
  
  fputs("\t\t\t ¡´ ¦X §@ ªÀ ¨¥ ½× ¼s ³õ ¡´ \n\n", fp);

  while (total > 0)
  {
    if(lseek(fd, (total - 1) * sizeof(myitem), SEEK_SET) == -1)
      break;
    if(read(fd, (char *) &myitem, sizeof(myitem)) != sizeof(myitem))
      break;
    
    sprintf(buf, "£X %s (%s)",
      myitem.userid, myitem.username);
    len = strlen(buf);

    strcat(buf, " " + (len & 1));

    for (i = len >> 1; i < 41; i++)
      strcat(buf, "¢e");
    sprintf(buf2, " %.14s £X\n",
      Cdate(&(myitem.date)));
    strcat(buf, buf2);
    fputs(buf, fp);

    sprintf(buf, "%s\n%s\n%s\n", myitem.buf[0], myitem.buf[1], myitem.buf[2]);
    fputs(buf, fp);

    total --;
  }
  fclose(fp);
  close(fd);
/*    */
#endif

  strcpy(vetitle, "[¦X§@ªÀªº¨¥½×¼s³õ]");
  more(fn_note_ans, YEA);
}
Ejemplo n.º 9
0
int
pip_live_again()
{
    char genbuf[80];
    time_t now;
    int tm;

    tm = (d.bbtime) / 60 / 30;

    clear();
    showtitle("小鸡复活手术中", BBS_FULL_NAME);

    now = time(0);
    sprintf(genbuf, "\033[1;33m%s %-11s的小鸡 [%s二代] 复活了!\033[m\n",
            Cdate(now), getCurrentUser()->userid, d.name);
    pip_log_record(genbuf);

    /*
     * 身体上的设定
     */
    d.death = 0;
    d.maxhp = d.maxhp * 3 / 4 + 1;
    d.hp = d.maxhp / 2 + 1;
    d.tired = 20;
    d.shit = 20;
    d.sick = 20;
    d.wrist = d.wrist * 3 / 4;
    d.weight = 45 + 10 * tm;

    /*
     * 钱减到五分之一
     */
    d.money = d.money / 5;

    /*
     * 战斗能力降一半
     */
    d.attack = d.attack * 3 / 4;
    d.resist = d.resist * 3 / 4;
    d.maxmp = d.maxmp * 3 / 4;
    d.mp = d.maxmp / 2;

    /*
     * 变的不快乐
     */
    d.happy = 0;
    d.satisfy = 0;

    /*
     * 评价减半
     */
    d.social = d.social * 3 / 4;
    d.family = d.family * 3 / 4;
    d.hexp = d.hexp * 3 / 4;
    d.mexp = d.mexp * 3 / 4;

    /*
     * 武器掉光光
     */
    d.weaponhead = 0;
    d.weaponrhand = 0;
    d.weaponlhand = 0;
    d.weaponbody = 0;
    d.weaponfoot = 0;

    /*
     * 食物剩一半
     */
    d.food = d.food / 2;
    d.medicine = d.medicine / 2;
    d.bighp = d.bighp / 2;
    d.cookie = d.cookie / 2;

    d.liveagain += 1;

    temppress("小鸡器官重建中!");
    temppress("小鸡体质恢复中!");
    temppress("小鸡能力调整中!");
    temppress("恭禧您,你的小鸡又复活罗!");
    pip_write_file();
    return 0;
}
Ejemplo n.º 10
0
int /*��ֻ���*/
pip_ending_screen()
{
  time_t now;
  char buf[256];
  char endbuf1[50];
  char endbuf2[50];
  char endbuf3[50];
  int endgrade=0;
  int endmode=0;
  clear();
  pip_ending_decide(endbuf1,endbuf2,endbuf3,&endmode,&endgrade);
  move(1,9); 
  prints("����������������  ����������  ����������������  ��  ������  ");
  move(2,9);
  prints("��      ����    ������      ����      ����    ������      ��");
  move(3,9);
  prints("��    ��  ��    ������      ��������������    ������  ������");
  move(4,9);
  prints("��    ��  ��  ��  ����      ��������������  ��  ����      ��");
  move(5,9);
  prints("��      ����  ��  ����      ����      ����  ��  ����      ��");
  move(6,9);
  prints("��������������  ������������  ��������������  ����  ������  ");
  move(7,8);
  prints("�������������������� �ǿ�ս������ֱ��� ����������������������");
  move(9,10);
  prints("���ʱ�䲻֪�����ػ��ǵ�����...");
  move(11,10);
  prints("%s ���뿪�����ů�������Լ�һֻ����������������.....",d.name);
  move(13,10);
  prints("�����չ˽̵��������ʱ�⣬�����Ӵ��˺ܶ����������˺ܶ������....");
  move(15,10);
  prints("��Ϊ��Щ����С�� %s ֮��������ø���ɶ�����........",d.name);
  move(17,10);
  prints("�����Ĺ��ģ���ĸ����������еİ�......");
  move(19,10);
  prints("%s ����Զ���������ĵ�....",d.name);
  pressanykey("��������δ����չ");
  clrchyiuan(7,19);
  move(7,8);
  prints("�������������������� �ǿ�ս����δ����չ ����������������������");
  move(9,10);
  prints("͸��ˮ����������һ������ %s ��δ����չ��.....",d.name);
  move(11,10);
  prints("�� %s ����%s....",d.name,endbuf1);
  move(13,10);
  prints("��Ϊ����֮ǰ��Ŭ����ʹ��������һ����%s....",endbuf2);
  move(15,10);
  prints("���С���Ļ���״����������%s���������Ǻ�����.....",endbuf3);
  move(17,10);
  prints("��..����һ������Ľ���..........");
  pressanykey("����  ��һ���ܸж���.....");
  show_ending_pic(0);
  pressanykey("��һ��������");
  endgrade=pip_game_over(endgrade);
  pressanykey("��һҳ��С������  �Ͽ�copy����������");
  pip_data_list();
  pressanykey("��ӭ������ս....");
  /*��¼��ʼ*/
  now=time(0);
  sprintf(buf, "������������������������������������������������������������������������������\n");
  pip_log_record(buf);
  sprintf(buf, "�� %s ��ʱ��%s ��С�� %s �����˽��\n", Cdate(&now), cuser.userid,d.name);
  pip_log_record(buf);
  sprintf(buf, "С�� %s Ŭ����ǿ�Լ�������%s\n��Ϊ֮ǰ��Ŭ����ʹ������һ����%s\n",d.name,endbuf1,endbuf2);
  pip_log_record(buf);
  sprintf(buf, "��춻���״����������%s���������Ǻ�����.....\n\nС�� %s ���ܻ��֣� %d\n",endbuf3,d.name,endgrade);
  pip_log_record(buf);
  sprintf(buf, "������������������������������������������������������������������������������\n");
  pip_log_record(buf);  
  /*��¼��ֹ*/
  d.death=3;
  pipdie("��Ϸ������...  ",3);
  return 0;
}
Ejemplo n.º 11
0
int
pip_system_service()
{
    int pipkey;
    int oldchoice;
    char buf[200];
    char oldname[21];
    time_t now;

    move(b_lines, 0);
    clrtoeol();
    move(b_lines, 0);
    prints
    ("\033[1;44m  服务项目  \033[46m[1]命名大师 [2]变性手术 [3]结局设局                                \033[0m");
    pipkey = igetkey();

    switch (pipkey) {
        case '1':
            move(b_lines - 1, 0);
            clrtobot();
#ifdef MAPLE
            getdata(b_lines - 1, 1, "帮小鸡重新取个好名字:", buf, 11,
                    DOECHO, NULL);
#else
            getdata(b_lines-1,1,"帮小鸡重新取个好名字:",buf,11,DOECHO,NULL,true);
#endif    // END MAPLE
            if (!buf[0]) {
                temppress("等一下想好再来好了  :)");
                break;
            } else {
                strcpy(oldname, d.name);
                strcpy(d.name, buf);
                /*
                 * 改名记录
                 */
                now = time(0);
                sprintf(buf,
                        "\033[1;37m%s %-11s把小鸡 [%s] 改名成 [%s] \033[0m\n",
                        Cdate(now), getCurrentUser()->userid, oldname, d.name);
                pip_log_record(buf);
                temppress("嗯嗯  换一个新的名字喔...");
            }
            break;

        case '2':  /*变性 */
            move(b_lines - 1, 0);
            clrtobot();
            /*
             * 1:公 2:母
             */
            if (d.sex == 1) {
                oldchoice = 2; /*公-->母 */
                move(b_lines - 1, 0);
                prints
                ("\033[1;33m将小鸡由\033[32m♂\033[33m变性成\033[35m♀\033[33m的吗? \033[37m[y/N]\033[0m");
            } else {
                oldchoice = 1; /*母-->公 */
                move(b_lines - 1, 0);
                prints
                ("\033[1;33m将小鸡由\033[35m♀\033[33m变性成\033[35m♂\033[33m的吗? \033[37m[y/N]\033[0m");
            }
            move(b_lines, 0);
            prints
            ("\033[1;44m  服务项目  \033[46m[1]命名大师 [2]变性手术 [3]结局设局                                \033[0m");
            pipkey = igetkey();
            if (pipkey == 'Y' || pipkey == 'y') {
                /*
                 * 改名记录
                 */
                now = time(0);
                if (d.sex == 1)
                    sprintf(buf,
                            "\033[1;37m%s %-11s把小鸡 [%s] 由♂变性成♀了\033[0m\n",
                            Cdate(now), getCurrentUser()->userid, d.name);
                else
                    sprintf(buf,
                            "\033[1;37m%s %-11s把小鸡 [%s] 由♀变性成♂了\033[0m\n",
                            Cdate(now), getCurrentUser()->userid, d.name);
                pip_log_record(buf);
                temppress("变性手术完毕...");
                d.sex = oldchoice;
            }
            break;

        case '3':
            move(b_lines - 1, 0);
            clrtobot();
            /*
             * 1:不要且未婚 4:要且未婚
             */
            oldchoice = d.wantend;
            if (d.wantend == 1 || d.wantend == 2 || d.wantend == 3) {
                oldchoice += 3; /*没有-->有 */
                move(b_lines - 1, 0);
                prints
                ("\033[1;33m将小鸡游戏改成\033[32m[有20岁结局]\033[33m? \033[37m[y/N]\033[0m");
                sprintf(buf, "小鸡游戏设定成[有20岁结局]..");
            } else {
                oldchoice -= 3; /*有-->没有 */
                move(b_lines - 1, 0);
                prints
                ("\033[1;33m将小鸡游戏改成\033[32m[没有20岁结局]\033[33m? \033[37m[y/N]\033[0m");
                sprintf(buf, "小鸡游戏设定成[没有20岁结局]..");
            }
            move(b_lines, 0);
            prints
            ("\033[1;44m  服务项目  \033[46m[1]命名大师 [2]变性手术 [3]结局设局                                \033[0m");
            pipkey = igetkey();
            if (pipkey == 'Y' || pipkey == 'y') {
                d.wantend = oldchoice;
                temppress(buf);
            }
            break;
    }
    return 0;
}
Ejemplo n.º 12
0
static void user_login() {
    char ans[4], i;
    char genbuf[200];
    struct tm *ptime, *tmp;
    time_t now;
    int a;
    /*** Heat:廣告詞
	 char *ADV[17] = {
	 "記得唷!! 5/12在台大二活地下室見~~~",
	 "你知道Ptt之夜是什麼嗎? 5/12號就要上演耶 快去問吧!",
	 "5/12 Ptt之夜即將引爆 能不去嗎? 在台大二活地下室咩",
	 "不來就落伍了 啥? 就Ptt之夜啊 很棒的晚會唷 時間:5/12",
	 "差點忘了提醒你 5/12我們有約 就台大二活地下室咩!!",
	 "Ptt是啥 想知嗎? 5/12在台大二活地下室告訴你唷",
	 "來來來....5/12快到台大二活地下室去拿獎品吧~~",
	 "去去去...到台大二活地下室去 就5/12麻 有粉多獎品耶",
	 "喂喂喂 怎還楞在這!!快呼朋引伴大鬧ptt",
	 "Ptt最佳豬腳 換你幹幹看 5/12來吧....*^_^*",
	 "幹什麼幹什麼?? 你怎麼不曉得啥是Ptt之夜..老土唷",
	 "累了嗎? 讓我們來為你來一段精采表演吧.. 5/12 Ptt之夜",
	 "世紀末最屁力的晚會 就在台大二活地下室 5/12不見不散 gogo",
	 "到底誰比較帥(美) 來比比吧 5/12Ptt之夜 一較高下",       
	 "台大二活地下室 5/12 聽說會有一場很棒的晚會唷 Ptt之夜",
	 "台大二活地下室 5/12 你能不來嗎?粉多網友等著你耶",
	 "5/12 台大二活地下室 是各約網友見面的好地方呢",
	 }; 
	 char *ADV[] = {
	 "7/17 @LIVE 亂彈, 何欣穗 的 入場卷要送給 ptt 的愛用者!",
	 "欲知詳情請看 PttAct 板!!",
	 }; ***/

    log_usies("ENTER", getenv("RFC931") /* fromhost */ );
    setproctitle("%s: %s", margs, cuser.userid);
    
    /* resolve all cache */
    resolve_garbage();	/* get ptt cache */
    resolve_fcache();
    resolve_boards();
    
    /* 初始化 uinfo、flag、mode */
    setup_utmp(LOGIN);
    mysrand();		/* 初始化: random number 增加user跟時間的差異 */
    currmode = MODE_STARTED;
    enter_uflag = cuser.uflag;

    /* get local time */
    time(&now);
    ptime = localtime(&now);
    tmp = localtime(&cuser.lastlogin);
    
    if((a = utmpshm->number) > fcache->max_user) {
	sem_init(FROMSEM_KEY, &fcache_semid);
	sem_lock(SEM_ENTER, fcache_semid);
	fcache->max_user = a;
	fcache->max_time = now;
	sem_lock(SEM_LEAVE, fcache_semid);
    }
#ifdef INITIAL_SETUP
    if(!getbnum(DEFAULT_BOARD)) {
	strcpy(currboard, "尚未選定");
    } else
#endif
    {
	brc_initial(DEFAULT_BOARD);
	set_board();
    }

    /* 畫面處理開始 */
    if(!(HAS_PERM(PERM_SYSOP) && HAS_PERM(PERM_DENYPOST)))
	do_aloha("<<上站通知>> -- 我來啦!");
    if(ptime->tm_mday == cuser.day && ptime->tm_mon + 1 == cuser.month) {
	more("etc/Welcome_birth", NA);
	currutmp->birth = 1;
    } else {
	more("etc/Welcome_login", NA);
//	pressanykey();
//    more("etc/CSIE_Week", NA);
	currutmp->birth = 0;
    }
    
    if(cuser.userlevel) {	/* not guest */
	move(t_lines - 4, 0);
	prints("      歡迎您第 \033[1;33m%d\033[0;37m 度拜訪本站,"
	       "上次您是從 \033[1;33m%s\033[0;37m 連往本站,\n"
	       "     我記得那天是 \033[1;33m%s\033[0;37m。\n",
	       ++cuser.numlogins, cuser.lasthost, Cdate(&cuser.lastlogin));
	currutmp->mind=rand()%8;  /* 初始心情 */
	pressanykey();
 	
	if(currutmp->birth && tmp->tm_mday != ptime->tm_mday) {
	    more("etc/birth.post", YEA);
	    brc_initial("WhoAmI");
	    set_board();
	    do_post();
	}
	setuserfile(genbuf, str_badlogin);
	if(more(genbuf, NA) != -1) {
	    getdata(b_lines - 1, 0, "您要刪除以上錯誤嘗試的記錄嗎(Y/N)?[Y]",
		    ans, 3, LCECHO);
	    if(*ans != 'n')
		unlink(genbuf);
	}
	check_register();
	strncpy(cuser.lasthost, fromhost, 16);
	cuser.lasthost[15] = '\0';
	restore_backup();
    } else if(!strcmp(cuser.userid, STR_GUEST)) {
	char *nick[13] = {
	    "椰子", "貝殼", "內衣", "寶特瓶", "翻車魚",
	    "樹葉", "浮萍", "鞋子", "潛水艇", "魔王",
	    "鐵罐", "考卷", "大美女"};
	char *name[13] = {
	    "大王椰子", "鸚鵡螺", "比基尼", "可口可樂", "仰泳的魚",
	    "憶", "高岡屋", "AIR Jordon", "紅色十月號", "批踢踢",
	    "SASAYA椰奶", "鴨蛋", "布魯克鱈魚香絲"};
	char *addr[13] = {
	    "天堂樂園", "大海", "綠島小夜曲", "美國", "綠色珊瑚礁",
	    "遠方", "原本海", "NIKE", "蘇聯", "男八618室",
	    "愛之味", "天上", "藍色珊瑚礁"};
	i = login_start_time % 13;
	sprintf(cuser.username, "海邊漂來的%s", nick[(int)i]);
	sprintf(currutmp->username, cuser.username);
	sprintf(cuser.realname, name[(int)i]);
	sprintf(currutmp->realname, cuser.realname);
	sprintf(cuser.address, addr[(int)i]);
	cuser.sex = i % 8;
	currutmp->pager = 2;
	pressanykey();
    } else
	pressanykey();
    
    if(!PERM_HIDE(currutmp))
	cuser.lastlogin = login_start_time;
    
    reload_money();
    passwd_update(usernum, &cuser);
    
    for(i = 0; i < NUMVIEWFILE; i++)
	if((cuser.loginview >> i) & 1)
	    more(loginview_file[(int)i][0], YEA);
	
	
}
Ejemplo n.º 13
0
/*求婚*/
int
pip_marriage_offer()
{
   time_t now;
   char buf[256];
   char ans[4];
   int money;
   int who;
   //% char *name[5][2]={{"女商人A","商人A"},
   char *name[5][2]={{"\xc5\xae\xc9\xcc\xc8\xcb\xa3\xc1","\xc9\xcc\xc8\xcb\xa3\xc1"},
                     //% {"女商人B","商人B"},
                     {"\xc5\xae\xc9\xcc\xc8\xcb\xa3\xc2","\xc9\xcc\xc8\xcb\xa3\xc2"},
                     //% {"女商人C","商人C"},
                     {"\xc5\xae\xc9\xcc\xc8\xcb\xa3\xc3","\xc9\xcc\xc8\xcb\xa3\xc3"},
                     //% {"女商人D","商人D"},
                     {"\xc5\xae\xc9\xcc\xc8\xcb\xa3\xc4","\xc9\xcc\xc8\xcb\xa3\xc4"},
                     //% {"女商人E","商人E"}};
                     {"\xc5\xae\xc9\xcc\xc8\xcb\xa3\xc5","\xc9\xcc\xc8\xcb\xa3\xc5"}};
   do
   { 
     who=rand()%5;
   }while(d.lover==(who+3));
  
   money=rand()%2000+rand()%3000+4000;
   //% sprintf(buf,"%s带来了金钱%d,要向你的小鸡求婚,您愿意吗?[y/N]",name[who][d.sex-1],money);
   sprintf(buf,"%s\xb4\xf8\xc0\xb4\xc1\xcb\xbd\xf0\xc7\xae%d\xa3\xac\xd2\xaa\xcf\xf2\xc4\xe3\xb5\xc4\xd0\xa1\xbc\xa6\xc7\xf3\xbb\xe9\xa3\xac\xc4\xfa\xd4\xb8\xd2\xe2\xc2\xf0\xa3\xbf[y/N]",name[who][d.sex-1],money);
#ifdef MAPLE
   getdata(b_lines-1, 1,buf, ans, 2, 1, 0);
#else
   getdata(b_lines-1, 1,buf, ans, 2, DOECHO, YEA);
#endif  // END MAPLE
   if(ans[0]=='y' || ans[0]=='Y')
   {
     if(d.wantend!=1 && d.wantend!=4)
     {
       //% sprintf(buf,"ㄚ~之前已经有婚约了,您确定要解除旧婚约,改定立婚约吗?[y/N]");
       sprintf(buf,"\xa8\xda\xa1\xab\xd6\xae\xc7\xb0\xd2\xd1\xbe\xad\xd3\xd0\xbb\xe9\xd4\xbc\xc1\xcb\xa3\xac\xc4\xfa\xc8\xb7\xb6\xa8\xd2\xaa\xbd\xe2\xb3\xfd\xbe\xc9\xbb\xe9\xd4\xbc\xa3\xac\xb8\xc4\xb6\xa8\xc1\xa2\xbb\xe9\xd4\xbc\xc2\xf0\xa3\xbf[y/N]");
#ifdef MAPLE
       getdata(b_lines-1, 1,buf, ans, 2, 1, 0);
#else
       getdata(b_lines-1, 1,buf, ans, 2, DOECHO, YEA);
#endif  // END MAPLE
       if(ans[0]!='y' && ans[0]!='Y')
       {
         d.social+=10;
         //% pressanykey("还是维持旧婚约好了..");
         pressanykey("\xbb\xb9\xca\xc7\xce\xac\xb3\xd6\xbe\xc9\xbb\xe9\xd4\xbc\xba\xc3\xc1\xcb..");
         return 0;
       }
       d.social-=rand()%50+100;
     }
     d.charm-=rand()%5+20;
     d.lover=who+3;
     d.relation-=20;
     if(d.relation<0)
        d.relation=0;
     if(d.wantend<4)
     	d.wantend=2;
     else
        d.wantend=5;
     //% pressanykey("我想对方是一个很好的伴侣..");
     pressanykey("\xce\xd2\xcf\xeb\xb6\xd4\xb7\xbd\xca\xc7\xd2\xbb\xb8\xf6\xba\xdc\xba\xc3\xb5\xc4\xb0\xe9\xc2\xc2..");
     now=time(0);
     //% sprintf(buf, "%s %-11s的小鸡 [%s] 接受了 %s 的求婚\n", Cdate(&now), cuser.userid,d.name,name[who][d.sex-1]);
     sprintf(buf, "%s %-11s\xb5\xc4\xd0\xa1\xbc\xa6 [%s] \xbd\xd3\xca\xdc\xc1\xcb %s \xb5\xc4\xc7\xf3\xbb\xe9\n", Cdate(&now), cuser.userid,d.name,name[who][d.sex-1]);
     pip_log_record(buf);
   }
   else
   {
     d.charm+=rand()%5+20;
     d.relation+=20;
     if(d.wantend==1 || d.wantend==4){
	     //% pressanykey("我还年轻  心情还不定...");
	     pressanykey("\xce\xd2\xbb\xb9\xc4\xea\xc7\xe1  \xd0\xc4\xc7\xe9\xbb\xb9\xb2\xbb\xb6\xa8...");
     } else {
     	     //% pressanykey("我早已有婚约了..对不起...");
     	     pressanykey("\xce\xd2\xd4\xe7\xd2\xd1\xd3\xd0\xbb\xe9\xd4\xbc\xc1\xcb..\xb6\xd4\xb2\xbb\xc6\xf0...");
     }
   }
   d.money+=money;
   return 0;
}
Ejemplo n.º 14
0
int    /*结局画面 */
pip_ending_screen()
{
    time_t now;
    char buf[256];
    char endbuf1[50];
    char endbuf2[50];
    char endbuf3[50];
    int endgrade = 0;
    int endmode = 0;

    clear();
    pip_ending_decide(endbuf1, endbuf2, endbuf3, &endmode, &endgrade);
    move(1, 9);
    prints
    ("\033[1;33m┏━━━┓┏━━  ┓┏━━━  ┏━━━┓┏━━  ┓  ━━━  \033[0m");
    move(2, 9);
    prints
    ("\033[1;37m┃      ┃┃    ┃┃┃      ┃┃      ┃┃    ┃┃┃      ┃\033[0m");
    move(3, 9);
    prints
    ("\033[0;37m┃    ━  ┃    ┃┃┃      ┃┗━┓┏┛┃    ┃┃┃  ┏━┓\033[0m");
    move(4, 9);
    prints
    ("\033[0;37m┃    ━  ┃  ┃  ┃┃      ┃┏━┛┗┓┃  ┃  ┃┃      ┃\033[0m");
    move(5, 9);
    prints
    ("\033[1;37m┃      ┃┃  ┃  ┃┃      ┃┃      ┃┃  ┃  ┃┃      ┃\033[0m");
    move(6, 9);
    prints
    ("\033[1;35m┗━━━┛┗━  ━┛┗━━━  ┗━━━┛┗━  ━┛  ━━━  \033[0m");
    move(7, 8);
    prints
    ("\033[1;31m——————————\033[41;37m 星空战斗鸡结局报告 \033[0;1;31m———————————\033[0m");
    move(9, 10);
    prints("\033[1;36m这个时间不知不觉地还是到临了...\033[0m");
    move(11, 10);
    prints
    ("\033[1;37m\033[33m%s\033[37m 得离开你的温暖怀抱,自己一只鸡在外面求生存了.....\033[0m",
     d.name);
    move(13, 10);
    prints
    ("\033[1;36m在你照顾教导他的这段时光,让他接触了很多领域,培养了很多的能力....\033[0m");
    move(15, 10);
    prints
    ("\033[1;37m因为这些,让小鸡 \033[33m%s\033[37m 之后的生活,变得更多采多姿了........\033[0m",
     d.name);
    move(17, 10);
    prints("\033[1;36m对於你的关心,你的付出,你所有的爱......\033[0m");
    move(19, 10);
    prints("\033[1;37m\033[33m%s\033[37m 会永远都铭记在心的....\033[0m", d.name);
    temppress("接下来看未来发展");
    clrchyiuan(7, 19);
    move(7, 8);
    prints
    ("\033[1;34m——————————\033[44;37m 星空战斗鸡未来发展 \033[0;1;34m———————————\033[0m");
    move(9, 10);
    prints
    ("\033[1;36m透过水晶球,让我们一起来看 \033[33m%s\033[36m 的未来发展吧.....\033[0m",
     d.name);
    move(11, 10);
    prints("\033[1;37m小鸡 \033[33m%s\033[37m 后来%s....\033[0m", d.name, endbuf1);
    move(13, 10);
    prints("\033[1;36m因为他的之前的努力,使得他在这一方面%s....\033[0m",
           endbuf2);
    move(15, 10);
    prints("\033[1;37m至於小鸡的婚姻状况,他后来%s,婚姻算是很美满.....\033[0m",
           endbuf3);
    move(17, 10);
    prints("\033[1;36m嗯..这是一个不错的结局唷..........\033[0m");
    temppress("我想  你一定很感动吧.....");
    show_ending_pic(0);
    temppress("看一看分数罗");
    endgrade = pip_game_over(endgrade);
    temppress("下一页是小鸡资料  赶快copy下来做纪念");
    pip_data_list();
    temppress("欢迎再来挑战....");
    /*
     * 记录开始
     */
    now = time(0);
    sprintf(buf,
            "\033[1;35m———————————————————————————————————————\033[0m\n");
    pip_log_record(buf);
    sprintf(buf,
            "\033[1;37m在 \033[33m%s \033[37m的时候,\033[36m%s \033[37m的小鸡 \033[32m%s\033[37m 出现了结局\033[0m\n",
            Cdate(now), getCurrentUser()->userid, d.name);
    pip_log_record(buf);
    sprintf(buf,
            "\033[1;37m小鸡 \033[32m%s \033[37m努力加强自己,后来%s\033[0m\n\033[1;37m因为之前的努力,使得在这一方面%s\033[0m\n",
            d.name, endbuf1, endbuf2);
    pip_log_record(buf);
    sprintf(buf,
            "\033[1;37m至於婚姻状况,他后来%s,婚姻算是很美满.....\033[0m\n\n\033[1;37m小鸡 \033[32n%s\033[37m 的总积分= \033[33m%d\033[0m\n",
            endbuf3, d.name, endgrade);
    pip_log_record(buf);
    sprintf(buf,
            "\033[1;35m———————————————————————————————————————\033[0m\n");
    pip_log_record(buf);
    /*
     * 记录终止
     */
    d.death = 3;
    pipdie("\033[1;31m游戏结束罗...\033[m  ", 3);
    return 0;
}
Ejemplo n.º 15
0
/*求婚*/
int
pip_marriage_offer()
{
	time_t now;
	char buf[256];
	char ans[4];
	int money;
	int who;
	const static char *name[5][2] = { {"女商人A", "商人A"},
	{"女商人B", "商人B"},
	{"女商人C", "商人C"},
	{"女商人D", "商人D"},
	{"女商人E", "商人E"}
	};

	do {
		who = rand() % 5;
	}
	while (d.lover == (who + 3));

	money = rand() % 2000 + rand() % 3000 + 4000;
	sprintf(buf, "%s带来了金钱%d,要向你的小鸡求婚,您愿意吗?[y/N]",
		name[who][d.sex - 1], money);
#ifdef MAPLE
	getdata(b_lines - 1, 1, buf, ans, 2, 1, 0);
#else
	getdata(b_lines-1,1,buf,ans,2,DOECHO,NULL,true);
#endif				// END MAPLE
	if (ans[0] == 'y' || ans[0] == 'Y') {
		if (d.wantend != 1 && d.wantend != 4) {
			sprintf(buf,
				"ㄚ~之前已经有婚约了,您确定要解除旧婚约,改定立婚约吗?[y/N]");
#ifdef MAPLE
			getdata(b_lines - 1, 1, buf, ans, 2, 1, 0);
#else
			getdata(b_lines-1,1,buf,ans,2,DOECHO,NULL,true);
#endif				// END MAPLE
			if (ans[0] != 'y' && ans[0] != 'Y') {
				d.social += 10;
				temppress("还是维持旧婚约好了..");
				return 0;
			}
			d.social -= rand() % 50 + 100;
		}
		d.charm -= rand() % 5 + 20;
		d.lover = who + 3;
		d.relation -= 20;
		if (d.relation < 0)
			d.relation = 0;
		if (d.wantend < 4)
			d.wantend = 2;
		else
			d.wantend = 5;
		temppress("我想对方是一个很好的伴侣..");
		now = time(0);
		sprintf(buf,
			"\033[1;37m%s %-11s的小鸡 [%s] 接受了 %s 的求婚\033[0m\n",
			Cdate(now), getCurrentUser()->userid, d.name,
			name[who][d.sex - 1]);
		pip_log_record(buf);
	} else {
		d.charm += rand() % 5 + 20;
		d.relation += 20;
		if (d.wantend == 1 || d.wantend == 4) {
			temppress("我还年轻  心情还不定...");
		} else {
			temppress("我早已有婚约了..对不起...");
		}
	}
	d.money += money;
	return 0;
}
Ejemplo n.º 16
0
int /*结局画面*/
pip_ending_screen()
{
  time_t now;
  char buf[256];
  char endbuf1[50];
  char endbuf2[50];
  char endbuf3[50];
  int endgrade=0;
  int endmode=0;
  screen_clear();
  pip_ending_decide(endbuf1,endbuf2,endbuf3,&endmode,&endgrade);
  move(1,9); 
  //% prints("┏━━━┓┏━━  ┓┏━━━  ┏━━━┓┏━━  ┓  ━━━  ");
  prints("\xa9\xb3\xa9\xa5\xa9\xa5\xa9\xa5\xa9\xb7\xa9\xb3\xa9\xa5\xa9\xa5  \xa9\xb7\xa9\xb3\xa9\xa5\xa9\xa5\xa9\xa5  \xa9\xb3\xa9\xa5\xa9\xa5\xa9\xa5\xa9\xb7\xa9\xb3\xa9\xa5\xa9\xa5  \xa9\xb7  \xa9\xa5\xa9\xa5\xa9\xa5  ");
  move(2,9);
  //% prints("┃      ┃┃    ┃┃┃      ┃┃      ┃┃    ┃┃┃      ┃");
  prints("\xa9\xa7      \xa9\xa7\xa9\xa7    \xa9\xa7\xa9\xa7\xa9\xa7      \xa9\xa7\xa9\xa7      \xa9\xa7\xa9\xa7    \xa9\xa7\xa9\xa7\xa9\xa7      \xa9\xa7");
  move(3,9);
  //% prints("┃    ━  ┃    ┃┃┃      ┃┗━┓┏┛┃    ┃┃┃  ┏━┓");
  prints("\xa9\xa7    \xa9\xa5  \xa9\xa7    \xa9\xa7\xa9\xa7\xa9\xa7      \xa9\xa7\xa9\xbb\xa9\xa5\xa9\xb7\xa9\xb3\xa9\xbf\xa9\xa7    \xa9\xa7\xa9\xa7\xa9\xa7  \xa9\xb3\xa9\xa5\xa9\xb7");
  move(4,9);
  //% prints("┃    ━  ┃  ┃  ┃┃      ┃┏━┛┗┓┃  ┃  ┃┃      ┃");
  prints("\xa9\xa7    \xa9\xa5  \xa9\xa7  \xa9\xa7  \xa9\xa7\xa9\xa7      \xa9\xa7\xa9\xb3\xa9\xa5\xa9\xbf\xa9\xbb\xa9\xb7\xa9\xa7  \xa9\xa7  \xa9\xa7\xa9\xa7      \xa9\xa7");
  move(5,9);
  //% prints("┃      ┃┃  ┃  ┃┃      ┃┃      ┃┃  ┃  ┃┃      ┃");
  prints("\xa9\xa7      \xa9\xa7\xa9\xa7  \xa9\xa7  \xa9\xa7\xa9\xa7      \xa9\xa7\xa9\xa7      \xa9\xa7\xa9\xa7  \xa9\xa7  \xa9\xa7\xa9\xa7      \xa9\xa7");
  move(6,9);
  //% prints("┗━━━┛┗━  ━┛┗━━━  ┗━━━┛┗━  ━┛  ━━━  ");
  prints("\xa9\xbb\xa9\xa5\xa9\xa5\xa9\xa5\xa9\xbf\xa9\xbb\xa9\xa5  \xa9\xa5\xa9\xbf\xa9\xbb\xa9\xa5\xa9\xa5\xa9\xa5  \xa9\xbb\xa9\xa5\xa9\xa5\xa9\xa5\xa9\xbf\xa9\xbb\xa9\xa5  \xa9\xa5\xa9\xbf  \xa9\xa5\xa9\xa5\xa9\xa5  ");
  move(7,8);
  //% prints("—————————— 星空战斗鸡结局报告 ———————————");
  prints("\xa1\xaa\xa1\xaa\xa1\xaa\xa1\xaa\xa1\xaa\xa1\xaa\xa1\xaa\xa1\xaa\xa1\xaa\xa1\xaa \xd0\xc7\xbf\xd5\xd5\xbd\xb6\xb7\xbc\xa6\xbd\xe1\xbe\xd6\xb1\xa8\xb8\xe6 \xa1\xaa\xa1\xaa\xa1\xaa\xa1\xaa\xa1\xaa\xa1\xaa\xa1\xaa\xa1\xaa\xa1\xaa\xa1\xaa\xa1\xaa");
  move(9,10);
  //% prints("这个时间不知不觉地还是到临了...");
  prints("\xd5\xe2\xb8\xf6\xca\xb1\xbc\xe4\xb2\xbb\xd6\xaa\xb2\xbb\xbe\xf5\xb5\xd8\xbb\xb9\xca\xc7\xb5\xbd\xc1\xd9\xc1\xcb...");
  move(11,10);
  //% prints("%s 得离开你的温暖怀抱,自己一只鸡在外面求生存了.....",d.name);
  prints("%s \xb5\xc3\xc0\xeb\xbf\xaa\xc4\xe3\xb5\xc4\xce\xc2\xc5\xaf\xbb\xb3\xb1\xa7\xa3\xac\xd7\xd4\xbc\xba\xd2\xbb\xd6\xbb\xbc\xa6\xd4\xda\xcd\xe2\xc3\xe6\xc7\xf3\xc9\xfa\xb4\xe6\xc1\xcb.....",d.name);
  move(13,10);
  //% prints("在你照顾教导他的这段时光,让他接触了很多领域,培养了很多的能力....");
  prints("\xd4\xda\xc4\xe3\xd5\xd5\xb9\xcb\xbd\xcc\xb5\xbc\xcb\xfb\xb5\xc4\xd5\xe2\xb6\xce\xca\xb1\xb9\xe2\xa3\xac\xc8\xc3\xcb\xfb\xbd\xd3\xb4\xa5\xc1\xcb\xba\xdc\xb6\xe0\xc1\xec\xd3\xf2\xa3\xac\xc5\xe0\xd1\xf8\xc1\xcb\xba\xdc\xb6\xe0\xb5\xc4\xc4\xdc\xc1\xa6....");
  move(15,10);
  //% prints("因为这些,让小鸡 %s 之後的生活,变得更多采多姿了........",d.name);
  prints("\xd2\xf2\xce\xaa\xd5\xe2\xd0\xa9\xa3\xac\xc8\xc3\xd0\xa1\xbc\xa6 %s \xd6\xae\xe1\xe1\xb5\xc4\xc9\xfa\xbb\xee\xa3\xac\xb1\xe4\xb5\xc3\xb8\xfc\xb6\xe0\xb2\xc9\xb6\xe0\xd7\xcb\xc1\xcb........",d.name);
  move(17,10);
  //% prints("对於你的关心,你的付出,你所有的爱......");
  prints("\xb6\xd4\xec\xb6\xc4\xe3\xb5\xc4\xb9\xd8\xd0\xc4\xa3\xac\xc4\xe3\xb5\xc4\xb8\xb6\xb3\xf6\xa3\xac\xc4\xe3\xcb\xf9\xd3\xd0\xb5\xc4\xb0\xae......");
  move(19,10);
  //% prints("%s 会永远都铭记在心的....",d.name);
  prints("%s \xbb\xe1\xd3\xc0\xd4\xb6\xb6\xbc\xc3\xfa\xbc\xc7\xd4\xda\xd0\xc4\xb5\xc4....",d.name);
  //% pressanykey("接下来看未来发展");
  pressanykey("\xbd\xd3\xcf\xc2\xc0\xb4\xbf\xb4\xce\xb4\xc0\xb4\xb7\xa2\xd5\xb9");
  clrchyiuan(7,19);
  move(7,8);
  //% prints("—————————— 星空战斗鸡未来发展 ———————————");
  prints("\xa1\xaa\xa1\xaa\xa1\xaa\xa1\xaa\xa1\xaa\xa1\xaa\xa1\xaa\xa1\xaa\xa1\xaa\xa1\xaa \xd0\xc7\xbf\xd5\xd5\xbd\xb6\xb7\xbc\xa6\xce\xb4\xc0\xb4\xb7\xa2\xd5\xb9 \xa1\xaa\xa1\xaa\xa1\xaa\xa1\xaa\xa1\xaa\xa1\xaa\xa1\xaa\xa1\xaa\xa1\xaa\xa1\xaa\xa1\xaa");
  move(9,10);
  //% prints("透过水晶球,让我们一起来看 %s 的未来发展吧.....",d.name);
  prints("\xcd\xb8\xb9\xfd\xcb\xae\xbe\xa7\xc7\xf2\xa3\xac\xc8\xc3\xce\xd2\xc3\xc7\xd2\xbb\xc6\xf0\xc0\xb4\xbf\xb4 %s \xb5\xc4\xce\xb4\xc0\xb4\xb7\xa2\xd5\xb9\xb0\xc9.....",d.name);
  move(11,10);
  //% prints("小鸡 %s 後来%s....",d.name,endbuf1);
  prints("\xd0\xa1\xbc\xa6 %s \xe1\xe1\xc0\xb4%s....",d.name,endbuf1);
  move(13,10);
  //% prints("因为他的之前的努力,使得他在这一方面%s....",endbuf2);
  prints("\xd2\xf2\xce\xaa\xcb\xfb\xb5\xc4\xd6\xae\xc7\xb0\xb5\xc4\xc5\xac\xc1\xa6\xa3\xac\xca\xb9\xb5\xc3\xcb\xfb\xd4\xda\xd5\xe2\xd2\xbb\xb7\xbd\xc3\xe6%s....",endbuf2);
  move(15,10);
  //% prints("至於小鸡的婚姻状况,他後来%s,婚姻算是很美满.....",endbuf3);
  prints("\xd6\xc1\xec\xb6\xd0\xa1\xbc\xa6\xb5\xc4\xbb\xe9\xd2\xf6\xd7\xb4\xbf\xf6\xa3\xac\xcb\xfb\xe1\xe1\xc0\xb4%s\xa3\xac\xbb\xe9\xd2\xf6\xcb\xe3\xca\xc7\xba\xdc\xc3\xc0\xc2\xfa.....",endbuf3);
  move(17,10);
  //% prints("嗯..这是一个不错的结局唷..........");
  prints("\xe0\xc5..\xd5\xe2\xca\xc7\xd2\xbb\xb8\xf6\xb2\xbb\xb4\xed\xb5\xc4\xbd\xe1\xbe\xd6\xe0\xa1..........");
  //% pressanykey("我想  你一定很感动吧.....");
  pressanykey("\xce\xd2\xcf\xeb  \xc4\xe3\xd2\xbb\xb6\xa8\xba\xdc\xb8\xd0\xb6\xaf\xb0\xc9.....");
  show_ending_pic(0);
  //% pressanykey("看一看分数罗");
  pressanykey("\xbf\xb4\xd2\xbb\xbf\xb4\xb7\xd6\xca\xfd\xc2\xde");
  endgrade=pip_game_over(endgrade);
  //% pressanykey("下一页是小鸡资料  赶快copy下来做纪念");
  pressanykey("\xcf\xc2\xd2\xbb\xd2\xb3\xca\xc7\xd0\xa1\xbc\xa6\xd7\xca\xc1\xcf  \xb8\xcf\xbf\xeccopy\xcf\xc2\xc0\xb4\xd7\xf6\xbc\xcd\xc4\xee");
  pip_data_list();
  //% pressanykey("欢迎再来挑战....");
  pressanykey("\xbb\xb6\xd3\xad\xd4\xd9\xc0\xb4\xcc\xf4\xd5\xbd....");
  /*记录开始*/
  now=time(0);
  //% sprintf(buf, "———————————————————————————————————————\n");
  sprintf(buf, "\xa1\xaa\xa1\xaa\xa1\xaa\xa1\xaa\xa1\xaa\xa1\xaa\xa1\xaa\xa1\xaa\xa1\xaa\xa1\xaa\xa1\xaa\xa1\xaa\xa1\xaa\xa1\xaa\xa1\xaa\xa1\xaa\xa1\xaa\xa1\xaa\xa1\xaa\xa1\xaa\xa1\xaa\xa1\xaa\xa1\xaa\xa1\xaa\xa1\xaa\xa1\xaa\xa1\xaa\xa1\xaa\xa1\xaa\xa1\xaa\xa1\xaa\xa1\xaa\xa1\xaa\xa1\xaa\xa1\xaa\xa1\xaa\xa1\xaa\xa1\xaa\xa1\xaa\n");
  pip_log_record(buf);
  //% sprintf(buf, "在 %s 的时候,%s 的小鸡 %s 出现了结局\n", Cdate(&now), cuser.userid,d.name);
  sprintf(buf, "\xd4\xda %s \xb5\xc4\xca\xb1\xba\xf2\xa3\xac%s \xb5\xc4\xd0\xa1\xbc\xa6 %s \xb3\xf6\xcf\xd6\xc1\xcb\xbd\xe1\xbe\xd6\n", Cdate(&now), cuser.userid,d.name);
  pip_log_record(buf);
  //% sprintf(buf, "小鸡 %s 努力加强自己,後来%s\n因为之前的努力,使得在这一方面%s\n",d.name,endbuf1,endbuf2);
  sprintf(buf, "\xd0\xa1\xbc\xa6 %s \xc5\xac\xc1\xa6\xbc\xd3\xc7\xbf\xd7\xd4\xbc\xba\xa3\xac\xe1\xe1\xc0\xb4%s\n\xd2\xf2\xce\xaa\xd6\xae\xc7\xb0\xb5\xc4\xc5\xac\xc1\xa6\xa3\xac\xca\xb9\xb5\xc3\xd4\xda\xd5\xe2\xd2\xbb\xb7\xbd\xc3\xe6%s\n",d.name,endbuf1,endbuf2);
  pip_log_record(buf);
  //% sprintf(buf, "至於婚姻状况,他後来%s,婚姻算是很美满.....\n\n小鸡 %s 的总积分= %d\n",endbuf3,d.name,endgrade);
  sprintf(buf, "\xd6\xc1\xec\xb6\xbb\xe9\xd2\xf6\xd7\xb4\xbf\xf6\xa3\xac\xcb\xfb\xe1\xe1\xc0\xb4%s\xa3\xac\xbb\xe9\xd2\xf6\xcb\xe3\xca\xc7\xba\xdc\xc3\xc0\xc2\xfa.....\n\n\xd0\xa1\xbc\xa6 %s \xb5\xc4\xd7\xdc\xbb\xfd\xb7\xd6\xa3\xbd %d\n",endbuf3,d.name,endgrade);
  pip_log_record(buf);
  //% sprintf(buf, "———————————————————————————————————————\n");
  sprintf(buf, "\xa1\xaa\xa1\xaa\xa1\xaa\xa1\xaa\xa1\xaa\xa1\xaa\xa1\xaa\xa1\xaa\xa1\xaa\xa1\xaa\xa1\xaa\xa1\xaa\xa1\xaa\xa1\xaa\xa1\xaa\xa1\xaa\xa1\xaa\xa1\xaa\xa1\xaa\xa1\xaa\xa1\xaa\xa1\xaa\xa1\xaa\xa1\xaa\xa1\xaa\xa1\xaa\xa1\xaa\xa1\xaa\xa1\xaa\xa1\xaa\xa1\xaa\xa1\xaa\xa1\xaa\xa1\xaa\xa1\xaa\xa1\xaa\xa1\xaa\xa1\xaa\xa1\xaa\n");
  pip_log_record(buf);  
  /*记录终止*/
  d.death=3;
  //% pipdie("游戏结束罗...  ",3);
  pipdie("\xd3\xce\xcf\xb7\xbd\xe1\xca\xf8\xc2\xde...  ",3);
  return 0;
}