Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

User uptime on Hub #26

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

User uptime on Hub #26

wants to merge 2 commits into from

Conversation

KuZon
Copy link

@KuZon KuZon commented Jan 13, 2016

works for only registered users
created a new table uptime

@hjpotter92
Copy link
Member

There is no need for this. If you look at the user table available in PtokaX documentation, you'll notice the field:

iLoginTime  - User login time in seconds from 1.1.1970

You can use this, in conjecture with os.time() or os.date() to compute user's uptime.

`nick` varchar(25) NOT NULL UNIQUE,
`time` bigint(10) unsigned DEFAULT '00000',
PRIMARY KEY (`id`),
UNIQUE KEY `id_nick` (`id`,`nick`)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With a primary id and unique nick, this indexing is redundant.

@KuZon
Copy link
Author

KuZon commented Jan 13, 2016

Oops..Didn't knew that iLoginTime is provided in API
I actually wanted to create a table with current session uptime and user's ip in that session. @nishithshah2211 suggested that it would be a lot of I/O.Any suggestions to improve / change this thing?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants