summaryrefslogtreecommitdiffstats
path: root/include/chess.h
diff options
context:
space:
mode:
authorscw <scw@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2005-08-10 09:47:34 +0800
committerscw <scw@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2005-08-10 09:47:34 +0800
commit4fe6fa6ea16743f6e6f265e1131df3bff3767116 (patch)
tree06fe4785b0e53dc726d3d720e31de1b998d8a231 /include/chess.h
parentb9f694e971dd74723e1cf3cd837b385c02820194 (diff)
downloadpttbbs-4fe6fa6ea16743f6e6f265e1131df3bff3767116.tar
pttbbs-4fe6fa6ea16743f6e6f265e1131df3bff3767116.tar.gz
pttbbs-4fe6fa6ea16743f6e6f265e1131df3bff3767116.tar.bz2
pttbbs-4fe6fa6ea16743f6e6f265e1131df3bff3767116.tar.lz
pttbbs-4fe6fa6ea16743f6e6f265e1131df3bff3767116.tar.xz
pttbbs-4fe6fa6ea16743f6e6f265e1131df3bff3767116.tar.zst
pttbbs-4fe6fa6ea16743f6e6f265e1131df3bff3767116.zip
* fix chc watching SEGV bug
* chc.[ch] and chess.[ch] code clean up git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@3022 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'include/chess.h')
-rw-r--r--include/chess.h18
1 files changed, 13 insertions, 5 deletions
diff --git a/include/chess.h b/include/chess.h
index 766486aa..bf9443ce 100644
--- a/include/chess.h
+++ b/include/chess.h
@@ -35,6 +35,14 @@ private typedef struct {
void *body;
} ChessHistory;
+/* 棋類觀戰
+ *
+ * 雙人對戰時,雙方都會有一個 broadcast_list 的 linked-list,紀錄著每下一
+ * 步棋,必須將這個訊息丟給那些人(sock)。
+ * 每當一個觀棋者加入(觀棋可以從紅方或黑方的觀點進行),其中一方的下棋者
+ * 的 broadcast_list 就會多一筆記錄,之後就會將下的或收到對方下的每一步棋
+ * 傳給 broadcast_list 中所有需要的人,達到觀棋的效果。
+ */
private typedef struct ChessBroadcastListNode {
int sock;
struct ChessBroadcastListNode *next;
@@ -112,7 +120,7 @@ typedef struct ChessInfo {
typedef struct ChessActions {
/* initial */
- void (*init_user) (const userec_t* rec, ChessUser* user);
+ void (*init_user) (const userinfo_t* uinfo, ChessUser* user);
void (*init_board) (void* board);
/* playing */
@@ -135,10 +143,10 @@ typedef struct ChessConstants {
int traditional_timeout;
int board_height;
int board_width;
- char *photo_file_name;
- char *log_board;
- char *turn_color[2];
- char *turn_str[2];
+ const char *photo_file_name;
+ const char *log_board;
+ const char *turn_color[2];
+ const char *turn_str[2];
} ChessConstants;
typedef enum {