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


C++ PreparedStatement::setUInt64方法代码示例

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


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

示例1: SaveToDB

void GmTicket::SaveToDB(SQLTransaction& trans) const
{
    uint8 index = 0;
    PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_REP_GM_TICKET);
    stmt->setUInt32(index, _ticketId);
    stmt->setUInt64(++index, GUID_LOPART(_playerGuid));
    stmt->setString(++index, _playerName);
    stmt->setString(++index, _message);
    stmt->setUInt32(++index, _ticketCreateTime);
    stmt->setUInt16(++index, _mapId);
    stmt->setFloat(++index, _pos.x);
    stmt->setFloat(++index, _pos.y);
    stmt->setFloat(++index, _pos.z);
    stmt->setUInt32(++index, uint32(_lastModifiedTime));
    stmt->setInt64(++index, GUID_LOPART(_closedBy));
    stmt->setUInt64(++index, GUID_LOPART(_assignedTo));
    stmt->setString(++index, _comment);
    stmt->setString(++index, _response);
    stmt->setBool(++index, _completed);
    stmt->setUInt8(++index, uint8(_escalatedStatus));
    stmt->setBool(++index, _viewed);
    stmt->setBool(++index, _haveTicket);

    CharacterDatabase.ExecuteOrAppend(trans, stmt);
}
开发者ID:ProjectSkyfire,项目名称:SkyFire.548,代码行数:25,代码来源:TicketInfo.cpp

示例2: PlaceBid

void BlackMarketEntry::PlaceBid(uint64 bid, Player* player, SQLTransaction& trans)   //Updated
{
    if (bid < _currentBid)
        return;

    _currentBid = bid;
    ++_numBids;

    if (GetSecondsRemaining() < 30 * MINUTE)
        _secondsRemaining += 30 * MINUTE;

    _bidder = player->GetGUID().GetCounter();

    player->ModifyMoney(-static_cast<int64>(bid));


    PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_BLACKMARKET_AUCTIONS);

    stmt->setUInt64(0, _currentBid);
    stmt->setInt32(1, GetExpirationTime());
    stmt->setInt32(2, _numBids);
    stmt->setUInt64(3, _bidder);
    stmt->setInt32(4, _marketId);

    trans->Append(stmt);

    sBlackMarketMgr->Update(true);
}
开发者ID:Diyvol,项目名称:TrinityCore,代码行数:28,代码来源:BlackMarketMgr.cpp

示例3: DeleteFromDB

void Corpse::DeleteFromDB(ObjectGuid const& ownerGuid, SQLTransaction& trans)
{
    PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CORPSE);
    stmt->setUInt64(0, ownerGuid.GetCounter());
    CharacterDatabase.ExecuteOrAppend(trans, stmt);

    stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CORPSE_PHASES);
    stmt->setUInt64(0, ownerGuid.GetCounter());
    CharacterDatabase.ExecuteOrAppend(trans, stmt);
}
开发者ID:doriangray2,项目名称:TrinityCore-devil,代码行数:10,代码来源:Corpse.cpp

示例4: SaveToDB

void BlackMarketEntry::SaveToDB(SQLTransaction& trans) const
{
    PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_BLACKMARKET_AUCTIONS);

    stmt->setInt32(0, _marketId);
    stmt->setUInt64(1, _currentBid);
    stmt->setInt32(2, GetExpirationTime());
    stmt->setInt32(3, _numBids);
    stmt->setUInt64(4, _bidder);

    trans->Append(stmt);
}
开发者ID:Diyvol,项目名称:TrinityCore,代码行数:12,代码来源:BlackMarketMgr.cpp

示例5: UpdateInvite

void CalendarMgr::UpdateInvite(CalendarInvite* invite, SQLTransaction& trans)
{
    PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_REP_CALENDAR_INVITE);
    stmt->setUInt64(0, invite->GetInviteId());
    stmt->setUInt64(1, invite->GetEventId());
    stmt->setUInt32(2, invite->GetInviteeGUID().GetCounter());
    stmt->setUInt32(3, invite->GetSenderGUID().GetCounter());
    stmt->setUInt8(4, invite->GetStatus());
    stmt->setUInt32(5, uint32(invite->GetStatusTime()));
    stmt->setUInt8(6, invite->GetRank());
    stmt->setString(7, invite->GetText());
    CharacterDatabase.ExecuteOrAppend(trans, stmt);
}
开发者ID:ElunaLuaEngine,项目名称:ElunaTrinityWotlk,代码行数:13,代码来源:CalendarMgr.cpp

