Hello, how do you assign names through a browser.
Picture this, your trying to sign up a name on a browser text box in order to join the game with your name saved in your browser as a cookie. There is possible of multiple players that can sign their names, but the game is only two players. How can I set player name that goes to my website, types in his name in a text box that gets saved into a cookies, and then he presses a join button to beings to send requests to the host to look for another player for a game.
My question would be since the player is two player, tic tac toe actually, after I have set their chosen names to a variable string, how can I assign their name to the physical player 1 and player 2 in the game, since one player goes first and one player goes second.
I though of who ever began sending requests to find another player becomes the first player (X), so who ever answers that request, responds to be the second player, the O player. Is that possible to do?
I’m running Visual Studios ’08, using ASP.NET website forms. So generally using text boxes, buttons, MapPathing Stream Reader for data, and cookies.
This is a lot to look over, but should give you a very good starting point:
ASPX:
Code-behind:
To see the code in action, run the website, browse to the form, and sign in, using two different browsers.
Steps that remain for you to do are things like validating a user only signs in once, wiring up the Challenge link button, etc.