From 19a7d334af71a1e70281d3b2b6602d291dd82960 Mon Sep 17 00:00:00 2001 From: Bertram Date: Sat, 24 Oct 2009 13:22:27 +0200 Subject: Don't log the sitting/standing action change transaction. Mantis #950. --- src/game-server/gamehandler.cpp | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/src/game-server/gamehandler.cpp b/src/game-server/gamehandler.cpp index 1c2e4f94..055b8d80 100644 --- a/src/game-server/gamehandler.cpp +++ b/src/game-server/gamehandler.cpp @@ -389,29 +389,41 @@ void GameHandler::processMessage(NetComputer *comp, MessageIn &message) { Being::Action action = (Being::Action)message.readByte(); Being::Action current = (Being::Action)computer.character->getAction(); + bool logActionChange = true; switch (action) { case Being::STAND: { if (current == Being::SIT) + { computer.character->setAction(Being::STAND); + logActionChange = false; + } } break; case Being::SIT: { if (current == Being::STAND) + { computer.character->setAction(Being::SIT); + logActionChange = false; + } } break; default: break; } - // log transaction - std::stringstream str; - str << "User changed action from " << current - << " to " << action; - accountHandler->sendTransaction(computer.character->getDatabaseID(), - TRANS_ACTION_CHANGE, str.str()); + // Log the action change only when this is relevant. + if (logActionChange) + { + // log transaction + std::stringstream str; + str << "User changed action from " << current + << " to " << action; + accountHandler->sendTransaction( + computer.character->getDatabaseID(), + TRANS_ACTION_CHANGE, str.str()); + } } break; -- cgit v1.2.3-70-g09d2