summaryrefslogtreecommitdiffstats
path: root/include/chc.h
diff options
context:
space:
mode:
authorvictor <victor@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2003-09-09 13:23:31 +0800
committervictor <victor@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2003-09-09 13:23:31 +0800
commite0f54c5ba43c5e4bc15698f5ffb4f222dc1d5e46 (patch)
tree4b64f73bf1ae84ed25d59743ce15d10a7848e408 /include/chc.h
parentb61b430b4dfbcddbe97b0fb432a9888e509ad76d (diff)
downloadpttbbs-e0f54c5ba43c5e4bc15698f5ffb4f222dc1d5e46.tar
pttbbs-e0f54c5ba43c5e4bc15698f5ffb4f222dc1d5e46.tar.gz
pttbbs-e0f54c5ba43c5e4bc15698f5ffb4f222dc1d5e46.tar.bz2
pttbbs-e0f54c5ba43c5e4bc15698f5ffb4f222dc1d5e46.tar.lz
pttbbs-e0f54c5ba43c5e4bc15698f5ffb4f222dc1d5e46.tar.xz
pttbbs-e0f54c5ba43c5e4bc15698f5ffb4f222dc1d5e46.tar.zst
pttbbs-e0f54c5ba43c5e4bc15698f5ffb4f222dc1d5e46.zip
merge chc from my branch
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@1170 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'include/chc.h')
-rw-r--r--include/chc.h41
1 files changed, 41 insertions, 0 deletions
diff --git a/include/chc.h b/include/chc.h
new file mode 100644
index 00000000..9305ab0d
--- /dev/null
+++ b/include/chc.h
@@ -0,0 +1,41 @@
+/* 象棋
+ * 雙人對戰時,雙方都會有一個 chc_act_list 的 linked-list,紀錄著每下一步
+ * 棋,必須將這個訊息丟給那些人(socket)。
+ * 一開始當然就是對手一個,每當一個觀棋者加入(觀棋可以從紅方或黑方的觀點
+ * 進行),其中一方的下棋者的 act_list 就會多一筆記錄,之後就會將下的或收
+ * 到對方下的每一步棋傳給 act_list 中所有需要的人,達到觀棋的效果。
+ */
+
+#define SIDE_ROW 7
+#define TURN_ROW 8
+#define STEP_ROW 9
+#define TIME_ROW 10
+#define WARN_ROW 12
+#define MYWIN_ROW 17
+#define HISWIN_ROW 18
+
+#define CHC_VERSUS 1 /* 雙人 */
+#define CHC_WATCH 2 /* 觀棋 */
+#define CHC_PERSONAL 4 /* 打譜 */
+#define CHC_WATCH_PERSONAL 8 /* 觀人打譜 */
+
+#define BLACK_COLOR "\033[1;36m"
+#define RED_COLOR "\033[1;31m"
+#define BLACK_REVERSE "\033[1;37;46m"
+#define RED_REVERSE "\033[1;37;41m"
+#define TURN_COLOR "\033[1;33m"
+
+typedef struct chcusr_t{
+ char userid[IDLEN + 1];
+ int win;
+ int lose;
+ int tie;
+} chcusr_t;
+
+#define CHC_ACT_BOARD 0x1 /* set if transfered board to this sock */
+
+typedef struct chc_act_list{
+ int sock;
+ struct chc_act_list *next;
+} chc_act_list;
+