CSC510-2015-Axitron / maze

Main repo for maze game
0 stars 2 forks source link

An integrated menu for user login/registration and designer #56

Closed macluo closed 9 years ago

macluo commented 9 years ago

should this be a HTML5 canvas pop-up or part of game menu?

duh102 commented 9 years ago

If we wanted to we could get into jQuery UI dialogs, which are modal in-pane things. I know I mentioned them before but I never got around to demo'ing them.

macluo commented 9 years ago

I think it is a good idea. We can also make jQuery UI to display the final winning popup too.

duh102 commented 9 years ago

I'll claim this for now and get some jQuery UI stuff into the mix. I don't know how much I'll be able to complete today but anyone else can claim it and continue work on it.

duh102 commented 9 years ago

Almost finished this feature in d9f2393ab3626d4a98beab5081d904e089f465b8 I think, just needs some additional logic to change something in the UI to indicate the user is logged in, and a logout button. Going to move onto doing some stuff with #51 if anyone wants to pick up where I left off.

macluo commented 9 years ago

I can pick up what you left off if you do not plan to work on it tonight.

duh102 commented 9 years ago

I don't think I'll be working on anything more tonight, feel free to go ahead.

macluo commented 9 years ago

Just added user login status and logout button 9f4a4ef625b3d110351abcdebe39da76a95d3811

macluo commented 9 years ago

Designer button is now available on the game menu caa54754484cc4993b534532a2e8c74d40e387c7. The designer is missing the background color. There might be a bug.

duh102 commented 9 years ago

Fixed that, it was a problem with me forgetting to add the mazeui css class to things in the designer (had to do stuff with css to fix a problem with the jQueryUI css interfering). Looks really good!

duh102 commented 9 years ago

I played with this a bit today, haven't broken it yet (but maybe I'm just a bad tester).

macluo commented 9 years ago

Another question: How can we do session control between mazeMenu and designer pages? Should we use local storage or is there a way to keep javascript file running/stored locally?

duh102 commented 9 years ago

Should be able to use a cookie for it to make it easy: http://stackoverflow.com/questions/1458724/how-to-set-unset-cookie-with-jquery

macluo commented 9 years ago

Thanks. That helps. What is the error response text when posting to /keepalive fails? Because I only see 'true' in the server.js.

duh102 commented 9 years ago

If you don't have a token or the token is expired, it'll be {"response":"unauthorized token"}, the only time when keepalive would fail is when your token is not valid (expired or not even there or not a valid token), so that's why there's only those two responses.

macluo commented 9 years ago

I see. Thanks. Just added session control to mazeMenu 75e32372c5a09bca05036a01932defd65cb535d0

this.sessionHandler = setInterval(function() {
            this.HTTPPostAsync("/keepalive", function(e) {
                if (e.response == "unauthorized token") {
                    this.logout();
                }
            });
        }, this.sessionTimeout*60*1000);

Haven't tested it yet because it will take about 20 mins. lol

duh102 commented 9 years ago

Sounds good, that will be useful for long play sessions.

macluo commented 9 years ago

I am done with this task for now and leave it to anyone who likes to continue refining it. One thing I can foresee that is tough to do next would be to get the new jQuery UI in mazeMenu.js to pass the mocha test.

duh102 commented 9 years ago

I guess pending more tests, this is done? I'll close it, make a new issue if there's anything that needs to be done as far as testing.