示例6: SaveToDB

void PlayerAchievementMgr::SaveToDB(SQLTransaction& trans)
{
    if (!_completedAchievements.empty())
    {
        for (auto iter = _completedAchievements.begin(); iter != _completedAchievements.end(); ++iter)
        {
            if (!iter->second.Changed)
                continue;

            PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_ACHIEVEMENT_BY_ACHIEVEMENT);
            stmt->setUInt32(0, iter->first);
            stmt->setUInt64(1, _owner->GetGUID().GetCounter());
            trans->Append(stmt);

            stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_CHAR_ACHIEVEMENT);
            stmt->setUInt64(0, _owner->GetGUID().GetCounter());
            stmt->setUInt32(1, iter->first);
            stmt->setUInt32(2, uint32(iter->second.Date));
            trans->Append(stmt);

            iter->second.Changed = false;
        }
    }

    if (!_criteriaProgress.empty())
    {
        for (auto iter = _criteriaProgress.begin(); iter != _criteriaProgress.end(); ++iter)
        {
            if (!iter->second.Changed)
                continue;

            PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_ACHIEVEMENT_PROGRESS_BY_CRITERIA);
            stmt->setUInt64(0, _owner->GetGUID().GetCounter());
            stmt->setUInt32(1, iter->first);
            trans->Append(stmt);

            if (iter->second.Counter)
            {
                stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_CHAR_ACHIEVEMENT_PROGRESS);
                stmt->setUInt64(0, _owner->GetGUID().GetCounter());
                stmt->setUInt32(1, iter->first);
                stmt->setUInt64(2, iter->second.Counter);
                stmt->setUInt32(3, uint32(iter->second.Date));
                trans->Append(stmt);
            }

            iter->second.Changed = false;
        }
    }
}
开发者ID:090809,项目名称:TrinityCore,代码行数:50,代码来源:AchievementMgr.cpp

示例7: DeleteFromDB

void QuestObjectiveCriteriaMgr::DeleteFromDB(ObjectGuid const& guid)
{
    SQLTransaction trans = CharacterDatabase.BeginTransaction();

    PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_QUESTSTATUS_OBJECTIVES_CRITERIA);
    stmt->setUInt64(0, guid.GetCounter());
    trans->Append(stmt);

    stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_QUESTSTATUS_OBJECTIVES_CRITERIA_PROGRESS);
    stmt->setUInt64(0, guid.GetCounter());
    trans->Append(stmt);

    CharacterDatabase.CommitTransaction(trans);
}
开发者ID:brecky,项目名称:TrinityCore,代码行数:14,代码来源:QuestObjectiveCriteriaMgr.cpp

示例8: DeleteFromDB

void PlayerAchievementMgr::DeleteFromDB(ObjectGuid const& guid)
{
    SQLTransaction trans = CharacterDatabase.BeginTransaction();

    PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_ACHIEVEMENT);
    stmt->setUInt64(0, guid.GetCounter());
    trans->Append(stmt);

    stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_ACHIEVEMENT_PROGRESS);
    stmt->setUInt64(0, guid.GetCounter());
    trans->Append(stmt);

    CharacterDatabase.CommitTransaction(trans);
}
开发者ID:090809,项目名称:TrinityCore,代码行数:14,代码来源:AchievementMgr.cpp

示例9: UpdateInvite

void CalendarMgr::UpdateInvite(CalendarInvite* invite)
{
    SQLTransaction trans = CharacterDatabase.BeginTransaction();
    PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_REP_CALENDAR_INVITE);
    stmt->setUInt64(0, invite->GetInviteId());
    stmt->setUInt64(1, invite->GetEventId());
    stmt->setUInt32(2, GUID_LOPART(invite->GetInviteeGUID()));
    stmt->setUInt32(3, GUID_LOPART(invite->GetSenderGUID()));
    stmt->setUInt8(4, invite->GetStatus());
    stmt->setUInt32(5, uint32(invite->GetStatusTime()));
    stmt->setUInt8(6, invite->GetRank());
    stmt->setString(7, invite->GetText());
    trans->Append(stmt);
    CharacterDatabase.CommitTransaction(trans);
}
开发者ID:ter884,项目名称:TER-Server,代码行数:15,代码来源:CalendarMgr.cpp

