Author Topic: Player IP Address's  (Read 1795 times)

Offline Crazy-T

  • Level 19
  • *
  • Posts: 197
  • Reputation: +0/-0
  • Building Games
    • View Profile
Player IP Address's
« on: October 04, 2009, 04:45:10 AM »
Hey,
Im stuck! I need a answer for user ip's what would be the best?.
There own ip table or storing them in the users table.
Will have 3 cols
#1 ip_register //signup ip..
#2 ip_last   //update everypage....
#3 ip_login  //update everylogin

Any ideas? thanks.
Crazy-T

Offline Slashmore

  • Level 17
  • *
  • Posts: 156
  • Reputation: +1/-0
    • View Profile
Re: Player IP Address's
« Reply #1 on: October 04, 2009, 05:08:02 AM »
I'm not really sure, I would chuck them in with the users/players table to save a table but thats just me, I dunno if its best to have more smaller tables or few bigger tables for performance.


Offline Dasein Fiasco

  • Level 15
  • *
  • Posts: 132
  • Reputation: +2/-0
    • View Profile
    • Travis Dunn
Re: Player IP Address's
« Reply #2 on: October 04, 2009, 05:30:04 AM »
I think it's just fine to store that information in the users tables. If you go so far to extract it then you're probably modeling something more like an activity log, which just begs more questions. There is no design downside or extra work to storing the ip addresses in the user's table.
Personal Site: www.travisdunn.com
There is neither speech nor language but their voice is heard among them

Offline Crazy-T

  • Level 19
  • *
  • Posts: 197
  • Reputation: +0/-0
  • Building Games
    • View Profile
Re: Player IP Address's
« Reply #3 on: October 04, 2009, 08:18:52 AM »
Would this be a good idea or NO..
Store ips into text
Then its like this.
lastip;loginip;registerip//comes from users table all in one.
$ip explode(";"$user->ips);
echo <<<OUT
Last IP: {$ip[0]}<br />
Login IP: 
{$ip[1]}<br />
Register IP: 
{$ip[2]}<br />
OUT;

Crazy-T

Offline karnedge

  • Level 17
  • *
  • Posts: 170
  • Reputation: +4/-0
  • ctrlHack provides the server, you bring the skill.
    • View Profile
    • ctrl://Hack.game
Re: Player IP Address's
« Reply #4 on: October 04, 2009, 08:35:19 AM »
register_IP will never change so it should be put into a MyISAM table that never changes for quick reference.

last_IP and login_IP are essentially the same in a sense unless you check back with the login_ip at some later point but that doesn't make any sense to me. If you are actually checking against the current IP to the last_IP at any given point and unless it's changed you don't need more than two.

Let's say, you logged in 1.1.1.1 and it keeps coming up the same at every page load. Then you decided to use your other computer you had already logged in with another IP from earlier today. The system at page load (including auto login using the session handler) would see the new IP, so it says to you "let's get your password again just in case this isn't some session stealing user", if it clears then you are kept logged in from both IPs, so then you would use the explode/implode function for more than one IP.

This of course is assuming your using sessions to keep your users logged in. By the way, I would only check the IP at major points in your game like if they were about to make a player trade or change settings or profile. That way it's that much less of a load on your system.
ctrlHack - Hacking simulation RPG in development.
Latest blog: Back on Track
bbgFramework v0.1.3

Offline Crazy-T

  • Level 19
  • *
  • Posts: 197
  • Reputation: +0/-0
  • Building Games
    • View Profile
Re: Player IP Address's
« Reply #5 on: October 04, 2009, 08:41:43 AM »
Ahh - I see now :) Thanks!!!!
Well I'm still looking at other tutorials on the net, about storing the sessions in a database table.
Thanks again! :)
Crazy-T

Offline Chris

  • Game Owner
  • Level 35
  • *
  • Posts: 2,217
  • Reputation: +28/-1
    • View Profile
Re: Player IP Address's
« Reply #6 on: October 04, 2009, 08:51:39 AM »
Quote
#2 ip_last   //update everypage....
What do you need it for? It seems like it is only causing an additional table write without any real benefit...

Make two user tables, one to store rarely used things (register_ip, email, password) and the playing table (all data that is used after you succesfully login to the game). Very convenient and fast.

Offline Crazy-T

  • Level 19
  • *
  • Posts: 197
  • Reputation: +0/-0
  • Building Games
    • View Profile
