当前位置: 首页>>代码示例>>C++>>正文


C++ MovementInfo::ReadFromPacket方法代码示例

本文整理汇总了C++中MovementInfo::ReadFromPacket方法的典型用法代码示例。如果您正苦于以下问题:C++ MovementInfo::ReadFromPacket方法的具体用法?C++ MovementInfo::ReadFromPacket怎么用?C++ MovementInfo::ReadFromPacket使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在MovementInfo的用法示例。


在下文中一共展示了MovementInfo::ReadFromPacket方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: HandleMovementOpcodes

void WorldSession::HandleMovementOpcodes(WorldPacket& recvPacket)
{
    MovementInfo info;
    info.ReadFromPacket(recvPacket);

    //Stop Emote
    if (GetPlayer()->GetUInt32Value(UNIT_NPC_EMOTESTATE))
        GetPlayer()->HandleEmoteCommand(0);

    HandleMovementInfo(info, recvPacket.GetOpcode(), recvPacket.size(), _player->m_mover);
}
开发者ID:Tithand,项目名称:TER-Server,代码行数:11,代码来源:MovementHandler.cpp

示例2: HandleMoveWaterWalkAck

void WorldSession::HandleMoveWaterWalkAck(WorldPacket& recvPacket)
{
	sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_MOVE_WATER_WALK_ACK");

	MovementInfo info;
	info.ReadFromPacket(recvPacket);

	recvPacket.read_skip<uint32>();                           // unk

	MovementInfo movementInfo;
	GetPlayer()->ReadMovementInfo(recvPacket, &movementInfo);

	recvPacket.read_skip<uint32>();                           // unk2
}
开发者ID:Tithand,项目名称:TER-Server,代码行数:14,代码来源:MovementHandler.cpp

示例3: HandleMovementUnrootAck

void WorldSession::HandleMovementUnrootAck(WorldPacket& recvPacket)
{
    MovementInfo info;
    info.ReadFromPacket(recvPacket);
    
    // skip old result
    if (_player->m_movement_ack[ACK_UNROOT] != info.ackCount)
    {
        recvPacket.rfinish();
        return;
    }

    HandleMovementInfo(info, recvPacket.GetOpcode(), recvPacket.size()-4, _player->m_mover);
}
开发者ID:Tithand,项目名称:TER-Server,代码行数:14,代码来源:MovementHandler.cpp

示例4: HandleDismissControlledVehicle

void WorldSession::HandleDismissControlledVehicle(WorldPacket &recvData)
{
    sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recvd CMSG_DISMISS_CONTROLLED_VEHICLE");

    uint64 vehicleGUID = _player->GetCharmGUID();

    if (!vehicleGUID)                                       // something wrong here...
    {
        recvData.rfinish();                                // prevent warnings spam
        return;
    }

    MovementInfo mi;
    mi.ReadFromPacket(recvData);
    mi.Sanitize(_player);

    _player->m_movementInfo = mi;

    _player->ExitVehicle();
}
开发者ID:beyourself,项目名称:Wow-4.3.4,代码行数:20,代码来源:VehicleHandler.cpp

示例5: HandleMovementSpeedChangeAck

void WorldSession::HandleMovementSpeedChangeAck(WorldPacket& recvPacket)
{
    UnitMoveType moveType;
    bool updatePacketNotKnown = false;

    switch (recvPacket.GetOpcode())
    {
        case CMSG_MOVE_FORCE_WALK_SPEED_CHANGE_ACK: moveType = MOVE_WALK; break;
        case CMSG_MOVE_FORCE_RUN_SPEED_CHANGE_ACK: moveType = MOVE_RUN; break;
        case CMSG_MOVE_FORCE_RUN_BACK_SPEED_CHANGE_ACK: moveType = MOVE_RUN_BACK; break;
        case CMSG_MOVE_FORCE_SWIM_SPEED_CHANGE_ACK: moveType = MOVE_SWIM; break;
        case CMSG_MOVE_FORCE_SWIM_BACK_SPEED_CHANGE_ACK: moveType = MOVE_SWIM_BACK; break;
        case CMSG_MOVE_FORCE_TURN_RATE_CHANGE_ACK: moveType = MOVE_TURN_RATE; updatePacketNotKnown = true; break;
        case CMSG_MOVE_FORCE_FLIGHT_SPEED_CHANGE_ACK: moveType = MOVE_FLIGHT; break;
        case CMSG_MOVE_FORCE_FLIGHT_BACK_SPEED_CHANGE_ACK: moveType = MOVE_FLIGHT_BACK; updatePacketNotKnown = true; break;
        case CMSG_MOVE_FORCE_PITCH_RATE_CHANGE_ACK: moveType = MOVE_PITCH_RATE; updatePacketNotKnown = true; break;
        default:
            sLog->outInfo(LOG_FILTER_BAD_OPCODE_HANDLER, "WorldSession::HandleMovementSpeedChangeAck for unknown opcode: %s", GetOpcodeNameForLogging(recvPacket.GetOpcode()).c_str());
            return;
    }

    MovementInfo info;
    info.ReadFromPacket(recvPacket);

    // skip old result
    if (_player->m_forced_speed_changes[moveType] != info.ackCount)
    {
        recvPacket.rfinish();
        return;
    }
        
    if (!_player->GetTransport() && fabs(_player->GetSpeed(moveType) - info.ackSpeed) > 0.01f)
    {
        if (_player->GetSpeed(moveType) > info.ackSpeed)
            _player->SetSpeed(moveType, _player->GetSpeedRate(moveType), true);

        recvPacket.rfinish();
        return;
    }

    // TODO: Find all structure (remove me)
    if (updatePacketNotKnown)
    {
        WorldPacket data;
        switch (moveType)
        {
            case MOVE_TURN_RATE:
                data.Initialize(SMSG_MOVE_SET_TURN_RATE, 1 + 8 + 4 + 4);
                info.WriteToPacket(data);
                _player->SendMessageToSet(&data, _player);
                break;
            case MOVE_FLIGHT_BACK:
                data.Initialize(SMSG_MOVE_SET_FLIGHT_BACK_SPEED, 1 + 8 + 4 + 4);
                info.WriteToPacket(data);
                _player->SendMessageToSet(&data, _player);
                break;
            case MOVE_PITCH_RATE:
                data.Initialize(SMSG_MOVE_SET_PITCH_RATE, 1 + 8 + 4 + 4);
                info.WriteToPacket(data);
                _player->SendMessageToSet(&data, _player);
                break;
            default:
                break;
        }
    }

    HandleMovementInfo(info, recvPacket.GetOpcode(), recvPacket.size()-4, _player->m_mover);
}
开发者ID:Tithand,项目名称:TER-Server,代码行数:68,代码来源:MovementHandler.cpp


注:本文中的MovementInfo::ReadFromPacket方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。