From: <mg...@us...> - 2008-05-23 22:34:36
|
Revision: 1560 http://planeshift.svn.sourceforge.net/planeshift/?rev=1560&view=rev Author: mgist Date: 2008-05-23 15:34:44 -0700 (Fri, 23 May 2008) Log Message: ----------- - Fixed binary xml parsing for some CS change. - Made all items with no sector fail to load, this will happen anyway later on. Modified Paths: -------------- trunk/src/common/engine/psregion.cpp trunk/src/server/bulkobjects/psitem.cpp Modified: trunk/src/common/engine/psregion.cpp =================================================================== --- trunk/src/common/engine/psregion.cpp 2008-05-23 19:11:03 UTC (rev 1559) +++ trunk/src/common/engine/psregion.cpp 2008-05-23 22:34:44 UTC (rev 1560) @@ -83,7 +83,7 @@ csString target; target.Format("%s/world", worlddir.GetData()); - csRef<iDataBuffer> buf (vfs->ReadFile (target.GetData())); + csRef<iDataBuffer> buf (vfs->ReadFile (target.GetData(), false)); if (!buf || !buf->GetSize ()) { Error2("Error loading world file. %s\n", target.GetData()); Modified: trunk/src/server/bulkobjects/psitem.cpp =================================================================== --- trunk/src/server/bulkobjects/psitem.cpp 2008-05-23 19:11:03 UTC (rev 1559) +++ trunk/src/server/bulkobjects/psitem.cpp 2008-05-23 22:34:44 UTC (rev 1560) @@ -372,12 +372,12 @@ // printf("KWF: Item instance=%d\n", instance); psSectorInfo *itemsector=CacheManager::GetSingleton().GetSectorInfoByID(row.GetInt("loc_sector_id")); - if (!itemsector && row.GetUInt32("parent_item_id") == 0 ) + if (!itemsector) { csString error; error.Format("Item %s(%s) Could not be loaded\nIt is in sector id %s which does not resolve\n", GetName(), row["id"], row["loc_sector_id"] ); - Error1( error ); + Error1( error ); return false; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <Kha...@us...> - 2008-05-24 00:28:06
|
Revision: 1563 http://planeshift.svn.sourceforge.net/planeshift/?rev=1563&view=rev Author: Khakilord Date: 2008-05-23 17:28:14 -0700 (Fri, 23 May 2008) Log Message: ----------- Doubled packet history to better handle doubled packets. Fixed server crash when printing mode strings. Modified Paths: -------------- trunk/src/common/net/netbase.h trunk/src/server/bulkobjects/pscharacter.cpp Modified: trunk/src/common/net/netbase.h =================================================================== --- trunk/src/common/net/netbase.h 2008-05-24 00:16:56 UTC (rev 1562) +++ trunk/src/common/net/netbase.h 2008-05-24 00:28:14 UTC (rev 1563) @@ -35,7 +35,7 @@ #define NUM_BROADCAST 0xffffffff #define MAXQUEUESIZE 20000 -#define MAXPACKETHISTORY 200 +#define MAXPACKETHISTORY 400 #define NETAVGCOUNT 400 #define RESENDAVGCOUNT 200 Modified: trunk/src/server/bulkobjects/pscharacter.cpp =================================================================== --- trunk/src/server/bulkobjects/pscharacter.cpp 2008-05-24 00:16:56 UTC (rev 1562) +++ trunk/src/server/bulkobjects/pscharacter.cpp 2008-05-24 00:28:14 UTC (rev 1563) @@ -85,7 +85,7 @@ PoolAllocator<psCharacter> psCharacter::characterpool; const char * psCharacter::player_mode_to_str[] = - {"unknown","peace","combat","spell casting","working","dead","sitting","carrying too much","exhausted"}; + {"unknown","peace","combat","spell casting","working","dead","sitting","carrying too much","exhausted", "defeated"}; void *psCharacter::operator new(size_t allocSize) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <Kha...@us...> - 2008-05-24 12:41:40
|
Revision: 1567 http://planeshift.svn.sourceforge.net/planeshift/?rev=1567&view=rev Author: Khakilord Date: 2008-05-24 05:41:48 -0700 (Sat, 24 May 2008) Log Message: ----------- Fixed compiler warning in client. Changed packet id assignment to be deterministic. Modified Paths: -------------- trunk/src/client/psengine.h trunk/src/common/net/netbase.cpp trunk/src/common/net/netbase.h trunk/src/server/npcmanager.cpp Modified: trunk/src/client/psengine.h =================================================================== --- trunk/src/client/psengine.h 2008-05-24 04:01:32 UTC (rev 1566) +++ trunk/src/client/psengine.h 2008-05-24 12:41:48 UTC (rev 1567) @@ -78,6 +78,7 @@ struct DelayedLoader { virtual void CheckMeshLoad() = 0; + virtual ~DelayedLoader() { }; }; /** Modified: trunk/src/common/net/netbase.cpp =================================================================== --- trunk/src/common/net/netbase.cpp 2008-05-24 04:01:32 UTC (rev 1566) +++ trunk/src/common/net/netbase.cpp 2008-05-24 12:41:48 UTC (rev 1567) @@ -510,11 +510,6 @@ // A failed append means that the packet can't fit or is a resent packet. // Resent packets MUST NOT be merged because it circumvents clientside packet dup // detection - // Set a random ID for the new merged packet - if(final->packet->pktid == 0) - { - final->packet->pktid = GetRandomID(); - } SendSinglePacket(final); // Start the process again with the packet that wouldn't fit @@ -523,9 +518,6 @@ } // There is always data in final here - // Set a random ID for the new merged packet if this is a merged packet (pktid==0) - if (final->packet->pktid == 0) - final->packet->pktid = GetRandomID(); SendSinglePacket(final); // this deletes if necessary return true; @@ -571,7 +563,10 @@ #endif return false; } - + if(pkt->packet->pktid == 0) + { + pkt->packet->pktid = connection->GetNextPacketID(); + } return SendFinalPacket(pkt,&(connection->addr)); } @@ -968,7 +963,8 @@ #ifndef CS_PLATFORM_WIN32 // tell the network code there is a transmission waiting, this minimises lag time for sending network messages - write(pipe_fd[1], ¬ify, 1); + if(pipe_fd[1] > 0) + write(pipe_fd[1], ¬ify, 1); #endif bytesleft -= pktlen; @@ -1262,7 +1258,7 @@ // -------------------------------------------------------------------------- -NetBase::Connection::Connection(uint32_t num) +NetBase::Connection::Connection(uint32_t num): sequence(1) { pcknumin=0; pcknumout=0; Modified: trunk/src/common/net/netbase.h =================================================================== --- trunk/src/common/net/netbase.h 2008-05-24 04:01:32 UTC (rev 1566) +++ trunk/src/common/net/netbase.h 2008-05-24 12:41:48 UTC (rev 1567) @@ -368,14 +368,15 @@ FD_ZERO (&set); FD_SET (mysocket, &set); #ifndef CS_PLATFORM_WIN32 - FD_SET (pipe_fd[0], &set); + if(pipe_fd[0] > 0) + FD_SET (pipe_fd[0], &set); #endif // Backup the timeval struct in case select changes it as on Linux struct timeval prevTimeout = timeout; /* select returns 0 if timeout, 1 if input available, -1 if error. */ - if (SOCK_SELECT(MAX(mysocket, pipe_fd[0]) + 1, &set, NULL, NULL, &timeout) < 1) + if (SOCK_SELECT(MAX(mysocket + 1, pipe_fd[0]) + 1, &set, NULL, NULL, &timeout) < 1) { timeout = prevTimeout; return 0; @@ -584,6 +585,7 @@ /** This class holds data for a connection */ class NetBase::Connection { + uint32_t sequence; public: /** buffer for split up packets, allocated when needed */ void *buf; @@ -611,6 +613,8 @@ ~Connection(); bool isValid() const { return valid; } + + uint32_t GetNextPacketID() {return sequence++;} }; class NetPacketQueueRefCount : public NetPacketQueue, public csSyncRefCount, public CS::Utility::WeakReferenced Modified: trunk/src/server/npcmanager.cpp =================================================================== --- trunk/src/server/npcmanager.cpp 2008-05-24 04:01:32 UTC (rev 1566) +++ trunk/src/server/npcmanager.cpp 2008-05-24 12:41:48 UTC (rev 1567) @@ -560,7 +560,7 @@ // CHECK 4: Check to see if the login is correct. - Error2("Check Superclient Login for: '%s'\n", (const char*)msg.sUser); + Notify2(LOG_SUPERCLIENT, "Check Superclient Login for: '%s'\n", (const char*)msg.sUser); psAccountInfo *acctinfo=CacheManager::GetSingleton().GetAccountInfoByUsername((const char *)msg.sUser); if (clients->FindAccount(acctinfo->accountid, client->GetClientNum())) // username already logged in This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mg...@us...> - 2008-05-26 21:09:32
|
Revision: 1606 http://planeshift.svn.sourceforge.net/planeshift/?rev=1606&view=rev Author: mgist Date: 2008-05-26 14:09:37 -0700 (Mon, 26 May 2008) Log Message: ----------- - Second attempt... Modified Paths: -------------- trunk/src/common/util/fileutil.cpp trunk/src/pslaunch/updaterengine.cpp Modified: trunk/src/common/util/fileutil.cpp =================================================================== --- trunk/src/common/util/fileutil.cpp 2008-05-26 20:58:28 UTC (rev 1605) +++ trunk/src/common/util/fileutil.cpp 2008-05-26 21:09:37 UTC (rev 1606) @@ -43,12 +43,8 @@ csPtr<FileStat> FileUtil::StatFile (const char* path) { - csString fullpath("/this/"); - fullpath.Append(path); - - csRef<iDataBuffer> db = vfs->GetRealPath(fullpath); struct stat filestats; - if (stat(db->GetData(), &filestats) < 0) + if (stat(path, &filestats) < 0) return NULL; csRef<FileStat> filestat; @@ -74,7 +70,7 @@ filestat->executable = (filestats.st_mode & S_IEXEC) != 0; filestat->readonly = !(filestats.st_mode & S_IWRITE); - return filestat; + return csPtr<FileStat>(filestat); } bool FileUtil::RemoveFile (const char* filename, bool silent) Modified: trunk/src/pslaunch/updaterengine.cpp =================================================================== --- trunk/src/pslaunch/updaterengine.cpp 2008-05-26 20:58:28 UTC (rev 1605) +++ trunk/src/pslaunch/updaterengine.cpp 2008-05-26 21:09:37 UTC (rev 1606) @@ -706,7 +706,10 @@ csRef<iDocumentNode> next = nodeItr->Next(); csString newFilePath = next->GetAttributeValue("filepath"); - bool isExec = fileUtil->isExecutable(newFilePath); + csString realPath("/this/"); + realPath.Append(newFilePath); + csRef<iDataBuffer> db = vfs->GetRealPath(realPath); + bool isExec = fileUtil->isExecutable(db->GetData()); if(!config->UpdateExecs() && isExec) continue; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mg...@us...> - 2008-05-31 01:02:49
|
Revision: 1625 http://planeshift.svn.sourceforge.net/planeshift/?rev=1625&view=rev Author: mgist Date: 2008-05-30 18:02:52 -0700 (Fri, 30 May 2008) Log Message: ----------- - Fix Jamfiles for osx and add gif plugin. Modified Paths: -------------- trunk/src/client/Jamfile trunk/src/pslaunch/Jamfile trunk/src/setup/Jamfile Modified: trunk/src/client/Jamfile =================================================================== --- trunk/src/client/Jamfile 2008-05-31 00:56:31 UTC (rev 1624) +++ trunk/src/client/Jamfile 2008-05-31 01:02:52 UTC (rev 1625) @@ -34,6 +34,7 @@ bruteblock csddsimg csfont + csgifimg csjpgimg csopcode csparser @@ -95,7 +96,7 @@ xmltiny ; -if $(TARGET.OS) != "WIN32" { STATIC.PLUGINLIST += xwin xext86vm glx2d sndsysalsa sndsysoss ; } +if $(TARGET.OS) != "WIN32" { if $(TARGET.OS) != "MACOS_X" { STATIC.PLUGINLIST += xwin xext86vm glx2d sndsysalsa sndsysoss ; } } if $(TARGET.OS) = "WIN32" { STATIC.PLUGINLIST += glwin32 sndsyswin ; } if $(TARGET.OS) = "MACOS_X" { STATIC.PLUGINLIST += glosx2d sndsyscoreaudio ; } Modified: trunk/src/pslaunch/Jamfile =================================================================== --- trunk/src/pslaunch/Jamfile 2008-05-31 00:56:31 UTC (rev 1624) +++ trunk/src/pslaunch/Jamfile 2008-05-31 01:02:52 UTC (rev 1625) @@ -60,9 +60,12 @@ if $(TARGET.OS) != "WIN32" { - if $(X11.AVAILABLE) = "yes" { STATIC.PLUGINLIST += xwin ; } - if $(XFREE86VM.AVAILABLE) = "yes" { STATIC.PLUGINLIST += xext86vm ; } - STATIC.OPTIONALPLUGINLIST += glx2d ; + if $(TARGET.OS) != "MACOS_X" + { + if $(X11.AVAILABLE) = "yes" { STATIC.PLUGINLIST += xwin ; } + if $(XFREE86VM.AVAILABLE) = "yes" { STATIC.PLUGINLIST += xext86vm ; } + STATIC.OPTIONALPLUGINLIST += glx2d ; + } } if $(TARGET.OS) = "WIN32" { STATIC.PLUGINLIST += glwin32 ; } if $(TARGET.OS) = "MACOS_X" { STATIC.PLUGINLIST += glosx2d ; } Modified: trunk/src/setup/Jamfile =================================================================== --- trunk/src/setup/Jamfile 2008-05-31 00:56:31 UTC (rev 1624) +++ trunk/src/setup/Jamfile 2008-05-31 01:02:52 UTC (rev 1625) @@ -38,7 +38,7 @@ xmltiny ; -if $(TARGET.OS) != "WIN32" { STATIC.PLUGINLIST += xwin xext86vm glx2d ; } +if $(TARGET.OS) != "WIN32" { if $(TARGET.OS) != "MACOS_X" { STATIC.PLUGINLIST += xwin xext86vm glx2d ; } } if $(TARGET.OS) = "WIN32" { STATIC.PLUGINLIST += glwin32 ; } if $(TARGET.OS) = "MACOS_X" { STATIC.PLUGINLIST += glosx2d ; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mg...@us...> - 2008-06-02 01:10:22
|
Revision: 1653 http://planeshift.svn.sourceforge.net/planeshift/?rev=1653&view=rev Author: mgist Date: 2008-06-01 18:10:30 -0700 (Sun, 01 Jun 2008) Log Message: ----------- - Cleanup Modified Paths: -------------- trunk/src/npcclient/networkmgr.cpp trunk/src/npcclient/networkmgr.h trunk/src/server/entitymanager.cpp trunk/src/server/gem.cpp trunk/src/server/psserver.cpp trunk/src/server/psserverdr.cpp trunk/src/server/usermanager.cpp Modified: trunk/src/npcclient/networkmgr.cpp =================================================================== --- trunk/src/npcclient/networkmgr.cpp 2008-06-01 23:54:32 UTC (rev 1652) +++ trunk/src/npcclient/networkmgr.cpp 2008-06-02 01:10:30 UTC (rev 1653) @@ -37,7 +37,6 @@ #include "net/messages.h" #include "net/msghandler.h" #include "net/npcmessages.h" -#include "engine/netpersist.h" #include "util/eventmanager.h" //============================================================================= Modified: trunk/src/npcclient/networkmgr.h =================================================================== --- trunk/src/npcclient/networkmgr.h 2008-06-01 23:54:32 UTC (rev 1652) +++ trunk/src/npcclient/networkmgr.h 2008-06-02 01:10:30 UTC (rev 1653) @@ -21,7 +21,6 @@ #include <csutil/csstring.h> -#include "engine/netpersist.h" #include "net/cmdbase.h" // Subscriber class #include "util/serverconsole.h" // iCommandCatcher class MsgHandler; Modified: trunk/src/server/entitymanager.cpp =================================================================== --- trunk/src/server/entitymanager.cpp 2008-06-01 23:54:32 UTC (rev 1652) +++ trunk/src/server/entitymanager.cpp 2008-06-02 01:10:30 UTC (rev 1653) @@ -67,7 +67,6 @@ #include "util/psxmlparser.h" #include "util/serverconsole.h" -#include "engine/netpersist.h" #include "engine/psworld.h" #include "engine/linmove.h" Modified: trunk/src/server/gem.cpp =================================================================== --- trunk/src/server/gem.cpp 2008-06-01 23:54:32 UTC (rev 1652) +++ trunk/src/server/gem.cpp 2008-06-02 01:10:30 UTC (rev 1653) @@ -76,7 +76,6 @@ #include "net/msghandler.h" #include "engine/psworld.h" -#include "engine/netpersist.h" #include "engine/linmove.h" //============================================================================= Modified: trunk/src/server/psserver.cpp =================================================================== --- trunk/src/server/psserver.cpp 2008-06-01 23:54:32 UTC (rev 1652) +++ trunk/src/server/psserver.cpp 2008-06-02 01:10:30 UTC (rev 1653) @@ -41,8 +41,6 @@ #include "util/log.h" #include "util/consoleout.h" -#include "engine/netpersist.h" - #include "net/msghandler.h" #include "net/messages.h" Modified: trunk/src/server/psserverdr.cpp =================================================================== --- trunk/src/server/psserverdr.cpp 2008-06-01 23:54:32 UTC (rev 1652) +++ trunk/src/server/psserverdr.cpp 2008-06-02 01:10:30 UTC (rev 1653) @@ -33,7 +33,6 @@ #include "net/msghandler.h" #include "engine/celbase.h" -#include "engine/netpersist.h" #include "engine/linmove.h" #include "util/serverconsole.h" Modified: trunk/src/server/usermanager.cpp =================================================================== --- trunk/src/server/usermanager.cpp 2008-06-01 23:54:32 UTC (rev 1652) +++ trunk/src/server/usermanager.cpp 2008-06-02 01:10:30 UTC (rev 1653) @@ -41,7 +41,6 @@ #include "util/eventmanager.h" #include "engine/celbase.h" -#include "engine/netpersist.h" #include "engine/psworld.h" #include "bulkobjects/pscharacter.h" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mg...@us...> - 2008-06-14 11:36:26
|
Revision: 1755 http://planeshift.svn.sourceforge.net/planeshift/?rev=1755&view=rev Author: mgist Date: 2008-06-14 04:36:34 -0700 (Sat, 14 Jun 2008) Log Message: ----------- - Fixed permissions bugs in the updater. Modified Paths: -------------- trunk/src/common/util/fileutil.cpp trunk/src/pslaunch/updaterengine.cpp Modified: trunk/src/common/util/fileutil.cpp =================================================================== --- trunk/src/common/util/fileutil.cpp 2008-06-14 11:02:13 UTC (rev 1754) +++ trunk/src/common/util/fileutil.cpp 2008-06-14 11:36:34 UTC (rev 1755) @@ -108,10 +108,10 @@ #endif csString dir = directory; - csRef<iDataBuffer> real; + csRef<iDataBuffer> real = realPath; while(rc < 0) { - dir.Truncate(dir.FindLast('/')+1); + dir.Truncate(dir.FindLast('/')); if(vfs->Exists(directory)) { @@ -128,7 +128,7 @@ } #ifdef CS_PLATFORM_UNIX - dir.Truncate(dir.FindLast('/')+1); + dir.Truncate(dir.FindLast('/')); csRef<iDataBuffer> parent = vfs->GetRealPath(dir); csRef<FileStat> dirStat = StatFile(parent->GetData()); SetPermissions(real->GetData(), dirStat); @@ -147,7 +147,7 @@ { // Make parent dir if needed. csString parent = to; - MakeDirectory(parent.Truncate(parent.FindLast('/')+1)); + MakeDirectory(parent.Truncate(parent.FindLast('/'))); if(!buff) { Modified: trunk/src/pslaunch/updaterengine.cpp =================================================================== --- trunk/src/pslaunch/updaterengine.cpp 2008-06-14 11:02:13 UTC (rev 1754) +++ trunk/src/pslaunch/updaterengine.cpp 2008-06-14 11:36:34 UTC (rev 1755) @@ -1013,7 +1013,7 @@ // Make parent dir if needed. csString parent = downloadpath; - fileUtil->MakeDirectory(parent.Truncate(parent.FindLast('/')+1)); + fileUtil->MakeDirectory(parent.Truncate(parent.FindLast('/'))); // Download file. if(!downloader->DownloadFile(baseurl + failed.Get(i)->GetAttributeValue("path"), @@ -1027,21 +1027,21 @@ // Restore file. fileUtil->MoveFile(downloadpath + ".bak", downloadpath, true, false, true); PrintOutput("Failed!\n"); + continue; } } - +#ifdef CS_PLATFORM_UNIX // Restore permissions. if(fs.IsValid()) { -#ifdef CS_PLATFORM_UNIX bool failedEx = failedExec.Get(failed.Get(i), false); if(failedEx) { fs->mode = fs->mode | S_IXUSR | S_IXGRP; } -#endif fileUtil->SetPermissions(rp->GetData(), fs); } +#endif fileUtil->RemoveFile(downloadpath + ".bak", true); PrintOutput("Success!\n"); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ken...@us...> - 2008-06-17 01:00:49
|
Revision: 1766 http://planeshift.svn.sourceforge.net/planeshift/?rev=1766&view=rev Author: kennygraunke Date: 2008-06-16 18:00:56 -0700 (Mon, 16 Jun 2008) Log Message: ----------- Fix GLPYH typo. Modified Paths: -------------- trunk/src/client/gui/pawsglyphwindow.cpp trunk/src/common/net/messages.cpp trunk/src/common/net/messages.h trunk/src/server/spellmanager.cpp Modified: trunk/src/client/gui/pawsglyphwindow.cpp =================================================================== --- trunk/src/client/gui/pawsglyphwindow.cpp 2008-06-14 15:55:34 UTC (rev 1765) +++ trunk/src/client/gui/pawsglyphwindow.cpp 2008-06-17 01:00:56 UTC (rev 1766) @@ -97,7 +97,7 @@ if ( !msgHandler ) return false; // Subscribe our message types that we are interested in. - if ( !msgHandler->Subscribe( this, MSGTYPE_GLPYH_REQUEST ) ) return false; + if ( !msgHandler->Subscribe( this, MSGTYPE_GLYPH_REQUEST ) ) return false; if ( !msgHandler->Subscribe( this, MSGTYPE_GLYPH_ASSEMBLE ) ) return false; @@ -155,7 +155,7 @@ { switch( me->GetType() ) { - case MSGTYPE_GLPYH_REQUEST: + case MSGTYPE_GLYPH_REQUEST: { HandleGlyphList(me); break; Modified: trunk/src/common/net/messages.cpp =================================================================== --- trunk/src/common/net/messages.cpp 2008-06-14 15:55:34 UTC (rev 1765) +++ trunk/src/common/net/messages.cpp 2008-06-17 01:00:56 UTC (rev 1766) @@ -2876,7 +2876,7 @@ //-------------------------------------------------------------------------- -PSF_IMPLEMENT_MSG_FACTORY(psRequestGlyphsMessage,MSGTYPE_GLPYH_REQUEST); +PSF_IMPLEMENT_MSG_FACTORY(psRequestGlyphsMessage,MSGTYPE_GLYPH_REQUEST); psRequestGlyphsMessage::psRequestGlyphsMessage( uint32_t client ) { @@ -2885,7 +2885,7 @@ if ( client == 0 ) { msg.AttachNew(new MsgEntry()); - msg->SetType(MSGTYPE_GLPYH_REQUEST); + msg->SetType(MSGTYPE_GLYPH_REQUEST); msg->clientnum = client; } } @@ -2913,7 +2913,7 @@ void psRequestGlyphsMessage::Construct() { msg.AttachNew(new MsgEntry( size + sizeof(int) )); - msg->SetType(MSGTYPE_GLPYH_REQUEST); + msg->SetType(MSGTYPE_GLYPH_REQUEST); msg->clientnum = client; msg->Add( (uint32_t)glyphs.GetSize() ); Modified: trunk/src/common/net/messages.h =================================================================== --- trunk/src/common/net/messages.h 2008-06-14 15:55:34 UTC (rev 1765) +++ trunk/src/common/net/messages.h 2008-06-17 01:00:56 UTC (rev 1766) @@ -114,7 +114,7 @@ MSGTYPE_GUIGROUP, MSGTYPE_STATDRUPDATE, MSGTYPE_SPELL_BOOK, - MSGTYPE_GLPYH_REQUEST, + MSGTYPE_GLYPH_REQUEST, MSGTYPE_GLYPH_ASSEMBLE, MSGTYPE_PURIFY_GLYPH, MSGTYPE_SPELL_CAST, Modified: trunk/src/server/spellmanager.cpp =================================================================== --- trunk/src/server/spellmanager.cpp 2008-06-14 15:55:34 UTC (rev 1765) +++ trunk/src/server/spellmanager.cpp 2008-06-17 01:00:56 UTC (rev 1766) @@ -60,7 +60,7 @@ randomgen = psserver->rng; - psserver->GetEventManager()->Subscribe(this,MSGTYPE_GLPYH_REQUEST,REQUIRE_READY_CLIENT|REQUIRE_ALIVE); + psserver->GetEventManager()->Subscribe(this,MSGTYPE_GLYPH_REQUEST,REQUIRE_READY_CLIENT|REQUIRE_ALIVE); psserver->GetEventManager()->Subscribe(this,MSGTYPE_GLYPH_ASSEMBLE,REQUIRE_READY_CLIENT|REQUIRE_ALIVE); psserver->GetEventManager()->Subscribe(this,MSGTYPE_SPELL_CAST,REQUIRE_READY_CLIENT|REQUIRE_ALIVE); psserver->GetEventManager()->Subscribe(this,MSGTYPE_PURIFY_GLYPH,REQUIRE_READY_CLIENT|REQUIRE_ALIVE); @@ -84,7 +84,7 @@ { if (psserver->GetEventManager()) { - psserver->GetEventManager()->Unsubscribe(this,MSGTYPE_GLPYH_REQUEST); + psserver->GetEventManager()->Unsubscribe(this,MSGTYPE_GLYPH_REQUEST); psserver->GetEventManager()->Unsubscribe(this,MSGTYPE_GLYPH_ASSEMBLE); psserver->GetEventManager()->Unsubscribe(this,MSGTYPE_SPELL_CAST); psserver->GetEventManager()->Unsubscribe(this,MSGTYPE_PURIFY_GLYPH); @@ -114,7 +114,7 @@ SendSpellBook( client ); break; } - case MSGTYPE_GLPYH_REQUEST: + case MSGTYPE_GLYPH_REQUEST: { SendGlyphs( client ); break; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ken...@us...> - 2008-07-02 21:40:24
|
Revision: 1856 http://planeshift.svn.sourceforge.net/planeshift/?rev=1856&view=rev Author: kennygraunke Date: 2008-07-02 14:40:24 -0700 (Wed, 02 Jul 2008) Log Message: ----------- Clean up some abuse of booleans. (It's already true or false, you don't need to compare it...) Modified Paths: -------------- trunk/src/client/charapp.cpp trunk/src/client/chatbubbles.cpp trunk/src/client/gui/pawsactivemagicwindow.cpp trunk/src/client/gui/pawscharbirth.cpp trunk/src/client/gui/pawscharcreatemain.cpp trunk/src/client/gui/pawscharparents.cpp trunk/src/client/gui/pawschild.cpp trunk/src/client/gui/pawsgmaction.cpp trunk/src/client/gui/pawslife.cpp trunk/src/client/gui/pawsloginwindow.cpp trunk/src/client/gui/pawspetstatwindow.cpp trunk/src/client/gui/pawsskillwindow.cpp trunk/src/client/shadowmanager.cpp trunk/src/client/sound/pssoundmngr.cpp trunk/src/common/paws/pawsmanager.cpp trunk/src/common/paws/pawswidget.cpp trunk/src/pslaunch/pslaunch.cpp trunk/src/server/adminmanager.cpp trunk/src/server/advicemanager.cpp trunk/src/server/bulkobjects/dictionary.cpp trunk/src/server/bulkobjects/psinventorycachesvr.cpp trunk/src/server/bulkobjects/psnpcdialog.cpp trunk/src/server/bulkobjects/psspell.cpp trunk/src/server/chatmanager.cpp trunk/src/server/creationmanager.cpp trunk/src/server/economymanager.cpp trunk/src/server/exchangemanager.cpp trunk/src/server/gem.cpp trunk/src/server/guildmanager.cpp trunk/src/server/invitemanager.cpp trunk/src/server/progressionmanager.cpp trunk/src/server/spawnmanager.cpp trunk/src/server/usermanager.cpp Modified: trunk/src/client/charapp.cpp =================================================================== --- trunk/src/client/charapp.cpp 2008-07-02 21:16:43 UTC (rev 1855) +++ trunk/src/client/charapp.cpp 2008-07-02 21:40:24 UTC (rev 1856) @@ -225,24 +225,23 @@ void psCharAppearance::ShowHair(bool show) { - if ( show && hairAttached ) + if (show) { - return; + if (hairAttached) + return; + + state->AttachCoreMesh(hairMesh); + + if (colorSet) + HairColor(hairShader); + + hairAttached = true; } - else if ( show == false ) + else { state->DetachCoreMesh(hairMesh); hairAttached = false; } - else if ( show == true ) - { - state->AttachCoreMesh(hairMesh); - - if (colorSet) - HairColor(hairShader); - - hairAttached = true; - } } void psCharAppearance::SetSkinTone(csString& part, csString& material, csString& texture) Modified: trunk/src/client/chatbubbles.cpp =================================================================== --- trunk/src/client/chatbubbles.cpp 2008-07-02 21:16:43 UTC (rev 1855) +++ trunk/src/client/chatbubbles.cpp 2008-07-02 21:40:24 UTC (rev 1856) @@ -45,7 +45,6 @@ //#define DISABLE_CHAT_BUBBLES // Used to set default config files if the userdata ones are not found. -#define SAVE_USER true #define DEFAULT_FILE "/planeshift/data/options/chatbubbles_def.xml" #define USER_FILE "/planeshift/userdata/options/chatbubbles.xml" @@ -66,13 +65,7 @@ msgHandler = psengine->GetMsgHandler(); msgHandler->Subscribe(this, MSGTYPE_CHAT); - bool result = Load(USER_FILE); - if ( result == false ) - { - result = Load(DEFAULT_FILE, SAVE_USER); - } - - return true; + return (Load(USER_FILE) || Load(DEFAULT_FILE, true)); } bool psChatBubbles::Load(const char * filename, bool saveAgain) Modified: trunk/src/client/gui/pawsactivemagicwindow.cpp =================================================================== --- trunk/src/client/gui/pawsactivemagicwindow.cpp 2008-07-02 21:16:43 UTC (rev 1855) +++ trunk/src/client/gui/pawsactivemagicwindow.cpp 2008-07-02 21:40:24 UTC (rev 1856) @@ -63,7 +63,7 @@ psGUIActiveMagicMessage incoming(me); pawsListBox *list; - if ( !IsVisible() && incoming.openWindow == true && psengine->loadstate == psEngine::LS_DONE) + if (!IsVisible() && incoming.openWindow && psengine->loadstate == psEngine::LS_DONE) Show(); //buffCategories->Clear(); Modified: trunk/src/client/gui/pawscharbirth.cpp =================================================================== --- trunk/src/client/gui/pawscharbirth.cpp 2008-07-02 21:16:43 UTC (rev 1855) +++ trunk/src/client/gui/pawscharbirth.cpp 2008-07-02 21:40:24 UTC (rev 1856) @@ -241,8 +241,8 @@ { pawsWidget::Draw(); // Check to see if we are waiting for data from the server. Should have a waiting - // curser if this fails. - if ( dataLoaded == false && createManager->HasChildhoodData() ) + // cursor if this fails. + if (!dataLoaded && createManager->HasChildhoodData()) { PopulateFields(); dataLoaded = true; Modified: trunk/src/client/gui/pawscharcreatemain.cpp =================================================================== --- trunk/src/client/gui/pawscharcreatemain.cpp 2008-07-02 21:16:43 UTC (rev 1855) +++ trunk/src/client/gui/pawscharcreatemain.cpp 2008-07-02 21:40:24 UTC (rev 1856) @@ -200,14 +200,14 @@ case MSGTYPE_CHAR_CREATE_NAME: { - psNameCheckMessage msg; - msg.FromServer( me ); - if ( msg.accepted == false ) - { + psNameCheckMessage msg; + msg.FromServer(me); + if (!msg.accepted) + { PawsManager::GetSingleton().CreateWarningBox( msg.reason ); - } - else - { + } + else + { if ( newWindow.Length() > 0 ) { Hide(); Modified: trunk/src/client/gui/pawscharparents.cpp =================================================================== --- trunk/src/client/gui/pawscharparents.cpp 2008-07-02 21:16:43 UTC (rev 1855) +++ trunk/src/client/gui/pawscharparents.cpp 2008-07-02 21:40:24 UTC (rev 1856) @@ -150,8 +150,8 @@ pawsWidget::Draw(); // Check to see if we are waiting for data from the server. Should have a waiting - // curser if this fails. - if ( dataLoaded == false && createManager->HasParentData()) + // cursor if this fails. + if (!dataLoaded && createManager->HasParentData()) { PopulateFields(); dataLoaded = true; Modified: trunk/src/client/gui/pawschild.cpp =================================================================== --- trunk/src/client/gui/pawschild.cpp 2008-07-02 21:16:43 UTC (rev 1855) +++ trunk/src/client/gui/pawschild.cpp 2008-07-02 21:40:24 UTC (rev 1856) @@ -191,11 +191,11 @@ { pawsWidget::Draw(); // Check to see if we are waiting for data from the server. Should have a waiting - // curser if this fails. - if ( dataLoaded == false && createManager->HasChildhoodData() ) + // cursor if this fails. + if (!dataLoaded && createManager->HasChildhoodData()) { - PopulateFields(); - dataLoaded = true; + PopulateFields(); + dataLoaded = true; } } Modified: trunk/src/client/gui/pawsgmaction.cpp =================================================================== --- trunk/src/client/gui/pawsgmaction.cpp 2008-07-02 21:16:43 UTC (rev 1855) +++ trunk/src/client/gui/pawsgmaction.cpp 2008-07-02 21:40:24 UTC (rev 1856) @@ -123,7 +123,7 @@ //} break; case 103: // Use Full Mesh - if ( chkFullMesh->GetState() == true ) + if (chkFullMesh->GetState()) { txtPolygon->SetText( "0" ); txtPosX->SetText( "0" ); Modified: trunk/src/client/gui/pawslife.cpp =================================================================== --- trunk/src/client/gui/pawslife.cpp 2008-07-02 21:16:43 UTC (rev 1855) +++ trunk/src/client/gui/pawslife.cpp 2008-07-02 21:40:24 UTC (rev 1856) @@ -157,15 +157,11 @@ pawsWidget::Draw(); // Check to see if we are waiting for data from the server. Should have a waiting - // curser if this fails. - if ( dataLoaded == false ) + // cursor if this fails. + if (!dataLoaded && createManager->HasLifeEventData()) { + PopulateFields(); dataLoaded = true; - - if ( createManager->HasLifeEventData() ) - PopulateFields(); - else - dataLoaded = false; } } Modified: trunk/src/client/gui/pawsloginwindow.cpp =================================================================== --- trunk/src/client/gui/pawsloginwindow.cpp 2008-07-02 21:16:43 UTC (rev 1855) +++ trunk/src/client/gui/pawsloginwindow.cpp 2008-07-02 21:40:24 UTC (rev 1856) @@ -177,7 +177,7 @@ storedPasswd = cfg->GetStr(cfg_name, ""); } - if (storedPasswd.IsEmpty() == false) + if (!storedPasswd.IsEmpty()) passwd->SetText(ASTERISKS); else passwd->SetText(""); Modified: trunk/src/client/gui/pawspetstatwindow.cpp =================================================================== --- trunk/src/client/gui/pawspetstatwindow.cpp 2008-07-02 21:16:43 UTC (rev 1855) +++ trunk/src/client/gui/pawspetstatwindow.cpp 2008-07-02 21:40:24 UTC (rev 1856) @@ -139,7 +139,7 @@ case psPetSkillMessage::SKILL_LIST: { skillString = "no"; -// if ( !IsVisible() && incoming.openWindow == true ) +// if (!IsVisible() && incoming.openWindow) // Show(); skillString = incoming.commandData; HandleSkillList(skillString); Modified: trunk/src/client/gui/pawsskillwindow.cpp =================================================================== --- trunk/src/client/gui/pawsskillwindow.cpp 2008-07-02 21:16:43 UTC (rev 1855) +++ trunk/src/client/gui/pawsskillwindow.cpp 2008-07-02 21:40:24 UTC (rev 1856) @@ -328,7 +328,7 @@ case psGUISkillMessage::SKILL_LIST: { skillString = "no"; - if ( !IsVisible() && incoming.openWindow == true ) + if (!IsVisible() && incoming.openWindow) { Show(); } @@ -708,7 +708,7 @@ // If this is the first time the window is open then we need to get our // full list of faction information. - if ( factRequest == false ) + if (!factRequest) { psFactionMessage factionRequest(0, psFactionMessage::MSG_FULL_LIST); factionRequest.BuildMsg(); Modified: trunk/src/client/shadowmanager.cpp =================================================================== --- trunk/src/client/shadowmanager.cpp 2008-07-02 21:16:43 UTC (rev 1855) +++ trunk/src/client/shadowmanager.cpp 2008-07-02 21:40:24 UTC (rev 1856) @@ -132,7 +132,7 @@ void psShadowManager::CreateShadow(GEMClientObject * object) { - if (shadowsEnabled == false) + if (!shadowsEnabled) return; if (!object) @@ -182,7 +182,7 @@ void psShadowManager::RecreateAllShadows() { - if (shadowsEnabled == false) + if (!shadowsEnabled) return; const csPDelArray<GEMClientObject>& entities = psengine->GetCelClient()->GetEntities(); @@ -193,7 +193,7 @@ void psShadowManager::RemoveAllShadows() { - if (shadowsEnabled == false) + if (!shadowsEnabled) return; const csPDelArray<GEMClientObject>& entities = psengine->GetCelClient()->GetEntities(); @@ -215,7 +215,7 @@ void psShadowManager::UpdateShadows() { - if (shadowsEnabled == false) + if (!shadowsEnabled) return; const csPDelArray<GEMClientObject>& entities = psengine->GetCelClient()->GetEntities(); Modified: trunk/src/client/sound/pssoundmngr.cpp =================================================================== --- trunk/src/client/sound/pssoundmngr.cpp 2008-07-02 21:16:43 UTC (rev 1855) +++ trunk/src/client/sound/pssoundmngr.cpp 2008-07-02 21:40:24 UTC (rev 1856) @@ -1996,10 +1996,8 @@ void psSoundObject::Update() { - if ( fadeComplete == true ) - { + if (fadeComplete) return; - } csTicks currentTime = csGetTicks(); float diff = currentTime - startTime; @@ -2012,7 +2010,7 @@ Debug2( LOG_SOUND,0, "diff > fadeDelay for %s. Setting currentVolume to minVol.",GetName().GetData()); currentVolume = minVol; } - fadeComplete = true; + fadeComplete = true; } else { @@ -2041,12 +2039,12 @@ if ( currentVolume <= minVol && fadeDir == FADE_DOWN ) { - isPlaying = false; - stream.SetVolume(0.0f); + isPlaying = false; + stream.SetVolume(0.0f); } else { - stream.SetVolume( currentVolume * ambientVolume ); + stream.SetVolume(currentVolume * ambientVolume); } } Modified: trunk/src/common/paws/pawsmanager.cpp =================================================================== --- trunk/src/common/paws/pawsmanager.cpp 2008-07-02 21:16:43 UTC (rev 1855) +++ trunk/src/common/paws/pawsmanager.cpp 2008-07-02 21:40:24 UTC (rev 1856) @@ -747,7 +747,7 @@ return NULL; } - if ( widget->Load( widgetNode ) == false ) + if (!widget->Load(widgetNode)) { Error3("Widget %s failed to load %s", widget->GetName(), factory.GetData() ); delete widget; Modified: trunk/src/common/paws/pawswidget.cpp =================================================================== --- trunk/src/common/paws/pawswidget.cpp 2008-07-02 21:16:43 UTC (rev 1855) +++ trunk/src/common/paws/pawswidget.cpp 2008-07-02 21:40:24 UTC (rev 1856) @@ -179,14 +179,9 @@ */ pawsWidget* pawsWidget::WidgetAt( int x, int y ) { - if ( ignore ) + if (ignore || !Contains(x,y)) return NULL; - if ( Contains( x, y ) == false ) - { - return NULL; - } - //Recurse through children to see if they could the one the mouse is over. for (size_t z = 0; z < children.GetSize(); z++ ) { @@ -783,7 +778,7 @@ } // Let the widget parse the rest of the node information - if ( widget->Load( childWidgetNode ) == false ) + if (!widget->Load(childWidgetNode)) { Error1("Failed to load child widget"); return false; Modified: trunk/src/pslaunch/pslaunch.cpp =================================================================== --- trunk/src/pslaunch/pslaunch.cpp 2008-07-02 21:16:43 UTC (rev 1855) +++ trunk/src/pslaunch/pslaunch.cpp 2008-07-02 21:40:24 UTC (rev 1856) @@ -410,7 +410,7 @@ delete infoShare; infoShare = NULL; - if(execPSClient == true) + if (execPSClient) { // Execute psclient process. Modified: trunk/src/server/adminmanager.cpp =================================================================== --- trunk/src/server/adminmanager.cpp 2008-07-02 21:16:43 UTC (rev 1855) +++ trunk/src/server/adminmanager.cpp 2008-07-02 21:40:24 UTC (rev 1856) @@ -3863,7 +3863,7 @@ else valid = false; - if (valid == false || (data.value == 0 && data.random == 0)) + if (!valid || (data.value == 0 && data.random == 0)) { psserver->SendSystemError(me->clientnum, "Syntax: /money <circles|hexas|octas|trias> <random|quantity>"); return; Modified: trunk/src/server/advicemanager.cpp =================================================================== --- trunk/src/server/advicemanager.cpp 2008-07-02 21:16:43 UTC (rev 1855) +++ trunk/src/server/advicemanager.cpp 2008-07-02 21:40:24 UTC (rev 1856) @@ -560,7 +560,7 @@ else { // One unadvised unanswered question at a time - if ( ( activeSession->GetAdvisor() == NULL ) && ( activeSession->answered == false ) ) + if (!activeSession->GetAdvisor() && !activeSession->answered) { psserver->SendSystemError(advisee->GetClientNum(), "Please wait for an advisor to respond to your previous inquiry before asking another question."); return; Modified: trunk/src/server/bulkobjects/dictionary.cpp =================================================================== --- trunk/src/server/bulkobjects/dictionary.cpp 2008-07-02 21:16:43 UTC (rev 1855) +++ trunk/src/server/bulkobjects/dictionary.cpp 2008-07-02 21:40:24 UTC (rev 1856) @@ -1010,7 +1010,7 @@ } } - } while(hit == true); + } while (hit); } bool NpcTrigger::Load(iResultRow& row) @@ -1037,7 +1037,7 @@ { if (resp->quest || resp->prerequisite) { - if ( resp->quest && resp->quest->Active() == false ) + if (resp->quest && !resp->quest->Active()) { haveAvail = false; } Modified: trunk/src/server/bulkobjects/psinventorycachesvr.cpp =================================================================== --- trunk/src/server/bulkobjects/psinventorycachesvr.cpp 2008-07-02 21:16:43 UTC (rev 1855) +++ trunk/src/server/bulkobjects/psinventorycachesvr.cpp 2008-07-02 21:40:24 UTC (rev 1856) @@ -83,7 +83,7 @@ { bool slotOK = true; - for (int slot=0; slot<PSCHARACTER_SLOT_BULK_END && slotOK==true; slot++) + for (int slot = 0; slot < PSCHARACTER_SLOT_BULK_END && slotOK; slot++) { slotOK = ClearSlot((INVENTORY_SLOT_NUMBER)slot); } Modified: trunk/src/server/bulkobjects/psnpcdialog.cpp =================================================================== --- trunk/src/server/bulkobjects/psnpcdialog.cpp 2008-07-02 21:16:43 UTC (rev 1855) +++ trunk/src/server/bulkobjects/psnpcdialog.cpp 2008-07-02 21:40:24 UTC (rev 1856) @@ -567,7 +567,7 @@ } } depth++; - } while (hit == true); + } while (hit); return NULL; } Modified: trunk/src/server/bulkobjects/psspell.cpp =================================================================== --- trunk/src/server/bulkobjects/psspell.cpp 2008-07-02 21:16:43 UTC (rev 1855) +++ trunk/src/server/bulkobjects/psspell.cpp 2008-07-02 21:40:24 UTC (rev 1856) @@ -532,7 +532,7 @@ if (targetnpc) psserver->npcmanager->QueueAttackPerception(caster, targetnpc); } - if ( AffectTarget( event, effectName, offset, anchorID, affectedTargetID, affectText) == true ) + if (AffectTarget(event, effectName, offset, anchorID, affectedTargetID, affectText)) { affectedCount++; } Modified: trunk/src/server/chatmanager.cpp =================================================================== --- trunk/src/server/chatmanager.cpp 2008-07-02 21:16:43 UTC (rev 1855) +++ trunk/src/server/chatmanager.cpp 2008-07-02 21:40:24 UTC (rev 1856) @@ -331,9 +331,9 @@ } level = client->GetCharacterData()->GetGuildLevel(); - if (level!=NULL && level->HasRights(RIGHTS_CHAT)==false) + if (level && !level->HasRights(RIGHTS_CHAT)) { - psserver->SendSystemInfo(client->GetClientNum(), "You are not allowed to use chat channel of your guild."); + psserver->SendSystemInfo(client->GetClientNum(), "You are not allowed to use your guild's chat channel."); return; } Modified: trunk/src/server/creationmanager.cpp =================================================================== --- trunk/src/server/creationmanager.cpp 2008-07-02 21:16:43 UTC (rev 1855) +++ trunk/src/server/creationmanager.cpp 2008-07-02 21:40:24 UTC (rev 1856) @@ -804,7 +804,7 @@ csString error; - if ( psserver->charCreationManager->Validate( upload, error) == false ) + if (!psserver->charCreationManager->Validate(upload, error)) { error.Append(", your creation choices are invalid." ); psCharRejectedMessage reject(me->clientnum, @@ -889,7 +889,7 @@ } - if ( sectorFound == false ) + if (!sectorFound) { Error2("Unresolvable starting sector='%s'", sectorname ); psCharRejectedMessage reject(me->clientnum); Modified: trunk/src/server/economymanager.cpp =================================================================== --- trunk/src/server/economymanager.cpp 2008-07-02 21:16:43 UTC (rev 1855) +++ trunk/src/server/economymanager.cpp 2008-07-02 21:40:24 UTC (rev 1856) @@ -294,13 +294,13 @@ unsigned int mostv = 0; // Valuable for(unsigned int z = 0; z < items.GetSize();z++) { - if(items[z].count > items[mosts].count && items[z].sold == true) + if (items[z].count > items[mosts].count && items[z].sold) mosts = z; - if(items[z].count > items[mostb].count && items[z].sold == false) + if (items[z].count > items[mostb].count && !items[z].sold) mostb = z; - if(items[z].price > items[mostv].price) + if (items[z].price > items[mostv].price) mostv = z; } Modified: trunk/src/server/exchangemanager.cpp =================================================================== --- trunk/src/server/exchangemanager.cpp 2008-07-02 21:16:43 UTC (rev 1855) +++ trunk/src/server/exchangemanager.cpp 2008-07-02 21:40:24 UTC (rev 1856) @@ -1348,7 +1348,7 @@ target = client->GetTargetObject(); - if ( target->IsAlive() == false ) + if (!target->IsAlive()) { psserver->SendSystemError(client->GetClientNum(), "Cannot give items to dead things!"); return; Modified: trunk/src/server/gem.cpp =================================================================== --- trunk/src/server/gem.cpp 2008-07-02 21:16:43 UTC (rev 1855) +++ trunk/src/server/gem.cpp 2008-07-02 21:40:24 UTC (rev 1856) @@ -654,7 +654,7 @@ gemObject::~gemObject() { // Assert on any dublicate delete - assert(valid == true); + assert(valid); valid = false; Disconnect(); Modified: trunk/src/server/guildmanager.cpp =================================================================== --- trunk/src/server/guildmanager.cpp 2008-07-02 21:16:43 UTC (rev 1855) +++ trunk/src/server/guildmanager.cpp 2008-07-02 21:40:24 UTC (rev 1856) @@ -1716,7 +1716,7 @@ return; } - bool new_secrecy_value = (msg.secret == "on"); + const bool new_secrecy_value = (msg.secret == "on"); // Only update the database if the value is really being changed. if (new_secrecy_value != guild->IsSecret() ) @@ -1737,7 +1737,7 @@ // If secrecy is on send a message to all others clearing guild name // else send a message to all others to show the guild name. - if ( new_secrecy_value == true ) + if (new_secrecy_value) { // Turn label off for everybody psUpdatePlayerGuildMessage update( @@ -1762,8 +1762,6 @@ guild->GetName() ); psserver->GetEventManager()->Broadcast(update.msg,NetBase::BC_EVERYONE); } - - } void GuildManager::Web(psGuildCmdMessage &msg, Client *client) Modified: trunk/src/server/invitemanager.cpp =================================================================== --- trunk/src/server/invitemanager.cpp 2008-07-02 21:16:43 UTC (rev 1855) +++ trunk/src/server/invitemanager.cpp 2008-07-02 21:40:24 UTC (rev 1856) @@ -139,7 +139,7 @@ csTicks ban = INVITESPAMBANTIME[inviter->GetSpamPoints()-1]*60*1000; - if (inviter->GetSpamPoints() && inviter->GetLastInviteResult() == false && now < then + ban) + if (inviter->GetSpamPoints() && !inviter->GetLastInviteResult() && now < then + ban) { // Warn the player, if not done already this session if (inviter->GetSpamPoints() >= 2 && !inviter->HasBeenWarned()) Modified: trunk/src/server/progressionmanager.cpp =================================================================== --- trunk/src/server/progressionmanager.cpp 2008-07-02 21:16:43 UTC (rev 1855) +++ trunk/src/server/progressionmanager.cpp 2008-07-02 21:40:24 UTC (rev 1856) @@ -165,12 +165,12 @@ } else { - if (word.CompareNoCase( "target" ) == true ) + if (word.CompareNoCase("target")) { str.ReplaceSubString( word, target->GetName() ); str.DeleteAt( where ); } - else if (word.CompareNoCase( "actor" ) == true ) + else if (word.CompareNoCase("actor")) { str.ReplaceSubString( word, actor->GetName() ); str.DeleteAt( where ); Modified: trunk/src/server/spawnmanager.cpp =================================================================== --- trunk/src/server/spawnmanager.cpp 2008-07-02 21:16:43 UTC (rev 1855) +++ trunk/src/server/spawnmanager.cpp 2008-07-02 21:40:24 UTC (rev 1856) @@ -1490,7 +1490,7 @@ void LootRandomizer::AddLootModifier(LootModifier *entry) { - if ( entry->modifier_type.CompareNoCase( "prefix" ) == true ) + if (entry->modifier_type.CompareNoCase("prefix")) { prefixes.Push( entry ); if (entry->probability > prefix_max) @@ -1498,7 +1498,7 @@ prefix_max = entry->probability; } } - else if ( entry->modifier_type.CompareNoCase( "suffix" ) == true ) + else if (entry->modifier_type.CompareNoCase("suffix")) { suffixes.Push( entry ); if (entry->probability > suffix_max) @@ -1506,7 +1506,7 @@ suffix_max = entry->probability; } } - else if ( entry->modifier_type.CompareNoCase( "adjective" ) == true ) + else if (entry->modifier_type.CompareNoCase("adjective")) { adjectives.Push( entry ); if (entry->probability > adjective_max) @@ -1577,17 +1577,17 @@ LootModifier *lootModifier = NULL; csArray<LootModifier *> *modifierList = NULL; - if ( modifierType.CompareNoCase( "prefix" ) == true ) + if (modifierType.CompareNoCase("prefix")) { modifierList = &prefixes; max_probability=(int)prefix_max; } - else if ( modifierType.CompareNoCase( "suffix" ) == true ) + else if (modifierType.CompareNoCase("suffix")) { modifierList = &suffixes; max_probability=(int)suffix_max; } - else if ( modifierType.CompareNoCase( "adjective" ) == true ) + else if (modifierType.CompareNoCase("adjective")) { modifierList = &adjectives; max_probability=(int)adjective_max; @@ -1654,19 +1654,19 @@ { csString newName; // Change Name - if ( oper2->modifier_type.CompareNoCase( "prefix" ) == true ) + if (oper2->modifier_type.CompareNoCase("prefix")) { newName.Append( oper2->name ); newName.Append( " " ); newName.Append( oper1->name ); } - else if ( oper2->modifier_type.CompareNoCase( "suffix" ) == true ) + else if (oper2->modifier_type.CompareNoCase("suffix")) { newName.Append( oper1->name ); newName.Append( " " ); newName.Append( oper2->name ); } - else if ( oper2->modifier_type.CompareNoCase( "adjective" ) == true ) + else if (oper2->modifier_type.CompareNoCase("adjective")) { newName.Append( oper2->name ); newName.Append( " " ); Modified: trunk/src/server/usermanager.cpp =================================================================== --- trunk/src/server/usermanager.cpp 2008-07-02 21:16:43 UTC (rev 1855) +++ trunk/src/server/usermanager.cpp 2008-07-02 21:40:24 UTC (rev 1856) @@ -1317,7 +1317,7 @@ psserver->SendSystemError(clientnum,"You cannot attack %s.", (const char*)target->GetName() ); return; } - if ( target->IsAlive() == false ) + if (!target->IsAlive()) { psserver->SendSystemError(clientnum,"%s is already dead.", (const char*)target->GetName() ); return; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |