44
|
1 /*
|
|
2 +-------+-------+-------+-----------+
|
|
3 | game | car | course| data |
|
|
4 | mode | id | id | (fmatrix) |
|
|
5 +-------+-------+-------+-----------+
|
|
6
|
|
7 mode : ゲームの状態(オープニング、車選択等)
|
|
8 car id : ユーザの選んだ車
|
|
9 course id : 走るコース(1Pのみ選択可能)
|
|
10 data : ユーザの車の状態(location、angle等)
|
|
11
|
|
12 ユーザのIDはLinda_IDで判断する
|
|
13 linda_seq[i]: ユーザID=i
|
|
14 */
|
|
15 #define PKT_MODE_OFFSET 0
|
|
16 #define PKT_CARID_OFFSET 4
|
|
17 #define PKT_COURSEID_OFFSET 8
|
|
18 #define PKT_DATA_OFFSET 12
|
|
19
|
|
20 #define PKT_HEADER_SIZE 12
|
|
21
|
|
22
|
|
23 #define CLIENT_MAX 2
|
|
24 #define LINDA_ASK_ID 65535
|
|
25 #define LINDA_HOST "firefly.cr.ie.u-ryukyu.ac.jp"
|
|
26
|
|
27 #define MODE_INIT 0
|
|
28 #define MODE_WAIT 1
|
|
29 #define MODE_WAIT_READY 2
|
|
30 #define MODE_OPENING 3
|
|
31 #define MODE_SELECT_CAR 4
|
46
|
32 #define MODE_SELECT_COURSE 5
|
|
33 #define MODE_READY 6
|
|
34 #define MODE_MAIN_INIT 7
|
|
35 #define MODE_MAIN 8
|
|
36 #define MODE_MAIN_PAUSE 9
|
|
37 #define MODE_MAIN_GOAL 10
|
|
38 #define MODE_MAIN_FINISH 11
|
|
39 #define MODE_FINISH 12
|
|
40
|
|
41
|
|
42 #define PLAYER_1P 1
|
|
43
|
58
|
44 static Bool linda_sche_wait0(int);
|
|
45 static Bool linda_sche_wait1(int);
|
|
46 static Bool linda_sche_wait_ready0(int);
|
|
47 static Bool linda_sche_wait_ready1(int);
|
|
48 static Bool linda_sche_opening0(int);
|
|
49 static Bool linda_sche_opening1(int);
|
|
50 static Bool linda_sche_select_car0(int);
|
|
51 static Bool linda_sche_select_car1(int);
|
|
52 static Bool linda_sche_select_course0(int);
|
|
53 static Bool linda_sche_select_course1(int);
|
|
54 static Bool linda_sche_ready0(int);
|
|
55 static Bool linda_sche_ready1(int);
|
|
56 static Bool linda_sche_main0(int);
|
|
57 static Bool linda_sche_main1(int);
|