diff --git a/src/server/game/DataStores/DB2Stores.cpp b/src/server/game/DataStores/DB2Stores.cpp
index f1436dd90e3..4571ecd5ef6 100644
--- a/src/server/game/DataStores/DB2Stores.cpp
+++ b/src/server/game/DataStores/DB2Stores.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2011 TrintiyCore
+ * Copyright (C) 2008-2017 TrinityCore
*
* 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
@@ -52,7 +52,7 @@ inline void LoadDB2(uint32& availableDb2Locales, DB2StoreProblemList& errlist, D
++DB2FilesCount;
std::string db2_filename = db2_path + filename;
- if (storage.Load(db2_filename.c_str(), uint32(sWorld->GetDefaultDbcLocale())))
+ if (storage.Load(db2_filename.c_str(), LocaleConstant(sWorld->GetDefaultDbcLocale())))
{
for (uint32 i = 0; i < TOTAL_LOCALES; ++i)
{
diff --git a/src/server/game/DataStores/DB2Stores.h b/src/server/game/DataStores/DB2Stores.h
index 17a92f98cde..f18313b1df3 100644
--- a/src/server/game/DataStores/DB2Stores.h
+++ b/src/server/game/DataStores/DB2Stores.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2011 TrintiyCore
+ * Copyright (C) 2008-2017 TrinityCore
*
* 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
diff --git a/src/server/game/DataStores/DB2Structure.h b/src/server/game/DataStores/DB2Structure.h
index 8a123c42aeb..c75f491b259 100644
--- a/src/server/game/DataStores/DB2Structure.h
+++ b/src/server/game/DataStores/DB2Structure.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2011 TrintiyCore
+ * Copyright (C) 2008-2017 TrinityCore
*
* 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
@@ -157,4 +157,4 @@ struct KeyChainEntry
#pragma pack(pop)
#endif
-#endif
\ No newline at end of file
+#endif
diff --git a/src/server/game/DataStores/DB2Utility.cpp b/src/server/game/DataStores/DB2Utility.cpp
index 22c81e99e41..d2a2ae93270 100644
--- a/src/server/game/DataStores/DB2Utility.cpp
+++ b/src/server/game/DataStores/DB2Utility.cpp
@@ -33,7 +33,7 @@ bool DB2Utilities::HasItemSparseEntry(DB2Storage const& /*store
return ItemExists(id);
}
-void DB2Utilities::WriteItemDbReply(DB2Storage const& /*store*/, uint32 id, uint32 /*locale*/, ByteBuffer& buffer)
+void DB2Utilities::WriteItemDbReply(DB2Storage const& /*store*/, uint32 id, LocaleConstant /*localeConstant*/, ByteBuffer& buffer)
{
ItemTemplate const* proto = sObjectMgr->GetItemTemplate(id);
ASSERT(proto);
@@ -48,12 +48,12 @@ void DB2Utilities::WriteItemDbReply(DB2Storage const& /*store*/, uint
buffer << uint32(proto->Sheath);
}
-void DB2Utilities::WriteItemSparseDbReply(DB2Storage const& /*store*/, uint32 id, uint32 locale, ByteBuffer& buffer)
+void DB2Utilities::WriteItemSparseDbReply(DB2Storage const& /*store*/, uint32 id, LocaleConstant localeConstant, ByteBuffer& buffer)
{
ItemTemplate const* proto = sObjectMgr->GetItemTemplate(id);
ASSERT(proto);
- ItemLocale const* localeData = locale ? sObjectMgr->GetItemLocale(id) : NULL;
+ ItemLocale const* localeData = localeConstant ? sObjectMgr->GetItemLocale(id) : NULL;
buffer << uint32(proto->ItemId);
buffer << uint32(proto->Quality);
@@ -120,7 +120,7 @@ void DB2Utilities::WriteItemSparseDbReply(DB2Storage const& /*s
// item name
std::string name = proto->Name1;
if (localeData)
- ObjectMgr::GetLocaleString(localeData->Name, locale, name);
+ ObjectMgr::GetLocaleString(localeData->Name, localeConstant, name);
buffer << uint16(name.length());
if (name.length())
@@ -131,7 +131,7 @@ void DB2Utilities::WriteItemSparseDbReply(DB2Storage const& /*s
std::string desc = proto->Description;
if (localeData)
- ObjectMgr::GetLocaleString(localeData->Description, locale, desc);
+ ObjectMgr::GetLocaleString(localeData->Description, localeConstant, desc);
buffer << uint16(desc.length());
if (desc.length())
diff --git a/src/server/game/DataStores/DB2Utility.h b/src/server/game/DataStores/DB2Utility.h
index 3cafeb552ee..fb072733e51 100644
--- a/src/server/game/DataStores/DB2Utility.h
+++ b/src/server/game/DataStores/DB2Utility.h
@@ -33,8 +33,8 @@ namespace DB2Utilities
bool HasItemSparseEntry(DB2Storage const& store, uint32 id);
//
- void WriteItemDbReply(DB2Storage const& store, uint32 id, uint32 locale, ByteBuffer& buffer);
- void WriteItemSparseDbReply(DB2Storage const& store, uint32 id, uint32 locale, ByteBuffer& buffer);
+ void WriteItemDbReply(DB2Storage const& store, uint32 id, LocaleConstant localeConstant, ByteBuffer& buffer);
+ void WriteItemSparseDbReply(DB2Storage const& store, uint32 id, LocaleConstant localeConstant, ByteBuffer& buffer);
}
#endif // DB2PACKETWRITER_H
diff --git a/src/server/game/DataStores/DB2fmt.h b/src/server/game/DataStores/DB2fmt.h
index e2904aed51e..2a93220066c 100644
--- a/src/server/game/DataStores/DB2fmt.h
+++ b/src/server/game/DataStores/DB2fmt.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2011 TrintiyCore
+ * Copyright (C) 2008-2017 TrinityCore
*
* 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
diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp
index 75a8c602b20..3637ef1e7e5 100644
--- a/src/server/game/Globals/ObjectMgr.cpp
+++ b/src/server/game/Globals/ObjectMgr.cpp
@@ -7441,7 +7441,7 @@ void ObjectMgr::LoadPointsOfInterest()
if (!Trinity::IsValidMapCoord(pointOfInterest.PositionX, pointOfInterest.PositionY))
{
- TC_LOG_ERROR("sql.sql", "Table `points_of_interest` (ID: %u) have invalid coordinates (PositionX: %f PositionY: %f), ignored.", point_id, POI.PositionX, POI.PositionY);
+ TC_LOG_ERROR("sql.sql", "Table `points_of_interest` (ID: %u) have invalid coordinates (PositionX: %f PositionY: %f), ignored.", id, pointOfInterest.PositionX, pointOfInterest.PositionY);
continue;
}
diff --git a/src/server/game/Globals/ObjectMgr.h b/src/server/game/Globals/ObjectMgr.h
index e9f0c9d8bae..cd2b81dee25 100644
--- a/src/server/game/Globals/ObjectMgr.h
+++ b/src/server/game/Globals/ObjectMgr.h
@@ -1363,7 +1363,7 @@ class TC_GAME_API ObjectMgr
GraveYardContainer GraveYardStore;
static void AddLocaleString(std::string const& value, LocaleConstant localeConstant, StringVector& data);
- static inline void GetLocaleString(const StringVector const& data, LocaleConstant localeConstant, std::string& value)
+ static inline void GetLocaleString(StringVector const& data, LocaleConstant localeConstant, std::string& value)
{
if (data.size() > size_t(localeConstant) && !data[localeConstant].empty())
value = data[localeConstant];
diff --git a/src/server/game/Handlers/MiscHandler.cpp b/src/server/game/Handlers/MiscHandler.cpp
index b3df68bf14f..b7450deb388 100644
--- a/src/server/game/Handlers/MiscHandler.cpp
+++ b/src/server/game/Handlers/MiscHandler.cpp
@@ -1801,7 +1801,7 @@ void WorldSession::HandleRequestHotfix(WorldPacket& recvPacket)
size_t sizePos = data.wpos();
data << uint32(0); // size of next block
- store->WriteRecord(entry, uint32(GetSessionDbcLocale()), data);
+ store->WriteRecord(entry, LocaleConstant(GetSessionDbcLocale()), data);
data.put(sizePos, data.wpos() - sizePos - 4);
SendPacket(&data);
diff --git a/src/server/scripts/Commands/cs_group.cpp b/src/server/scripts/Commands/cs_group.cpp
index afb986ccbaa..3a39cdf9fa4 100644
--- a/src/server/scripts/Commands/cs_group.cpp
+++ b/src/server/scripts/Commands/cs_group.cpp
@@ -346,14 +346,14 @@ public:
// ... than, it prints information like "is online", where he is, etc...
onlineState = "online";
phase = (!p->IsGameMaster() ? p->GetPhaseMask() : -1);
- uint32 locale = handler->GetSessionDbcLocale();
+ LocaleConstant localeConstant = handler->GetSessionDbcLocale();
AreaTableEntry const* area = sAreaTableStore.LookupEntry(p->GetAreaId());
if (area)
{
AreaTableEntry const* zone = sAreaTableStore.LookupEntry(area->zone);
if (zone)
- zoneName = zone->area_name[locale];
+ zoneName = zone->area_name[localeConstant];
}
}
else
diff --git a/src/server/shared/DataStores/DB2FileLoader.cpp b/src/server/shared/DataStores/DB2FileLoader.cpp
index 7772b8ab9a1..dec839b0c1c 100644
--- a/src/server/shared/DataStores/DB2FileLoader.cpp
+++ b/src/server/shared/DataStores/DB2FileLoader.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2011 TrintiyCore
+ * Copyright (C) 2008-2017 TrinityCore
*
* 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
diff --git a/src/server/shared/DataStores/DB2FileLoader.h b/src/server/shared/DataStores/DB2FileLoader.h
index 001980c4e4c..3e01d5e8017 100644
--- a/src/server/shared/DataStores/DB2FileLoader.h
+++ b/src/server/shared/DataStores/DB2FileLoader.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2011 TrintiyCore
+ * Copyright (C) 2007-2017 TrinityCore
*
* 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
@@ -104,4 +104,4 @@ private:
int unk5; // WDB2
};
-#endif
\ No newline at end of file
+#endif
diff --git a/src/server/shared/DataStores/DB2Store.h b/src/server/shared/DataStores/DB2Store.h
index 8bc4f5f3d3b..5ee36216ed8 100644
--- a/src/server/shared/DataStores/DB2Store.h
+++ b/src/server/shared/DataStores/DB2Store.h
@@ -33,7 +33,7 @@ public:
virtual bool HasRecord(uint32 id) const = 0;
- virtual void WriteRecord(uint32 id, uint32 locale, ByteBuffer& buffer) const = 0;
+ virtual void WriteRecord(uint32 id, LocaleConstant localeConstant, ByteBuffer& buffer) const = 0;
protected:
uint32 tableHash;
@@ -103,7 +103,7 @@ class DB2Storage : public DB2StorageBase
typedef std::list StringPoolList;
typedef std::vector DataTableEx;
typedef bool(*EntryChecker)(DB2Storage const&, uint32);
- typedef void(*PacketWriter)(DB2Storage const&, uint32, uint32, ByteBuffer&);
+ typedef void(*PacketWriter)(DB2Storage const&, uint32, LocaleConstant, ByteBuffer&);
public:
DB2Storage(char const* f, EntryChecker checkEntry = NULL, PacketWriter writePacket = NULL) :
nCount(0), fieldCount(0), fmt(f), m_dataTable(NULL)
@@ -120,9 +120,9 @@ public:
uint32 GetNumRows() const { return nCount; }
char const* GetFormat() const { return fmt; }
uint32 GetFieldCount() const { return fieldCount; }
- void WriteRecord(uint32 id, uint32 locale, ByteBuffer& buffer) const
+ void WriteRecord(uint32 id, LocaleConstant localeConstant, ByteBuffer& buffer) const
{
- WritePacket(*this, id, locale, buffer);
+ WritePacket(*this, id, localeConstant, buffer);
}
T* CreateEntry(uint32 id, bool evenIfExists = false)
@@ -149,7 +149,7 @@ public:
void EraseEntry(uint32 id) { indexTable.asT[id] = NULL; }
- bool Load(char const* fn, uint32 locale)
+ bool Load(char const* fn, LocaleConstant localeConstant)
{
DB2FileLoader db2;
// Check if load was sucessful, only then continue
@@ -166,7 +166,7 @@ public:
m_stringPoolList.push_back(db2.AutoProduceStringsArrayHolders(fmt, (char*)m_dataTable));
// load strings from dbc data
- m_stringPoolList.push_back(db2.AutoProduceStrings(fmt, (char*)m_dataTable, locale));
+ m_stringPoolList.push_back(db2.AutoProduceStrings(fmt, (char*)m_dataTable, localeConstant));
// error in dbc file at loading if NULL
return indexTable.asT != NULL;