mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-18 08:28:32 +01:00
Missing part
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2011 TrintiyCore <http://www.trinitycore.org/>
|
||||
* Copyright (C) 2008-2017 TrinityCore <http://www.trinitycore.org/>
|
||||
*
|
||||
* 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)
|
||||
{
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2011 TrintiyCore <http://www.trinitycore.org/>
|
||||
* Copyright (C) 2008-2017 TrinityCore <http://www.trinitycore.org/>
|
||||
*
|
||||
* 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
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2011 TrintiyCore <http://www.trinitycore.org/>
|
||||
* Copyright (C) 2008-2017 TrinityCore <http://www.trinitycore.org/>
|
||||
*
|
||||
* 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
|
||||
#endif
|
||||
|
||||
@@ -33,7 +33,7 @@ bool DB2Utilities::HasItemSparseEntry(DB2Storage<ItemSparseEntry> const& /*store
|
||||
return ItemExists(id);
|
||||
}
|
||||
|
||||
void DB2Utilities::WriteItemDbReply(DB2Storage<ItemEntry> const& /*store*/, uint32 id, uint32 /*locale*/, ByteBuffer& buffer)
|
||||
void DB2Utilities::WriteItemDbReply(DB2Storage<ItemEntry> const& /*store*/, uint32 id, LocaleConstant /*localeConstant*/, ByteBuffer& buffer)
|
||||
{
|
||||
ItemTemplate const* proto = sObjectMgr->GetItemTemplate(id);
|
||||
ASSERT(proto);
|
||||
@@ -48,12 +48,12 @@ void DB2Utilities::WriteItemDbReply(DB2Storage<ItemEntry> const& /*store*/, uint
|
||||
buffer << uint32(proto->Sheath);
|
||||
}
|
||||
|
||||
void DB2Utilities::WriteItemSparseDbReply(DB2Storage<ItemSparseEntry> const& /*store*/, uint32 id, uint32 locale, ByteBuffer& buffer)
|
||||
void DB2Utilities::WriteItemSparseDbReply(DB2Storage<ItemSparseEntry> 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<ItemSparseEntry> 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<ItemSparseEntry> 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())
|
||||
|
||||
@@ -33,8 +33,8 @@ namespace DB2Utilities
|
||||
bool HasItemSparseEntry(DB2Storage<ItemSparseEntry> const& store, uint32 id);
|
||||
|
||||
//
|
||||
void WriteItemDbReply(DB2Storage<ItemEntry> const& store, uint32 id, uint32 locale, ByteBuffer& buffer);
|
||||
void WriteItemSparseDbReply(DB2Storage<ItemSparseEntry> const& store, uint32 id, uint32 locale, ByteBuffer& buffer);
|
||||
void WriteItemDbReply(DB2Storage<ItemEntry> const& store, uint32 id, LocaleConstant localeConstant, ByteBuffer& buffer);
|
||||
void WriteItemSparseDbReply(DB2Storage<ItemSparseEntry> const& store, uint32 id, LocaleConstant localeConstant, ByteBuffer& buffer);
|
||||
}
|
||||
|
||||
#endif // DB2PACKETWRITER_H
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2011 TrintiyCore <http://www.trinitycore.org/>
|
||||
* Copyright (C) 2008-2017 TrinityCore <http://www.trinitycore.org/>
|
||||
*
|
||||
* 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
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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];
|
||||
|
||||
@@ -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<uint32>(sizePos, data.wpos() - sizePos - 4);
|
||||
|
||||
SendPacket(&data);
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2011 TrintiyCore <http://www.trinitycore.org/>
|
||||
* Copyright (C) 2008-2017 TrinityCore <http://www.trinitycore.org/>
|
||||
*
|
||||
* 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
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2011 TrintiyCore <http://www.trinitycore.org/>
|
||||
* Copyright (C) 2007-2017 TrinityCore <http://www.trinitycore.org/>
|
||||
*
|
||||
* 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
|
||||
#endif
|
||||
|
||||
@@ -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<char*> StringPoolList;
|
||||
typedef std::vector<T*> DataTableEx;
|
||||
typedef bool(*EntryChecker)(DB2Storage<T> const&, uint32);
|
||||
typedef void(*PacketWriter)(DB2Storage<T> const&, uint32, uint32, ByteBuffer&);
|
||||
typedef void(*PacketWriter)(DB2Storage<T> 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;
|
||||
|
||||
Reference in New Issue
Block a user