View/Edit #2323:trackActivity

Switch to edit mode.

Name(s): trackActivity
1:  "void $ddd:trackActivity()"
2:  "Tracks user activity.  Called by the $clock every few minutes."
3:  caller_perms():controls(this) || raise(E_PERM, "Don't touch me there!")
4:  cp = connected_players()
5:  ticks_left() < 2000 || seconds_left() < 2 ? suspend(0) | 0
6:  for p in (cp)
7:    "Track idleness for each connected player."
8:    this.activityLog = {@this.activityLog, tostr(time(), " ", p, " IDLE ", `idle_seconds(p) ! ANY => -1')}
9:    "Also track their location and who's there with them."
10:   {lcn, cohorts} = {p.location, {}}
11:   for c in (lcn.contents)
12:     ticks_left() < 2000 || seconds_left() < 2 ? suspend(0) | 0
13:     cohorts = c in cp ? {@cohorts, c} | cohorts
14:   endfor
15:   logLine = tostr(time(), " ", p, " LOCATION ", lcn, " COHORTS ", toliteral(cohorts))
16:   this.activityLog = {@this.activityLog, logLine}
17: endfor
18: "Last modified by JS (#7214) on Wed Jun 18 22:17:05 2003 MDT."

Verb arguments: this none this
Verb perms: Readable eXecutable NOT-Debug
Verb owned by: JS (#7214)

You are not logged in.

[home | help | who | search | setup | code]