Mercurial > hg > old > magoroku_racing
changeset 68:c72f11630cb0
*** empty log message ***
author | gongo |
---|---|
date | Thu, 09 Nov 2006 03:37:24 +0000 |
parents | 74c59d9abde3 |
children | 672b16f9d28f |
files | linda.c schedule.c |
diffstat | 2 files changed, 43 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/linda.c Thu Nov 09 03:31:51 2006 +0000 +++ b/linda.c Thu Nov 09 03:37:24 2006 +0000 @@ -300,7 +300,7 @@ } if (p == 1 && connect == CLIENT_MAX) { - linda_set_schedule(linda_sche_main_init0, MODE_READY); + linda_set_schedule(linda_sche_ready0, MODE_READY); return TRUE; } else { return FALSE; @@ -318,7 +318,7 @@ game.course_id = course_id; return FALSE; } else if (mode == MODE_READY) { - linda_set_schedule(linda_sche_main_init1, MODE_READY); + linda_set_schedule(linda_sche_ready1, MODE_READY); return TRUE; } else { return FALSE; @@ -327,6 +327,46 @@ static Bool +linda_sche_ready0(int p) +{ + 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_READY) { + connect++; + flg = 0; + } + } + + if (p == 1 && connect == CLIENT_MAX) { + linda_set_schedule(linda_sche_main_init0, MODE_MAIN_INIT); + return TRUE; + } else { + return FALSE; + } + return TRUE; +} + +static Bool +linda_sche_ready1(int p) +{ + int mode; + + get_packet(PLAYER_1P, NULL, &mode, NULL, NULL, NULL); + + if (mode == MODE_MAIN_INIT) { + linda_set_schedule(linda_sche_main_init1, MODE_MAIN_INIT); + return TRUE; + } else { + return FALSE; + } +} + +static Bool linda_sche_main_init0(int p) { int i, flg, mode;