Graal Forums  

Go Back   Graal Forums > Development Forums > Future Improvements
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 09-13-2012, 05:51 AM
Twinny Twinny is offline
My empire of dirt
Twinny's Avatar
Join Date: Mar 2006
Location: Australia
Posts: 2,422
Twinny is just really niceTwinny is just really nice
Send a message via AIM to Twinny
Staff Activity

This would be most helpful in Testbed but I can see value everywhere else.

I would like a RC function which will output all current accounts in the stafflist along with the last time they logged in. I'd also like the ability to optionally extend this to include the last 3 entries in their staff activity.

Thoughts?
Reply With Quote
  #2  
Old 09-13-2012, 06:04 AM
Sinkler Sinkler is offline
.
Sinkler's Avatar
Join Date: Jul 2004
Location: Washington, D.C.
Posts: 683
Sinkler is a jewel in the roughSinkler is a jewel in the rough
Send a message via AIM to Sinkler
You could in theory always ask a PWA...
__________________
Hello!

If you need to get in contact with me, please send an e-mail to: [email protected]



"He who knows only his own side of the case knows little of that."

-John Stuart Mill
Reply With Quote
  #3  
Old 09-13-2012, 06:17 AM
Twinny Twinny is offline
My empire of dirt
Twinny's Avatar
Join Date: Mar 2006
Location: Australia
Posts: 2,422
Twinny is just really niceTwinny is just really nice
Send a message via AIM to Twinny
Quote:
Originally Posted by Sinkler View Post
You could in theory always ask a PWA...
Slow process! I think a pre-formatted list available would be great!
Reply With Quote
  #4  
Old 09-13-2012, 06:22 AM
DustyPorViva DustyPorViva is offline
Will work for food. Maybe
DustyPorViva's Avatar
Join Date: Sep 2003
Location: Maryland, USA
Posts: 9,589
DustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond repute
Send a message via AIM to DustyPorViva Send a message via MSN to DustyPorViva
There's already staff activity in /openaccess, it just needs to be expanded to include more than just NC activity.
Reply With Quote
  #5  
Old 09-13-2012, 06:30 AM
Twinny Twinny is offline
My empire of dirt
Twinny's Avatar
Join Date: Mar 2006
Location: Australia
Posts: 2,422
Twinny is just really niceTwinny is just really nice
Send a message via AIM to Twinny
Quote:
Originally Posted by DustyPorViva View Post
There's already staff activity in /openaccess, it just needs to be expanded to include more than just NC activity.
I know but I want an overview of all staff members added in staff options with a quick one line command :o

[Edit]: Testbed -> Currently 457 staff registered in server options

I'm trying to remove inactive people but it's a horrid manual process. Anything to speed it up would be awesome!
Reply With Quote
  #6  
Old 09-13-2012, 03:32 PM
fowlplay4 fowlplay4 is offline
team canada
fowlplay4's Avatar
Join Date: Jul 2004
Location: Canada
Posts: 5,200
fowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond repute
Download the rclog and then to populate last login dates through it then use Testbed's time-online tracking (or whatever it's called) system to track future login dates.
__________________
Quote:
Reply With Quote
  #7  
Old 09-13-2012, 09:26 PM
xAndrewx xAndrewx is offline
Registered User
xAndrewx's Avatar
Join Date: Sep 2004
Posts: 5,260
xAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud of
notepad++ is your friend
__________________
Reply With Quote
  #8  
Old 09-13-2012, 11:53 PM
BlueMelon BlueMelon is offline
asdfg
BlueMelon's Avatar
Join Date: Sep 2008
Posts: 1,481
BlueMelon is a splendid one to beholdBlueMelon is a splendid one to beholdBlueMelon is a splendid one to beholdBlueMelon is a splendid one to behold
Whiped up a little python script:

PHP Code:

#Copy/Paste your staff= into this string here:
server_staff "MonkeyBob,BlueMelon,Crow,Stefan"


months = ['Jan','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec']
open("rclog.txt",'r')
log f.readlines()
f.close()
staff server_staff.split(",")
times = {}
for 
s in staff:
    
times[s] = 'Jan 01'

for i in range(0,len(log)):
    if (
i+1) >= len(log):
        break
    
line log[i]
    
line2 log[i+1]
    if 
"is logged in from" in line2 and "Client-RC" not in line2:
        
acc line2.split(" ")[0]
        if 
acc in staff:
            
currentmonth times[acc].split(" ")[0]
            
currentmonth_num months.index(currentmonth)
            
newmonth line.split(" ")[2]
            
newmonth_num months.index(newmonth)
            if 
newmonth_num >= currentmonth_num:
                
times[acc] = line[10:len(line2)-1]


for 
acc in times.keys():
    print 
"Last Login ("+acc+"): "+str(times[acc]) 
http://pastebin.com/5yVy0e7w


