Skip to content

Commit

Permalink
[6908] Faster setting online=0 at startup and semilar queries.
Browse files Browse the repository at this point in the history
Signed-off-by: VladimirMangos <vladimir@getmangos.com>
  • Loading branch information
balrok authored and VladimirMangos committed Dec 14, 2008
1 parent c648427 commit 76d2f86
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/game/Level2.cpp
Expand Up @@ -3137,7 +3137,7 @@ bool ChatHandler::HandleWpShowCommand(const char* args)
}
}while(result->NextRow());
// set "wpguid" column to "empty" - no visual waypoint spawned
WorldDatabase.PExecuteLog("UPDATE creature_movement SET wpguid = '0'");
WorldDatabase.PExecuteLog("UPDATE creature_movement SET wpguid = '0' WHERE wpguid <> '0'");

if( hasError )
{
Expand Down
2 changes: 1 addition & 1 deletion src/game/Level3.cpp
Expand Up @@ -4564,7 +4564,7 @@ bool ChatHandler::HandleResetAllCommand(const char * args)
return false;
}

CharacterDatabase.PExecute("UPDATE characters SET at_login = at_login | '%u'",atLogin);
CharacterDatabase.PExecute("UPDATE characters SET at_login = at_login | '%u' WHERE (at_login & '%u') = '0'",atLogin,atLogin);
HashMapHolder<Player>::MapType const& plist = ObjectAccessor::Instance().GetPlayers();
for(HashMapHolder<Player>::MapType::const_iterator itr = plist.begin(); itr != plist.end(); ++itr)
itr->second->SetAtLoginFlag(atLogin);
Expand Down
2 changes: 1 addition & 1 deletion src/mangosd/Master.cpp
Expand Up @@ -459,7 +459,7 @@ void Master::clearOnlineAccounts()
"AND id IN (SELECT acctid FROM realmcharacters WHERE realmid = '%d')",realmID);


CharacterDatabase.Execute("UPDATE characters SET online = 0");
CharacterDatabase.Execute("UPDATE characters SET online = 0 WHERE online<>0");
}

/// Handle termination signals
Expand Down
2 changes: 1 addition & 1 deletion src/shared/revision_nr.h
@@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__
#define __REVISION_NR_H__
#define REVISION_NR "6907"
#define REVISION_NR "6908"
#endif // __REVISION_NR_H__

0 comments on commit 76d2f86

Please sign in to comment.