From: <mg...@us...> - 2008-05-12 18:06:38
|
Revision: 1505 http://planeshift.svn.sourceforge.net/planeshift/?rev=1505&view=rev Author: mgist Date: 2008-05-12 11:01:32 -0700 (Mon, 12 May 2008) Log Message: ----------- - Logging fixes. Modified Paths: -------------- trunk/src/common/util/log.cpp trunk/src/server/bulkobjects/pscharacter.cpp trunk/src/server/paladinjr.cpp trunk/src/server/paladinjr.h trunk/src/server/psserverdr.cpp Modified: trunk/src/common/util/log.cpp =================================================================== --- trunk/src/common/util/log.cpp 2008-05-12 17:40:39 UTC (rev 1504) +++ trunk/src/common/util/log.cpp 2008-05-12 18:01:32 UTC (rev 1505) @@ -351,23 +351,20 @@ for(int i = 0;i < MAX_CSV;i++) { - if(logs[i].first.IsEmpty()) - StartLog(logs[i].first, vfs, logs[i].second, maxSize, csvFile[i]); + StartLog(logs[i].first, vfs, logs[i].second, maxSize, csvFile[i]); } } void LogCSV::StartLog(const char* logfile, iVFS* vfs, const char* header, size_t maxSize, csRef<iFile>& csvFile) { bool writeHeader = false; - if (!(vfs->Exists(logfile))) + if (!vfs->Exists(logfile)) { csvFile = vfs->Open(logfile,VFS_FILE_WRITE); - writeHeader = true; - + writeHeader = true; } else - { - + { csvFile = vfs->Open(logfile,VFS_FILE_APPEND); // Need to rotate log Modified: trunk/src/server/bulkobjects/pscharacter.cpp =================================================================== --- trunk/src/server/bulkobjects/pscharacter.cpp 2008-05-12 17:40:39 UTC (rev 1504) +++ trunk/src/server/bulkobjects/pscharacter.cpp 2008-05-12 18:01:32 UTC (rev 1505) @@ -113,8 +113,6 @@ familiar_id = 0; owner_id = 0; - animal_affinity.Clear(); - override_max_hp = 0.0f; override_max_mana = 0.0f; Modified: trunk/src/server/paladinjr.cpp =================================================================== --- trunk/src/server/paladinjr.cpp 2008-05-12 17:40:39 UTC (rev 1504) +++ trunk/src/server/paladinjr.cpp 2008-05-12 18:01:32 UTC (rev 1505) @@ -58,6 +58,10 @@ void PaladinJr::PredictClient(Client* client, psDRMessage& currUpdate) { + // Don't check GMs/Devs + if(client->GetSecurityLevel()) + return; + // Speed check always enabled SpeedCheck(client, currUpdate); @@ -82,7 +86,7 @@ target = client; lastUpdate = currUpdate; #ifdef PALADIN_DEBUG - CPrintf(CON_DEBUG, "Now checking client %d", target->GetClientNum()); + CPrintf(CON_DEBUG, "Now checking client %d\n", target->GetClientNum()); #endif checked.DeleteAll(); } @@ -95,7 +99,7 @@ target = client; lastUpdate = currUpdate; #ifdef PALADIN_DEBUG - CPrintf(CON_DEBUG, "Now checking client %d", target->GetClientNum()); + CPrintf(CON_DEBUG, "Now checking client %d\n", target->GetClientNum()); #endif return; } @@ -148,7 +152,7 @@ void PaladinJr::CheckClient(Client* client) { - if (!enabled || !checkClient) + if (!enabled || !checkClient || !client->GetSecurityLevel()) return; csVector3 pos; @@ -180,7 +184,7 @@ #endif csString buf; - buf.Format("%s, %s, %s, %.3f %.3f %.3f, %.3f %.3f %.3f, %.3f %.3f %.3f, %.3f %.3f %.3f, %.3f %.3f %.3f, %s", + buf.Format("%s, %s, %s, %.3f %.3f %.3f, %.3f %.3f %.3f, %.3f %.3f %.3f, %.3f %.3f %.3f, %.3f %.3f %.3f, %s\n", client->GetName(), "CD violation", sector->QueryObject()->GetName(),origPos.x, origPos.y, origPos.z, maxmove.x, maxmove.y, maxmove.z, posChange.x, posChange.y, posChange.z, vel.x, vel.y, vel.z, angVel.x, angVel.y, angVel.z, PALADIN_VERSION); @@ -248,7 +252,7 @@ vel = client->GetActor()->pcmove->GetVelocity(); client->GetActor()->pcmove->GetAngularVelocity(angVel); - buf.Format("%s, %s, %s, %.3f %.3f %.3f, %.3f 0 %.3f, %.3f %.3f %.3f, %.3f %.3f %.3f, %.3f %.3f %.3f, %s", + buf.Format("%s, %s, %s, %.3f %.3f %.3f, %.3f 0 %.3f, %.3f %.3f %.3f, %.3f %.3f %.3f, %.3f %.3f %.3f, %s\n", client->GetName(), type.GetData(), sectorName.GetData(),oldpos.x, oldpos.y, oldpos.z, max_noncheat_distance, max_noncheat_distance, currUpdate.pos.x - oldpos.x, currUpdate.pos.y - oldpos.y, currUpdate.pos.z - oldpos.z, Modified: trunk/src/server/paladinjr.h =================================================================== --- trunk/src/server/paladinjr.h 2008-05-12 17:40:39 UTC (rev 1504) +++ trunk/src/server/paladinjr.h 2008-05-12 18:01:32 UTC (rev 1505) @@ -19,7 +19,7 @@ #ifndef __PALADIN_H__ #define __PALADIN_H__ -#define PALADIN_DEBUG +//#define PALADIN_DEBUG #include "entitymanager.h" #include <iutil/cfgmgr.h> Modified: trunk/src/server/psserverdr.cpp =================================================================== --- trunk/src/server/psserverdr.cpp 2008-05-12 17:40:39 UTC (rev 1504) +++ trunk/src/server/psserverdr.cpp 2008-05-12 18:01:32 UTC (rev 1505) @@ -240,7 +240,7 @@ return; } - //paladin->PredictClient(client, drmsg); + paladin->PredictClient(client, drmsg); // Go ahead and update the server version if (!actor->SetDRData(drmsg)) // out of date message if returns false @@ -303,7 +303,7 @@ actor->GetMulticastClients(), me->clientnum,PROX_LIST_ANY_RANGE); - //paladin->CheckClient(client); + paladin->CheckClient(client); // Swap lines for easy Death Penalty testing. //if (strcmp(drmsg.sector->QueryObject()->GetName(), "NPCroom1") == 0) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |