diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-12-16 13:24:04 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-12-16 13:24:04 +0300 |
commit | 320fd14cf5ec9197f8c12b9bd69536d3a62528ef (patch) | |
tree | 70db69272ad1cafc1bdaa68bca0695cab5789442 /src/net | |
parent | dfec4a0e4425870cbe1a8d4075102768d2a0dd5c (diff) | |
download | manaplus-320fd14cf5ec9197f8c12b9bd69536d3a62528ef.tar.gz manaplus-320fd14cf5ec9197f8c12b9bd69536d3a62528ef.tar.bz2 manaplus-320fd14cf5ec9197f8c12b9bd69536d3a62528ef.tar.xz manaplus-320fd14cf5ec9197f8c12b9bd69536d3a62528ef.zip |
eathena: remove packet SMSG_PLAYER_MOVE.
Diffstat (limited to 'src/net')
-rw-r--r-- | src/net/eathena/beinghandler.cpp | 157 | ||||
-rw-r--r-- | src/net/eathena/beinghandler.h | 2 |
2 files changed, 0 insertions, 159 deletions
diff --git a/src/net/eathena/beinghandler.cpp b/src/net/eathena/beinghandler.cpp index d49fc145e..c79384268 100644 --- a/src/net/eathena/beinghandler.cpp +++ b/src/net/eathena/beinghandler.cpp @@ -90,7 +90,6 @@ BeingHandler::BeingHandler(const bool enableSync) : SMSG_BEING_CHANGE_DIRECTION, SMSG_PLAYER_UPDATE_1, SMSG_PLAYER_UPDATE_2, - SMSG_PLAYER_MOVE, SMSG_PLAYER_STOP, SMSG_PLAYER_MOVE_TO_ATTACK, SMSG_PLAYER_STATUS_CHANGE, @@ -238,10 +237,6 @@ void BeingHandler::handleMessage(Net::MessageIn &msg) processPlayerUpdate2(msg); break; - case SMSG_PLAYER_MOVE: - processPlayerMove(msg); - break; - case SMSG_PLAYER_STOP: processPlayerStop(msg); break; @@ -796,158 +791,6 @@ void BeingHandler::processPlayerUpdate2(Net::MessageIn &msg) statusEffects & 0xffffU)); } -void BeingHandler::processPlayerMove(Net::MessageIn &msg) -{ - if (!actorManager || !localPlayer) - return; - - // An update about a player, potentially including movement. - const int id = msg.readInt32("account id"); - const int16_t speed = msg.readInt16("speed"); - const uint16_t stunMode = msg.readInt16("opt1"); - uint32_t statusEffects = msg.readInt16("opt2"); - statusEffects |= (static_cast<uint16_t>(msg.readInt16("options"))) << 16U; - const int16_t job = msg.readInt16("class"); - int disguiseId = 0; - if (id < 110000000 && job >= 1000) - disguiseId = job; - - Being *dstBeing = actorManager->findBeing(id); - - if (!dstBeing) - { - if (actorManager->isBlocked(id) == true) - return; - - dstBeing = createBeing(id, job); - - if (!dstBeing) - return; - } - else if (disguiseId) - { - actorManager->undelete(dstBeing); - if (serverVersion < 1) - beingHandler->requestNameById(id); - } - - const uint8_t dir = dstBeing->getDirectionDelayed(); - if (dir) - { - if (dir != dstBeing->getDirection()) - dstBeing->setDirection(dir); - } - - if (Party *const party = localPlayer->getParty()) - { - if (party->isMember(id)) - dstBeing->setParty(party); - } - - dstBeing->setWalkSpeed(Vector(speed, speed, 0)); - dstBeing->setSubtype(job, 0); - - const int hairStyle = msg.readInt16("hair style"); - const uint16_t weapon = msg.readInt16("weapon"); - const uint16_t shield = msg.readInt16("shield"); - const uint16_t headBottom = msg.readInt16("head bottom"); - - msg.readInt32("tick"); - - const uint16_t headTop = msg.readInt16("head top"); - const uint16_t headMid = msg.readInt16("head mid"); - const int hairColor = msg.readInt16("hair color"); - - msg.readUInt8("unused?"); - msg.readUInt8("unused?"); - msg.readUInt8("unused?"); - msg.readUInt8("unused?"); - - const int guild = msg.readInt32("guild"); - - if (!guildManager || !GuildManager::getEnableGuildBot()) - { - if (guild == 0) - dstBeing->clearGuilds(); - else - dstBeing->setGuild(Guild::getGuild(static_cast<int16_t>(guild))); - } - - msg.readInt16("emblem"); - dstBeing->setManner(msg.readInt16("manner")); - dstBeing->setStatusEffectBlock(32, msg.readInt16("opt3")); - dstBeing->setKarma(msg.readUInt8("karma")); - dstBeing->setGender(Being::intToGender(msg.readUInt8("gender"))); - - if (!disguiseId) - { - // Set these after the gender, as the sprites may be gender-specific - dstBeing->updateSprite(SPRITE_BODY, weapon, "", 1, true); - if (!mHideShield) - dstBeing->updateSprite(SPRITE_FLOOR, shield); - dstBeing->updateSprite(SPRITE_WEAPON, headBottom); - dstBeing->updateSprite(SPRITE_HEAD_BOTTOM, headMid); - dstBeing->updateSprite(SPRITE_CLOTHES_COLOR, headTop); - dstBeing->updateSprite(SPRITE_HAIR_COLOR, hairStyle * -1, - ItemDB::get(-hairStyle).getDyeColorsString(hairColor)); - } - localPlayer->imitateOutfit(dstBeing); - - uint16_t srcX, srcY, dstX, dstY; - msg.readCoordinatePair(srcX, srcY, dstX, dstY, "move path"); - msg.readUInt8("(sx<<4) | (sy&0x0f)"); - - localPlayer->followMoveTo(dstBeing, srcX, srcY, dstX, dstY); - - dstBeing->setTileCoords(srcX, srcY); - dstBeing->setDestination(dstX, dstY); - - // because server don't send direction in move packet, - // we fixing it - - if (srcX != dstX || srcY != dstY) - { - const int d = dstBeing->calcDirection(dstX, dstY); - - if (d && dstBeing->getDirection() != d) - dstBeing->setDirectionDelayed(static_cast<uint8_t>(d)); - } - - if (localPlayer->getCurrentAction() != BeingAction::STAND) - localPlayer->imitateAction(dstBeing, BeingAction::STAND); - if (localPlayer->getDirection() != dstBeing->getDirection()) - { - localPlayer->imitateDirection(dstBeing, - dstBeing->getDirection()); - } - - const uint16_t gmstatus = msg.readInt16("gm status"); - - if (gmstatus & 0x80) - dstBeing->setGM(true); - - msg.readUInt8("unknown?"); - - const int level = static_cast<int>(msg.readUInt8("level")); - - if (level) - dstBeing->setLevel(level); - - msg.readUInt8("unknown"); - - if (dstBeing->getType() != ActorType::Player) - dstBeing->setActionTime(tick_time); - - dstBeing->setStunMode(stunMode); - dstBeing->setStatusEffectBlock(0, static_cast<uint16_t>( - (statusEffects >> 16) & 0xffffU)); - dstBeing->setStatusEffectBlock(16, static_cast<uint16_t>( - statusEffects & 0xffffU)); - - if (dstBeing->getType() == ActorType::Player) - dstBeing->setMoveTime(); -} - void BeingHandler::processBeingVisible(Net::MessageIn &msg) { if (!actorManager) diff --git a/src/net/eathena/beinghandler.h b/src/net/eathena/beinghandler.h index cb5c5d6a4..2ec4fb2d1 100644 --- a/src/net/eathena/beinghandler.h +++ b/src/net/eathena/beinghandler.h @@ -65,8 +65,6 @@ class BeingHandler final : public MessageHandler, public Ea::BeingHandler static void processPlayerUpdate2(Net::MessageIn &msg); - static void processPlayerMove(Net::MessageIn &msg); - static void processMapTypeProperty(Net::MessageIn &msg); static void processMapType(Net::MessageIn &msg); |