Jump to content

Recommended Posts

Can anyone tell me how to make the user's online show in real time. I have a chat the is in real time and looks funny when its not matching the users online.

chat.png

i think that those pilots that are not being showed in the chat list are not being showed because those pilots must be flying maybe on kacars..

Just a thought.

  • Like 1
Link to post
Share on other sites

The online users is based on login sessions which last 30 mins I think... just get the same list as the chat?

TOM WHY DID U GIVE ME A -1!!!!!!!!!!!!!!!!!!!!!!! :angry: THIS IS VERY UNFAIR CAN SOME ADMIN PLEASE TELL ME WHAT IS THE PROBLEM WHERE EVER ANYONE SEE'S MY POST I GET A -1. WHAT IS UR PROBLEM!!!!

  • Like 2
Link to post
Share on other sites

What is wrong with you people. I don't rate posts. Thanks for the -2 though... I'll keep my knowledge to myself next time.

Also, fsxsimulation. I might just -1 all your posts now for lolz because you'll rage in caps and I'll laugh. Edit: Not that it'd matter, you're already on -147 bahaha

  • Like 2
Link to post
Share on other sites
  • Moderators

TOM WHY DID U GIVE ME A -1!!!!!!!!!!!!!!!!!!!!!!! :angry: THIS IS VERY UNFAIR CAN SOME ADMIN PLEASE TELL ME WHAT IS THE PROBLEM WHERE EVER ANYONE SEE'S MY POST I GET A -1. WHAT IS UR PROBLEM!!!!

OH GROW UP ALREADY! Your pathetic! And you don't know what your doing when you are fixing the problem. So I'm going to say it again! GROW UP!

Sorry for hijacking the thread, but I had to say something.

  • Like 1
Link to post
Share on other sites
Guest lorathon

Back on topic......

You would have to change the following in the StatsData

public static function UsersOnline($minutes = '')
{
	$key = 'users_online';
	$users_online = CodonCache::read($key);

	if($users_online === false)
	{
		if($minutes == '')
			$minutes = Config::Get('USERS_ONLINE_TIME');

		$sql = "SELECT p.*
				FROM ".TABLE_PREFIX."pilots p, ".TABLE_PREFIX."sessions s
				WHERE s.pilotid = p.pilotid 
				AND DATE_SUB(UTC_TIMESTAMP(), INTERVAL {$minutes} MINUTE) <= s.`logintime`";

		$users_online = DB::get_results($sql);

		# Check if it's blank, then return an empty array
		if(!$users_online)
			$users_online = array();

		CodonCache::write($key, $users_online, 'short');
	}

	return $users_online;
}

The problem is you would also have to remove the cache of this query. Since the query may keep the list old even if you change the time comparison in the query. So change the USER_ONLINE_TIME to say 1 min ( a least it will be closer) and then remove the cache scripting.

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...