# HG changeset patch # User gongo # Date 1163043111 0 # Node ID 74c59d9abde3f075bd0bbfe34bdc25b57ab124c1 # Parent 4af6c92304bb8d882307d0570b673f6a9f061d23 *** empty log message *** diff -r 4af6c92304bb -r 74c59d9abde3 linda.c --- 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 diff -r 4af6c92304bb -r 74c59d9abde3 linda.h --- 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);