mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-15 23:20:36 +01:00
Core/Calendar: Completely rewrite and fix most of the calendar system
There are still some issues that need to be fixed, for more info see CalendarHandler.cpp TODO part. Some unblizzlike behaviour possible, we don't have a lot of sniffs. Big thanks to @Warpten, he joined my project and helped a lot. IMPORTANT NOTE: Read / append packed time functions in ByteBuffer.h are not correct, they need to be fixed in order to have event times accurate Signed-off-by: Nay <dnpd.dd@gmail.com>
This commit is contained in:
@@ -237,6 +237,47 @@ LOCK TABLES `bugreport` WRITE;
|
||||
/*!40000 ALTER TABLE `bugreport` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
--
|
||||
-- Table structure for table `calendar_events`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `calendar_events`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!40101 SET character_set_client = utf8 */;
|
||||
CREATE TABLE IF NOT EXISTS `calendar_events` (
|
||||
`id` bigint(20) unsigned NOT NULL DEFAULT '0',
|
||||
`creator` int(10) unsigned NOT NULL DEFAULT '0',
|
||||
`title` varchar(255) NOT NULL DEFAULT '',
|
||||
`description` varchar(255) NOT NULL DEFAULT '',
|
||||
`type` tinyint(1) unsigned NOT NULL DEFAULT '4',
|
||||
`dungeon` int(10) NOT NULL DEFAULT '-1',
|
||||
`eventtime` int(10) unsigned NOT NULL DEFAULT '0',
|
||||
`flags` int(10) unsigned NOT NULL DEFAULT '0',
|
||||
`time2` int(10) unsigned NOT NULL DEFAULT '0',
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Table structure for table `calendar_invites`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `calendar_invites`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!40101 SET character_set_client = utf8 */;
|
||||
CREATE TABLE IF NOT EXISTS `calendar_invites` (
|
||||
`id` bigint(20) unsigned NOT NULL DEFAULT '0',
|
||||
`event` bigint(20) unsigned NOT NULL DEFAULT '0',
|
||||
`invitee` int(10) unsigned NOT NULL DEFAULT '0',
|
||||
`sender` int(10) unsigned NOT NULL DEFAULT '0',
|
||||
`status` tinyint(1) unsigned NOT NULL DEFAULT '0',
|
||||
`statustime` int(10) unsigned NOT NULL DEFAULT '0',
|
||||
`rank` tinyint(1) unsigned NOT NULL DEFAULT '0',
|
||||
`text` varchar(255) NOT NULL DEFAULT '',
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Table structure for table `channels`
|
||||
--
|
||||
|
||||
26
sql/updates/characters/2012_11_11_00_character_calendar.sql
Normal file
26
sql/updates/characters/2012_11_11_00_character_calendar.sql
Normal file
@@ -0,0 +1,26 @@
|
||||
DROP TABLE IF EXISTS `calendar_events`;
|
||||
CREATE TABLE IF NOT EXISTS `calendar_events` (
|
||||
`id` bigint(20) unsigned NOT NULL DEFAULT '0',
|
||||
`creator` int(10) unsigned NOT NULL DEFAULT '0',
|
||||
`title` varchar(255) NOT NULL DEFAULT '',
|
||||
`description` varchar(255) NOT NULL DEFAULT '',
|
||||
`type` tinyint(1) unsigned NOT NULL DEFAULT '4',
|
||||
`dungeon` int(10) NOT NULL DEFAULT '-1',
|
||||
`eventtime` int(10) unsigned NOT NULL DEFAULT '0',
|
||||
`flags` int(10) unsigned NOT NULL DEFAULT '0',
|
||||
`time2` int(10) unsigned NOT NULL DEFAULT '0',
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
DROP TABLE IF EXISTS `calendar_invites`;
|
||||
CREATE TABLE IF NOT EXISTS `calendar_invites` (
|
||||
`id` bigint(20) unsigned NOT NULL DEFAULT '0',
|
||||
`event` bigint(20) unsigned NOT NULL DEFAULT '0',
|
||||
`invitee` int(10) unsigned NOT NULL DEFAULT '0',
|
||||
`sender` int(10) unsigned NOT NULL DEFAULT '0',
|
||||
`status` tinyint(1) unsigned NOT NULL DEFAULT '0',
|
||||
`statustime` int(10) unsigned NOT NULL DEFAULT '0',
|
||||
`rank` tinyint(1) unsigned NOT NULL DEFAULT '0',
|
||||
`text` varchar(255) NOT NULL DEFAULT '',
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
@@ -511,6 +511,23 @@ void ArenaTeam::BroadcastEvent(ArenaTeamEvents event, uint64 guid, uint8 strCoun
|
||||
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_ARENA_TEAM_EVENT");
|
||||
}
|
||||
|
||||
void ArenaTeam::MassInviteToEvent(WorldSession* session)
|
||||
{
|
||||
WorldPacket data(SMSG_CALENDAR_ARENA_TEAM, (Members.size() - 1) * (4 + 8 + 1));
|
||||
data << uint32(Members.size() - 1);
|
||||
|
||||
for (MemberList::const_iterator itr = Members.begin(); itr != Members.end(); ++itr)
|
||||
{
|
||||
if (itr->Guid != session->GetPlayer()->GetGUID())
|
||||
{
|
||||
data.appendPackGUID(itr->Guid);
|
||||
data << uint8(0); // unk
|
||||
}
|
||||
}
|
||||
|
||||
session->SendPacket(&data);
|
||||
}
|
||||
|
||||
uint8 ArenaTeam::GetSlotByType(uint32 type)
|
||||
{
|
||||
switch (type)
|
||||
|
||||
@@ -162,6 +162,8 @@ class ArenaTeam
|
||||
void BroadcastEvent(ArenaTeamEvents event, uint64 guid, uint8 strCount, std::string const& str1, std::string const& str2, std::string const& str3);
|
||||
void NotifyStatsChanged();
|
||||
|
||||
void MassInviteToEvent(WorldSession* session);
|
||||
|
||||
void Roster(WorldSession* session);
|
||||
void Query(WorldSession* session);
|
||||
void SendStats(WorldSession* session);
|
||||
|
||||
@@ -1,99 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
|
||||
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License as published by the
|
||||
* Free Software Foundation; either version 2 of the License, or (at your
|
||||
* option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
* more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "Player.h"
|
||||
#include "Calendar.h"
|
||||
|
||||
std::string CalendarInvite::GetDebugString() const
|
||||
{
|
||||
std::ostringstream data;
|
||||
|
||||
data << "CalendarInvite::"
|
||||
<< " inviteId: " << _inviteId
|
||||
<< " EventId: " << _eventId
|
||||
<< " Status: " << uint32(_status)
|
||||
<< " Invitee: " << _invitee
|
||||
<< " Sender: " << _senderGUID
|
||||
<< " Rank: " << uint32(_rank)
|
||||
<< " Text: " << _text;
|
||||
|
||||
return data.str();
|
||||
}
|
||||
|
||||
void CalendarInvite::Init()
|
||||
{
|
||||
_eventId = 0;
|
||||
_invitee = 0;
|
||||
_senderGUID = 0;
|
||||
_statusTime = 0;
|
||||
_status = CALENDAR_STATUS_INVITED; // default (0)?
|
||||
_rank = CALENDAR_RANK_PLAYER;
|
||||
_text = "";
|
||||
}
|
||||
|
||||
std::string CalendarEvent::GetDebugString() const
|
||||
{
|
||||
std::ostringstream data;
|
||||
|
||||
data << "CalendarEvent::"
|
||||
<< " EventId: " << _eventId
|
||||
<< " Title: " << _title
|
||||
<< " Description" << _description
|
||||
<< " Type: " << uint32(_type)
|
||||
<< " Max Invites: " << _maxInvites
|
||||
<< " Creator: " << _creatorGUID
|
||||
<< " Flags: " << _flags
|
||||
<< " Guild: " << _guildId
|
||||
<< " Time: " << _eventTime
|
||||
<< " Time2: " << _timezoneTime
|
||||
<< " Repeatable: " << uint32(_repeatable)
|
||||
<< " DungeonId: " << _dungeonId;
|
||||
|
||||
return data.str();
|
||||
}
|
||||
|
||||
void CalendarEvent::Init()
|
||||
{
|
||||
_creatorGUID = 0;
|
||||
_guildId = 0;
|
||||
_type = CALENDAR_TYPE_OTHER;
|
||||
_dungeonId = -1;
|
||||
_maxInvites = 0;
|
||||
_eventTime = 0;
|
||||
_flags = 0;
|
||||
_repeatable = false;
|
||||
_timezoneTime = 0;
|
||||
_title = "";
|
||||
_description = "";
|
||||
|
||||
}
|
||||
|
||||
std::string CalendarAction::GetDebugString() const
|
||||
{
|
||||
std::ostringstream data;
|
||||
|
||||
data << "CalendarAction::"
|
||||
<< " Action: " << GetAction()
|
||||
<< " Guid: " << GetPlayer()->GetGUID()
|
||||
<< " Invite Id: " << GetInviteId()
|
||||
<< " Extra data: " << GetExtraData()
|
||||
<< " Event: " << Event.GetDebugString()
|
||||
<< " Invite: " << Invite.GetDebugString();
|
||||
|
||||
return data.str();
|
||||
}
|
||||
@@ -1,189 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
|
||||
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License as published by the
|
||||
* Free Software Foundation; either version 2 of the License, or (at your
|
||||
* option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
* more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef TRINITY_CALENDAR_H
|
||||
#define TRINITY_CALENDAR_H
|
||||
|
||||
#include "Errors.h"
|
||||
#include "SharedDefines.h"
|
||||
#include <map>
|
||||
|
||||
class CalendarInvite
|
||||
{
|
||||
public:
|
||||
CalendarInvite() : _inviteId(0) { Init(); }
|
||||
explicit CalendarInvite(uint64 inviteId) : _inviteId(inviteId) { Init(); }
|
||||
|
||||
~CalendarInvite() { }
|
||||
|
||||
void SetInviteId(uint64 inviteId) { _inviteId = inviteId; }
|
||||
uint64 GetInviteId() const { return _inviteId; }
|
||||
|
||||
void SetEventId(uint64 eventId) { _eventId = eventId; }
|
||||
uint64 GetEventId() const { return _eventId; }
|
||||
|
||||
void SetSenderGUID(uint64 guid) { _senderGUID = guid; }
|
||||
uint64 GetSenderGUID() const { return _senderGUID; }
|
||||
|
||||
void SetInvitee(uint64 guid) { _invitee = guid; }
|
||||
uint64 GetInvitee() const { return _invitee; }
|
||||
|
||||
void SetStatusTime(uint32 statusTime) { _statusTime = statusTime; }
|
||||
uint32 GetStatusTime() const { return _statusTime; }
|
||||
|
||||
void SetText(std::string const& text) { _text = text; }
|
||||
std::string const& GetText() const { return _text; }
|
||||
|
||||
void SetStatus(CalendarInviteStatus status) { _status = status; }
|
||||
CalendarInviteStatus GetStatus() const { return _status; }
|
||||
|
||||
void SetRank(CalendarModerationRank rank) { _rank = rank; }
|
||||
CalendarModerationRank GetRank() const { return _rank; }
|
||||
|
||||
std::string GetDebugString() const;
|
||||
|
||||
private:
|
||||
void Init();
|
||||
|
||||
uint64 _inviteId;
|
||||
uint64 _eventId;
|
||||
uint64 _invitee;
|
||||
uint64 _senderGUID;
|
||||
uint32 _statusTime;
|
||||
CalendarInviteStatus _status;
|
||||
CalendarModerationRank _rank;
|
||||
std::string _text;
|
||||
};
|
||||
|
||||
typedef std::set<uint64> CalendarInviteIdList;
|
||||
|
||||
class CalendarEvent
|
||||
{
|
||||
public:
|
||||
CalendarEvent() : _eventId(0) { Init(); }
|
||||
explicit CalendarEvent(uint64 eventId) : _eventId(eventId) { Init(); }
|
||||
|
||||
~CalendarEvent() { }
|
||||
|
||||
void SetEventId(uint64 eventId) { _eventId = eventId; }
|
||||
uint64 GetEventId() const { return _eventId; }
|
||||
|
||||
void SetCreatorGUID(uint64 guid) { _creatorGUID = guid; }
|
||||
uint64 GetCreatorGUID() const { return _creatorGUID; }
|
||||
|
||||
void SetGuildId(uint32 guildId) { _guildId = guildId; }
|
||||
uint32 GetGuildId() const { return _guildId; }
|
||||
|
||||
void SetTitle(std::string const& title) { _title = title; }
|
||||
std::string const& GetTitle() const { return _title; }
|
||||
|
||||
void SetDescription(std::string const& description) { _description = description; }
|
||||
std::string const& GetDescription() const { return _description; }
|
||||
|
||||
void SetType(CalendarEventType type) { _type = type; }
|
||||
CalendarEventType GetType() const { return _type; }
|
||||
|
||||
void SetMaxInvites(uint32 limit) { _maxInvites = limit; }
|
||||
uint32 GetMaxInvites() const { return _maxInvites; }
|
||||
|
||||
void SetDungeonId(int32 dungeonId) { _dungeonId = dungeonId; }
|
||||
int32 GetDungeonId() const { return _dungeonId; }
|
||||
|
||||
void SetTime(uint32 eventTime) { _eventTime = eventTime; }
|
||||
uint32 GetTime() const { return _eventTime; }
|
||||
|
||||
void SetFlags(uint32 flags) { _flags = flags; }
|
||||
uint32 GetFlags() const { return _flags; }
|
||||
|
||||
void SetRepeatable(bool repeatable) { _repeatable = repeatable; }
|
||||
bool GetRepeatable() const { return _repeatable; }
|
||||
|
||||
void SetTimeZoneTime(uint32 timezoneTime) { _timezoneTime = timezoneTime; }
|
||||
uint32 GetTimeZoneTime() const { return _timezoneTime; }
|
||||
|
||||
void AddInvite(uint64 inviteId)
|
||||
{
|
||||
if (inviteId)
|
||||
_invites.insert(inviteId);
|
||||
}
|
||||
|
||||
void RemoveInvite(uint64 inviteId) { _invites.erase(inviteId); }
|
||||
bool HasInvite(uint64 inviteId) const { return _invites.find(inviteId) != _invites.end(); }
|
||||
CalendarInviteIdList const& GetInviteIdList() const { return _invites; }
|
||||
void SetInviteIdList(CalendarInviteIdList const& list) { _invites = list; }
|
||||
void ClearInviteIdList() { _invites.clear(); }
|
||||
|
||||
std::string GetDebugString() const;
|
||||
|
||||
private:
|
||||
void Init();
|
||||
|
||||
uint64 _eventId;
|
||||
uint64 _creatorGUID;
|
||||
uint32 _guildId;
|
||||
CalendarEventType _type;
|
||||
int32 _dungeonId;
|
||||
uint32 _maxInvites;
|
||||
uint32 _eventTime;
|
||||
uint32 _flags;
|
||||
bool _repeatable;
|
||||
uint32 _timezoneTime;
|
||||
std::string _title;
|
||||
std::string _description;
|
||||
CalendarInviteIdList _invites;
|
||||
};
|
||||
|
||||
typedef std::set<uint64> CalendarEventIdList;
|
||||
typedef std::map<uint64, CalendarInviteIdList> CalendarPlayerInviteIdMap;
|
||||
typedef std::map<uint64, CalendarEventIdList> CalendarPlayerEventIdMap;
|
||||
typedef std::map<uint64, CalendarInvite> CalendarInviteMap;
|
||||
typedef std::map<uint64, CalendarEvent> CalendarEventMap;
|
||||
|
||||
class Player;
|
||||
|
||||
struct CalendarAction
|
||||
{
|
||||
CalendarAction(): _action(CALENDAR_ACTION_NONE), _player(NULL), _inviteId(0), _data(0)
|
||||
{
|
||||
}
|
||||
|
||||
void SetAction(CalendarActionData data) { _action = data; }
|
||||
CalendarActionData GetAction() const { return _action; }
|
||||
|
||||
void SetPlayer(Player* player) { ASSERT(player); _player = player; }
|
||||
Player* GetPlayer() const { return _player; }
|
||||
|
||||
void SetInviteId(uint64 id) { _inviteId = id; }
|
||||
uint64 GetInviteId() const { return _inviteId; }
|
||||
|
||||
void SetExtraData(uint32 data) { _data = data; }
|
||||
uint32 GetExtraData() const { return _data; }
|
||||
|
||||
CalendarEvent Event;
|
||||
CalendarInvite Invite;
|
||||
|
||||
std::string GetDebugString() const;
|
||||
|
||||
private:
|
||||
CalendarActionData _action;
|
||||
Player* _player;
|
||||
uint64 _inviteId;
|
||||
uint32 _data;
|
||||
};
|
||||
|
||||
#endif
|
||||
File diff suppressed because it is too large
Load Diff
@@ -19,60 +19,311 @@
|
||||
#define TRINITY_CALENDARMGR_H
|
||||
|
||||
#include <ace/Singleton.h>
|
||||
#include "Calendar.h"
|
||||
#include "Common.h"
|
||||
#include "WorldPacket.h"
|
||||
|
||||
enum CalendarMailAnswers
|
||||
{
|
||||
// else
|
||||
CALENDAR_EVENT_REMOVED_MAIL_SUBJECT = 0,
|
||||
// if ( *(_DWORD *)(a1 + 8292) & 0x100 )
|
||||
CALENDAR_INVITE_REMOVED_MAIL_SUBJECT = 0x100
|
||||
};
|
||||
|
||||
enum CalendarFlags
|
||||
{
|
||||
CALENDAR_FLAG_ALL_ALLOWED = 0x001,
|
||||
CALENDAR_FLAG_INVITES_LOCKED = 0x010,
|
||||
CALENDAR_FLAG_WITHOUT_INVITES = 0x040,
|
||||
CALENDAR_FLAG_GUILD_EVENT = 0x400
|
||||
};
|
||||
|
||||
enum CalendarModerationRank
|
||||
{
|
||||
CALENDAR_RANK_PLAYER = 0,
|
||||
CALENDAR_RANK_MODERATOR = 1,
|
||||
CALENDAR_RANK_OWNER = 2
|
||||
};
|
||||
|
||||
enum CalendarSendEventType
|
||||
{
|
||||
CALENDAR_SENDTYPE_GET = 0,
|
||||
CALENDAR_SENDTYPE_ADD = 1,
|
||||
CALENDAR_SENDTYPE_COPY = 2
|
||||
};
|
||||
|
||||
enum CalendarEventType
|
||||
{
|
||||
CALENDAR_TYPE_RAID = 0,
|
||||
CALENDAR_TYPE_DUNGEON = 1,
|
||||
CALENDAR_TYPE_PVP = 2,
|
||||
CALENDAR_TYPE_MEETING = 3,
|
||||
CALENDAR_TYPE_OTHER = 4
|
||||
};
|
||||
|
||||
enum CalendarRepeatType
|
||||
{
|
||||
CALENDAR_REPEAT_NEVER = 0,
|
||||
CALENDAR_REPEAT_WEEKLY = 1,
|
||||
CALENDAR_REPEAT_BIWEEKLY = 2,
|
||||
CALENDAR_REPEAT_MONTHLY = 3
|
||||
};
|
||||
|
||||
enum CalendarInviteStatus
|
||||
{
|
||||
CALENDAR_STATUS_INVITED = 0,
|
||||
CALENDAR_STATUS_ACCEPTED = 1,
|
||||
CALENDAR_STATUS_DECLINED = 2,
|
||||
CALENDAR_STATUS_CONFIRMED = 3,
|
||||
CALENDAR_STATUS_OUT = 4,
|
||||
CALENDAR_STATUS_STANDBY = 5,
|
||||
CALENDAR_STATUS_SIGNED_UP = 6,
|
||||
CALENDAR_STATUS_NOT_SIGNED_UP = 7,
|
||||
CALENDAR_STATUS_TENTATIVE = 8,
|
||||
CALENDAR_STATUS_REMOVED = 9 // correct name?
|
||||
};
|
||||
|
||||
enum CalendarError
|
||||
{
|
||||
CALENDAR_OK = 0,
|
||||
CALENDAR_ERROR_GUILD_EVENTS_EXCEEDED = 1,
|
||||
CALENDAR_ERROR_EVENTS_EXCEEDED = 2,
|
||||
CALENDAR_ERROR_SELF_INVITES_EXCEEDED = 3,
|
||||
CALENDAR_ERROR_OTHER_INVITES_EXCEEDED = 4,
|
||||
CALENDAR_ERROR_PERMISSIONS = 5,
|
||||
CALENDAR_ERROR_EVENT_INVALID = 6,
|
||||
CALENDAR_ERROR_NOT_INVITED = 7,
|
||||
CALENDAR_ERROR_INTERNAL = 8,
|
||||
CALENDAR_ERROR_GUILD_PLAYER_NOT_IN_GUILD = 9,
|
||||
CALENDAR_ERROR_ALREADY_INVITED_TO_EVENT_S = 10,
|
||||
CALENDAR_ERROR_PLAYER_NOT_FOUND = 11,
|
||||
CALENDAR_ERROR_NOT_ALLIED = 12,
|
||||
CALENDAR_ERROR_IGNORING_YOU_S = 13,
|
||||
CALENDAR_ERROR_INVITES_EXCEEDED = 14,
|
||||
CALENDAR_ERROR_INVALID_DATE = 16,
|
||||
CALENDAR_ERROR_INVALID_TIME = 17,
|
||||
|
||||
CALENDAR_ERROR_NEEDS_TITLE = 19,
|
||||
CALENDAR_ERROR_EVENT_PASSED = 20,
|
||||
CALENDAR_ERROR_EVENT_LOCKED = 21,
|
||||
CALENDAR_ERROR_DELETE_CREATOR_FAILED = 22,
|
||||
CALENDAR_ERROR_SYSTEM_DISABLED = 24,
|
||||
CALENDAR_ERROR_RESTRICTED_ACCOUNT = 25,
|
||||
CALENDAR_ERROR_ARENA_EVENTS_EXCEEDED = 26,
|
||||
CALENDAR_ERROR_RESTRICTED_LEVEL = 27,
|
||||
CALENDAR_ERROR_USER_SQUELCHED = 28,
|
||||
CALENDAR_ERROR_NO_INVITE = 29,
|
||||
|
||||
CALENDAR_ERROR_EVENT_WRONG_SERVER = 36,
|
||||
CALENDAR_ERROR_INVITE_WRONG_SERVER = 37,
|
||||
CALENDAR_ERROR_NO_GUILD_INVITES = 38,
|
||||
CALENDAR_ERROR_INVALID_SIGNUP = 39,
|
||||
CALENDAR_ERROR_NO_MODERATOR = 40
|
||||
};
|
||||
|
||||
#define CALENDAR_MAX_EVENTS 30
|
||||
#define CALENDAR_MAX_GUILD_EVENTS 100
|
||||
#define CALENDAR_MAX_INVITES 100
|
||||
|
||||
struct CalendarInvite
|
||||
{
|
||||
public:
|
||||
CalendarInvite(CalendarInvite const& calendarInvite, uint64 inviteId, uint64 eventId)
|
||||
{
|
||||
_inviteId = inviteId;
|
||||
_eventId = eventId;
|
||||
_invitee = calendarInvite.GetInviteeGUID();
|
||||
_senderGUID = calendarInvite.GetSenderGUID();
|
||||
_statusTime = calendarInvite.GetStatusTime();
|
||||
_status = calendarInvite.GetStatus();
|
||||
_rank = calendarInvite.GetRank();
|
||||
_text = calendarInvite.GetText();
|
||||
}
|
||||
|
||||
CalendarInvite() : _inviteId(1), _eventId(0), _invitee(0), _senderGUID(0), _statusTime(time(NULL)),
|
||||
_status(CALENDAR_STATUS_INVITED), _rank(CALENDAR_RANK_PLAYER), _text("") { }
|
||||
|
||||
CalendarInvite(uint64 inviteId, uint64 eventId, uint64 invitee, uint64 senderGUID, time_t statusTime,
|
||||
CalendarInviteStatus status, CalendarModerationRank rank, std::string text) :
|
||||
_inviteId(inviteId), _eventId(eventId), _invitee(invitee), _senderGUID(senderGUID), _statusTime(statusTime),
|
||||
_status(status), _rank(rank), _text(text) { }
|
||||
|
||||
~CalendarInvite();
|
||||
|
||||
void SetInviteId(uint64 inviteId) { _inviteId = inviteId; }
|
||||
uint64 GetInviteId() const { return _inviteId; }
|
||||
|
||||
void SetEventId(uint64 eventId) { _eventId = eventId; }
|
||||
uint64 GetEventId() const { return _eventId; }
|
||||
|
||||
void SetSenderGUID(uint64 guid) { _senderGUID = guid; }
|
||||
uint64 GetSenderGUID() const { return _senderGUID; }
|
||||
|
||||
void SetInvitee(uint64 guid) { _invitee = guid; }
|
||||
uint64 GetInviteeGUID() const { return _invitee; }
|
||||
|
||||
void SetStatusTime(time_t statusTime) { _statusTime = statusTime; }
|
||||
time_t GetStatusTime() const { return _statusTime; }
|
||||
|
||||
void SetText(std::string text) { _text = text; }
|
||||
std::string GetText() const { return _text; }
|
||||
|
||||
void SetStatus(CalendarInviteStatus status) { _status = status; }
|
||||
CalendarInviteStatus GetStatus() const { return _status; }
|
||||
|
||||
void SetRank(CalendarModerationRank rank) { _rank = rank; }
|
||||
CalendarModerationRank GetRank() const { return _rank; }
|
||||
|
||||
private:
|
||||
uint64 _inviteId;
|
||||
uint64 _eventId;
|
||||
uint64 _invitee;
|
||||
uint64 _senderGUID;
|
||||
time_t _statusTime;
|
||||
CalendarInviteStatus _status;
|
||||
CalendarModerationRank _rank;
|
||||
std::string _text;
|
||||
};
|
||||
|
||||
struct CalendarEvent
|
||||
{
|
||||
public:
|
||||
CalendarEvent(CalendarEvent const& calendarEvent, uint64 eventId)
|
||||
{
|
||||
_eventId = eventId;
|
||||
_creatorGUID = calendarEvent.GetCreatorGUID();
|
||||
_guildId = calendarEvent.GetGuildId();
|
||||
_type = calendarEvent.GetType();
|
||||
_dungeonId = calendarEvent.GetDungeonId();
|
||||
_eventTime = calendarEvent.GetEventTime();
|
||||
_flags = calendarEvent.GetFlags();
|
||||
_timezoneTime = calendarEvent.GetTimeZoneTime();
|
||||
_title = calendarEvent.GetTitle();
|
||||
_description = calendarEvent.GetDescription();
|
||||
}
|
||||
|
||||
CalendarEvent(uint64 eventId, uint64 creatorGUID, uint32 guildId, CalendarEventType type, int32 dungeonId,
|
||||
time_t eventTime, uint32 flags, time_t timezoneTime, std::string title, std::string description) :
|
||||
_eventId(eventId), _creatorGUID(creatorGUID), _guildId(guildId), _type(type), _dungeonId(dungeonId),
|
||||
_eventTime(eventTime), _flags(flags), _timezoneTime(timezoneTime), _title(title),
|
||||
_description(description) { }
|
||||
|
||||
CalendarEvent() : _eventId(1), _creatorGUID(0), _guildId(0), _type(CALENDAR_TYPE_OTHER), _dungeonId(-1), _eventTime(0),
|
||||
_flags(0), _timezoneTime(0), _title(""), _description("") { }
|
||||
|
||||
~CalendarEvent();
|
||||
|
||||
void SetEventId(uint64 eventId) { _eventId = eventId; }
|
||||
uint64 GetEventId() const { return _eventId; }
|
||||
|
||||
void SetCreatorGUID(uint64 guid) { _creatorGUID = guid; }
|
||||
uint64 GetCreatorGUID() const { return _creatorGUID; }
|
||||
|
||||
void SetGuildId(uint32 guildId) { _guildId = guildId; }
|
||||
uint32 GetGuildId() const { return _guildId; }
|
||||
|
||||
void SetTitle(std::string title) { _title = title; }
|
||||
std::string GetTitle() const { return _title; }
|
||||
|
||||
void SetDescription(std::string description) { _description = description; }
|
||||
std::string GetDescription() const { return _description; }
|
||||
|
||||
void SetType(CalendarEventType type) { _type = type; }
|
||||
CalendarEventType GetType() const { return _type; }
|
||||
|
||||
void SetDungeonId(int32 dungeonId) { _dungeonId = dungeonId; }
|
||||
int32 GetDungeonId() const { return _dungeonId; }
|
||||
|
||||
void SetEventTime(time_t eventTime) { _eventTime = eventTime; }
|
||||
time_t GetEventTime() const { return _eventTime; }
|
||||
|
||||
void SetFlags(uint32 flags) { _flags = flags; }
|
||||
uint32 GetFlags() const { return _flags; }
|
||||
|
||||
void SetTimeZoneTime(time_t timezoneTime) { _timezoneTime = timezoneTime; }
|
||||
time_t GetTimeZoneTime() const { return _timezoneTime; }
|
||||
|
||||
bool IsGuildEvent() const { return _flags & CALENDAR_FLAG_GUILD_EVENT; }
|
||||
bool IsGuildAnnouncement() const { return _flags & CALENDAR_FLAG_WITHOUT_INVITES; }
|
||||
|
||||
std::string BuildCalendarMailSubject(uint64 remover) const;
|
||||
std::string BuildCalendarMailBody() const;
|
||||
|
||||
private:
|
||||
uint64 _eventId;
|
||||
uint64 _creatorGUID;
|
||||
uint32 _guildId;
|
||||
CalendarEventType _type;
|
||||
int32 _dungeonId;
|
||||
time_t _eventTime;
|
||||
uint32 _flags;
|
||||
time_t _timezoneTime;
|
||||
std::string _title;
|
||||
std::string _description;
|
||||
};
|
||||
|
||||
typedef std::set<CalendarEvent*> CalendarEventStore;
|
||||
typedef std::map<uint64 /* eventId */, std::vector<CalendarInvite*> > CalendarInviteStore;
|
||||
|
||||
class CalendarMgr
|
||||
{
|
||||
friend class ACE_Singleton<CalendarMgr, ACE_Null_Mutex>;
|
||||
friend class ACE_Singleton<CalendarMgr, ACE_Null_Mutex>;
|
||||
|
||||
private:
|
||||
CalendarMgr();
|
||||
~CalendarMgr();
|
||||
|
||||
CalendarEventStore _events;
|
||||
CalendarInviteStore _invites;
|
||||
|
||||
std::deque<uint64> _freeEventIds;
|
||||
std::deque<uint64> _freeInviteIds;
|
||||
uint64 _maxEventId;
|
||||
uint64 _maxInviteId;
|
||||
|
||||
public:
|
||||
void LoadFromDB();
|
||||
|
||||
CalendarInvite* GetInvite(uint64 inviteId);
|
||||
CalendarEvent* GetEvent(uint64 eventId);
|
||||
CalendarEventStore const& GetEvents() const { return _events; }
|
||||
CalendarEventStore GetPlayerEvents(uint64 guid);
|
||||
|
||||
CalendarInviteIdList const& GetPlayerInvites(uint64 guid);
|
||||
CalendarEventIdList const& GetPlayerEvents(uint64 guid);
|
||||
CalendarInvite* GetInvite(uint64 inviteId);
|
||||
CalendarInviteStore const& GetInvites() const { return _invites; }
|
||||
std::vector<CalendarInvite*> GetEventInvites(uint64 eventId);
|
||||
std::vector<CalendarInvite*> GetPlayerInvites(uint64 guid);
|
||||
|
||||
uint32 GetPlayerNumPending(uint64 guid);
|
||||
void FreeEventId(uint64 id);
|
||||
uint64 GetFreeEventId();
|
||||
void FreeInviteId(uint64 id);
|
||||
uint64 GetFreeInviteId();
|
||||
|
||||
void AddAction(CalendarAction const& action);
|
||||
uint32 GetPlayerNumPending(uint64 guid);
|
||||
|
||||
void SendCalendarEvent(CalendarEvent const& calendarEvent, CalendarSendEventType type);
|
||||
void SendCalendarEventInvite(CalendarInvite const& invite, bool pending);
|
||||
void AddEvent(CalendarEvent* calendarEvent, CalendarSendEventType sendType);
|
||||
void RemoveEvent(uint64 eventId, uint64 remover);
|
||||
void UpdateEvent(CalendarEvent* calendarEvent);
|
||||
|
||||
void AddInvite(CalendarEvent* calendarEvent, CalendarInvite* invite);
|
||||
void RemoveInvite(uint64 inviteId, uint64 eventId, uint64 remover);
|
||||
void UpdateInvite(CalendarInvite* invite);
|
||||
|
||||
void RemoveAllPlayerEventsAndInvites(uint64 guid);
|
||||
void RemovePlayerGuildEventsAndSignups(uint64 guid, uint32 guildId);
|
||||
|
||||
void SendCalendarEvent(uint64 guid, CalendarEvent const& calendarEvent, CalendarSendEventType sendType);
|
||||
void SendCalendarEventInvite(CalendarInvite const& invite);
|
||||
void SendCalendarEventInviteAlert(CalendarEvent const& calendarEvent, CalendarInvite const& invite);
|
||||
void SendCalendarEventInviteRemove(uint64 guid, CalendarInvite const& invite, uint32 flags);
|
||||
void SendCalendarEventInviteRemove(CalendarEvent const& calendarEvent, CalendarInvite const& invite, uint32 flags);
|
||||
void SendCalendarEventInviteRemoveAlert(uint64 guid, CalendarEvent const& calendarEvent, CalendarInviteStatus status);
|
||||
void SendCalendarEventUpdateAlert(uint64 guid, CalendarEvent const& calendarEvent, CalendarSendEventType type);
|
||||
void SendCalendarEventStatus(uint64 guid, CalendarEvent const& calendarEvent, CalendarInvite const& invite);
|
||||
void SendCalendarEventRemovedAlert(uint64 guid, CalendarEvent const& calendarEvent);
|
||||
void SendCalendarEventModeratorStatusAlert(CalendarInvite const& invite);
|
||||
void SendCalendarEventUpdateAlert(CalendarEvent const& calendarEvent, time_t oldEventTime);
|
||||
void SendCalendarEventStatus(CalendarEvent const& calendarEvent, CalendarInvite const& invite);
|
||||
void SendCalendarEventRemovedAlert(CalendarEvent const& calendarEvent);
|
||||
void SendCalendarEventModeratorStatusAlert(CalendarEvent const& calendarEvent, CalendarInvite const& invite);
|
||||
void SendCalendarClearPendingAction(uint64 guid);
|
||||
void SendCalendarCommandResult(uint64 guid, CalendarError err, char const* param = NULL);
|
||||
|
||||
private:
|
||||
CalendarEvent* CheckPermisions(uint64 eventId, Player* player, uint64 inviteId, CalendarModerationRank minRank);
|
||||
|
||||
bool AddEvent(CalendarEvent const& calendarEvent);
|
||||
bool RemoveEvent(uint64 eventId);
|
||||
bool AddPlayerEvent(uint64 guid, uint64 eventId);
|
||||
bool RemovePlayerEvent(uint64 guid, uint64 eventId);
|
||||
|
||||
bool AddInvite(CalendarInvite const& invite);
|
||||
uint64 RemoveInvite(uint64 inviteId);
|
||||
bool AddPlayerInvite(uint64 guid, uint64 inviteId);
|
||||
bool RemovePlayerInvite(uint64 guid, uint64 inviteId);
|
||||
|
||||
CalendarEventMap _events;
|
||||
CalendarInviteMap _invites;
|
||||
CalendarPlayerInviteIdMap _playerInvites;
|
||||
CalendarPlayerEventIdMap _playerEvents;
|
||||
|
||||
uint64 _eventNum;
|
||||
uint64 _inviteNum;
|
||||
void SendPacketToAllEventRelatives(WorldPacket packet, CalendarEvent const& calendarEvent);
|
||||
};
|
||||
|
||||
#define sCalendarMgr ACE_Singleton<CalendarMgr, ACE_Null_Mutex>::instance()
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
#include "SocialMgr.h"
|
||||
#include "Log.h"
|
||||
#include "AccountMgr.h"
|
||||
#include "CalendarMgr.h"
|
||||
|
||||
#define MAX_GUILD_BANK_TAB_TEXT_LEN 500
|
||||
#define EMBLEM_PRICE 10 * GOLD
|
||||
@@ -1579,6 +1580,8 @@ void Guild::HandleLeaveMember(WorldSession* session)
|
||||
|
||||
SendCommandResult(session, GUILD_COMMAND_QUIT, ERR_GUILD_COMMAND_SUCCESS, m_name);
|
||||
}
|
||||
|
||||
sCalendarMgr->RemovePlayerGuildEventsAndSignups(player->GetGUID(), GetId());
|
||||
}
|
||||
|
||||
void Guild::HandleRemoveMember(WorldSession* session, std::string const& name)
|
||||
@@ -2138,6 +2141,39 @@ void Guild::BroadcastPacket(WorldPacket* packet) const
|
||||
player->GetSession()->SendPacket(packet);
|
||||
}
|
||||
|
||||
void Guild::MassInviteToEvent(WorldSession* session, uint32 minLevel, uint32 maxLevel, uint32 minRank)
|
||||
{
|
||||
uint32 count = 0;
|
||||
|
||||
WorldPacket data(SMSG_CALENDAR_FILTER_GUILD);
|
||||
data << uint32(count); // count placeholder
|
||||
|
||||
for (Members::const_iterator itr = m_members.begin(); itr != m_members.end(); ++itr)
|
||||
{
|
||||
// not sure if needed, maybe client checks it as well
|
||||
if (count >= CALENDAR_MAX_INVITES)
|
||||
{
|
||||
if (Player* player = session->GetPlayer())
|
||||
sCalendarMgr->SendCalendarCommandResult(player->GetGUID(), CALENDAR_ERROR_INVITES_EXCEEDED);
|
||||
return;
|
||||
}
|
||||
|
||||
Member* member = itr->second;
|
||||
uint32 level = Player::GetLevelFromDB(member->GetGUID());
|
||||
|
||||
if (member->GetGUID() != session->GetPlayer()->GetGUID() && level >= minLevel && level <= maxLevel && member->IsRankNotLower(minRank))
|
||||
{
|
||||
data.appendPackGUID(member->GetGUID());
|
||||
data << uint8(0); // unk
|
||||
++count;
|
||||
}
|
||||
}
|
||||
|
||||
data.put<uint32>(0, count);
|
||||
|
||||
session->SendPacket(&data);
|
||||
}
|
||||
|
||||
// Members handling
|
||||
bool Guild::AddMember(uint64 guid, uint8 rankId)
|
||||
{
|
||||
|
||||
@@ -711,6 +711,8 @@ public:
|
||||
void BroadcastPacketToRank(WorldPacket* packet, uint8 rankId) const;
|
||||
void BroadcastPacket(WorldPacket* packet) const;
|
||||
|
||||
void MassInviteToEvent(WorldSession* session, uint32 minLevel, uint32 maxLevel, uint32 minRank);
|
||||
|
||||
template<class Do>
|
||||
void BroadcastWorker(Do& _do, Player* except = NULL)
|
||||
{
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -44,6 +44,7 @@
|
||||
#include "Battleground.h"
|
||||
#include "AccountMgr.h"
|
||||
#include "LFGMgr.h"
|
||||
#include "CalendarMgr.h"
|
||||
|
||||
class LoginQueryHolder : public SQLQueryHolder
|
||||
{
|
||||
@@ -726,6 +727,7 @@ void WorldSession::HandleCharDeleteOpcode(WorldPacket & recvData)
|
||||
sLog->outCharDump(dump.c_str(), GetAccountId(), GUID_LOPART(guid), name.c_str());
|
||||
}
|
||||
|
||||
sCalendarMgr->RemoveAllPlayerEventsAndInvites(guid);
|
||||
Player::DeleteFromDB(guid, GetAccountId());
|
||||
|
||||
WorldPacket data(SMSG_CHAR_DELETE, 1);
|
||||
|
||||
@@ -607,10 +607,8 @@ void WorldSession::HandleGetMailList(WorldPacket & recvData)
|
||||
case MAIL_CREATURE:
|
||||
case MAIL_GAMEOBJECT:
|
||||
case MAIL_AUCTION:
|
||||
data << uint32((*itr)->sender); // creature/gameobject entry, auction id
|
||||
break;
|
||||
case MAIL_ITEM: // item entry (?) sender = "Unknown", NYI
|
||||
data << uint32(0); // item entry
|
||||
case MAIL_CALENDAR:
|
||||
data << uint32((*itr)->sender); // creature/gameobject entry, auction id, calendar event id?
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
@@ -26,6 +26,7 @@
|
||||
#include "BattlegroundMgr.h"
|
||||
#include "Item.h"
|
||||
#include "AuctionHouseMgr.h"
|
||||
#include "CalendarMgr.h"
|
||||
|
||||
MailSender::MailSender(Object* sender, MailStationery stationery) : m_stationery(stationery)
|
||||
{
|
||||
@@ -39,10 +40,10 @@ MailSender::MailSender(Object* sender, MailStationery stationery) : m_stationery
|
||||
m_messageType = MAIL_GAMEOBJECT;
|
||||
m_senderId = sender->GetEntry();
|
||||
break;
|
||||
case TYPEID_ITEM:
|
||||
/*case TYPEID_ITEM:
|
||||
m_messageType = MAIL_ITEM;
|
||||
m_senderId = sender->GetEntry();
|
||||
break;
|
||||
break;*/
|
||||
case TYPEID_PLAYER:
|
||||
m_messageType = MAIL_NORMAL;
|
||||
m_senderId = sender->GetGUIDLow();
|
||||
@@ -55,6 +56,11 @@ MailSender::MailSender(Object* sender, MailStationery stationery) : m_stationery
|
||||
}
|
||||
}
|
||||
|
||||
MailSender::MailSender(CalendarEvent* sender)
|
||||
: m_messageType(MAIL_CALENDAR), m_senderId(sender->GetEventId()), m_stationery(MAIL_STATIONERY_DEFAULT) // what stationery we should use here?
|
||||
{
|
||||
}
|
||||
|
||||
MailSender::MailSender(AuctionEntry* sender)
|
||||
: m_messageType(MAIL_AUCTION), m_senderId(sender->GetHouseId()), m_stationery(MAIL_STATIONERY_AUCTION)
|
||||
{
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
#include <map>
|
||||
|
||||
struct AuctionEntry;
|
||||
struct CalendarEvent;
|
||||
class Item;
|
||||
class Object;
|
||||
class Player;
|
||||
@@ -36,7 +37,7 @@ enum MailMessageType
|
||||
MAIL_AUCTION = 2,
|
||||
MAIL_CREATURE = 3, // client send CMSG_CREATURE_QUERY on this mailmessagetype
|
||||
MAIL_GAMEOBJECT = 4, // client send CMSG_GAMEOBJECT_QUERY on this mailmessagetype
|
||||
MAIL_ITEM = 5 // client send CMSG_ITEM_QUERY on this mailmessagetype
|
||||
MAIL_CALENDAR = 5
|
||||
};
|
||||
|
||||
enum MailCheckMask
|
||||
@@ -85,6 +86,7 @@ class MailSender
|
||||
{
|
||||
}
|
||||
MailSender(Object* sender, MailStationery stationery = MAIL_STATIONERY_DEFAULT);
|
||||
MailSender(CalendarEvent* sender);
|
||||
MailSender(AuctionEntry* sender);
|
||||
MailSender(Player* sender);
|
||||
public: // Accessors
|
||||
|
||||
@@ -3428,104 +3428,6 @@ enum DuelCompleteType
|
||||
DUEL_WON = 1,
|
||||
DUEL_FLED = 2
|
||||
};
|
||||
|
||||
enum CalendarFlags
|
||||
{
|
||||
CALENDAR_FLAG_ALL_ALLOWED = 0x001,
|
||||
CALENDAR_FLAG_INVITES_LOCKED = 0x010,
|
||||
CALENDAR_FLAG_WITHOUT_INVITES = 0x040,
|
||||
CALENDAR_FLAG_GUILD_ONLY = 0x400
|
||||
};
|
||||
|
||||
enum CalendarActionData
|
||||
{
|
||||
CALENDAR_ACTION_NONE,
|
||||
CALENDAR_ACTION_ADD_EVENT,
|
||||
CALENDAR_ACTION_MODIFY_EVENT,
|
||||
CALENDAR_ACTION_REMOVE_EVENT,
|
||||
CALENDAR_ACTION_COPY_EVENT,
|
||||
CALENDAR_ACTION_ADD_EVENT_INVITE,
|
||||
CALENDAR_ACTION_MODIFY_EVENT_INVITE,
|
||||
CALENDAR_ACTION_MODIFY_MODERATOR_EVENT_INVITE,
|
||||
CALENDAR_ACTION_REMOVE_EVENT_INVITE,
|
||||
CALENDAR_ACTION_SIGNUP_TO_EVENT
|
||||
};
|
||||
|
||||
enum CalendarModerationRank
|
||||
{
|
||||
CALENDAR_RANK_PLAYER,
|
||||
CALENDAR_RANK_MODERATOR,
|
||||
CALENDAR_RANK_OWNER
|
||||
};
|
||||
|
||||
enum CalendarSendEventType
|
||||
{
|
||||
CALENDAR_SENDTYPE_GET,
|
||||
CALENDAR_SENDTYPE_ADD,
|
||||
CALENDAR_SENDTYPE_COPY
|
||||
};
|
||||
|
||||
enum CalendarEventType
|
||||
{
|
||||
CALENDAR_TYPE_RAID,
|
||||
CALENDAR_TYPE_DUNGEON,
|
||||
CALENDAR_TYPE_PVP,
|
||||
CALENDAR_TYPE_MEETING,
|
||||
CALENDAR_TYPE_OTHER
|
||||
};
|
||||
|
||||
enum CalendarInviteStatus
|
||||
{
|
||||
CALENDAR_STATUS_INVITED,
|
||||
CALENDAR_STATUS_ACCEPTED,
|
||||
CALENDAR_STATUS_DECLINED,
|
||||
CALENDAR_STATUS_TENTATIVE,
|
||||
CALENDAR_STATUS_OUT,
|
||||
CALENDAR_STATUS_STANDBY,
|
||||
CALENDAR_STATUS_CONFIRMED,
|
||||
CALENDAR_STATUS_NO_OWNER,
|
||||
CALENDAR_STATUS_8,
|
||||
CALENDAR_STATUS_9
|
||||
};
|
||||
|
||||
enum CalendarError
|
||||
{
|
||||
CALENDAR_OK = 0,
|
||||
CALENDAR_ERROR_GUILD_EVENTS_EXCEEDED = 1,
|
||||
CALENDAR_ERROR_EVENTS_EXCEEDED = 2,
|
||||
CALENDAR_ERROR_SELF_INVITES_EXCEEDED = 3,
|
||||
CALENDAR_ERROR_OTHER_INVITES_EXCEEDED = 4,
|
||||
CALENDAR_ERROR_PERMISSIONS = 5,
|
||||
CALENDAR_ERROR_EVENT_INVALID = 6,
|
||||
CALENDAR_ERROR_NOT_INVITED = 7,
|
||||
CALENDAR_ERROR_INTERNAL = 8,
|
||||
CALENDAR_ERROR_GUILD_PLAYER_NOT_IN_GUILD = 9,
|
||||
CALENDAR_ERROR_ALREADY_INVITED_TO_EVENT_S = 10,
|
||||
CALENDAR_ERROR_PLAYER_NOT_FOUND = 11,
|
||||
CALENDAR_ERROR_NOT_ALLIED = 12,
|
||||
CALENDAR_ERROR_IGNORING_YOU_S = 13,
|
||||
CALENDAR_ERROR_INVITES_EXCEEDED = 14,
|
||||
CALENDAR_ERROR_INVALID_DATE = 16,
|
||||
CALENDAR_ERROR_INVALID_TIME = 17,
|
||||
|
||||
CALENDAR_ERROR_NEEDS_TITLE = 19,
|
||||
CALENDAR_ERROR_EVENT_PASSED = 20,
|
||||
CALENDAR_ERROR_EVENT_LOCKED = 21,
|
||||
CALENDAR_ERROR_DELETE_CREATOR_FAILED = 22,
|
||||
CALENDAR_ERROR_SYSTEM_DISABLED = 24,
|
||||
CALENDAR_ERROR_RESTRICTED_ACCOUNT = 25,
|
||||
CALENDAR_ERROR_ARENA_EVENTS_EXCEEDED = 26,
|
||||
CALENDAR_ERROR_RESTRICTED_LEVEL = 27,
|
||||
CALENDAR_ERROR_USER_SQUELCHED = 28,
|
||||
CALENDAR_ERROR_NO_INVITE = 29,
|
||||
|
||||
CALENDAR_ERROR_EVENT_WRONG_SERVER = 36,
|
||||
CALENDAR_ERROR_INVITE_WRONG_SERVER = 37,
|
||||
CALENDAR_ERROR_NO_GUILD_INVITES = 38,
|
||||
CALENDAR_ERROR_INVALID_SIGNUP = 39,
|
||||
CALENDAR_ERROR_NO_MODERATOR = 40
|
||||
};
|
||||
|
||||
// handle the queue types and bg types separately to enable joining queue for different sized arenas at the same time
|
||||
enum BattlegroundQueueTypeId
|
||||
{
|
||||
|
||||
@@ -684,7 +684,7 @@ OpcodeHandler opcodeTable[NUM_MSG_TYPES] =
|
||||
/*0x28F*/ { "CMSG_GROUP_ASSISTANT_LEADER", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGroupAssistantLeaderOpcode},
|
||||
/*0x290*/ { "CMSG_BUYBACK_ITEM", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBuybackItem },
|
||||
/*0x291*/ { "SMSG_SERVER_MESSAGE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide },
|
||||
/*0x292*/ { "CMSG_SET_SAVED_INSTANCE_EXTEND", STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL },
|
||||
/*0x292*/ { "CMSG_SET_SAVED_INSTANCE_EXTEND", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetSavedInstanceExtend },
|
||||
/*0x293*/ { "SMSG_LFG_OFFER_CONTINUE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide },
|
||||
/*0x294*/ { "CMSG_TEST_DROP_RATE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL },
|
||||
/*0x295*/ { "SMSG_TEST_DROP_RATE_RESULT", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide },
|
||||
|
||||
@@ -31,8 +31,6 @@
|
||||
#include "WorldPacket.h"
|
||||
#include "Cryptography/BigNumber.h"
|
||||
|
||||
class CalendarEvent;
|
||||
class CalendarInvite;
|
||||
class Creature;
|
||||
class GameObject;
|
||||
class InstanceSave;
|
||||
@@ -904,19 +902,9 @@ class WorldSession
|
||||
void HandleCalendarGetNumPending(WorldPacket& recvData);
|
||||
void HandleCalendarEventSignup(WorldPacket& recvData);
|
||||
|
||||
void SendCalendarEvent(CalendarEvent const& calendarEvent, CalendarSendEventType sendEventType);
|
||||
void SendCalendarEventInvite(CalendarInvite const& invite, bool pending);
|
||||
void SendCalendarEventInviteAlert(CalendarEvent const& calendarEvent, CalendarInvite const& calendarInvite);
|
||||
void SendCalendarEventInviteRemove(CalendarInvite const& invite, uint32 flags);
|
||||
void SendCalendarEventInviteRemoveAlert(CalendarEvent const& calendarEvent, CalendarInviteStatus status);
|
||||
void SendCalendarEventRemovedAlert(CalendarEvent const& calendarEvent);
|
||||
void SendCalendarEventUpdateAlert(CalendarEvent const& calendarEvent, CalendarSendEventType sendEventType);
|
||||
void SendCalendarEventStatus(CalendarEvent const& calendarEvent, CalendarInvite const& invite);
|
||||
void SendCalendarEventModeratorStatusAlert(CalendarInvite const& invite);
|
||||
void SendCalendarClearPendingAction();
|
||||
void SendCalendarRaidLockout(InstanceSave const* save, bool add);
|
||||
void SendCalendarRaidLockoutUpdated(InstanceSave const* save);
|
||||
void SendCalendarCommandResult(CalendarError err, char const* param = NULL);
|
||||
void HandleSetSavedInstanceExtend(WorldPacket& recvData);
|
||||
|
||||
void HandleSpellClick(WorldPacket& recvData);
|
||||
void HandleMirrorImageDataRequest(WorldPacket& recvData);
|
||||
|
||||
@@ -535,4 +535,10 @@ void CharacterDatabaseConnection::DoPrepareStatements()
|
||||
PREPARE_STATEMENT(CHAR_INS_CHAR_TALENT, "INSERT INTO character_talent (guid, spell, spec) VALUES (?, ?, ?)", CONNECTION_ASYNC);
|
||||
PREPARE_STATEMENT(CHAR_DEL_CHAR_ACTION_EXCEPT_SPEC, "DELETE FROM character_action WHERE spec<>? AND guid = ?", CONNECTION_ASYNC);
|
||||
PREPARE_STATEMENT(CHAR_SEL_CHAR_PET_BY_ENTRY_AND_SLOT, "SELECT id, entry, owner, modelid, level, exp, Reactstate, slot, name, renamed, curhealth, curmana, curhappiness, abdata, savetime, CreatedBySpell, PetType FROM character_pet WHERE owner = ? AND slot = ?", CONNECTION_SYNCH);
|
||||
|
||||
// Calendar
|
||||
PREPARE_STATEMENT(CHAR_REP_CALENDAR_EVENT, "REPLACE INTO calendar_events (id, creator, title, description, type, dungeon, eventtime, flags, time2) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)", CONNECTION_ASYNC);
|
||||
PREPARE_STATEMENT(CHAR_DEL_CALENDAR_EVENT, "DELETE FROM calendar_events WHERE id = ?", CONNECTION_ASYNC);
|
||||
PREPARE_STATEMENT(CHAR_REP_CALENDAR_INVITE, "REPLACE INTO calendar_invites (id, event, invitee, sender, status, statustime, rank, text) VALUES (?, ?, ?, ?, ?, ?, ?, ?)", CONNECTION_ASYNC);
|
||||
PREPARE_STATEMENT(CHAR_DEL_CALENDAR_INVITE, "DELETE FROM calendar_invites WHERE id = ?", CONNECTION_ASYNC);
|
||||
}
|
||||
|
||||
@@ -496,6 +496,11 @@ enum CharacterDatabaseStatements
|
||||
CHAR_DEL_CHAR_ACTION_EXCEPT_SPEC,
|
||||
CHAR_SEL_CHAR_PET_BY_ENTRY_AND_SLOT,
|
||||
|
||||
CHAR_REP_CALENDAR_EVENT,
|
||||
CHAR_DEL_CALENDAR_EVENT,
|
||||
CHAR_REP_CALENDAR_INVITE,
|
||||
CHAR_DEL_CALENDAR_INVITE,
|
||||
|
||||
MAX_CHARACTERDATABASE_STATEMENTS
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user