Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

Limit ID login time.

Newbie Spellweaver
Joined
Jul 23, 2014
Messages
56
Reaction score
2
Hello RageZone , i am having an big issue with finding an way to limit the login time for example once in 6 hours.
The current script that i have limit only the IP (which can be easly changed) , but the logging screen won't work anymore after making an small change to it.
Could anyone give me an advice please?
 
Watching from above
Legend
Joined
Apr 9, 2004
Messages
3,828
Reaction score
752
The question needs more detail. You don't really explain what your problems are, what you can do so far and what you've tried to solve your problem.
 
Intelligent DoucheBag
Loyal Member
Joined
Jan 5, 2008
Messages
1,698
Reaction score
288
set a session for the user with an array.
$_SESSION['user'] = array("username"=>$username, "logintime" => time());

Then you know when he logged in.

when you want him online for 6 hours.
you check the logintime each time.

$sixhours = 60*60*6;
if($_SESSSION['user']['logintime'] < (time()-$sixhours))
{
unset($_SESSION['user'];
}



only show the page if $_SESSION['user'] is set.

if(isset($_SESSION['user'])
{
//showpage

}
else
{
//redirect somewhere else

}



ps.

Bit too lazy to add tags, getting ready for work.
 
Back
Top