mirror of
https://github.com/mangosfour/server.git
synced 2025-12-26 07:37:02 +00:00
[9861] Backporting some code chnages from 400 branch.
(based on 400's commit 0f37423) (based on 400's commit 636cfef) (based on 400's commit 0bbe3a7) (based on 400's commit ce86b56) (based on 400's commit b74c6a8)
This commit is contained in:
parent
a0d9ffcc5f
commit
ff2cda6af1
18 changed files with 68 additions and 43 deletions
|
|
@ -31,7 +31,7 @@ char const* localeNames[MAX_LOCALE] = {
|
|||
};
|
||||
|
||||
// used for search by name or iterate all names
|
||||
LocaleNameStr fullLocaleNameList[] =
|
||||
LocaleNameStr const fullLocaleNameList[] =
|
||||
{
|
||||
{ "enUS", LOCALE_enUS },
|
||||
{ "enGB", LOCALE_enUS },
|
||||
|
|
@ -48,7 +48,7 @@ LocaleNameStr fullLocaleNameList[] =
|
|||
|
||||
LocaleConstant GetLocaleByName(const std::string& name)
|
||||
{
|
||||
for(LocaleNameStr* itr = &fullLocaleNameList[0]; itr->name; ++itr)
|
||||
for(LocaleNameStr const* itr = &fullLocaleNameList[0]; itr->name; ++itr)
|
||||
if (name==itr->name)
|
||||
return itr->locale;
|
||||
|
||||
|
|
|
|||
|
|
@ -220,7 +220,7 @@ struct LocaleNameStr
|
|||
};
|
||||
|
||||
// used for iterate all names including alternative
|
||||
extern LocaleNameStr fullLocaleNameList[];
|
||||
extern LocaleNameStr const fullLocaleNameList[];
|
||||
|
||||
//operator new[] based version of strdup() function! Release memory by using operator delete[] !
|
||||
inline char * mangos_strdup(const char * source)
|
||||
|
|
|
|||
|
|
@ -242,6 +242,7 @@ char* DBCFileLoader::AutoProduceStrings(const char* format, char* dataTable)
|
|||
offset+=1;
|
||||
break;
|
||||
case FT_STRING:
|
||||
{
|
||||
// fill only not filled entries
|
||||
char** slot = (char**)(&dataTable[offset]);
|
||||
if(!*slot || !**slot)
|
||||
|
|
@ -251,6 +252,13 @@ char* DBCFileLoader::AutoProduceStrings(const char* format, char* dataTable)
|
|||
}
|
||||
offset+=sizeof(char*);
|
||||
break;
|
||||
}
|
||||
case FT_NA:
|
||||
case FT_NA_BYTE:
|
||||
case FT_SORT:
|
||||
break;
|
||||
default:
|
||||
assert(false && "unknown format character");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -42,7 +42,11 @@ class DBCStorage
|
|||
return false;
|
||||
|
||||
fieldCount = dbc.GetCols();
|
||||
|
||||
// load raw non-string data
|
||||
m_dataTable = (T*)dbc.AutoProduceData(fmt,nCount,(char**&)indexTable);
|
||||
|
||||
// load strings from dbc data
|
||||
m_stringPoolList.push_back(dbc.AutoProduceStrings(fmt,(char*)m_dataTable));
|
||||
|
||||
// error in dbc file at loading if NULL
|
||||
|
|
@ -60,6 +64,7 @@ class DBCStorage
|
|||
if(!dbc.Load(fn, fmt))
|
||||
return false;
|
||||
|
||||
// load strings from another locale dbc data
|
||||
m_stringPoolList.push_back(dbc.AutoProduceStrings(fmt,(char*)m_dataTable));
|
||||
|
||||
return true;
|
||||
|
|
@ -93,4 +98,5 @@ class DBCStorage
|
|||
T* m_dataTable;
|
||||
StringPoolList m_stringPoolList;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
#ifndef __REVISION_NR_H__
|
||||
#define __REVISION_NR_H__
|
||||
#define REVISION_NR "9860"
|
||||
#define REVISION_NR "9861"
|
||||
#endif // __REVISION_NR_H__
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue