Handling Accounts, Properties and Inventory
soulman903
05 Feb 2008, 23:31I have several questions on how to handle accounts, properties and inventory.
How are accounts handled in Quest? Meaning can I have a player create an account on the website and then login to the server with his or her name and password? Also would it be possible for them to create n Character and play as that character, maybe have several characters?
If the player has Health, Mana, Energy and they log off the server, say they only have 55 Hit Points, is there a way I can save it so that when they log back in they start off with the same amount of Hit Points?
Finally, inventory, how does quest save inventory of a player so that when they come back, they find they still have the same amount of ammo, cloth etc they had in their inventory before they left the game.
Thank you kindly.
How are accounts handled in Quest? Meaning can I have a player create an account on the website and then login to the server with his or her name and password? Also would it be possible for them to create n Character and play as that character, maybe have several characters?
If the player has Health, Mana, Energy and they log off the server, say they only have 55 Hit Points, is there a way I can save it so that when they log back in they start off with the same amount of Hit Points?
Finally, inventory, how does quest save inventory of a player so that when they come back, they find they still have the same amount of ammo, cloth etc they had in their inventory before they left the game.
Thank you kindly.
I think Im Dead
06 Feb 2008, 03:23Heya, if you were hosting a QuestNet game on your own dedicated server(like an extra PC of yours), then it would be entirely possible to have signups through a website. The simple part would be setting up Questnet to use a login file, it already can do this and stores the usernames/passwords in a plain text .qlf file. The slightly more difficult part would be having your websites registration script add a line to the .qlf file, but the formatting is straight forward and simply username;password.
A simple way to do this would be using PHP. W3C Schools @ http://www.w3schools.com/php/default.asp is a great place to learn PHP on the web completely free, and with the lessons there you could easily create such a script in a matter of minutes. Specifically check out the PHP File lesson under PHP Advanced.
I'll take a second and plug a website I'm just now getting up on it's legs, http://www.questdev.info, which aims to provide easy to follow ASL references and tutorials, though honestly is completely bare as of right now. Perhaps I'll make persistent accounts, properties and inventories some of the first few tutorials.
Hope that helped.
A simple way to do this would be using PHP. W3C Schools @ http://www.w3schools.com/php/default.asp is a great place to learn PHP on the web completely free, and with the lessons there you could easily create such a script in a matter of minutes. Specifically check out the PHP File lesson under PHP Advanced.
I'll take a second and plug a website I'm just now getting up on it's legs, http://www.questdev.info, which aims to provide easy to follow ASL references and tutorials, though honestly is completely bare as of right now. Perhaps I'll make persistent accounts, properties and inventories some of the first few tutorials.
Hope that helped.
Elexxorine
06 Feb 2008, 08:44When some-one connects to your server they are given a 'userid', this number is used to identify them by quest. So health isn't %health% but %health[userid]%. The problem is that if you log out then some-one else logs in, they get the first unused userid, yours. All the variable acciosiated with your are now his. You can imagine how bad that can get. I've developed a system which uses a room with objects named after the player's username, all the data about them, password, health, mana, items, etc are stored as properties. The log in code takes the username you've given, looks for it in that room, finds the user object, looks up it's password property, checks it against yours, and logs you in. It sets a string called 'name[userid]' to your username which is the access to all their data from then on. When registering it clones a pre-made object with all the properties already (but blank/at defaults) and changes password, etc. I can give you the code for it if you want and tell you how to interface with it for your own game.
soulman903
06 Feb 2008, 18:12That would be great. Thank you.