示例10: SaveToDB

void AuctionEntry::SaveToDB(SQLTransaction& trans) const
{
    PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_AUCTION);
    stmt->setUInt32(0, Id);
    stmt->setUInt32(1, auctioneer);
    stmt->setUInt32(2, itemGUIDLow);
    stmt->setUInt32(3, owner);
    stmt->setUInt64 (4, buyout);
    stmt->setUInt64(5, uint64(expire_time));
    stmt->setUInt32(6, bidder);
    stmt->setUInt64 (7, bid);
    stmt->setUInt64 (8, startbid);
    stmt->setInt32 (9, int32(deposit));
    trans->Append(stmt);
}
开发者ID:Cailiaock,项目名称:5.4.7-Wow-source,代码行数:15,代码来源:AuctionHouseMgr.cpp

示例11: HandleResetSpellsCommand

    static bool HandleResetSpellsCommand(ChatHandler* handler, char const* args)
    {
        Player* target;
        ObjectGuid targetGuid;
        std::string targetName;
        if (!handler->extractPlayerTarget((char*)args, &target, &targetGuid, &targetName))
            return false;

        if (target)
        {
            target->ResetSpells(/* bool myClassOnly */);

            ChatHandler(target->GetSession()).SendSysMessage(LANG_RESET_SPELLS);
            if (!handler->GetSession() || handler->GetSession()->GetPlayer() != target)
                handler->PSendSysMessage(LANG_RESET_SPELLS_ONLINE, handler->GetNameLink(target).c_str());
        }
        else
        {
            PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_ADD_AT_LOGIN_FLAG);
            stmt->setUInt16(0, uint16(AT_LOGIN_RESET_SPELLS));
            stmt->setUInt64(1, targetGuid.GetCounter());
            CharacterDatabase.Execute(stmt);

            handler->PSendSysMessage(LANG_RESET_SPELLS_OFFLINE, targetName.c_str());
        }

        return true;
    }
开发者ID:joinjold,项目名称:TrinityCore,代码行数:28,代码来源:cs_reset.cpp

示例12: HandleCharacterLevel

    static void HandleCharacterLevel(Player* player, ObjectGuid playerGuid, uint32 oldLevel, uint32 newLevel, ChatHandler* handler)
    {
        if (player)
        {
            player->GiveLevel(newLevel);
            player->InitTalentForLevel();
            player->SetUInt32Value(PLAYER_XP, 0);

            if (handler->needReportToTarget(player))
            {
                if (oldLevel == newLevel)
                    ChatHandler(player->GetSession()).PSendSysMessage(LANG_YOURS_LEVEL_PROGRESS_RESET, handler->GetNameLink().c_str());
                else if (oldLevel < newLevel)
                    ChatHandler(player->GetSession()).PSendSysMessage(LANG_YOURS_LEVEL_UP, handler->GetNameLink().c_str(), newLevel);
                else                                                // if (oldlevel > newlevel)
                    ChatHandler(player->GetSession()).PSendSysMessage(LANG_YOURS_LEVEL_DOWN, handler->GetNameLink().c_str(), newLevel);
            }
        }
        else
        {
            // Update level and reset XP, everything else will be updated at login
            PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_LEVEL);
            stmt->setUInt8(0, uint8(newLevel));
            stmt->setUInt64(1, playerGuid.GetCounter());
            CharacterDatabase.Execute(stmt);
        }
    }
开发者ID:Palabola,项目名称:WoD,代码行数:27,代码来源:cs_character.cpp

