Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I think if two people are accessing your website they can access the data separately and play game independently</p> <p>To control number of concurrent users in a site you have to create a Application State variable and store two selected user ids to it.</p> <p>Every time a user try to play game, you have to check if its ID exists in Application State variable or not , if exists allow him otherwise not.</p> <p>Of course you have to write lot of code to </p> <ol> <li>add/delete userid to Application State variable in Global.ascx file</li> <li>implement authentication to know who the user is and user validations.</li> <li>if you want them to sign out automatically after some time (idle/fixed) you have to write code in Session_End event of Global.ascx file.</li> </ol> <p>Let me know more details if you want specific answer.</p> <p>Create a class GameSession { int gameid; string player1; string player2}</p> <p>suppose there is only one game and 2 users max</p> <p>User Registration Process: if a first user enters to your website, check user if he is registered check his userid pwd and get his userid from table, if he is guest generate random key (guid) or ask him for the unique key (uniquenickname). </p> <p>State Management: create object of this class , assign gameid = 1 and assign player1 = user's unique key. Create collection of GameSession object say GameSessions, add GameSession to GameSessions Store GameSessions to Application State.</p> <p>Next time if another user logs in, follow the same User Registration Process. Check for empty slot (empty player2) in GameSessions, if found assign this user to first or selected empty slot of GameSessions. Now this GameSession is ready to serve.</p> <p>Save the object back to Application State.</p> <p>Allow user to play the game</p> <p>Write negative cases for above scenarios. </p> <p>This way you can do this.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload