本文整理汇总了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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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;
}
}
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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;
}
示例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);
}
}
示例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);
}
示例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);
}
示例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());
*/
}
}