mirror of
https://github.com/mangosfour/server.git
synced 2025-12-13 04:37:00 +00:00
nuke tabs
This commit is contained in:
parent
0bf26d3e8d
commit
a626464ea7
16 changed files with 1431 additions and 1431 deletions
|
|
@ -2651,8 +2651,8 @@ std::string Creature::GetScriptName() const
|
|||
|
||||
uint32 Creature::GetScriptId() const
|
||||
{
|
||||
// scripts bound to DB guid have priority over ones bound to creature entry
|
||||
return sScriptMgr.GetBoundScriptId(SCRIPTED_UNIT, -int32(GetGUIDLow())) ? sScriptMgr.GetBoundScriptId(SCRIPTED_UNIT, -int32(GetGUIDLow())) : sScriptMgr.GetBoundScriptId(SCRIPTED_UNIT, GetEntry());
|
||||
// scripts bound to DB guid have priority over ones bound to creature entry
|
||||
return sScriptMgr.GetBoundScriptId(SCRIPTED_UNIT, -int32(GetGUIDLow())) ? sScriptMgr.GetBoundScriptId(SCRIPTED_UNIT, -int32(GetGUIDLow())) : sScriptMgr.GetBoundScriptId(SCRIPTED_UNIT, GetEntry());
|
||||
}
|
||||
|
||||
VendorItemData const* Creature::GetVendorItems() const
|
||||
|
|
|
|||
|
|
@ -608,7 +608,7 @@ class Creature : public Unit
|
|||
|
||||
void _AddCreatureSpellCooldown(uint32 spell_id, time_t end_time);
|
||||
void _AddCreatureCategoryCooldown(uint32 category, time_t apply_time);
|
||||
uint32 GetCreatureSpellCooldownDelay(uint32 spellId) const;
|
||||
uint32 GetCreatureSpellCooldownDelay(uint32 spellId) const;
|
||||
void AddCreatureSpellCooldown(uint32 spellid);
|
||||
bool HasSpellCooldown(uint32 spell_id) const;
|
||||
bool HasCategoryCooldown(uint32 spell_id) const;
|
||||
|
|
|
|||
|
|
@ -564,7 +564,7 @@ void ObjectMgr::LoadCreatureTemplates()
|
|||
continue;
|
||||
}
|
||||
|
||||
if (sScriptMgr.GetBoundScriptId(SCRIPTED_UNIT, difficultyInfo->Entry))
|
||||
if (sScriptMgr.GetBoundScriptId(SCRIPTED_UNIT, difficultyInfo->Entry))
|
||||
{
|
||||
sLog.outErrorDb("Difficulty %u mode creature (Entry: %u) has `ScriptName`, but in any case will used difficulty 0 mode creature (Entry: %u) ScriptName.",
|
||||
diff + 1, cInfo->DifficultyEntry[diff], i);
|
||||
|
|
@ -896,78 +896,78 @@ void ObjectMgr::LoadCreatureAddons()
|
|||
|
||||
void ObjectMgr::LoadCreatureClassLvlStats()
|
||||
{
|
||||
// initialize data array
|
||||
memset(&m_creatureClassLvlStats, 0, sizeof(m_creatureClassLvlStats));
|
||||
// initialize data array
|
||||
memset(&m_creatureClassLvlStats, 0, sizeof(m_creatureClassLvlStats));
|
||||
|
||||
std::string queryStr = "SELECT Class, Level, BaseMana, BaseMeleeAttackPower, BaseRangedAttackPower, BaseArmor";
|
||||
std::string queryStr = "SELECT Class, Level, BaseMana, BaseMeleeAttackPower, BaseRangedAttackPower, BaseArmor";
|
||||
|
||||
for (int i = 0; i <= MAX_EXPANSION; i++)
|
||||
{
|
||||
std::ostringstream str;
|
||||
str << ", `BaseHealthExp" << i << "`, `BaseDamageExp" << i << "`";
|
||||
queryStr.append(str.str().c_str());
|
||||
}
|
||||
for (int i = 0; i <= MAX_EXPANSION; i++)
|
||||
{
|
||||
std::ostringstream str;
|
||||
str << ", `BaseHealthExp" << i << "`, `BaseDamageExp" << i << "`";
|
||||
queryStr.append(str.str().c_str());
|
||||
}
|
||||
|
||||
queryStr.append(" FROM `creature_template_classlevelstats` ORDER BY `Class`, `Level`");
|
||||
QueryResult* result = WorldDatabase.Query(queryStr.c_str());
|
||||
queryStr.append(" FROM `creature_template_classlevelstats` ORDER BY `Class`, `Level`");
|
||||
QueryResult* result = WorldDatabase.Query(queryStr.c_str());
|
||||
|
||||
if (!result)
|
||||
{
|
||||
BarGoLink bar(1);
|
||||
if (!result)
|
||||
{
|
||||
BarGoLink bar(1);
|
||||
|
||||
bar.step();
|
||||
bar.step();
|
||||
|
||||
sLog.outString();
|
||||
sLog.outErrorDb("DB table `creature_template_classlevelstats` is empty.");
|
||||
return;
|
||||
}
|
||||
sLog.outString();
|
||||
sLog.outErrorDb("DB table `creature_template_classlevelstats` is empty.");
|
||||
return;
|
||||
}
|
||||
|
||||
BarGoLink bar(result->GetRowCount());
|
||||
uint32 DataCount = 0;
|
||||
BarGoLink bar(result->GetRowCount());
|
||||
uint32 DataCount = 0;
|
||||
|
||||
do
|
||||
{
|
||||
Field* fields = result->Fetch();
|
||||
bar.step();
|
||||
do
|
||||
{
|
||||
Field* fields = result->Fetch();
|
||||
bar.step();
|
||||
|
||||
uint32 creatureClass = fields[0].GetUInt32();
|
||||
uint32 creatureLevel = fields[1].GetUInt32();
|
||||
uint32 creatureClass = fields[0].GetUInt32();
|
||||
uint32 creatureLevel = fields[1].GetUInt32();
|
||||
|
||||
if (creatureLevel == 0 || creatureLevel > DEFAULT_MAX_CREATURE_LEVEL)
|
||||
{
|
||||
sLog.outErrorDb("Found stats for creature level [%u] with incorrect level. Skipping!", creatureLevel);
|
||||
continue;
|
||||
}
|
||||
if (creatureLevel == 0 || creatureLevel > DEFAULT_MAX_CREATURE_LEVEL)
|
||||
{
|
||||
sLog.outErrorDb("Found stats for creature level [%u] with incorrect level. Skipping!", creatureLevel);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (((1 << (creatureClass - 1)) & CLASSMASK_ALL_CREATURES) == 0)
|
||||
{
|
||||
sLog.outErrorDb("Found stats for creature class [%u] with incorrect class. Skipping!", creatureClass);
|
||||
continue;
|
||||
}
|
||||
if (((1 << (creatureClass - 1)) & CLASSMASK_ALL_CREATURES) == 0)
|
||||
{
|
||||
sLog.outErrorDb("Found stats for creature class [%u] with incorrect class. Skipping!", creatureClass);
|
||||
continue;
|
||||
}
|
||||
|
||||
uint32 baseMana = fields[2].GetUInt32();
|
||||
float baseMeleeAttackPower = fields[3].GetFloat();
|
||||
float baseRangedAttackPower = fields[4].GetFloat();
|
||||
uint32 baseArmor = fields[5].GetUInt32();
|
||||
uint32 baseMana = fields[2].GetUInt32();
|
||||
float baseMeleeAttackPower = fields[3].GetFloat();
|
||||
float baseRangedAttackPower = fields[4].GetFloat();
|
||||
uint32 baseArmor = fields[5].GetUInt32();
|
||||
|
||||
for (uint8 i = 0; i <= MAX_EXPANSION; ++i)
|
||||
{
|
||||
CreatureClassLvlStats &cCLS = m_creatureClassLvlStats[creatureLevel][classToIndex[creatureClass]][i - 1]; // values should start from 0
|
||||
cCLS.BaseMana = baseMana;
|
||||
cCLS.BaseMeleeAttackPower = baseMeleeAttackPower;
|
||||
cCLS.BaseRangedAttackPower = baseRangedAttackPower;
|
||||
cCLS.BaseArmor = baseArmor;
|
||||
for (uint8 i = 0; i <= MAX_EXPANSION; ++i)
|
||||
{
|
||||
CreatureClassLvlStats &cCLS = m_creatureClassLvlStats[creatureLevel][classToIndex[creatureClass]][i - 1]; // values should start from 0
|
||||
cCLS.BaseMana = baseMana;
|
||||
cCLS.BaseMeleeAttackPower = baseMeleeAttackPower;
|
||||
cCLS.BaseRangedAttackPower = baseRangedAttackPower;
|
||||
cCLS.BaseArmor = baseArmor;
|
||||
|
||||
cCLS.BaseHealth = fields[6 + (i * 2)].GetUInt32();
|
||||
cCLS.BaseDamage = fields[7 + (i * 2)].GetFloat();
|
||||
}
|
||||
++DataCount;
|
||||
} while (result->NextRow());
|
||||
cCLS.BaseHealth = fields[6 + (i * 2)].GetUInt32();
|
||||
cCLS.BaseDamage = fields[7 + (i * 2)].GetFloat();
|
||||
}
|
||||
++DataCount;
|
||||
} while (result->NextRow());
|
||||
|
||||
delete result;
|
||||
delete result;
|
||||
|
||||
sLog.outString();
|
||||
sLog.outString(">> Loaded %u creature class level stats definitions.", DataCount);
|
||||
sLog.outString();
|
||||
sLog.outString(">> Loaded %u creature class level stats definitions.", DataCount);
|
||||
}
|
||||
|
||||
CreatureClassLvlStats const* ObjectMgr::GetCreatureClassLvlStats(uint32 level, uint32 unitClass, int32 expansion) const
|
||||
|
|
|
|||
|
|
@ -293,19 +293,19 @@ static bool ReadDBCBuildFileText(const std::string& dbc_path, char const* locale
|
|||
|
||||
int ReadDBCLocale(const std::string sDataPath)
|
||||
{
|
||||
std::string sDBCpath = sDataPath + "dbc/";
|
||||
std::string sDBCpath = sDataPath + "dbc/";
|
||||
std::string sFilename;
|
||||
|
||||
for (int uLocaleIndex = 0; uLocaleIndex < MAX_LOCALE; ++uLocaleIndex)
|
||||
{
|
||||
for (int uLocaleIndex = 0; uLocaleIndex < MAX_LOCALE; ++uLocaleIndex)
|
||||
{
|
||||
sFilename = sDBCpath + "component.wow-" + fullLocaleNameList[uLocaleIndex].name + ".txt";
|
||||
if (FILE* file = fopen(sFilename.c_str(), "rb"))
|
||||
{
|
||||
return uLocaleIndex; // Successfully located the locale
|
||||
}
|
||||
}
|
||||
if (FILE* file = fopen(sFilename.c_str(), "rb"))
|
||||
{
|
||||
return uLocaleIndex; // Successfully located the locale
|
||||
}
|
||||
}
|
||||
|
||||
return -1; // Failed to locate or access the component.wow<locale>.txt file
|
||||
return -1; // Failed to locate or access the component.wow<locale>.txt file
|
||||
}
|
||||
|
||||
static uint32 ReadDBCBuild(const std::string& dbc_path, LocaleNameStr const*&localeNameStr)
|
||||
|
|
|
|||
|
|
@ -673,7 +673,7 @@ struct ChatChannelsEntry
|
|||
uint32 ChannelID; // 0 m_ID
|
||||
uint32 flags; // 1 m_flags
|
||||
//uint32 // 2 m_factionGroup
|
||||
DBCString pattern; // 3 m_name_lang
|
||||
DBCString pattern; // 3 m_name_lang
|
||||
// char* pattern[16]; // 3 m_name_lang
|
||||
//char* name; // 4 m_shortcut_lang
|
||||
};
|
||||
|
|
@ -1274,29 +1274,29 @@ struct ItemSetEntry
|
|||
|
||||
struct LfgDungeonsEntry
|
||||
{
|
||||
uint32 ID;
|
||||
DBCString Name;
|
||||
uint32 minLevel;
|
||||
uint32 maxLevel;
|
||||
uint32 target_level;
|
||||
uint32 target_level_min;
|
||||
uint32 target_level_max;
|
||||
float mapID;
|
||||
uint32 difficulty;
|
||||
uint32 flags;
|
||||
uint32 typeID;
|
||||
float faction;
|
||||
DBCString textureFilename;
|
||||
uint32 expansionLevel;
|
||||
DBCString order_index;
|
||||
uint32 group_id;
|
||||
DBCString description_lang;
|
||||
uint32 col17;
|
||||
uint32 col18;
|
||||
uint32 col19;
|
||||
uint32 col20;
|
||||
uint32 ID;
|
||||
DBCString Name;
|
||||
uint32 minLevel;
|
||||
uint32 maxLevel;
|
||||
uint32 target_level;
|
||||
uint32 target_level_min;
|
||||
uint32 target_level_max;
|
||||
float mapID;
|
||||
uint32 difficulty;
|
||||
uint32 flags;
|
||||
uint32 typeID;
|
||||
float faction;
|
||||
DBCString textureFilename;
|
||||
uint32 expansionLevel;
|
||||
DBCString order_index;
|
||||
uint32 group_id;
|
||||
DBCString description_lang;
|
||||
uint32 col17;
|
||||
uint32 col18;
|
||||
uint32 col19;
|
||||
uint32 col20;
|
||||
|
||||
uint32 Entry() const { return ID + ((uint8)typeID << 24); }
|
||||
uint32 Entry() const { return ID + ((uint8)typeID << 24); }
|
||||
};
|
||||
|
||||
/*struct LfgDungeonGroupEntry
|
||||
|
|
|
|||
|
|
@ -129,7 +129,7 @@ WorldSession::~WorldSession()
|
|||
m_Socket = NULL;
|
||||
}
|
||||
|
||||
// CAUSES CRASH ON PLAYER EXITING TO LOGIN SCREEN
|
||||
// CAUSES CRASH ON PLAYER EXITING TO LOGIN SCREEN
|
||||
// Warden
|
||||
// if (_warden)
|
||||
// delete _warden;
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -77,210 +77,210 @@ enum ChatNotify
|
|||
|
||||
class Channel
|
||||
{
|
||||
enum ChannelFlags
|
||||
{
|
||||
CHANNEL_FLAG_NONE = 0x00,
|
||||
CHANNEL_FLAG_CUSTOM = 0x01,
|
||||
// 0x02
|
||||
CHANNEL_FLAG_TRADE = 0x04,
|
||||
CHANNEL_FLAG_NOT_LFG = 0x08,
|
||||
CHANNEL_FLAG_GENERAL = 0x10,
|
||||
CHANNEL_FLAG_CITY = 0x20,
|
||||
CHANNEL_FLAG_LFG = 0x40,
|
||||
CHANNEL_FLAG_VOICE = 0x80
|
||||
// General 0x18 = 0x10 | 0x08
|
||||
// Trade 0x3C = 0x20 | 0x10 | 0x08 | 0x04
|
||||
// LocalDefence 0x18 = 0x10 | 0x08
|
||||
// GuildRecruitment 0x38 = 0x20 | 0x10 | 0x08
|
||||
// LookingForGroup 0x50 = 0x40 | 0x10
|
||||
};
|
||||
enum ChannelFlags
|
||||
{
|
||||
CHANNEL_FLAG_NONE = 0x00,
|
||||
CHANNEL_FLAG_CUSTOM = 0x01,
|
||||
// 0x02
|
||||
CHANNEL_FLAG_TRADE = 0x04,
|
||||
CHANNEL_FLAG_NOT_LFG = 0x08,
|
||||
CHANNEL_FLAG_GENERAL = 0x10,
|
||||
CHANNEL_FLAG_CITY = 0x20,
|
||||
CHANNEL_FLAG_LFG = 0x40,
|
||||
CHANNEL_FLAG_VOICE = 0x80
|
||||
// General 0x18 = 0x10 | 0x08
|
||||
// Trade 0x3C = 0x20 | 0x10 | 0x08 | 0x04
|
||||
// LocalDefence 0x18 = 0x10 | 0x08
|
||||
// GuildRecruitment 0x38 = 0x20 | 0x10 | 0x08
|
||||
// LookingForGroup 0x50 = 0x40 | 0x10
|
||||
};
|
||||
|
||||
enum ChannelDBCFlags
|
||||
{
|
||||
CHANNEL_DBC_FLAG_NONE = 0x00000,
|
||||
CHANNEL_DBC_FLAG_INITIAL = 0x00001, // General, Trade, LocalDefense, LFG
|
||||
CHANNEL_DBC_FLAG_ZONE_DEP = 0x00002, // General, Trade, LocalDefense, GuildRecruitment
|
||||
CHANNEL_DBC_FLAG_GLOBAL = 0x00004, // WorldDefense
|
||||
CHANNEL_DBC_FLAG_TRADE = 0x00008, // Trade
|
||||
CHANNEL_DBC_FLAG_CITY_ONLY = 0x00010, // Trade, GuildRecruitment
|
||||
CHANNEL_DBC_FLAG_CITY_ONLY2 = 0x00020, // Trade, GuildRecruitment
|
||||
CHANNEL_DBC_FLAG_DEFENSE = 0x10000, // LocalDefense, WorldDefense
|
||||
CHANNEL_DBC_FLAG_GUILD_REQ = 0x20000, // GuildRecruitment
|
||||
CHANNEL_DBC_FLAG_LFG = 0x40000 // LookingForGroup
|
||||
};
|
||||
enum ChannelDBCFlags
|
||||
{
|
||||
CHANNEL_DBC_FLAG_NONE = 0x00000,
|
||||
CHANNEL_DBC_FLAG_INITIAL = 0x00001, // General, Trade, LocalDefense, LFG
|
||||
CHANNEL_DBC_FLAG_ZONE_DEP = 0x00002, // General, Trade, LocalDefense, GuildRecruitment
|
||||
CHANNEL_DBC_FLAG_GLOBAL = 0x00004, // WorldDefense
|
||||
CHANNEL_DBC_FLAG_TRADE = 0x00008, // Trade
|
||||
CHANNEL_DBC_FLAG_CITY_ONLY = 0x00010, // Trade, GuildRecruitment
|
||||
CHANNEL_DBC_FLAG_CITY_ONLY2 = 0x00020, // Trade, GuildRecruitment
|
||||
CHANNEL_DBC_FLAG_DEFENSE = 0x10000, // LocalDefense, WorldDefense
|
||||
CHANNEL_DBC_FLAG_GUILD_REQ = 0x20000, // GuildRecruitment
|
||||
CHANNEL_DBC_FLAG_LFG = 0x40000 // LookingForGroup
|
||||
};
|
||||
|
||||
enum ChannelMemberFlags
|
||||
{
|
||||
MEMBER_FLAG_NONE = 0x00,
|
||||
MEMBER_FLAG_OWNER = 0x01,
|
||||
MEMBER_FLAG_MODERATOR = 0x02,
|
||||
MEMBER_FLAG_VOICED = 0x04,
|
||||
MEMBER_FLAG_MUTED = 0x08,
|
||||
MEMBER_FLAG_CUSTOM = 0x10,
|
||||
MEMBER_FLAG_MIC_MUTED = 0x20,
|
||||
// 0x40
|
||||
// 0x80
|
||||
};
|
||||
enum ChannelMemberFlags
|
||||
{
|
||||
MEMBER_FLAG_NONE = 0x00,
|
||||
MEMBER_FLAG_OWNER = 0x01,
|
||||
MEMBER_FLAG_MODERATOR = 0x02,
|
||||
MEMBER_FLAG_VOICED = 0x04,
|
||||
MEMBER_FLAG_MUTED = 0x08,
|
||||
MEMBER_FLAG_CUSTOM = 0x10,
|
||||
MEMBER_FLAG_MIC_MUTED = 0x20,
|
||||
// 0x40
|
||||
// 0x80
|
||||
};
|
||||
|
||||
struct PlayerInfo
|
||||
{
|
||||
ObjectGuid player;
|
||||
uint8 flags;
|
||||
struct PlayerInfo
|
||||
{
|
||||
ObjectGuid player;
|
||||
uint8 flags;
|
||||
|
||||
bool HasFlag(uint8 flag) { return flags & flag; }
|
||||
void SetFlag(uint8 flag) { if (!HasFlag(flag)) flags |= flag; }
|
||||
bool IsOwner() { return flags & MEMBER_FLAG_OWNER; }
|
||||
void SetOwner(bool state)
|
||||
{
|
||||
if (state) flags |= MEMBER_FLAG_OWNER;
|
||||
else flags &= ~MEMBER_FLAG_OWNER;
|
||||
}
|
||||
bool IsModerator() { return flags & MEMBER_FLAG_MODERATOR; }
|
||||
void SetModerator(bool state)
|
||||
{
|
||||
if (state) flags |= MEMBER_FLAG_MODERATOR;
|
||||
else flags &= ~MEMBER_FLAG_MODERATOR;
|
||||
}
|
||||
bool IsMuted() { return flags & MEMBER_FLAG_MUTED; }
|
||||
void SetMuted(bool state)
|
||||
{
|
||||
if (state) flags |= MEMBER_FLAG_MUTED;
|
||||
else flags &= ~MEMBER_FLAG_MUTED;
|
||||
}
|
||||
};
|
||||
bool HasFlag(uint8 flag) { return flags & flag; }
|
||||
void SetFlag(uint8 flag) { if (!HasFlag(flag)) flags |= flag; }
|
||||
bool IsOwner() { return flags & MEMBER_FLAG_OWNER; }
|
||||
void SetOwner(bool state)
|
||||
{
|
||||
if (state) flags |= MEMBER_FLAG_OWNER;
|
||||
else flags &= ~MEMBER_FLAG_OWNER;
|
||||
}
|
||||
bool IsModerator() { return flags & MEMBER_FLAG_MODERATOR; }
|
||||
void SetModerator(bool state)
|
||||
{
|
||||
if (state) flags |= MEMBER_FLAG_MODERATOR;
|
||||
else flags &= ~MEMBER_FLAG_MODERATOR;
|
||||
}
|
||||
bool IsMuted() { return flags & MEMBER_FLAG_MUTED; }
|
||||
void SetMuted(bool state)
|
||||
{
|
||||
if (state) flags |= MEMBER_FLAG_MUTED;
|
||||
else flags &= ~MEMBER_FLAG_MUTED;
|
||||
}
|
||||
};
|
||||
|
||||
public:
|
||||
Channel(const std::string& name, uint32 channel_id);
|
||||
std::string GetName() const { return m_name; }
|
||||
uint32 GetChannelId() const { return m_channelId; }
|
||||
bool IsConstant() const { return m_channelId != 0; }
|
||||
bool IsAnnounce() const { return m_announce; }
|
||||
bool IsLFG() const { return GetFlags() & CHANNEL_FLAG_LFG; }
|
||||
std::string GetPassword() const { return m_password; }
|
||||
void SetPassword(const std::string& npassword) { m_password = npassword; }
|
||||
void SetAnnounce(bool nannounce) { m_announce = nannounce; }
|
||||
uint32 GetNumPlayers() const { return m_players.size(); }
|
||||
uint8 GetFlags() const { return m_flags; }
|
||||
bool HasFlag(uint8 flag) { return m_flags & flag; }
|
||||
Channel(const std::string& name, uint32 channel_id);
|
||||
std::string GetName() const { return m_name; }
|
||||
uint32 GetChannelId() const { return m_channelId; }
|
||||
bool IsConstant() const { return m_channelId != 0; }
|
||||
bool IsAnnounce() const { return m_announce; }
|
||||
bool IsLFG() const { return GetFlags() & CHANNEL_FLAG_LFG; }
|
||||
std::string GetPassword() const { return m_password; }
|
||||
void SetPassword(const std::string& npassword) { m_password = npassword; }
|
||||
void SetAnnounce(bool nannounce) { m_announce = nannounce; }
|
||||
uint32 GetNumPlayers() const { return m_players.size(); }
|
||||
uint8 GetFlags() const { return m_flags; }
|
||||
bool HasFlag(uint8 flag) { return m_flags & flag; }
|
||||
|
||||
void Join(Player* player, const char* password);
|
||||
void Leave(Player* player, bool send = true);
|
||||
void KickOrBan(Player* player, const char* targetName, bool ban);
|
||||
void Kick(Player* player, const char* targetName) { KickOrBan(player, targetName, false); }
|
||||
void Ban(Player* player, const char* targetName) { KickOrBan(player, targetName, true); }
|
||||
void UnBan(Player* player, const char* targetName);
|
||||
void Password(Player* player, const char* password);
|
||||
void SetMode(Player* player, const char* targetName, bool moderator, bool set);
|
||||
void SetOwner(ObjectGuid guid, bool exclaim = true);
|
||||
void SetOwner(Player* player, const char* targetName);
|
||||
void SendWhoOwner(Player* player);
|
||||
void SetModerator(Player* player, const char* targetName) { SetMode(player, targetName, true, true); }
|
||||
void UnsetModerator(Player* player, const char* targetName) { SetMode(player, targetName, true, false); }
|
||||
void SetMute(Player* player, const char* targetName) { SetMode(player, targetName, false, true); }
|
||||
void UnsetMute(Player* player, const char* targetName) { SetMode(player, targetName, false, false); }
|
||||
void List(Player* player);
|
||||
void Announce(Player* player);
|
||||
void Moderate(Player* player);
|
||||
void Say(Player* player, const char* text, uint32 lang);
|
||||
void Invite(Player* player, const char* targetName);
|
||||
void Voice(ObjectGuid guid1, ObjectGuid guid2);
|
||||
void DeVoice(ObjectGuid guid1, ObjectGuid guid2);
|
||||
void JoinNotify(ObjectGuid guid); // invisible notify
|
||||
void LeaveNotify(ObjectGuid guid); // invisible notify
|
||||
void Join(Player* player, const char* password);
|
||||
void Leave(Player* player, bool send = true);
|
||||
void KickOrBan(Player* player, const char* targetName, bool ban);
|
||||
void Kick(Player* player, const char* targetName) { KickOrBan(player, targetName, false); }
|
||||
void Ban(Player* player, const char* targetName) { KickOrBan(player, targetName, true); }
|
||||
void UnBan(Player* player, const char* targetName);
|
||||
void Password(Player* player, const char* password);
|
||||
void SetMode(Player* player, const char* targetName, bool moderator, bool set);
|
||||
void SetOwner(ObjectGuid guid, bool exclaim = true);
|
||||
void SetOwner(Player* player, const char* targetName);
|
||||
void SendWhoOwner(Player* player);
|
||||
void SetModerator(Player* player, const char* targetName) { SetMode(player, targetName, true, true); }
|
||||
void UnsetModerator(Player* player, const char* targetName) { SetMode(player, targetName, true, false); }
|
||||
void SetMute(Player* player, const char* targetName) { SetMode(player, targetName, false, true); }
|
||||
void UnsetMute(Player* player, const char* targetName) { SetMode(player, targetName, false, false); }
|
||||
void List(Player* player);
|
||||
void Announce(Player* player);
|
||||
void Moderate(Player* player);
|
||||
void Say(Player* player, const char* text, uint32 lang);
|
||||
void Invite(Player* player, const char* targetName);
|
||||
void Voice(ObjectGuid guid1, ObjectGuid guid2);
|
||||
void DeVoice(ObjectGuid guid1, ObjectGuid guid2);
|
||||
void JoinNotify(ObjectGuid guid); // invisible notify
|
||||
void LeaveNotify(ObjectGuid guid); // invisible notify
|
||||
|
||||
private:
|
||||
// initial packet data (notify type and channel name)
|
||||
void MakeNotifyPacket(WorldPacket* data, uint8 notify_type);
|
||||
// type specific packet data
|
||||
void MakeJoined(WorldPacket* data, ObjectGuid guid); //+ 0x00
|
||||
void MakeLeft(WorldPacket* data, ObjectGuid guid); //+ 0x01
|
||||
void MakeYouJoined(WorldPacket* data); //+ 0x02
|
||||
void MakeYouLeft(WorldPacket* data); //+ 0x03
|
||||
void MakeWrongPassword(WorldPacket* data); //? 0x04
|
||||
void MakeNotMember(WorldPacket* data); //? 0x05
|
||||
void MakeNotModerator(WorldPacket* data); //? 0x06
|
||||
void MakePasswordChanged(WorldPacket* data, ObjectGuid guid); //+ 0x07
|
||||
void MakeOwnerChanged(WorldPacket* data, ObjectGuid guid); //? 0x08
|
||||
void MakePlayerNotFound(WorldPacket* data, const std::string& name); //+ 0x09
|
||||
void MakeNotOwner(WorldPacket* data); //? 0x0A
|
||||
void MakeChannelOwner(WorldPacket* data); //? 0x0B
|
||||
void MakeModeChange(WorldPacket* data, ObjectGuid guid, uint8 oldflags);//+ 0x0C
|
||||
void MakeAnnouncementsOn(WorldPacket* data, ObjectGuid guid); //+ 0x0D
|
||||
void MakeAnnouncementsOff(WorldPacket* data, ObjectGuid guid); //+ 0x0E
|
||||
void MakeModerationOn(WorldPacket* data, ObjectGuid guid); //+ 0x0F
|
||||
void MakeModerationOff(WorldPacket* data, ObjectGuid guid); //+ 0x10
|
||||
void MakeMuted(WorldPacket* data); //? 0x11
|
||||
void MakePlayerKicked(WorldPacket* data, ObjectGuid target, ObjectGuid source);//? 0x12
|
||||
void MakeBanned(WorldPacket* data); //? 0x13
|
||||
void MakePlayerBanned(WorldPacket* data, ObjectGuid target, ObjectGuid source);//? 0x14
|
||||
void MakePlayerUnbanned(WorldPacket* data, ObjectGuid target, ObjectGuid source);//? 0x15
|
||||
void MakePlayerNotBanned(WorldPacket* data, const std::string& name); //? 0x16
|
||||
void MakePlayerAlreadyMember(WorldPacket* data, ObjectGuid guid); //+ 0x17
|
||||
void MakeInvite(WorldPacket* data, ObjectGuid guid); //? 0x18
|
||||
void MakeInviteWrongFaction(WorldPacket* data); //? 0x19
|
||||
void MakeWrongFaction(WorldPacket* data); //? 0x1A
|
||||
void MakeInvalidName(WorldPacket* data); //? 0x1B
|
||||
void MakeNotModerated(WorldPacket* data); //? 0x1C
|
||||
void MakePlayerInvited(WorldPacket* data, const std::string& name); //+ 0x1D
|
||||
void MakePlayerInviteBanned(WorldPacket* data, const std::string& name);//? 0x1E
|
||||
void MakeThrottled(WorldPacket* data); //? 0x1F
|
||||
void MakeNotInArea(WorldPacket* data); //? 0x20
|
||||
void MakeNotInLfg(WorldPacket* data); //? 0x21
|
||||
void MakeVoiceOn(WorldPacket* data, ObjectGuid guid); //+ 0x22
|
||||
void MakeVoiceOff(WorldPacket* data, ObjectGuid guid); //+ 0x23
|
||||
// initial packet data (notify type and channel name)
|
||||
void MakeNotifyPacket(WorldPacket* data, uint8 notify_type);
|
||||
// type specific packet data
|
||||
void MakeJoined(WorldPacket* data, ObjectGuid guid); //+ 0x00
|
||||
void MakeLeft(WorldPacket* data, ObjectGuid guid); //+ 0x01
|
||||
void MakeYouJoined(WorldPacket* data); //+ 0x02
|
||||
void MakeYouLeft(WorldPacket* data); //+ 0x03
|
||||
void MakeWrongPassword(WorldPacket* data); //? 0x04
|
||||
void MakeNotMember(WorldPacket* data); //? 0x05
|
||||
void MakeNotModerator(WorldPacket* data); //? 0x06
|
||||
void MakePasswordChanged(WorldPacket* data, ObjectGuid guid); //+ 0x07
|
||||
void MakeOwnerChanged(WorldPacket* data, ObjectGuid guid); //? 0x08
|
||||
void MakePlayerNotFound(WorldPacket* data, const std::string& name); //+ 0x09
|
||||
void MakeNotOwner(WorldPacket* data); //? 0x0A
|
||||
void MakeChannelOwner(WorldPacket* data); //? 0x0B
|
||||
void MakeModeChange(WorldPacket* data, ObjectGuid guid, uint8 oldflags);//+ 0x0C
|
||||
void MakeAnnouncementsOn(WorldPacket* data, ObjectGuid guid); //+ 0x0D
|
||||
void MakeAnnouncementsOff(WorldPacket* data, ObjectGuid guid); //+ 0x0E
|
||||
void MakeModerationOn(WorldPacket* data, ObjectGuid guid); //+ 0x0F
|
||||
void MakeModerationOff(WorldPacket* data, ObjectGuid guid); //+ 0x10
|
||||
void MakeMuted(WorldPacket* data); //? 0x11
|
||||
void MakePlayerKicked(WorldPacket* data, ObjectGuid target, ObjectGuid source);//? 0x12
|
||||
void MakeBanned(WorldPacket* data); //? 0x13
|
||||
void MakePlayerBanned(WorldPacket* data, ObjectGuid target, ObjectGuid source);//? 0x14
|
||||
void MakePlayerUnbanned(WorldPacket* data, ObjectGuid target, ObjectGuid source);//? 0x15
|
||||
void MakePlayerNotBanned(WorldPacket* data, const std::string& name); //? 0x16
|
||||
void MakePlayerAlreadyMember(WorldPacket* data, ObjectGuid guid); //+ 0x17
|
||||
void MakeInvite(WorldPacket* data, ObjectGuid guid); //? 0x18
|
||||
void MakeInviteWrongFaction(WorldPacket* data); //? 0x19
|
||||
void MakeWrongFaction(WorldPacket* data); //? 0x1A
|
||||
void MakeInvalidName(WorldPacket* data); //? 0x1B
|
||||
void MakeNotModerated(WorldPacket* data); //? 0x1C
|
||||
void MakePlayerInvited(WorldPacket* data, const std::string& name); //+ 0x1D
|
||||
void MakePlayerInviteBanned(WorldPacket* data, const std::string& name);//? 0x1E
|
||||
void MakeThrottled(WorldPacket* data); //? 0x1F
|
||||
void MakeNotInArea(WorldPacket* data); //? 0x20
|
||||
void MakeNotInLfg(WorldPacket* data); //? 0x21
|
||||
void MakeVoiceOn(WorldPacket* data, ObjectGuid guid); //+ 0x22
|
||||
void MakeVoiceOff(WorldPacket* data, ObjectGuid guid); //+ 0x23
|
||||
|
||||
void SendToAll(WorldPacket* data, ObjectGuid guid = ObjectGuid());
|
||||
void SendToOne(WorldPacket* data, ObjectGuid who);
|
||||
void SendToAll(WorldPacket* data, ObjectGuid guid = ObjectGuid());
|
||||
void SendToOne(WorldPacket* data, ObjectGuid who);
|
||||
|
||||
bool IsOn(ObjectGuid who) const { return m_players.find(who) != m_players.end(); }
|
||||
bool IsBanned(ObjectGuid guid) const { return m_banned.find(guid) != m_banned.end(); }
|
||||
bool IsOn(ObjectGuid who) const { return m_players.find(who) != m_players.end(); }
|
||||
bool IsBanned(ObjectGuid guid) const { return m_banned.find(guid) != m_banned.end(); }
|
||||
|
||||
uint8 GetPlayerFlags(ObjectGuid guid) const
|
||||
{
|
||||
PlayerList::const_iterator p_itr = m_players.find(guid);
|
||||
if (p_itr == m_players.end())
|
||||
return 0;
|
||||
uint8 GetPlayerFlags(ObjectGuid guid) const
|
||||
{
|
||||
PlayerList::const_iterator p_itr = m_players.find(guid);
|
||||
if (p_itr == m_players.end())
|
||||
return 0;
|
||||
|
||||
return p_itr->second.flags;
|
||||
}
|
||||
return p_itr->second.flags;
|
||||
}
|
||||
|
||||
void SetModerator(ObjectGuid guid, bool set)
|
||||
{
|
||||
if (m_players[guid].IsModerator() != set)
|
||||
{
|
||||
uint8 oldFlag = GetPlayerFlags(guid);
|
||||
m_players[guid].SetModerator(set);
|
||||
void SetModerator(ObjectGuid guid, bool set)
|
||||
{
|
||||
if (m_players[guid].IsModerator() != set)
|
||||
{
|
||||
uint8 oldFlag = GetPlayerFlags(guid);
|
||||
m_players[guid].SetModerator(set);
|
||||
|
||||
WorldPacket data;
|
||||
MakeModeChange(&data, guid, oldFlag);
|
||||
SendToAll(&data);
|
||||
}
|
||||
}
|
||||
WorldPacket data;
|
||||
MakeModeChange(&data, guid, oldFlag);
|
||||
SendToAll(&data);
|
||||
}
|
||||
}
|
||||
|
||||
void SetMute(ObjectGuid guid, bool set)
|
||||
{
|
||||
if (m_players[guid].IsMuted() != set)
|
||||
{
|
||||
uint8 oldFlag = GetPlayerFlags(guid);
|
||||
m_players[guid].SetMuted(set);
|
||||
void SetMute(ObjectGuid guid, bool set)
|
||||
{
|
||||
if (m_players[guid].IsMuted() != set)
|
||||
{
|
||||
uint8 oldFlag = GetPlayerFlags(guid);
|
||||
m_players[guid].SetMuted(set);
|
||||
|
||||
WorldPacket data;
|
||||
MakeModeChange(&data, guid, oldFlag);
|
||||
SendToAll(&data);
|
||||
}
|
||||
}
|
||||
WorldPacket data;
|
||||
MakeModeChange(&data, guid, oldFlag);
|
||||
SendToAll(&data);
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
bool m_announce;
|
||||
bool m_moderate;
|
||||
std::string m_name;
|
||||
std::string m_password;
|
||||
uint8 m_flags;
|
||||
uint32 m_channelId;
|
||||
ObjectGuid m_ownerGuid;
|
||||
bool m_announce;
|
||||
bool m_moderate;
|
||||
std::string m_name;
|
||||
std::string m_password;
|
||||
uint8 m_flags;
|
||||
uint32 m_channelId;
|
||||
ObjectGuid m_ownerGuid;
|
||||
|
||||
typedef std::map<ObjectGuid, PlayerInfo> PlayerList;
|
||||
PlayerList m_players;
|
||||
GuidSet m_banned;
|
||||
typedef std::map<ObjectGuid, PlayerInfo> PlayerList;
|
||||
PlayerList m_players;
|
||||
GuidSet m_banned;
|
||||
};
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -238,14 +238,14 @@ void LFGMgr::JoinLFG(uint32 roles, std::set<uint32> dungeons, std::string commen
|
|||
|
||||
if (dungeon)
|
||||
{
|
||||
uint32 group = dungeon->group_id;
|
||||
uint32 group = dungeon->group_id;
|
||||
|
||||
for (uint32 id = 0; id < sLfgDungeonsStore.GetNumRows(); ++id)
|
||||
{
|
||||
LfgDungeonsEntry const* dungeonList = sLfgDungeonsStore.LookupEntry(id);
|
||||
if (dungeonList)
|
||||
{
|
||||
if (dungeonList->group_id == group)
|
||||
if (dungeonList->group_id == group)
|
||||
dungeons.insert(dungeonList->ID); // adding to set
|
||||
}
|
||||
}
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -91,7 +91,7 @@ class Config
|
|||
* @return int32
|
||||
*/
|
||||
int32 GetIntDefault(const char* name, const int32 def);
|
||||
int64 GetInt64Default(const char* name, const int64 def);
|
||||
int64 GetInt64Default(const char* name, const int64 def);
|
||||
/**
|
||||
* @brief
|
||||
*
|
||||
|
|
|
|||
|
|
@ -102,18 +102,18 @@ class Field
|
|||
*
|
||||
* @return bool
|
||||
*/
|
||||
bool GetBool() const { return mValue ? atoi(mValue) > 0 : false; }
|
||||
/**
|
||||
* @brief
|
||||
*
|
||||
* @return double
|
||||
*/
|
||||
double GetDouble() const { return mValue ? static_cast<double>(atof(mValue)) : 0.0f; }
|
||||
/**
|
||||
* @brief
|
||||
*
|
||||
* @return int8
|
||||
*/
|
||||
bool GetBool() const { return mValue ? atoi(mValue) > 0 : false; }
|
||||
/**
|
||||
* @brief
|
||||
*
|
||||
* @return double
|
||||
*/
|
||||
double GetDouble() const { return mValue ? static_cast<double>(atof(mValue)) : 0.0f; }
|
||||
/**
|
||||
* @brief
|
||||
*
|
||||
* @return int8
|
||||
*/
|
||||
int8 GetInt8() const { return mValue ? static_cast<int8>(atol(mValue)) : int8(0); }
|
||||
/**
|
||||
* @brief
|
||||
|
|
@ -158,11 +158,11 @@ class Field
|
|||
|
||||
return value;
|
||||
}
|
||||
/**
|
||||
* @brief
|
||||
*
|
||||
* @return int64
|
||||
*/
|
||||
/**
|
||||
* @brief
|
||||
*
|
||||
* @return int64
|
||||
*/
|
||||
uint64 GetInt64() const
|
||||
{
|
||||
int64 value = 0;
|
||||
|
|
|
|||
|
|
@ -388,13 +388,13 @@ void utf8truncate(std::string& utf8str, size_t len)
|
|||
|
||||
bool Utf8ToUpperOnlyLatin(std::string& utf8String)
|
||||
{
|
||||
std::wstring wstr;
|
||||
if (!Utf8toWStr(utf8String, wstr))
|
||||
return false;
|
||||
std::wstring wstr;
|
||||
if (!Utf8toWStr(utf8String, wstr))
|
||||
return false;
|
||||
|
||||
std::transform(wstr.begin(), wstr.end(), wstr.begin(), wcharToUpperOnlyLatin);
|
||||
std::transform(wstr.begin(), wstr.end(), wstr.begin(), wcharToUpperOnlyLatin);
|
||||
|
||||
return WStrToUtf8(wstr, utf8String);
|
||||
return WStrToUtf8(wstr, utf8String);
|
||||
}
|
||||
|
||||
bool Utf8toWStr(char const* utf8str, size_t csize, wchar_t* wstr, size_t& wsize)
|
||||
|
|
|
|||
|
|
@ -391,13 +391,13 @@ void setVMapMagicVersion(int iCoreNumber, char* magic)
|
|||
bool CreateDir(const std::string& sPath)
|
||||
{
|
||||
#ifdef WIN32
|
||||
if (_mkdir(sPath.c_str()) == 0)
|
||||
return 1;
|
||||
if (_mkdir(sPath.c_str()) == 0)
|
||||
return 1;
|
||||
#else
|
||||
if (mkdir(sPath.c_str(), 0777) == 0)
|
||||
return 1;
|
||||
if (mkdir(sPath.c_str(), 0777) == 0)
|
||||
return 1;
|
||||
#endif
|
||||
return 0; // failed to create the directory
|
||||
return 0; // failed to create the directory
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -517,8 +517,8 @@ bool shouldSkipMap(int mapID,bool m_skipContinents, bool m_skipJunkMaps, bool m_
|
|||
case 605: // development_nonweighted.wdt - (WOTLK / CATA / MOP)
|
||||
case 606: // QA_DVD.wdt - (WOTLK / CATA / MOP)
|
||||
case 627: // unused.wdt - (CATA / MOP)
|
||||
case 930: // (UNUSED) Scenario: Alcaz Island - (MOP)
|
||||
case 995: // The Depths [UNUSED] - (MOP)
|
||||
case 930: // (UNUSED) Scenario: Alcaz Island - (MOP)
|
||||
case 995: // The Depths [UNUSED] - (MOP)
|
||||
case 1010: // MistsCTF3
|
||||
case 1014: // (UNUSED) Peak of Serenity Scenario - (MOP)
|
||||
case 1028: // (UNUSED) Scenario: Mogu Ruins - (MOP)
|
||||
|
|
@ -558,7 +558,7 @@ bool shouldSkipMap(int mapID,bool m_skipContinents, bool m_skipJunkMaps, bool m_
|
|||
case 728: // BfG - (CATA / MOP)
|
||||
case 761: // BfG2 - (CATA / MOP)
|
||||
case 968: // EotS2 - (CATA / MOP)
|
||||
case 998: // VOP - (MOP)
|
||||
case 998: // VOP - (MOP)
|
||||
case 1010: // CTF3 - (MOP)
|
||||
case 1101: // DOTA - (MOP)
|
||||
case 1105: // GR - (MOP)
|
||||
|
|
|
|||
|
|
@ -41,11 +41,11 @@ int main(int argc, char* argv[])
|
|||
|
||||
std::cout << "using " << src << " as source directory and writing output to " << dest << std::endl;
|
||||
|
||||
std::cout << "Create TileAssembler " << std::endl;
|
||||
std::cout << "Create TileAssembler " << std::endl;
|
||||
|
||||
VMAP::TileAssembler* ta = new VMAP::TileAssembler(src, dest);
|
||||
VMAP::TileAssembler* ta = new VMAP::TileAssembler(src, dest);
|
||||
|
||||
std::cout << "Convert to World2 " << std::endl;
|
||||
std::cout << "Convert to World2 " << std::endl;
|
||||
|
||||
if (!ta->convertWorld2())
|
||||
{
|
||||
|
|
@ -54,7 +54,7 @@ int main(int argc, char* argv[])
|
|||
return 1;
|
||||
}
|
||||
|
||||
std::cout << "THE END!!! " << std::endl;
|
||||
std::cout << "THE END!!! " << std::endl;
|
||||
|
||||
delete ta;
|
||||
std::cout << "Ok, all done" << std::endl;
|
||||
|
|
|
|||
|
|
@ -557,8 +557,8 @@ bool processArgv(int argc, char** argv)
|
|||
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
bool bCreatedVmapsFolder = false;
|
||||
bool bExtractedWMOfiles = false;
|
||||
bool bCreatedVmapsFolder = false;
|
||||
bool bExtractedWMOfiles = false;
|
||||
std::string outDir = std::string(output_path) + "/vmaps";
|
||||
|
||||
// Use command line arguments, when some
|
||||
|
|
@ -598,9 +598,9 @@ int main(int argc, char** argv)
|
|||
//xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
|
||||
// Create the working and ouput directories
|
||||
CreateDir(std::string(szWorkDirWmo));
|
||||
bCreatedVmapsFolder = CreateDir(outDir);
|
||||
bCreatedVmapsFolder = CreateDir(outDir);
|
||||
|
||||
printf("Loading common MPQ files\n");
|
||||
printf("Loading common MPQ files\n");
|
||||
LoadCommonMPQFiles(CONF_TargetBuild);
|
||||
|
||||
int FirstLocale = -1;
|
||||
|
|
@ -621,15 +621,15 @@ int main(int argc, char** argv)
|
|||
ReadLiquidTypeTableDBC();
|
||||
|
||||
// extract data
|
||||
if (bCreatedVmapsFolder)
|
||||
{
|
||||
printf("Extracting WMO file\n");
|
||||
bExtractedWMOfiles = ExtractWmo();
|
||||
}
|
||||
if (bCreatedVmapsFolder)
|
||||
{
|
||||
printf("Extracting WMO file\n");
|
||||
bExtractedWMOfiles = ExtractWmo();
|
||||
}
|
||||
|
||||
//xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
|
||||
//map.dbc
|
||||
if (bExtractedWMOfiles)
|
||||
if (bExtractedWMOfiles)
|
||||
{
|
||||
DBCFile* dbc = new DBCFile(LocaleMpq, "DBFilesClient\\Map.dbc");
|
||||
if (!dbc->open())
|
||||
|
|
@ -660,17 +660,17 @@ int main(int argc, char** argv)
|
|||
SFileCloseArchive(WorldMpq);
|
||||
|
||||
printf("\n");
|
||||
if (!bExtractedWMOfiles)
|
||||
if (!bExtractedWMOfiles)
|
||||
{
|
||||
printf("ERROR: Extract for %s. Work NOT complete.\n Precise vector data=%d.\nPress any key.\n", szRawVMAPMagic, preciseVectorData);
|
||||
getchar();
|
||||
return 1;
|
||||
}
|
||||
|
||||
printf("Extract for %s. Work complete. ", szRawVMAPMagic);
|
||||
if (!bCreatedVmapsFolder || !bExtractedWMOfiles)
|
||||
printf("There were errors.\n");
|
||||
else
|
||||
printf("Extract for %s. Work complete. ", szRawVMAPMagic);
|
||||
if (!bCreatedVmapsFolder || !bExtractedWMOfiles)
|
||||
printf("There were errors.\n");
|
||||
else
|
||||
printf("No errors.\n");
|
||||
|
||||
delete [] LiqType;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue