本文整理汇总了C++中CalendarEvent::SetEventTime方法的典型用法代码示例。如果您正苦于以下问题:C++ CalendarEvent::SetEventTime方法的具体用法?C++ CalendarEvent::SetEventTime怎么用?C++ CalendarEvent::SetEventTime使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CalendarEvent
的用法示例。
在下文中一共展示了CalendarEvent::SetEventTime方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: HandleCalendarCopyEvent
void WorldSession::HandleCalendarCopyEvent(WorldPacket& recvData)
{
uint64 guid = _player->GetGUID();
uint64 eventId;
uint64 inviteId;
uint32 time;
recvData >> eventId >> inviteId;
recvData.ReadPackedTime(time);
sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_CALENDAR_COPY_EVENT [" UI64FMTD "], EventId [" UI64FMTD
"] inviteId [" UI64FMTD "] Time: %u", guid, eventId, inviteId, time);
if (CalendarEvent* oldEvent = sCalendarMgr->GetEvent(eventId))
{
CalendarEvent* newEvent = new CalendarEvent(*oldEvent, sCalendarMgr->GetFreeEventId());
newEvent->SetEventTime(time_t(time));
sCalendarMgr->AddEvent(newEvent, CALENDAR_SENDTYPE_COPY);
std::vector<CalendarInvite*> invites = sCalendarMgr->GetEventInvites(eventId);
for (std::vector<CalendarInvite*>::const_iterator itr = invites.begin(); itr != invites.end(); ++itr)
sCalendarMgr->AddInvite(newEvent, new CalendarInvite(**itr, sCalendarMgr->GetFreeInviteId(), newEvent->GetEventId()));
// should we change owner when somebody makes a copy of event owned by another person?
}
else
sCalendarMgr->SendCalendarCommandResult(guid, CALENDAR_ERROR_EVENT_INVALID);
}
示例2: HandleCalendarCopyEvent
void WorldSession::HandleCalendarCopyEvent(WorldPacket& recvData)
{
uint64 guid = _player->GetGUID();
uint64 eventId;
uint64 inviteId;
uint32 time;
recvData >> eventId >> inviteId;
recvData.ReadPackedTime(time);
TC_LOG_DEBUG("network", "CMSG_CALENDAR_COPY_EVENT [" UI64FMTD "], EventId [" UI64FMTD
"] inviteId [" UI64FMTD "] Time: %u", guid, eventId, inviteId, time);
if (CalendarEvent* oldEvent = sCalendarMgr->GetEvent(eventId))
{
CalendarEvent* newEvent = new CalendarEvent(*oldEvent, sCalendarMgr->GetFreeEventId());
newEvent->SetEventTime(time_t(time));
sCalendarMgr->AddEvent(newEvent, CALENDAR_SENDTYPE_COPY);
CalendarInviteStore invites = sCalendarMgr->GetEventInvites(eventId);
SQLTransaction trans;
if (invites.size() > 1)
trans = CharacterDatabase.BeginTransaction();
for (CalendarInviteStore::const_iterator itr = invites.begin(); itr != invites.end(); ++itr)
sCalendarMgr->AddInvite(newEvent, new CalendarInvite(**itr, sCalendarMgr->GetFreeInviteId(), newEvent->GetEventId()), trans);
if (invites.size() > 1)
CharacterDatabase.CommitTransaction(trans);
// should we change owner when somebody makes a copy of event owned by another person?
}
else
sCalendarMgr->SendCalendarCommandResult(guid, CALENDAR_ERROR_EVENT_INVALID);
}
示例3: HandleCalendarCopyEvent
void WorldSession::HandleCalendarCopyEvent(WorldPacket& recvData)
{
uint64 guid = _player->GetGUID();
uint64 eventId;
uint64 inviteId;
uint32 time;
recvData >> eventId >> inviteId;
recvData.ReadPackedTime(time);
if (CalendarEvent* oldEvent = sCalendarMgr->GetEvent(eventId))
{
CalendarEvent* newEvent = new CalendarEvent(*oldEvent, sCalendarMgr->GetFreeEventId());
newEvent->SetEventTime(time_t(time));
sCalendarMgr->AddEvent(newEvent, CALENDAR_SENDTYPE_COPY);
CalendarInviteStore invites = sCalendarMgr->GetEventInvites(eventId);
for (CalendarInviteStore::const_iterator itr = invites.begin(); itr != invites.end(); ++itr)
sCalendarMgr->AddInvite(newEvent, new CalendarInvite(**itr, sCalendarMgr->GetFreeInviteId(), newEvent->GetEventId()));
// should we change owner when somebody makes a copy of event owned by another person?
}
else
sCalendarMgr->SendCalendarCommandResult(guid, CALENDAR_ERROR_EVENT_INVALID);
}
示例4: HandleCalendarCopyEvent
void WorldSession::HandleCalendarCopyEvent(WorldPacket& recvData)
{
ObjectGuid guid = _player->GetGUID();
uint64 eventId;
uint64 inviteId;
uint32 eventTime;
recvData >> eventId >> inviteId;
recvData.ReadPackedTime(eventTime);
TC_LOG_DEBUG("network", "CMSG_CALENDAR_COPY_EVENT [%s], EventId [" UI64FMTD
"] inviteId [" UI64FMTD "] Time: %u", guid.ToString().c_str(), eventId, inviteId, eventTime);
// prevent events in the past
// To Do: properly handle timezones and remove the "- time_t(86400L)" hack
if (time_t(eventTime) < (time(NULL) - time_t(86400L)))
{
recvData.rfinish();
return;
}
if (CalendarEvent* oldEvent = sCalendarMgr->GetEvent(eventId))
{
CalendarEvent* newEvent = new CalendarEvent(*oldEvent, sCalendarMgr->GetFreeEventId());
newEvent->SetEventTime(time_t(eventTime));
sCalendarMgr->AddEvent(newEvent, CALENDAR_SENDTYPE_COPY);
CalendarInviteStore invites = sCalendarMgr->GetEventInvites(eventId);
SQLTransaction trans;
if (invites.size() > 1)
trans = CharacterDatabase.BeginTransaction();
for (CalendarInviteStore::const_iterator itr = invites.begin(); itr != invites.end(); ++itr)
sCalendarMgr->AddInvite(newEvent, new CalendarInvite(**itr, sCalendarMgr->GetFreeInviteId(), newEvent->GetEventId()), trans);
if (invites.size() > 1)
CharacterDatabase.CommitTransaction(trans);
// should we change owner when somebody makes a copy of event owned by another person?
}
else
sCalendarMgr->SendCalendarCommandResult(guid, CALENDAR_ERROR_EVENT_INVALID);
}