作者itoc.bbs@processor.tfcis.org (:MM:) 看板: plan
標題Re: [問題] 如何在發文時,防止用複製貼上賺錢
時間XEON (Thu, 15 May 2003 21:02:49 +0800 (CST)) Updated: 2004/04/10
※ 引述《qazq (一平海岸線)》之銘言:
> 有沒有什麼方法可以一個字一個字判斷呢?
※ 法一 陽春型
: post.c:do_post()
else
{
+ if (wordsnum > spendtime * 3)
+ {
mode = BMIN(wordsnum, spendtime) / 10; /* 每十字/秒 一元 */
prints("這是您的第 %d 篇文章,得 %d 銀。", ++cuser.numposts, mode);
cuser.money += mode;
+ }
+ else
+ prints("請不要使用 copy-paste 的方法來騙稿費");
}
※ 法二 暴力型
這方法對新注音輸入法那種打很多再一次輸入的
也會判斷為 copy-paste :p
: edit.c:vedit()
+ int copypaste; /* 1: 用 copy-paste 的 */
int /* -1:取消編輯 0:完成編輯 */
vedit(fpath, ve_op)
char *fpath;
int ve_op;
{
textline *vln, *tmp;
int cc, col, mode, margin, pos;
+ time_t now, lastype;
+ int typing;
+ typing = 0;
+ copypaste = 0;
+ time(&lastype);
/* --------------------------------------------------- */
/* 初始設定:載入檔案、引用文章、設定編輯模式 */
/* --------------------------------------------------- */
...
...
cc = vkey();
if (isprint2(cc))
{
+ if (!copypaste) /* copy paste 檢查 */
+ {
+ typing++;
+ if (typing == 5) /* 一秒最多輸入 5 個字 */
+ {
+ typing = 0;
+ time(&now);
+ if (now == lastype)
+ copypaste = 1;
+ lastype = now;
+ }
+ }
ve_char(cc);
}
: post.c:do_post
else
{
+ extern int copypaste;
+ if (!copypaste)
+ {
mode = BMIN(wordsnum, spendtime) / 10; /* 每十字/分 一元 */
prints("這是您的第 %d 篇文章,得 %d 銀。", ++cuser.numposts, mode);
cuser.money += mode;
/* itoc.010408: 依文章長度/所費時間來決定要給多少錢 */
/* itoc.註解: 錢要難賺,幣制才會有意義 */
+ }
+ else
+ prints("請不要使用 copy-paste 的方法來騙稿費");
}
--
╭─ Origin ─╗ ���O���� processor.tfcis.org ~ κλμ ─┤
├ Author ╡ itoc.Dorm-GD2.NCTU.edu.tw