Beispiel #1
0
void Player::SendItemPushResult(bool created, bool recieved, bool sendtoset, bool newitem, uint8 destbagslot, uint32 destslot, uint32 count, uint32 entry, uint32 suffix, uint32 randomprop, uint32 stack)
{
    WorldPacket data(SMSG_ITEM_PUSH_RESULT, 8 + 4 + 4 + 4 + 1 + 4 + 4 + 4 + 4 + 4 + 4);
    data << uint64(GetGUID());

    if (recieved)
        data << uint32(1);
    else
        data << uint32(0);

    if (created)
        data << uint32(1);
    else
        data << uint32(0);

    data << uint32(1);
    data << uint8(destbagslot);

    if (newitem)
        data << uint32(destslot);
    else
        data << uint32(-1);

    data << uint32(entry);
    data << uint32(suffix);
    data << uint32(randomprop);
    data << uint32(count);
    data << uint32(stack);

    if (sendtoset && InGroup())
        GetGroup()->SendPacketToAll(&data);
    else
        m_session->SendPacket(&data);

}
Beispiel #2
0
void Player::SendRaidDifficulty()
{
    WorldPacket data(MSG_SET_RAID_DIFFICULTY, 12);
    data << uint32(m_RaidDifficulty);
    data << uint32(1);
    data << uint32(InGroup());

    m_session->SendPacket(&data);
}
Beispiel #3
0
void Player::SendDungeonDifficulty()
{
    WorldPacket data(MSG_SET_DUNGEON_DIFFICULTY, 12);
    data << uint32(iInstanceType);
    data << uint32(1);
    data << uint32(InGroup());

    m_session->SendPacket(&data);
}
Beispiel #4
0
String Capstone::OperandText(int opindex) const
{
    if(opindex >= mInstr->detail->x86.op_count)
        return "";
    const auto & op = mInstr->detail->x86.operands[opindex];
    String result;
    char temp[32] = "";
    switch(op.type)
    {
    case X86_OP_REG:
    {
        result = RegName(x86_reg(op.reg));
    }
    break;

    case X86_OP_IMM:
    {
        if(InGroup(CS_GRP_JUMP) || InGroup(CS_GRP_CALL) || IsLoop())
            sprintf_s(temp, "%" fext "X", op.imm + mInstr->size);
        else
            sprintf_s(temp, "%" fext "X", op.imm);
        result = temp;
    }
    break;

    case X86_OP_MEM:
    {
        const auto & mem = op.mem;
        if(op.mem.base == X86_REG_RIP)  //rip-relative
        {
            sprintf_s(temp, "%" fext "X", mInstr->address + op.mem.disp + mInstr->size);
            result += temp;
        }
        else //normal
        {
            bool prependPlus = false;
            if(mem.base)
            {
                result += RegName(x86_reg(mem.base));
                prependPlus = true;
            }
            if(mem.index)
            {
                if(prependPlus)
                    result += "+";
                result += RegName(x86_reg(mem.index));
                sprintf_s(temp, "*%X", mem.scale);
                result += temp;
                prependPlus = true;
            }
            if(mem.disp)
            {
                char operatorText = '+';
                if(mem.disp < 0)
                {
                    operatorText = '-';
                    sprintf_s(temp, "%" fext "X", mem.disp * -1);
                }
                else
                    sprintf_s(temp, "%" fext "X", mem.disp);
                if(prependPlus)
                    result += operatorText;
                result += temp;
            }
        }
    }
    break;

    case X86_OP_FP:
    case X86_OP_INVALID:
    {
    }
    break;
    }
    return result;
}