From: Andrew M. <rh...@us...> - 2003-03-08 07:33:54
|
Update of /cvsroot/planeshift/planeshift/src/common/engine In directory sc8-pr-cvs1:/tmp/cvs-serv1980 Modified Files: netpersist.cpp Log Message: Wrapped debug messages with #ifdef PSNETPERSISTDEBUG . Default still has these on since they offer good status hints for debugging. Index: netpersist.cpp =================================================================== RCS file: /cvsroot/planeshift/planeshift/src/common/engine/netpersist.cpp,v retrieving revision 1.45 retrieving revision 1.46 diff -C2 -d -r1.45 -r1.46 *** netpersist.cpp 25 Feb 2003 22:19:22 -0000 1.45 --- netpersist.cpp 8 Mar 2003 07:33:49 -0000 1.46 *************** *** 33,36 **** --- 33,39 ---- #include "psprop/pc/pspcproxlist.h" + // Define for debugging printfs. You probably want this on for development, off for server. + #define PSNETPERSISTDEBUG + psCelPersistMessage::psCelPersistMessage(uint32_t clientnum, uint16_t cmd, int prty, uint32_t id, csMemFile* memfile, const char *extra_str) : memfile(NULL) *************** *** 160,165 **** psCelPersistMessage pmsg(clientnum, CELPERSISTCMD_SEND_ENTITY, PRIORITY_HIGH, entity->GetID(), memfile); ! printf("Multicasting entity %s to %d clients.\n",entity->GetName(),proxlist->GetClients().Length() ); msghandler->Multicast(pmsg.me, proxlist->GetClients().GetArray(), --- 163,169 ---- psCelPersistMessage pmsg(clientnum, CELPERSISTCMD_SEND_ENTITY, PRIORITY_HIGH, entity->GetID(), memfile); ! #ifdef PSNETPERSISTDEBUG printf("Multicasting entity %s to %d clients.\n",entity->GetName(),proxlist->GetClients().Length() ); + #endif msghandler->Multicast(pmsg.me, proxlist->GetClients().GetArray(), *************** *** 212,216 **** --- 216,222 ---- return NULL; + #ifdef PSNETPERSISTDEBUG printf("Building custom prox list for client %d\n",clientnum); + #endif for (int i=0; i<pcinv->GetEntityCount(); i++) *************** *** 218,223 **** iCelEntity *candidate = pcinv->GetEntity(i); printf(" Checking #%d (%s)...",i,candidate->GetName() ); ! // Get list of interested clients csRef<iPcProximityList> proxlist = --- 224,230 ---- iCelEntity *candidate = pcinv->GetEntity(i); + #ifdef PSNETPERSISTDEBUG printf(" Checking #%d (%s)...",i,candidate->GetName() ); ! #endif // Get list of interested clients csRef<iPcProximityList> proxlist = *************** *** 228,235 **** --- 235,246 ---- // This was subscribed, so add to temp list listinv->AddEntity(candidate); + #ifdef PSNETPERSISTDEBUG printf("Added\n"); + #endif } + #ifdef PSNETPERSISTDEBUG else printf("Not added.\n"); + #endif } *************** *** 263,267 **** --- 274,280 ---- void psNetPersist::RequestWorld(uint32_t clientnum) { + #ifdef PSNETPERSISTDEBUG printf ("Request World!\n"); + #endif psCelPersistMessage pmsg(clientnum, CELPERSISTCMD_REQUEST_WORLD, PRIORITY_HIGH); msghandler->SendMessage(pmsg.me); *************** *** 270,274 **** --- 283,289 ---- void psNetPersist::RequestActors(uint32_t clientnum) { + #ifdef PSNETPERSISTDEBUG printf ("Requesting Actorslist!\n"); + #endif psCelPersistMessage pmsg(clientnum, CELPERSISTCMD_REQUEST_ACTORLIST,PRIORITY_HIGH); msghandler->SendMessage(pmsg.me); *************** *** 277,281 **** --- 292,298 ---- void psNetPersist::RequestEntity(uint32_t clientnum, uint32_t serverentid) { + #ifdef PSNETPERSISTDEBUG printf ("Requesting Entity %d!\n", serverentid); + #endif psCelPersistMessage pmsg(clientnum, CELPERSISTCMD_REQUEST_ENTITY, |