示例13: HandleCharacterDeletedRestoreHelper

    /**
    * Restore a previously deleted character
    *
    * @see HandleCharacterDeletedListHelper
    * @see HandleCharacterDeletedRestoreCommand
    * @see HandleCharacterDeletedDeleteCommand
    * @see DeletedInfoList
    *
    * @param delInfo the informations about the character which will be restored
    */
    static void HandleCharacterDeletedRestoreHelper(DeletedInfo const& delInfo, ChatHandler* handler)
    {
        if (delInfo.accountName.empty())                    // account not exist
        {
            handler->PSendSysMessage(LANG_CHARACTER_DELETED_SKIP_ACCOUNT, delInfo.name.c_str(), delInfo.guid.ToString().c_str(), delInfo.accountId);
            return;
        }

        // check character count
        uint32 charcount = AccountMgr::GetCharactersCount(delInfo.accountId);
        if (charcount >= sWorld->getIntConfig(CONFIG_CHARACTERS_PER_REALM))
        {
            handler->PSendSysMessage(LANG_CHARACTER_DELETED_SKIP_FULL, delInfo.name.c_str(), delInfo.guid.ToString().c_str(), delInfo.accountId);
            return;
        }

        if (!ObjectMgr::GetPlayerGUIDByName(delInfo.name).IsEmpty())
        {
            handler->PSendSysMessage(LANG_CHARACTER_DELETED_SKIP_NAME, delInfo.name.c_str(), delInfo.guid.ToString().c_str(), delInfo.accountId);
            return;
        }

        PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_RESTORE_DELETE_INFO);
        stmt->setString(0, delInfo.name);
        stmt->setUInt32(1, delInfo.accountId);
        stmt->setUInt64(2, delInfo.guid.GetCounter());
        CharacterDatabase.Execute(stmt);

        sWorld->UpdateCharacterInfoDeleted(delInfo.guid, false, &delInfo.name);
    }
开发者ID:Palabola,项目名称:WoD,代码行数:40,代码来源:cs_character.cpp

示例14: RemoveInvite

void CalendarMgr::RemoveInvite(uint64 inviteId, uint64 eventId, ObjectGuid /*remover*/)
{
    CalendarEvent* calendarEvent = GetEvent(eventId);

    if (!calendarEvent)
        return;

    CalendarInviteStore::iterator itr = _invites[eventId].begin();
    for (; itr != _invites[eventId].end(); ++itr)
        if ((*itr)->GetInviteId() == inviteId)
            break;

    if (itr == _invites[eventId].end())
        return;

    SQLTransaction trans = CharacterDatabase.BeginTransaction();
    PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CALENDAR_INVITE);
    stmt->setUInt64(0, (*itr)->GetInviteId());
    trans->Append(stmt);
    CharacterDatabase.CommitTransaction(trans);

    if (!calendarEvent->IsGuildEvent())
        SendCalendarEventInviteRemoveAlert((*itr)->GetInviteeGUID(), *calendarEvent, CALENDAR_STATUS_REMOVED);

    SendCalendarEventInviteRemove(*calendarEvent, **itr, calendarEvent->GetFlags());

    // we need to find out how to use CALENDAR_INVITE_REMOVED_MAIL_SUBJECT to force client to display different mail
    //if ((*itr)->GetInviteeGUID() != remover)
    //    MailDraft(calendarEvent->BuildCalendarMailSubject(remover), calendarEvent->BuildCalendarMailBody())
    //        .SendMailTo(trans, MailReceiver((*itr)->GetInvitee()), calendarEvent, MAIL_CHECK_MASK_COPIED);

    delete *itr;
    _invites[eventId].erase(itr);
}
开发者ID:ElunaLuaEngine,项目名称:ElunaTrinityWotlk,代码行数:34,代码来源:CalendarMgr.cpp

示例15: HandleDeclinePetition

void WorldSession::HandleDeclinePetition(WorldPackets::Petition::DeclinePetition& packet)
{
    TC_LOG_DEBUG("network", "Petition %s declined by %s", packet.PetitionGUID.ToString().c_str(), _player->GetGUID().ToString().c_str());

    PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_PETITION_OWNER_BY_GUID);
    stmt->setUInt64(0, packet.PetitionGUID.GetCounter());
    PreparedQueryResult result = CharacterDatabase.Query(stmt);

    if (!result)
        return;

    Field* fields = result->Fetch();
    ObjectGuid ownerguid = ObjectGuid::Create<HighGuid::Player>(fields[0].GetUInt64());

    Player* owner = ObjectAccessor::FindConnectedPlayer(ownerguid);
    if (owner)                                               // petition owner online
    {
        // Disabled because packet isn't handled by the client in any way
        /*
        WorldPackets::Petition::PetitionDeclined packet;
        packet.Decliner = _player->GetGUID();
        owner->GetSession()->SendPacket(packet.Write());
        */
    }
}
开发者ID:beyourself,项目名称:DeathCore_6.x,代码行数:25,代码来源:PetitionsHandler.cpp


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