summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorFreeyorp <Freeyorp101@hotmail.com>2010-09-19 03:25:48 +1200
committerFreeyorp <Freeyorp101@hotmail.com>2010-09-19 05:49:07 +1200
commit2683da54614b9930857b8a7689e7ea0457ed6ef4 (patch)
tree307e650a1d989917f7b9eee40c4d82e95a6f8ad7 /src
parentf75f98e4cc483a3a0f2019c4bb5f3a18461c4ac2 (diff)
downloadmanaserv-2683da54614b9930857b8a7689e7ea0457ed6ef4.tar.gz
manaserv-2683da54614b9930857b8a7689e7ea0457ed6ef4.tar.bz2
manaserv-2683da54614b9930857b8a7689e7ea0457ed6ef4.tar.xz
manaserv-2683da54614b9930857b8a7689e7ea0457ed6ef4.zip
Small fixes.
There is no longer any need to send attribute change information for character or correction point changes to the account server. This is now handled elsewhere in a dedicated function. The account server was already doing this but the game server hadn't been updated. This wasn't causing any major problems since this data was being sent at the end of the packet. Update documentation for the functions accordingly. Also adjust a misplaced opening curly brace in attribute calculation which could cause modifiers to be applied wrongly in certain cases. Reviewed-by: Kage
Diffstat (limited to 'src')
-rw-r--r--src/game-server/accountconnection.cpp6
-rw-r--r--src/game-server/accountconnection.hpp9
-rw-r--r--src/game-server/attribute.cpp4
-rw-r--r--src/game-server/gamehandler.cpp8
4 files changed, 11 insertions, 16 deletions
diff --git a/src/game-server/accountconnection.cpp b/src/game-server/accountconnection.cpp
index 1a35587e..128e3df0 100644
--- a/src/game-server/accountconnection.cpp
+++ b/src/game-server/accountconnection.cpp
@@ -348,17 +348,13 @@ void AccountConnection::syncChanges(bool force)
}
void AccountConnection::updateCharacterPoints(int charId, int charPoints,
- int corrPoints,
- int attribId,
- int attribValue)
+ int corrPoints)
{
mSyncMessages++;
mSyncBuffer->writeByte(SYNC_CHARACTER_POINTS);
mSyncBuffer->writeLong(charId);
mSyncBuffer->writeLong(charPoints);
mSyncBuffer->writeLong(corrPoints);
- mSyncBuffer->writeByte(attribId);
- mSyncBuffer->writeLong(attribValue);
syncChanges();
}
diff --git a/src/game-server/accountconnection.hpp b/src/game-server/accountconnection.hpp
index e2b793b1..28599f82 100644
--- a/src/game-server/accountconnection.hpp
+++ b/src/game-server/accountconnection.hpp
@@ -126,12 +126,15 @@ class AccountConnection : public Connection
* @param charId ID of the character
* @param charPoints character points left for the character
* @param corrPoints correction points left for the character
+ */
+ void updateCharacterPoints(int charId, int charPoints,
+ int corrPoints);
+
+ /**
+ * @param charId ID of the character
* @param attribId ID of the modified attribute
* @param attribValue New value of the modified attribute
*/
- void updateCharacterPoints(int charId, int charPoints,
- int corrPoints, int attribId,
- int attribValue);
void updateAttributes(int charId, int attrId, double base,
double mod);
diff --git a/src/game-server/attribute.cpp b/src/game-server/attribute.cpp
index 37ac07b5..0feb1fd0 100644
--- a/src/game-server/attribute.cpp
+++ b/src/game-server/attribute.cpp
@@ -179,8 +179,8 @@ void AttributeModifiersEffect::updateMod(double value)
bool AttributeModifiersEffect::recalculateModifiedValue(double newPrevLayerValue)
{
double oldValue = mCacheVal;
- switch (mEType)
- case AME_ADD: {
+ switch (mEType) {
+ case AME_ADD:
switch (mSType) {
case TY_ST:
case TY_NSTB:
diff --git a/src/game-server/gamehandler.cpp b/src/game-server/gamehandler.cpp
index 95478d82..15214a78 100644
--- a/src/game-server/gamehandler.cpp
+++ b/src/game-server/gamehandler.cpp
@@ -543,9 +543,7 @@ void GameHandler::processMessage(NetComputer *comp, MessageIn &message)
accountHandler->updateCharacterPoints(
computer.character->getDatabaseID(),
computer.character->getCharacterPoints(),
- computer.character->getCorrectionPoints(),
- attribute,
- computer.character->getAttribute(attribute));
+ computer.character->getCorrectionPoints());
// log transaction
std::stringstream str;
@@ -569,9 +567,7 @@ void GameHandler::processMessage(NetComputer *comp, MessageIn &message)
accountHandler->updateCharacterPoints(
computer.character->getDatabaseID(),
computer.character->getCharacterPoints(),
- computer.character->getCorrectionPoints(),
- attribute,
- computer.character->getAttribute(attribute));
+ computer.character->getCorrectionPoints());
// log transaction
std::stringstream str;