Page 1 of 1

Online list logging

Posted: 08 May 2013, 18:07
by AnonDuck
So I've been logging the online list to a sqlite database on and off for several years. It just grabs the online list every few seconds and records when people login or logout.. Also keeps track of total time online for any given player. This data can then be analyzed and displayed as useful information.


I had a few minutes today and figured I'd clean up/rewrite the code and release it.

Some sample runs of the included analysis scripts (on a new dataset)

Top 20 users sorted by total time spent in-game

Code: Select all

user@mana:~/logger/./top20.pl 
Top 20 most-online players:
	Kronos 1430 seconds
	Aryaes 1430 seconds
	webcam.now.im 1430 seconds
	ConfusedTree 1430 seconds
	Adelina 1430 seconds
	Biqcassy 1430 seconds
	reldin 1430 seconds
	Chaosava 1430 seconds
	Necromonger 1430 seconds
	SpkTwo 1430 seconds
	StarsavekCinderweb 1430 seconds
	Rabonbon 1430 seconds
	Oswalda 1430 seconds
	Apotheosis 1430 seconds
	V0id 1430 seconds
	Nightghost 1430 seconds
	Geologista 1430 seconds
	Zekrom 1430 seconds
	Chonkers 1430 seconds
	Garreth 1430 seconds
When a user was last seen. Maybe Tree could do this too?

Code: Select all

user@mana:~/logger/./seen.pl Dyna
Dyna last seen on Wed May  8 13:54:06 2013
Snoop on a user to see when they login/out

Code: Select all

user@mana:~/logger/./snoop.pl 4144
4144 login Wed May  8 13:54:06 2013
4144 logout Wed May  8 13:53:58 2013
4144 login Wed May  8 13:38:37 2013
4144 logout Wed May  8 13:38:05 2013
4144 login Wed May  8 13:21:19 2013
There are many more ways to analyze the data this logger collects. It can be used to determine what hours a player is likely to be online, etc.

Code is attached.

Re: Online list logging

Posted: 08 May 2013, 18:16
by o11c
Somebody needed to do this.

Many people are way to naive about privacy.

Re: Online list logging

Posted: 08 May 2013, 18:20
by melkior
MadCamel wrote: When a user was last seen. Maybe Tree could do this too?
I've been meaning to add this to the tree.

With the code you've provided, this might just happen sooner. :D

Re: Online list logging

Posted: 08 May 2013, 18:34
by AnonDuck
Small patch: Line 67 of logger.pl should be

Code: Select all

s/\s+$//g;
It was stripping spaces out of character names. :oops:

Re: Online list logging

Posted: 08 May 2013, 18:41
by Sanity
Can this be added as a function of main website?

Re: Online list logging

Posted: 08 May 2013, 23:56
by AnonDuck
I didn't expect there to be much interest in this, but there was :)

I've fixed a bunch of bugs and added some stuff.

Changelog:

Code: Select all

No longer compatible with old DB format. Start fresh (sorry)
Database size no longer grows out of control
Whitespace in character names is kept
GMs have (GM) stripped from their name
Added 'oldest' script to find the oldest players by account age
Seen script can now guess if a player is currently online or not
New version attached!

Re: Online list logging

Posted: 09 May 2013, 05:24
by Nard
We have been discussing for this kind of topic for a long time:

http://forums.themanaworld.org/viewtopic.php?t=15887
.
More: /w AuctionBot !lastseen MadCamel
##C[05:21] AuctionBot: I have last seen MadCamel 4 weeks ago.



And you fear the publication of server statistics!? This seems rather inconsistent to me... :?

Re: Online list logging

Posted: 09 May 2013, 05:39
by AnonDuck
Neat. Had no idea AuxtionBot had seen.
Nard wrote:And you fear the publication of server statistics!? This seems rather inconsistent to me... :?
The online list is published openly and is entirely public. I am 100% for processing any and all public data into useful statistics and information. I'm just not sure that the map server logs should be made public (See other topic, silly to re-discuss here)

Re: Online list logging

Posted: 09 May 2013, 06:08
by Nard
MadCamel wrote: The online list is published openly and is entirely public. I am 100% for processing any and all public data into useful statistics and information. I'm just not sure that the map server logs should be made public (See other topic, silly to re-discuss here)
I totally agree with this. Even without this list our presence ingame on a public server, is a public thing. However the extraction of some data out of them is the problem especially the sorting by account age. As I understood the previously expressed opinions, even online durations can be considered by some as privacy violation.
Note that if you read the thread I quoted, you'll see that it is not my opinion. On the opposite, your topic shows that I am right to say that the actual situation is: Only people with programming skills can access and retrieve information from server, if the whole data set is public everyone "can" do it and verify the information given elsewhere.

Anyway, as for guild, chat channels, manamarket... this kind of feature is part of the game and should be made availabe from content and server, not from a bot.

Re: Online list logging

Posted: 09 May 2013, 12:58
by Matt
I did this too until 2009, you can create some cool statistics with that ;)