Question about browser based online game

I am developing a small browser game in asp.net. Think of a game room in which there are 22 players, and players join the room by pressing a button. (I save the number of players in the room in the database) I need to call the method when the number of players in the room is 22. The problem is that I do not know how to control the number of players in the room. I mean, I think there should be bacground code that should work all the time on the server, and this code controls the number and calls the function. This is my first web project (school project), and I hope you all help me.

+3
source share
4 answers

Presumably, you will call a web method every time a user enters or leaves a room, right? Thus, you can simply update the number of users in the room at this moment (make sure that you have made the appropriate lock), and if he is 22, call any code that you want (since you are already on the server). You may also need to periodically request users on the server so that you know that they are still active, so that you can remove them from the room if they are disconnected or something else.

+1
source

? AJAX , , <div> - . jQuery .

0

, , , .

, , . , - ?

0

, , - .

(asp.net) (, Silverlight/Flash).

, , .

, (, sql).

, ... http://msdn.microsoft.com/en-us/library/ms178473.aspx

ashx (-), WCF .

(, silverlight, #), .

( ), .

, , AJAX , ajax , , , .

Since this is a simple school project, although I'm sure everything will be fine.

0
source

Source: https://habr.com/ru/post/1745516/


All Articles