[mw-devel] MW3 r1264 - trunk/src/webclient

arthur at sucs.org arthur at sucs.org
Wed Oct 17 15:24:14 BST 2012


Author: arthur
Date: 2012-10-17 15:24:14 +0100 (Wed, 17 Oct 2012)
New Revision: 1264

Modified:
   trunk/src/webclient/mwpoll.c
Log:
Make web client update total logged in stats


Modified: trunk/src/webclient/mwpoll.c
===================================================================
--- trunk/src/webclient/mwpoll.c	2012-10-01 12:40:33 UTC (rev 1263)
+++ trunk/src/webclient/mwpoll.c	2012-10-17 14:24:14 UTC (rev 1264)
@@ -185,9 +185,10 @@
 	}
 
 	/* mark as in talker */
-	user->chatmode=0;
-	user->chatmode=cm_flags(user->chatmode,CM_ONCHAT,CM_MODE_SET);
-	user->idletime=time(0);
+	time_t loggedin = time(0);
+	user->chatmode = 0;
+	user->chatmode = cm_flags(user->chatmode,CM_ONCHAT,CM_MODE_SET);
+	user->idletime = loggedin;
 	user->room = channel;
 	update_user(user,userposn);
 
@@ -224,7 +225,7 @@
 	}
 
 	who_add(getpid(),userposn);
-	lastcomm = time(NULL);
+	loggedin = lastcomm = loggedin;
 	
 	/* spock, announce us please... */
 	//broadcast_onoffcode(3, 0, user->name, NULL);
@@ -242,8 +243,12 @@
 		}
 	};
 
-	user->idletime=time(0);
+	time_t now = time(0);
+	user->idletime = now;
+	user->lastlogout = now;
+	user->timeused += now - loggedin;
 	user->chatmode=cm_flags(user->chatmode, CM_ONCHAT, CM_MODE_CLEAR);
+
 	update_user(user,userposn);
 	talk_rawbcast("\03311%s has just left the web talker", user->name);
 	broadcast_onoffcode(0,0,user->name,NULL);




More information about the mw-devel mailing list