diff options
author | Thorbjørn Lindeijer <thorbjorn@lindeijer.nl> | 2010-11-03 23:15:47 +0100 |
---|---|---|
committer | Thorbjørn Lindeijer <thorbjorn@lindeijer.nl> | 2010-11-03 23:27:30 +0100 |
commit | b7f58023d6596d96c36b904c02a81e0b52fc28f1 (patch) | |
tree | 7a10a72c7e8fa9ca99e98a913704c76fe5bfe5f9 /src/game-server/character.cpp | |
parent | 0de400f87b7ecc4bcbdbd1f3dfd552c60c5e927b (diff) | |
download | manaserv-b7f58023d6596d96c36b904c02a81e0b52fc28f1.tar.gz manaserv-b7f58023d6596d96c36b904c02a81e0b52fc28f1.tar.xz manaserv-b7f58023d6596d96c36b904c02a81e0b52fc28f1.zip |
Renamed write{Byte,Short,Long} to writeInt{8,16,32}
Mainly for consistency with the client, and the general consensus was
that these numbered versions were clearer.
Diffstat (limited to 'src/game-server/character.cpp')
-rw-r--r-- | src/game-server/character.cpp | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/src/game-server/character.cpp b/src/game-server/character.cpp index 1bb8ffa..4e8fe03 100644 --- a/src/game-server/character.cpp +++ b/src/game-server/character.cpp @@ -78,7 +78,7 @@ Character::Character(MessageIn &msg): mAttributes.insert(std::make_pair(it1->first, Attribute(*it1->second))); // Get character data. - mDatabaseID = msg.readLong(); + mDatabaseID = msg.readInt32(); setName(msg.readString()); deserializeCharacterData(*this, msg); mOld = getPosition(); @@ -234,10 +234,10 @@ void Character::sendSpecialUpdate() { MessageOut msg(GPMSG_SPECIAL_STATUS ); - msg.writeByte(i->first); - msg.writeLong(i->second->currentMana); - msg.writeLong(i->second->neededMana); - msg.writeLong(mRechargePerSpecial); + msg.writeInt8(i->first); + msg.writeInt32(i->second->currentMana); + msg.writeInt32(i->second->neededMana); + msg.writeInt32(mRechargePerSpecial); /* Yes, the last one is redundant because it is the same for each special, but I would like to keep the netcode flexible enough to allow different recharge speed per special when necessary */ @@ -321,9 +321,9 @@ void Character::sendStatus() i_end = mModifiedAttributes.end(); i != i_end; ++i) { int attr = *i; - attribMsg.writeShort(attr); - attribMsg.writeLong(getAttribute(attr) * 256); - attribMsg.writeLong(getModifiedAttribute(attr) * 256); + attribMsg.writeInt16(attr); + attribMsg.writeInt32(getAttribute(attr) * 256); + attribMsg.writeInt32(getModifiedAttribute(attr) * 256); } if (attribMsg.getLength() > 2) gameHandler->sendTo(this, attribMsg); mModifiedAttributes.clear(); @@ -333,9 +333,9 @@ void Character::sendStatus() i_end = mModifiedExperience.end(); i != i_end; ++i) { int skill = *i; - expMsg.writeShort(skill); - expMsg.writeLong(getExpGot(skill)); - expMsg.writeLong(getExpNeeded(skill)); + expMsg.writeInt16(skill); + expMsg.writeInt32(getExpGot(skill)); + expMsg.writeInt32(getExpNeeded(skill)); } if (expMsg.getLength() > 2) gameHandler->sendTo(this, expMsg); mModifiedExperience.clear(); @@ -344,7 +344,7 @@ void Character::sendStatus() { mUpdateLevelProgress = false; MessageOut progressMessage(GPMSG_LEVEL_PROGRESS); - progressMessage.writeByte(mLevelProgress); + progressMessage.writeInt8(mLevelProgress); gameHandler->sendTo(this, progressMessage); } } @@ -604,9 +604,9 @@ void Character::levelup() mCorrectionPoints = CORRECTIONPOINTS_MAX; MessageOut levelupMsg(GPMSG_LEVELUP); - levelupMsg.writeShort(mLevel); - levelupMsg.writeShort(mCharacterPoints); - levelupMsg.writeShort(mCorrectionPoints); + levelupMsg.writeInt16(mLevel); + levelupMsg.writeInt16(mCharacterPoints); + levelupMsg.writeInt16(mCorrectionPoints); gameHandler->sendTo(this, levelupMsg); LOG_INFO(getName()<<" reached level "<<mLevel); } |