Output:
PHP Code:
Last Login (BlueMelon): Sep 13 23:11:23 2012

Last Login 
(MonkeyBob): Sep 13 15:31:56 2012

Last Login 
(Stefan): Jul 18 03:36:44 2012

Last Login 
(Crow): Sep 13 17:12:31 2012 
__________________
http://i.imgur.com/OOJbW.jpg

Last edited by BlueMelon; 09-14-2012 at 10:10 PM..
Reply With Quote
  #9  
Old 09-14-2012, 08:31 AM
Crow Crow is offline
ǝɔɐɹq ʎןɹnɔ
Crow's Avatar
Join Date: Dec 2006
Location: Germany
Posts: 5,153
Crow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond repute
Melon! You're not even closing your file handle! :/
__________________
Reply With Quote
  #10  
Old 09-14-2012, 02:13 PM
BlueMelon BlueMelon is offline
asdfg
BlueMelon's Avatar
Join Date: Sep 2008
Posts: 1,481
BlueMelon is a splendid one to beholdBlueMelon is a splendid one to beholdBlueMelon is a splendid one to beholdBlueMelon is a splendid one to behold
Quote:
Originally Posted by Crow View Post
Melon! You're not even closing your file handle! :/
Sorry I got to exited...

add log.close() at the end of the script
__________________
http://i.imgur.com/OOJbW.jpg
Reply With Quote
  #11  
Old 09-14-2012, 02:27 PM
Tricxta Tricxta is offline
The Muffin Man
Tricxta's Avatar
Join Date: Oct 2010
Location: Australia
Posts: 563
Tricxta is a jewel in the roughTricxta is a jewel in the rough
Quote:
Originally Posted by BlueMelon View Post
Sorry I got to exited...
Yo man! that's my line
__________________
Quote:
Originally Posted by Crono View Post
No look at it, Stefan is totally trolling Thor. Calling Classic a "playerworld" (something it's not supposed to be) is the ultimate subtle insult to a true fan.

It's genius.
Reply With Quote
  #12  
Old 09-14-2012, 03:01 PM
Crow Crow is offline
ǝɔɐɹq ʎןɹnɔ
Crow's Avatar
Join Date: Dec 2006
Location: Germany
Posts: 5,153
Crow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond repute
Quote:
Originally Posted by BlueMelon View Post
Sorry I got to exited...

add log.close() at the end of the script
Won't work, since "log" is your list of lines, not the file handle. Instead:
PHP Code:
f   open("rclog.txt",'r')
log f.readlines()
f.close() 
__________________
Reply With Quote
  #13  
Old 09-14-2012, 06:51 PM
BlueMelon BlueMelon is offline
asdfg
BlueMelon's Avatar
Join Date: Sep 2008
Posts: 1,481
BlueMelon is a splendid one to beholdBlueMelon is a splendid one to beholdBlueMelon is a splendid one to beholdBlueMelon is a splendid one to behold
Quote:
Originally Posted by Crow View Post
Won't work, since "log" is your list of lines, not the file handle. Instead:
PHP Code:
f   open("rclog.txt",'r')
log f.readlines()
f.close() 
After a bit of research,

PHP Code:
log open('rclog.txt','r').readlines() 
Will automatic close the file descriptor (handle) once the python garbage collector finds it.

Its better to explicitly use a variable handle, or a with-block but since its a small script that will only be ran once in a while, it doesn't really matter.
For bigger projects though, you would need to close it.
__________________
http://i.imgur.com/OOJbW.jpg
Reply With Quote
  #14  
Old 09-14-2012, 07:14 PM
Crow Crow is offline
ǝɔɐɹq ʎןɹnɔ
Crow's Avatar
Join Date: Dec 2006
Location: Germany
Posts: 5,153
Crow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond repute
Quote:
Originally Posted by BlueMelon View Post
After a bit of research,

PHP Code:
log open('rclog.txt','r').readlines() 
Will automatic close the file descriptor (handle) once the python garbage collector finds it.

Its better to explicitly use a variable handle, or a with-block but since its a small script that will only be ran once in a while, it doesn't really matter.
For bigger projects though, you would need to close it.
IT'S BAD PRACTICE *rant* I'M TELLING YOU!
__________________
Reply With Quote
  #15  
Old 09-14-2012, 07:24 PM
BlueMelon BlueMelon is offline
asdfg
BlueMelon's Avatar
Join Date: Sep 2008
Posts: 1,481
BlueMelon is a splendid one to beholdBlueMelon is a splendid one to beholdBlueMelon is a splendid one to beholdBlueMelon is a splendid one to behold
Quote:
Originally Posted by Crow View Post
IT'S BAD PRACTICE *rant* I'M TELLING YOU!
I agree, but for small projects/scripts its acceptable.
__________________
http://i.imgur.com/OOJbW.jpg
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 09:50 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.