Welcome,
Guest
. Please
login
or
register
.
Did you miss your
activation email
?
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
News:
Our Scripts Vault contains many game scripts that you can use to create your own game!
Home
Forum
Help
Login
Register
BBGameZone.net
»
Webmasters
»
Coding Discussion
»
What does your User table look like?
« previous
next »
Print
Pages: [
1
]
Go Down
Author
Topic: What does your User table look like? (Read 753 times)
CygnusX
Level 24
Posts: 304
Reputation: +3/-2
What does your User table look like?
«
on:
October 14, 2010, 10:44:31 AM »
I typically have:
UserID
UserName
Password
Email
isValidEmail
isBanned
isAdmin
Joined
LastSeen
Does anyone store any other/different information here?
Logged
Lords of Midnight
Chris
Game Owner
Level 35
Posts: 2,217
Reputation: +28/-1
Re: What does your User table look like?
«
Reply #1 on:
October 14, 2010, 11:05:00 AM »
LastIP, RegisterIP
isAdmin is not enough as boolean, you need isHelper/isModerator too
I strongly advise also a separate player table to store game related data. I also endorse denormalization of username field.
Logged
www.lordsgame.com
|
www.SamuraiMMORPG.com
|
www.Moonstone-RPG.com
|
www.GalacticImperator.com
|
Europe1300.eu
CygnusX
Level 24
Posts: 304
Reputation: +3/-2
Re: What does your User table look like?
«
Reply #2 on:
October 14, 2010, 11:43:28 AM »
I keep a separate table for IP's. Each time a user logs in/out/registers/etc, I log it along with their UserID and a time stamp.
I haven't gotten to a point where I distinguish between helpers, moderators and admins. I guess none of my games have gotten to that size before. Either you're an admin and can modify stuff, or you can't.
I of course keep all 'game' related data in separate fields. But, those tables are so different from game to game, its hard to generalize what to keep in them.
Does anyone have any other general tables? I usually have:
UserInfo - stores userid, gold, turns, turns used, etc
Fighters - a table for storing playable character information (id, class, exp, attributes, etc)
Market - stores purchasable in-game items, prices, etc
Inventory - what each player has in inventory, qty, and isEquipped if it is equipped
News - stores news events for each player
BattleLog - stories previous battles, their outcome, etc
Logged
Lords of Midnight
Nox
Level 35
Posts: 768
Reputation: +12/-2
Re: What does your User table look like?
«
Reply #3 on:
October 14, 2010, 03:11:11 PM »
isValidEmail - imho pointless, you can check upon email change, no need to store ... unless you mean if the player way verified via e-mail (then I'd modify the name a bit)
isAdmin - too specific, why not have Role instead to assign any role you want, not just admin (arguably similar to isBanned, but I guess that could stay)
(I see now you replied to this already, but anyway, the mechanism would be very similar... and it's imho worth to have a role that could take care of the game without breaking it etc.)
Why
User
Info when it's not related to user but to fighter/user's character
Anyway these tables doesn't seem general to me, rather game's design-dependant... even the more general tables would depend on focus of your game etc.
For example I have so far these user_* tables: friends, logins, options, signup, tokens ... but I undoubtably many other people here have totally different ones
Logged
Meet us at an IRC irc.freenode.net #bbg as well
https://vimeo.com/36579366
(a must-watch) | Join
BOINC
- no longer a hype, but you can help never the less
CygnusX
Level 24
Posts: 304
Reputation: +3/-2
Re: What does your User table look like?
«
Reply #4 on:
October 14, 2010, 03:29:49 PM »
I've never really liked the table name UserInfo. I've combined this information into both Users and Fighters before, but I've never been happy doing that. Its been difficult finding a good place for information such as gold, attack turns, and other 'high level' variables.
isValidEmail just states that the email has been validated. isValidatedEmail just seemed too long.
I'm curious what you use logins, signup and tokens tables for.
Logged
Lords of Midnight
Nox
Level 35
Posts: 768
Reputation: +12/-2
Re: What does your User table look like?
«
Reply #5 on:
October 14, 2010, 03:57:24 PM »
OK
Nothing interesting, logins is just logging table, signup is your Joined expanded and tokens are some authentication fun, which 'm not sure it's all that needed
Logged
Meet us at an IRC irc.freenode.net #bbg as well
https://vimeo.com/36579366
(a must-watch) | Join
BOINC
- no longer a hype, but you can help never the less
Curtis
Level 5
Posts: 19
Reputation: +0/-0
Re: What does your User table look like?
«
Reply #6 on:
October 15, 2010, 04:31:27 AM »
I use the following:
Users table:
id, email, username, password, logins, last_login, language
User_Histories:
user_id,time,history
Roles:
id,name,description
Roles_Users:
user_id,role_id
All the stats are in a characters table which uses character_races, character_classes.
Logged
Modular Gaming - Open source web game framework.
aerosuidae
Level 9
Posts: 50
Reputation: +5/-0
Re: What does your User table look like?
«
Reply #7 on:
October 23, 2010, 08:38:45 AM »
Interesting... do any of you salt your password hashes?
http://en.wikipedia.org/wiki/Salt_(cryptography)
Most of my user tables have some form of:
id
is_ai
is_active
is_verified
created_stamp
updated_stamp
email
nickname
password (hash)
password_salt
All groups/permissions are elsewhere.
And as an example, one of my games materializes a lot of per user aggregate data (calculated from user inventories), each tick:
score
currency
income
expense
experience
prestige
wealth
culture
offense
defense
fortify
demolish
«
Last Edit: October 23, 2010, 08:41:08 AM by aerosuidae
»
Logged
Print
Pages: [
1
]
Go Up
« previous
next »
BBGameZone.net
»
Webmasters
»
Coding Discussion
»
What does your User table look like?
SimplePortal 2.3.3 © 2008-2010, SimplePortal