Update of /cvsroot/wpdev/wolfpack
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2037
Modified Files:
world.cpp world.h
Log Message:
New wolfpack functions: playercount, npccount, accounts.count
Index: world.h
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/world.h,v
retrieving revision 1.14
retrieving revision 1.15
diff -C2 -d -r1.14 -r1.15
*** world.h 10 Jun 2004 00:27:12 -0000 1.14
--- world.h 16 Jul 2004 21:01:07 -0000 1.15
***************
*** 74,77 ****
--- 74,78 ----
unsigned int lastTooltip;
SERIAL _lastCharSerial, _lastItemSerial;
+ unsigned int _playerCount, _npcCount;
public:
***************
*** 123,126 ****
--- 124,135 ----
}
+ unsigned int npcCount() const {
+ return _npcCount;
+ }
+
+ unsigned int playerCount() const {
+ return _playerCount;
+ }
+
unsigned int getUnusedTooltip()
{
Index: world.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/world.cpp,v
retrieving revision 1.103
retrieving revision 1.104
diff -C2 -d -r1.103 -r1.104
*** world.cpp 2 Jul 2004 06:27:32 -0000 1.103
--- world.cpp 16 Jul 2004 21:01:07 -0000 1.104
***************
*** 337,340 ****
--- 337,342 ----
p = new cWorldPrivate;
+ _npcCount = 0;
+ _playerCount = 0;
_charCount = 0;
_itemCount = 0;
***************
*** 948,951 ****
--- 950,959 ----
if ( serial > _lastCharSerial )
_lastCharSerial = serial;
+
+ if (pChar->objectType() == enPlayer) {
+ ++_playerCount;
+ } else if (pChar->objectType() == enNPC) {
+ ++_npcCount;
+ }
}
else
***************
*** 995,998 ****
--- 1003,1013 ----
}
+ P_CHAR pChar = it->second;
+ if (pChar->objectType() == enPlayer) {
+ --_playerCount;
+ } else if (pChar->objectType() == enNPC) {
+ --_npcCount;
+ }
+
p->chars.erase( it );
_charCount--;
|