Click here to Skip to main content
15,887,214 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
I need to do a page which only one user can be in.
I have a game and only one player should enter the room.
I couldn't fix it with any sessions or applications.
PLEASE HELP!


[edit]Urgency deleted: It may be urgent to you, but it isn't to us. All that your stressing the urgency does is to make us think you have left it too late, and want us to do it for you. This annoys some people, and can slow a response. - OriginalGriff[/edit]
Posted
Updated 5-Jun-11 7:45am
v2
Comments
[no name] 5-Jun-11 14:22pm    
Perhaps if you posted some (not all) of the relevant code you have tried maybe we can point out something.
Sergey Alexandrovich Kryukov 5-Jun-11 15:24pm    
Agree. We expect questions, not the order to do your job for you.
--SA

1 solution

This is a place where programmers can ask for help. You've given no indication that you've done any work. You've only given us a vague spec. Most people here could write this, the question is, with all the info on this site and elsewhere on the web, why could you not even try to the point of being able to post some code and ask a specific question ?
 
Share this answer
 
Comments
Member 7966831 6-Jun-11 10:09am    
Hi I am sorry i can't explain myself well

It goes like this I have a Page which has some rooms

For each room I created 2 applications.The one saves the status of the room:

false for free and true if someone is in it

The second saves the player name of the player who is playing.

Now what is the problem?

When a player enters a free room It sets the applications for him,

but what if he descides to close the browser?

in seesion_end function as I understood it doesn't save the session of the user when It accors therfore I can't check If he quited the page because I have to compare his name to the room owner name. I tried to use javascript .js which knows if a person quited a page but I have to change the applications values from it. That's why I was looking for a solution without sessions or applications. So maybe there is a way to cahnge the applications values from the .js file. The code I thought will do that is:

if (Application["player1"] == Session["mynick"]) {

Application["status1"] = false;

Application["player1"] = ""; }

if (Application["player2"] == Session["mynick"]) {

Application["status2"] = false;

Application["player2"] = ""; }

if (Application["player3"] == Session["mynick"]) {

Application["status3"] = false;

Application["player3"] = ""; }

Hope it's clear.. Thanks

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900