changeset 67:74c59d9abde3

*** empty log message ***
author gongo
date Thu, 09 Nov 2006 03:31:51 +0000
parents 4af6c92304bb
children c72f11630cb0
files linda.c linda.h
diffstat 2 files changed, 31 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/linda.c	Thu Nov 09 03:27:18 2006 +0000
+++ b/linda.c	Thu Nov 09 03:31:51 2006 +0000
@@ -329,15 +329,41 @@
 static Bool
 linda_sche_main_init0(int p)
 {
-    linda_set_schedule(linda_sche_main0, MODE_MAIN);
+    int i, flg, mode;
+    int id = game.play_id;
+    int connect = 1;
+
+    for (i=1; i<=CLIENT_MAX; i++) {
+	if (i == id) continue;
+	get_packet(i, &flg, &mode, NULL, NULL, NULL);
+	if (flg == 1 && mode == MODE_MAIN) {
+	    connect++;
+	    flg = 0;
+	}
+    }
+
+    if (p == 1 && connect == CLIENT_MAX) {
+	linda_set_schedule(linda_sche_main0, MODE_MAIN);
+	return TRUE;
+    } else {
+	return FALSE;
+    }
     return TRUE;
 }
 
 static Bool
 linda_sche_main_init1(int p)
 {
-    linda_set_schedule(linda_sche_main1, MODE_MAIN);
-    return TRUE;
+    int mode;
+
+    get_packet(PLAYER_1P, NULL, &mode, NULL, NULL, NULL);
+
+    if (mode == MODE_MAIN) {
+	linda_set_schedule(linda_sche_main1, MODE_MAIN);
+	return TRUE;
+    } else {
+	return FALSE;
+    }
 }
 
 static Bool
--- a/linda.h	Thu Nov 09 03:27:18 2006 +0000
+++ b/linda.h	Thu Nov 09 03:31:51 2006 +0000
@@ -53,5 +53,7 @@
 static Bool linda_sche_select_course1(int);
 static Bool linda_sche_ready0(int);
 static Bool linda_sche_ready1(int);
+static Bool linda_sche_main_init0(int);
+static Bool linda_sche_main_init1(int);
 static Bool linda_sche_main0(int);
 static Bool linda_sche_main1(int);