From e73c1ee5e26f59380806d0dcd90c4ed6617e76ef Mon Sep 17 00:00:00 2001 From: ultramage Date: Tue, 11 Mar 2008 09:44:12 +0000 Subject: Replaced clif_countusers() with a more efficient alternative (thanks to the fact that pc_db now only holds fully authed players only). git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@12339 54d463be-8e91-2dee-dedb-b68131a5f0ec --- src/map/map.c | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) (limited to 'src/map/map.c') diff --git a/src/map/map.c b/src/map/map.c index a9ac939bf..27eeab5d2 100644 --- a/src/map/map.c +++ b/src/map/map.c @@ -170,14 +170,28 @@ void map_setusers(int users) map_users = users; } -/*========================================== - * 全map鯖?計での接??取得 (/wへの?答用) - *------------------------------------------*/ int map_getusers(void) { return map_users; } +/*========================================== + * server player count (this mapserver only) + *------------------------------------------*/ +int map_usercount(void) +{ +/* + int count = 0; + struct s_mapiterator* iter = mapit_getallusers(); + for( mapit_first(iter); mapit_exists(iter); mapit_next(iter) ) + count++; + mapit_free(iter); + return count; +*/ + // since pc_db now only holds fully authed players, this approach is equivalent: + return pc_db->size(pc_db); +} + // // block削除の安全性確保?理 // -- cgit v1.2.3-60-g2f50