Jump to content

Getting the username from the server.


AmAuron
 Share

Recommended Posts

Hi there,

Sorry if this question seems simple, but i searched the forum and didn't find any specific topics related to this issue.

 

I'm doing a game that uses the user login on a page as an identifier to record and save his score. My question is, imagining we are using a server,

the user makes the login and after that is redirected to the game, is there any way to do an HTTP get or a function the get extra information that we are

passing when we are redirecting to the game?

 

The only thing i need is when we are redirecting, the game recieves the username.

 

Thank you for your patience and answers.

 

 

Link to comment
Share on other sites

You could put it in the preload function of your main game state.

Okay but i got several states in this order....Boot State -> Preloader State -> Main Menu State ->goes to several states from here

 

I think you mean to put that on the Boot State right? The Boot state is the first state that runs and i use him to load the sprite of the preloader bar and logo of the game.

Link to comment
Share on other sites

Okay but i got several states in this order....Boot State -> Preloader State -> Main Menu State ->goes to several states from here

 

I think you mean to put that on the Boot State right? The Boot state is the first state that runs and i use him to load the sprite of the preloader bar and logo of the game.

 

It doesn't really matter as long as you load the username before you need it. If you want it to persists through multiple states you can either bind it as an attribute of the game object, or simply make it a global variable.

Link to comment
Share on other sites

It doesn't really matter as long as you load the username before you need it. If you want it to persists through multiple states you can either bind it as an attribute of the game object, or simply make it a global variable.

Ty for the help i will test it out now ! I will give feedback soon :)

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...