summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--data/sql/updates/characters/2016_08_15_00.sql4
-rw-r--r--src/game/Chat/Channels/Channel.cpp4
-rw-r--r--src/game/Chat/Channels/Channel.h2
-rw-r--r--src/game/Chat/Channels/ChannelMgr.cpp7
4 files changed, 11 insertions, 6 deletions
diff --git a/data/sql/updates/characters/2016_08_15_00.sql b/data/sql/updates/characters/2016_08_15_00.sql
new file mode 100644
index 0000000000..cdc91b044e
--- /dev/null
+++ b/data/sql/updates/characters/2016_08_15_00.sql
@@ -0,0 +1,4 @@
+ALTER TABLE characters_db_version CHANGE COLUMN 2016_08_12_00 2016_08_15_00 bit;
+
+ALTER TABLE `channels`
+ ADD `ownership` tinyint(3) unsigned NOT NULL DEFAULT '1' AFTER `announce`;
diff --git a/src/game/Chat/Channels/Channel.cpp b/src/game/Chat/Channels/Channel.cpp
index dc287ed0dd..6f059455aa 100644
--- a/src/game/Chat/Channels/Channel.cpp
+++ b/src/game/Chat/Channels/Channel.cpp
@@ -25,9 +25,9 @@
#include "AccountMgr.h"
#include "Player.h"
-Channel::Channel(std::string const& name, uint32 channelId, uint32 channelDBId, TeamId teamId, bool announce):
+Channel::Channel(std::string const& name, uint32 channelId, uint32 channelDBId, TeamId teamId, bool announce, bool ownership):
_announce(announce),
- _ownership(true),
+ _ownership(ownership),
_IsSaved(false),
_flags(0),
_channelId(channelId),
diff --git a/src/game/Chat/Channels/Channel.h b/src/game/Chat/Channels/Channel.h
index 7512c3439a..e2b848e96a 100644
--- a/src/game/Chat/Channels/Channel.h
+++ b/src/game/Chat/Channels/Channel.h
@@ -187,7 +187,7 @@ class Channel
};
public:
- Channel(std::string const& name, uint32 channel_id, uint32 channelDBId, TeamId teamId = TEAM_NEUTRAL, bool announce = true);
+ Channel(std::string const& name, uint32 channel_id, uint32 channelDBId, TeamId teamId = TEAM_NEUTRAL, bool announce = true, bool ownership = true);
std::string const& GetName() const { return _name; }
uint32 GetChannelId() const { return _channelId; }
bool IsConstant() const { return _channelId != 0; }
diff --git a/src/game/Chat/Channels/ChannelMgr.cpp b/src/game/Chat/Channels/ChannelMgr.cpp
index af7112da70..510a230a96 100644
--- a/src/game/Chat/Channels/ChannelMgr.cpp
+++ b/src/game/Chat/Channels/ChannelMgr.cpp
@@ -48,7 +48,8 @@ void ChannelMgr::LoadChannels()
uint32 oldMSTime = getMSTime();
uint32 count = 0;
- QueryResult result = CharacterDatabase.PQuery("SELECT channelId, name, team, announce, password FROM channels WHERE team = %u ORDER BY channelId ASC", _teamId);
+ // 0 1 2 3 4 5
+ QueryResult result = CharacterDatabase.PQuery("SELECT channelId, name, team, announce, ownership, password FROM channels WHERE team = %u ORDER BY channelId ASC", _teamId);
if (!result)
{
sLog->outString(">> Loaded 0 channels for %s", _teamId == TEAM_ALLIANCE ? "Alliance" : "Horde");
@@ -64,11 +65,11 @@ void ChannelMgr::LoadChannels()
uint32 channelDBId = fields[0].GetUInt32();
std::string channelName = fields[1].GetString();
- std::string password = fields[4].GetString();
+ std::string password = fields[5].GetString();
std::wstring channelWName;
Utf8toWStr(channelName, channelWName);
- Channel* newChannel = new Channel(channelName, 0, channelDBId, TeamId(fields[2].GetUInt32()), fields[3].GetUInt8());
+ Channel* newChannel = new Channel(channelName, 0, channelDBId, TeamId(fields[2].GetUInt32()), fields[3].GetUInt8(), fields[4].GetUInt8());
newChannel->SetPassword(password);
channels[channelWName] = newChannel;