summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mbbsd/Makefile2
-rw-r--r--mbbsd/lovepaper.c124
-rw-r--r--mbbsd/menu.c1
3 files changed, 1 insertions, 126 deletions
diff --git a/mbbsd/Makefile b/mbbsd/Makefile
index 4f199b42..fc462764 100644
--- a/mbbsd/Makefile
+++ b/mbbsd/Makefile
@@ -14,7 +14,7 @@ NETOBJS = mbbsd.o io.o term.o telnet.o
TALKOBJS = talk.o chat.o friend.o
UTILOBJS = stuff.o kaede.o convert.o name.o syspost.o
PAGEROBJS= more.o pmore.o
-PLUGOBJS = lovepaper.o calendar.o topsong.o gamble.o vice.o angel.o
+PLUGOBJS = calendar.o topsong.o gamble.o vice.o angel.o
CHESSOBJS= chc.o chc_tab.o chess.o go.o gomo.o dark.o reversi.o
GAMEOBJS = card.o chicken.o
OBJS:= admin.o assess.o edit.o menu.o xyz.o var.o visio.o \
diff --git a/mbbsd/lovepaper.c b/mbbsd/lovepaper.c
deleted file mode 100644
index 10e5c0e2..00000000
--- a/mbbsd/lovepaper.c
+++ /dev/null
@@ -1,124 +0,0 @@
-/* $Id$ */
-#include "bbs.h"
-#define DATA "etc/lovepaper.dat"
-
-int
-x_love(void)
-{
- char buf1[200], title[TTLEN + 1];
- char fpath[PATHLEN];
- char receiver[61], path[STRLEN] = "home/";
- int x, y = 0, tline = 0, poem = 0;
- FILE *fp, *fpo;
- struct tm gtime;
- fileheader_t mhdr;
- char save_title[STRLEN];
-
- setutmpmode(LOVE);
-
- localtime4_r(&now, &gtime);
- snprintf(buf1, sizeof(buf1), "%c/%s/love%d%d",
- cuser.userid[0], cuser.userid, gtime.tm_sec, gtime.tm_min);
- strcat(path, buf1);
- move(1, 0);
- clrtobot();
-
- outs("\n歡迎使用情書產生器 v0.00 板 \n");
- outs("有何難以啟齒的話,交由系統幫你說吧.\n爸爸說 : 濫情不犯法.\n");
-
- if (!getdata(7, 0, "收信人:", receiver, sizeof(receiver), DOECHO))
- return 0;
- if (receiver[0] && !(searchuser(receiver, receiver) &&
- getdata(8, 0, "主 題:", title,
- sizeof(title), DOECHO))) {
- move(10, 0);
- vmsg("收信人或主題不正確,情書無法傳遞");
- return 0;
- }
- fpo = fopen(path, "w");
- assert(fpo);
- fprintf(fpo, "\n");
- if ((fp = fopen(DATA, "r"))) {
- while (fgets(buf1, 100, fp)) {
- switch (buf1[0]) {
- case '#':
- break;
- case '@':
- if (!strncmp(buf1, "@begin", 6) || !strncmp(buf1, "@end", 4))
- tline = 3;
- else if (!strncmp(buf1, "@poem", 5)) {
- poem = 1;
- tline = 1;
- fprintf(fpo, "\n\n");
- } else
- tline = 2;
- break;
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9':
- sscanf(buf1, "%d", &x);
- y = (random() % (x - 1)) * tline;
- break;
- default:
- if (!poem) {
- if (y > 0)
- y = y - 1;
- else {
- if (tline > 0) {
- fputs(buf1, fpo);
- tline--;
- }
- }
- } else {
- if (buf1[0] == '$')
- y--;
- else if (y == 0)
- fputs(buf1, fpo);
- }
- }
-
- }
-
- fclose(fp);
- fclose(fpo);
- strlcpy(save_title, title, sizeof(save_title));
- curredit |= EDIT_MAIL;
- if (vedit(path, YEA, NULL, save_title) == EDIT_ABORTED) {
- curredit &= ~EDIT_MAIL;
- unlink(path);
- clear();
- outs("\n\n 放棄寄情書\n");
- pressanykey();
- return -2;
- }
- curredit &= ~EDIT_MAIL;
-
- sethomefile(fpath, receiver, FN_OVERRIDES);
- x = file_exist_record(fpath, cuser.userid);
- sethomefile(fpath, receiver, FN_REJECT);
-
- if (x || !file_exist_record(fpath, cuser.userid)) {/* if friend or not rejected */
- sethomepath(buf1, receiver);
- stampfile(buf1, &mhdr);
- Rename(path, buf1);
- strlcpy(mhdr.title, save_title, sizeof(mhdr.title));
- strlcpy(mhdr.owner, cuser.userid, sizeof(mhdr.owner));
- sethomedir(path, receiver);
- if (append_record(path, &mhdr, sizeof(mhdr)) == -1)
- return -1;
- sendalert(receiver, ALERT_NEW_MAIL);
- }
- hold_mail(buf1, receiver, save_title);
- return 1;
- } else {
- vmsg("本站目前無情書資料庫,請向站長反應。");
- }
- fclose(fpo);
- return 0;
-}
diff --git a/mbbsd/menu.c b/mbbsd/menu.c
index 15841fcf..bbb540f3 100644
--- a/mbbsd/menu.c
+++ b/mbbsd/menu.c
@@ -504,7 +504,6 @@ static const commands_t maillist[] = {
{m_read, PERM_READMAIL, "RRead 多功\能讀信選單"},
{m_send, PERM_LOGINOK, "RSend 站內寄信"},
{mail_list, PERM_LOGINOK, "RMail List 群組寄信"},
- {x_love, PERM_LOGINOK, "PPaper 情書產生器"},
// #ifdef USE_MAIL_AUTO_FORWARD
{setforward, PERM_LOGINOK, "FForward 設定信箱自動轉寄" },
// #endif