Re: Player IP Address's
« Reply #7 on: October 04, 2009, 08:59:57 AM »
Quote
What do you need it for? It seems like it is only causing an additional table write without any real benefit...
Was thinking of something else, but yeah i got it wrong. :( lol
Quote
Make two user tables, one to store rarely used things (register_ip, email, password) and the playing table (all data that is used after you succesfully login to the game). Very convenient and fast.
Yeah, i was thinking of doing that, thanks for tip too. :)
Crazy-T

Offline shoespeak

  • Level 11
  • *
  • Posts: 75
  • Reputation: +3/-0
    • View Profile
Re: Player IP Address's
« Reply #8 on: October 09, 2009, 11:41:22 AM »
Do you need two different fields for las_ip and login_ip? Why not just store the login_ip in the table. Then when they log in again, you check the current IP against the one stored in the database and if they are different, just print a message letting the player know this. Or if you are checking IP's as check for multis, this could flag the account and you could start logging every IP.

I just think most of the players will be logging in from the same IP every time...no need to store that data twice unless I am missing something...

Offline saljutin

  • Level 22
  • *
  • Posts: 266
  • Reputation: +6/-0
    • View Profile
Re: Player IP Address's
« Reply #9 on: October 09, 2009, 11:50:14 AM »
well depends on how their internet provider asigns IP to them...is it dynamical IP or static IP.
also people can login to game from work, school, internet cafe etc.
so then u can have quite a lot of "multies" :)

Offline shoespeak

  • Level 11
  • *
  • Posts: 75
  • Reputation: +3/-0
    • View Profile
Re: Player IP Address's
« Reply #10 on: October 09, 2009, 11:59:10 AM »
Yeah true I guess I didn't think about those people still using AOL...lol

Offline Nox

  • Level 35
  • **
  • Posts: 768
  • Reputation: +12/-2
    • View Profile
Re: Player IP Address's
« Reply #11 on: October 09, 2009, 02:36:47 PM »
Don't forget it can also be useful to a player to check if his/her account hasn't been accessed by someone unauthorized

I'm not sure I'll have signup IP, but I have a login log to register all log and ulog IPs and times...

"Last IP" would also be handy, but should you replace (and not just store) it on every pageload,
then almost every suspicious entry will be overwritten and lost before you find them out...
generally you will imho have a hard time working with just one value

I plan to log as much as I can, so far I use specificly designed tables but I didn't finish this really...
probably have also CRON regularly store logs into file and clean DB, but that's a minor, performance thing
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

Offline die4me

  • Level 16
  • *
  • Posts: 137
  • Reputation: +0/-0
  • When life gives you lemons throw them at people
    • View Profile
    • Hostworks free hosting
Re: Player IP Address's
« Reply #12 on: October 10, 2009, 04:46:23 PM »
i would just go with sign up ip and last login one

Offline codestryke

  • Administrator
  • Level 33
  • *****
  • Posts: 589
  • Reputation: +22/-0
    • View Profile
    • eXtremeCast Games
Re: Player IP Address's
« Reply #13 on: October 11, 2009, 03:30:53 PM »
For our games we use two fields in the player table register date/time and last login date/time.

Upon login we also take the ip and add it to a table called player_loginhistory. This allows us to see trends in when people login, times and what all IP's they used in the past. With just a couple fields in the player table you only get to see a snapshot of the last time they logged in and not a history of logins ;)

Creating online addictions, one game at a time:

Offline JGadrow

  • Level 35
  • **
  • Posts: 1,133
  • Reputation: +23/-2
    • View Profile
Re: Player IP Address's
« Reply #14 on: October 12, 2009, 10:12:46 AM »
I agree with codestryke. Logging is where it is at. In that manner, you can, with at least a measure of certainty, determine some information about a user. Is there only a single IP address? Then your user is accessing from a statically-assigned location. If there is NO common IP addresses they must have DHCP that is assigning an IP to them.

In the first case, you can identify possible shared account activity (some games prohibit this) or hacking attempt if, suddenly, records start appearing with a multitude of IP addresses.
Idiocy - Never underestimate the power of stupid people in large groups.


Offline Karlos

  • Level 7
  • *
  • Posts: 31
  • Reputation: +2/-0
    • View Profile
Re: Player IP Address's
« Reply #15 on: April 17, 2010, 10:00:08 AM »
For our games we use two fields in the player table register date/time and last login date/time.

Upon login we also take the ip and add it to a table called player_loginhistory. This allows us to see trends in when people login, times and what all IP's they used in the past. With just a couple fields in the player table you only get to see a snapshot of the last time they logged in and not a history of logins ;)



Very good idea, I'll have to use a system like that.

 


SimplePortal 2.3.3 © 2008-2010, SimplePortal