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


C++ CalendarEvent::GetTimeZoneTime方法代码示例

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


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

示例1: SendCalendarEvent

void CalendarMgr::SendCalendarEvent(uint64 guid, CalendarEvent const& calendarEvent, CalendarSendEventType sendType)
{
    Player* player = ObjectAccessor::FindPlayer(guid);
    if (!player)
        return;

	CalendarInviteStore const& eventInviteeList = _invites[calendarEvent.GetEventId()];

    WorldPacket data(SMSG_CALENDAR_SEND_EVENT, 60 + eventInviteeList.size() * 32);
    data << uint8(sendType);
    data.appendPackGUID(calendarEvent.GetCreatorGUID());
    data << uint64(calendarEvent.GetEventId());
    data << calendarEvent.GetTitle();
    data << calendarEvent.GetDescription();
    data << uint8(calendarEvent.GetType());
    data << uint8(CALENDAR_REPEAT_NEVER);   // repeatable
    data << uint32(CALENDAR_MAX_INVITES);
    data << int32(calendarEvent.GetDungeonId());
    data << uint32(calendarEvent.GetFlags());
    data.AppendPackedTime(calendarEvent.GetEventTime());
    data.AppendPackedTime(calendarEvent.GetTimeZoneTime());

    Guild* guild = sGuildMgr->GetGuildById(calendarEvent.GetGuildId());
    data << uint64(guild ? guild->GetGUID() : 0);

    data << uint32(eventInviteeList.size());
	for (CalendarInviteStore::const_iterator itr = eventInviteeList.begin(); itr != eventInviteeList.end(); ++itr)
	{
        CalendarInvite const* calendarInvite = (*itr);
        uint64 inviteeGuid = calendarInvite->GetInviteeGUID();
        Player* invitee = ObjectAccessor::FindPlayer(inviteeGuid);

        uint8 inviteeLevel = invitee ? invitee->getLevel() : Player::GetLevelFromDB(inviteeGuid);
        uint32 inviteeGuildId = invitee ? invitee->GetGuildId() : Player::GetGuildIdFromDB(inviteeGuid);

        data.appendPackGUID(inviteeGuid);
        data << uint8(inviteeLevel);
        data << uint8(calendarInvite->GetStatus());
        data << uint8(calendarInvite->GetRank());
        data << uint8(calendarEvent.IsGuildEvent() && calendarEvent.GetGuildId() == inviteeGuildId);
        data << uint64(calendarInvite->GetInviteId());
        data.AppendPackedTime(calendarInvite->GetStatusTime());
        data << calendarInvite->GetText();
    }

    player->SendDirectMessage(&data);
}
开发者ID:ter884,项目名称:TER-Server,代码行数:47,代码来源:CalendarMgr.cpp

示例2: AddAction

void CalendarMgr::AddAction(CalendarAction const& action)
{
    switch (action.GetAction())
    {
        case CALENDAR_ACTION_ADD_EVENT:
        {
            if (AddEvent(action.Event) && AddInvite(action.Invite))
            {
                SendCalendarEventInviteAlert(action.Event, action.Invite);
                SendCalendarEvent(action.Event, CALENDAR_SENDTYPE_ADD);
            }
            break;
        }
        case CALENDAR_ACTION_MODIFY_EVENT:
        {
            uint64 eventId = action.Event.GetEventId();
            CalendarEvent* calendarEvent = CheckPermisions(eventId,
                action.GetGUID(), action.GetInviteId(), CALENDAR_RANK_MODERATOR);

            if (!calendarEvent)
                return;

            calendarEvent->SetEventId(action.Event.GetEventId());
            calendarEvent->SetType(action.Event.GetType());
            calendarEvent->SetFlags(action.Event.GetFlags());
            calendarEvent->SetTime(action.Event.GetTime());
            calendarEvent->SetTimeZoneTime(action.Event.GetTimeZoneTime());
            calendarEvent->SetRepeatable(action.Event.GetRepeatable());
            calendarEvent->SetDungeonId(action.Event.GetDungeonId());
            calendarEvent->SetTitle(action.Event.GetTitle());
            calendarEvent->SetDescription(action.Event.GetDescription());
            calendarEvent->SetMaxInvites(action.Event.GetMaxInvites());

            CalendarinviteIdList const& invites = calendarEvent->GetInviteIdList();
            for (CalendarinviteIdList::const_iterator itr = invites.begin(); itr != invites.end(); ++itr)
                if (CalendarInvite* invite = GetInvite(*itr))
                    SendCalendarEventUpdateAlert(invite->GetInvitee(), *calendarEvent, CALENDAR_SENDTYPE_ADD);

            break;
        }
        case CALENDAR_ACTION_COPY_EVENT:
        {
            CalendarEvent* calendarEvent = CheckPermisions(action.Event.GetEventId(),
                action.GetGUID(), action.GetInviteId(), CALENDAR_RANK_OWNER);

            if (!calendarEvent)
                return;

            uint64 eventId = GetFreeEventId();
            CalendarEvent newEvent(eventId);
            newEvent.SetType(calendarEvent->GetType());
            newEvent.SetFlags(calendarEvent->GetFlags());
            newEvent.SetTime(action.Event.GetTime());
            newEvent.SetTimeZoneTime(calendarEvent->GetTimeZoneTime());
            newEvent.SetRepeatable(calendarEvent->GetRepeatable());
            newEvent.SetDungeonId(calendarEvent->GetDungeonId());
            newEvent.SetTitle(calendarEvent->GetTitle());
            newEvent.SetDescription(calendarEvent->GetDescription());
            newEvent.SetMaxInvites(calendarEvent->GetMaxInvites());
            newEvent.SetCreatorGUID(calendarEvent->GetCreatorGUID());
            newEvent.SetGuildId(calendarEvent->GetGuildId());

            CalendarinviteIdList const invites = calendarEvent->GetInviteIdList();
            for (CalendarinviteIdList::const_iterator itr = invites.begin(); itr != invites.end(); ++itr)
                if (CalendarInvite* invite = GetInvite(*itr))
                {
                    uint64 inviteId = GetFreeInviteId();
                    CalendarInvite newInvite(inviteId);
                    newInvite.SetEventId(eventId);
                    newInvite.SetSenderGUID(action.GetGUID());
                    newInvite.SetInvitee(invite->GetInvitee());
                    newInvite.SetStatus(invite->GetStatus());
                    newInvite.SetStatusTime(invite->GetStatusTime());
                    newInvite.SetText(invite->GetText());
                    newInvite.SetRank(invite->GetRank());
                    if (AddInvite(newInvite))
                    {
                        SendCalendarEventInviteAlert(newEvent, newInvite);
                        newEvent.AddInvite(inviteId);
                    }
                }

            if (AddEvent(newEvent))
                SendCalendarEvent(newEvent, CALENDAR_SENDTYPE_COPY);

            break;
        }
        case CALENDAR_ACTION_REMOVE_EVENT:
        {
            uint64 eventId = action.Event.GetEventId();
            uint32 flags = action.Event.GetFlags();
            sLog->outError("CalendarMgr::AddAction:: Flags %u", flags);
            // FIXME - Use of Flags here!

            CalendarEvent* calendarEvent = CheckPermisions(eventId,
                action.GetGUID(), action.GetInviteId(), CALENDAR_RANK_OWNER);

            if (!calendarEvent)
                return;

//.........这里部分代码省略.........
开发者ID:scymex,项目名称:TrinityCore,代码行数:101,代码来源:CalendarMgr.cpp


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