diff --git a/sql/base/characters_database.sql b/sql/base/characters_database.sql
index 5548630d2d6..02efbe77101 100644
--- a/sql/base/characters_database.sql
+++ b/sql/base/characters_database.sql
@@ -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`
--
diff --git a/sql/updates/characters/2012_11_11_00_character_calendar.sql b/sql/updates/characters/2012_11_11_00_character_calendar.sql
new file mode 100644
index 00000000000..a3e7c352788
--- /dev/null
+++ b/sql/updates/characters/2012_11_11_00_character_calendar.sql
@@ -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;
diff --git a/src/server/game/Battlegrounds/ArenaTeam.cpp b/src/server/game/Battlegrounds/ArenaTeam.cpp
index 0223541335c..cc543544c7a 100755
--- a/src/server/game/Battlegrounds/ArenaTeam.cpp
+++ b/src/server/game/Battlegrounds/ArenaTeam.cpp
@@ -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)
diff --git a/src/server/game/Battlegrounds/ArenaTeam.h b/src/server/game/Battlegrounds/ArenaTeam.h
index 7d2d680cddc..137ac93d3c0 100755
--- a/src/server/game/Battlegrounds/ArenaTeam.h
+++ b/src/server/game/Battlegrounds/ArenaTeam.h
@@ -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);
diff --git a/src/server/game/Calendar/Calendar.cpp b/src/server/game/Calendar/Calendar.cpp
deleted file mode 100755
index 139e63614cc..00000000000
--- a/src/server/game/Calendar/Calendar.cpp
+++ /dev/null
@@ -1,99 +0,0 @@
-/*
- * Copyright (C) 2008-2012 TrinityCore
- * Copyright (C) 2005-2009 MaNGOS
- *
- * 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 .
- */
-
-#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();
-}
diff --git a/src/server/game/Calendar/Calendar.h b/src/server/game/Calendar/Calendar.h
deleted file mode 100755
index 273db4c3854..00000000000
--- a/src/server/game/Calendar/Calendar.h
+++ /dev/null
@@ -1,189 +0,0 @@
-/*
- * Copyright (C) 2008-2012 TrinityCore
- * Copyright (C) 2005-2009 MaNGOS
- *
- * 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 .
- */
-
-#ifndef TRINITY_CALENDAR_H
-#define TRINITY_CALENDAR_H
-
-#include "Errors.h"
-#include "SharedDefines.h"
-#include