asp.net - Referencing same object in different sessions -


i'm building web based chess in asp.net , idea keep information table (position of pieces, who's turn it...) in session reference instance of game class stores needed information.

i don't know how make sessions of both players contains reference same object on server when 1 player moves, other has in session information move made.

is valid way since want avoid lots of db accessing?

things "who's turn it" needs kept @ application level. either use static variable, or use application collection. personally, use static collection of 'game' objects. you'll need keep thread-safty in mind, because sessions have access same collection.


Comments

Popular posts from this blog

javascript - backbone.js Collection.add() doesn't `construct` (`initialize`) an object -

php - Get uncommon values from two or more arrays -

Adding duplicate array rows in Php -