reset password
Author Message
rodthung
Posts: 14
Posted 23:58 May 30, 2014 |

Once Player 1 host the game and Player 2 click join the game. It will go to the 2-player game page but only Player 2 page that redirect to that page but not Player1 page  ? How to notify change to Player1 page and change their page to 2-player game page ?

Last edited by rodthung at 00:02 May 31, 2014.
cysun
Posts: 2935
Posted 08:34 May 31, 2014 |

1. You need to examine your code logic. The implementation of host and join should be symmetric because it's also possible that a player clicks join and waits for another player to host.

2. You should be using DeferedResult so no response is sent back until there's a match.

rodthung
Posts: 14
Posted 11:01 May 31, 2014 |

    I have 4 beans to keep track of 

    - List of online player

    - List of player who host the game

    - List of player who want to join the game

    - List of game

   

    Here is where it goes when some player click join game

  ...

[Edited by cysun]

Last edited by cysun at 11:04 May 31, 2014.
cysun
Posts: 2935
Posted 11:06 May 31, 2014 |
rodthung wrote:

    I have 4 beans to keep track of 

    - List of online player

    - List of player who host the game

    - List of player who want to join the game

    - List of game

   

    Here is where it goes when some player click join game

  ...

I removed the code from your post.

Please do not post large chunk of code in the forum - it's considered facilitating cheating.

And you need to debug your own code.

rodthung
Posts: 14
Posted 11:17 May 31, 2014 |

I'm sorry. I didn't mean to do that