mirror of
https://github.com/mangosfour/server.git
synced 2025-12-25 22:37:04 +00:00
Merge branch 'master' into 303
Conflicts: src/game/Player.h
This commit is contained in:
commit
5d4d7292b9
47 changed files with 244 additions and 209 deletions
|
|
@ -30,7 +30,7 @@ char const* localeNames[MAX_LOCALE] = {
|
|||
"ruRU"
|
||||
};
|
||||
|
||||
LocaleConstant GetLocaleByName(std::string name)
|
||||
LocaleConstant GetLocaleByName(const std::string& name)
|
||||
{
|
||||
for(uint32 i = 0; i < MAX_LOCALE; ++i)
|
||||
if(name==localeNames[i])
|
||||
|
|
|
|||
|
|
@ -186,7 +186,7 @@ enum LocaleConstant
|
|||
|
||||
extern char const* localeNames[MAX_LOCALE];
|
||||
|
||||
LocaleConstant GetLocaleByName(std::string name);
|
||||
LocaleConstant GetLocaleByName(const std::string& name);
|
||||
|
||||
// we always use stdlibc++ std::max/std::min, undefine some not C++ standard defines (Win API and some pother platforms)
|
||||
#ifdef max
|
||||
|
|
|
|||
|
|
@ -23,6 +23,5 @@
|
|||
#include "Common.h"
|
||||
#include "dotconfpp/dotconfpp.h"
|
||||
#include "Config.h"
|
||||
#include "Log.h"
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -141,7 +141,7 @@ DBCStorage <WorldMapOverlayEntry> sWorldMapOverlayStore(WorldMapOverlayEntryfmt)
|
|||
|
||||
typedef std::list<std::string> StoreProblemList;
|
||||
|
||||
static bool LoadDBC_assert_print(uint32 fsize,uint32 rsize, std::string filename)
|
||||
static bool LoadDBC_assert_print(uint32 fsize,uint32 rsize, const std::string& filename)
|
||||
{
|
||||
sLog.outError("ERROR: Size of '%s' setted by format string (%u) not equal size of C++ structure (%u).",filename.c_str(),fsize,rsize);
|
||||
|
||||
|
|
@ -150,7 +150,7 @@ static bool LoadDBC_assert_print(uint32 fsize,uint32 rsize, std::string filename
|
|||
}
|
||||
|
||||
template<class T>
|
||||
inline void LoadDBC(uint32& availableDbcLocales,barGoLink& bar, StoreProblemList& errlist, DBCStorage<T>& storage, std::string dbc_path, std::string filename)
|
||||
inline void LoadDBC(uint32& availableDbcLocales,barGoLink& bar, StoreProblemList& errlist, DBCStorage<T>& storage, const std::string& dbc_path, const std::string& filename)
|
||||
{
|
||||
// compatibility format and C++ structure sizes
|
||||
assert(DBCFile::GetFormatRecordSize(storage.GetFormat()) == sizeof(T) || LoadDBC_assert_print(DBCFile::GetFormatRecordSize(storage.GetFormat()),sizeof(T),filename));
|
||||
|
|
@ -185,7 +185,7 @@ inline void LoadDBC(uint32& availableDbcLocales,barGoLink& bar, StoreProblemList
|
|||
}
|
||||
}
|
||||
|
||||
void LoadDBCStores(std::string dataPath)
|
||||
void LoadDBCStores(const std::string& dataPath)
|
||||
{
|
||||
std::string dbcPath = dataPath+"dbc/";
|
||||
|
||||
|
|
|
|||
|
|
@ -208,7 +208,7 @@ extern DBCStorage <VehicleSeatEntry> sVehicleSeatStore;
|
|||
extern DBCStorage <WorldSafeLocsEntry> sWorldSafeLocsStore;
|
||||
extern DBCStorage <WorldMapOverlayEntry> sWorldMapOverlayStore;
|
||||
|
||||
void LoadDBCStores(std::string dataPath);
|
||||
void LoadDBCStores(const std::string& dataPath);
|
||||
|
||||
// script support functions
|
||||
MANGOS_DLL_SPEC DBCStorage <SoundEntriesEntry> const* GetSoundEntriesStore();
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ Log::Log() :
|
|||
Initialize();
|
||||
}
|
||||
|
||||
void Log::InitColors(std::string str)
|
||||
void Log::InitColors(const std::string& str)
|
||||
{
|
||||
if(str.empty())
|
||||
{
|
||||
|
|
|
|||
|
|
@ -82,7 +82,7 @@ class Log : public MaNGOS::Singleton<Log, MaNGOS::ClassLevelLockable<Log, ZThrea
|
|||
}
|
||||
public:
|
||||
void Initialize();
|
||||
void InitColors(std::string init_str);
|
||||
void InitColors(const std::string& init_str);
|
||||
void outTitle( const char * str);
|
||||
void outCommand( uint32 account, const char * str, ...) ATTR_PRINTF(3,4);
|
||||
void outString(); // any log level
|
||||
|
|
|
|||
|
|
@ -131,13 +131,13 @@ std::string secsToTimeString(uint32 timeInSecs, bool shortText, bool hoursOnly)
|
|||
return ss.str();
|
||||
}
|
||||
|
||||
uint32 TimeStringToSecs(std::string timestring)
|
||||
uint32 TimeStringToSecs(const std::string& timestring)
|
||||
{
|
||||
uint32 secs = 0;
|
||||
uint32 buffer = 0;
|
||||
uint32 multiplier = 0;
|
||||
|
||||
for(std::string::iterator itr = timestring.begin(); itr != timestring.end(); itr++ )
|
||||
for(std::string::const_iterator itr = timestring.begin(); itr != timestring.end(); itr++ )
|
||||
{
|
||||
if(isdigit(*itr))
|
||||
{
|
||||
|
|
@ -193,7 +193,7 @@ bool IsIPAddress(char const* ipaddress)
|
|||
}
|
||||
|
||||
/// create PID file
|
||||
uint32 CreatePIDFile(std::string filename)
|
||||
uint32 CreatePIDFile(const std::string& filename)
|
||||
{
|
||||
FILE * pid_file = fopen (filename.c_str(), "w" );
|
||||
if (pid_file == NULL)
|
||||
|
|
@ -271,7 +271,7 @@ bool Utf8toWStr(char const* utf8str, size_t csize, wchar_t* wstr, size_t& wsize)
|
|||
return true;
|
||||
}
|
||||
|
||||
bool Utf8toWStr(std::string utf8str, std::wstring& wstr)
|
||||
bool Utf8toWStr(const std::string& utf8str, std::wstring& wstr)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
|
@ -376,7 +376,7 @@ std::wstring GetMainPartOfName(std::wstring wname, uint32 declension)
|
|||
return wname;
|
||||
}
|
||||
|
||||
bool utf8ToConsole(std::string utf8str, std::string& conStr)
|
||||
bool utf8ToConsole(const std::string& utf8str, std::string& conStr)
|
||||
{
|
||||
#if PLATFORM == PLATFORM_WINDOWS
|
||||
std::wstring wstr;
|
||||
|
|
@ -393,7 +393,7 @@ bool utf8ToConsole(std::string utf8str, std::string& conStr)
|
|||
return true;
|
||||
}
|
||||
|
||||
bool consoleToUtf8(std::string conStr,std::string& utf8str)
|
||||
bool consoleToUtf8(const std::string& conStr,std::string& utf8str)
|
||||
{
|
||||
#if PLATFORM == PLATFORM_WINDOWS
|
||||
std::wstring wstr;
|
||||
|
|
@ -408,7 +408,7 @@ bool consoleToUtf8(std::string conStr,std::string& utf8str)
|
|||
#endif
|
||||
}
|
||||
|
||||
bool Utf8FitTo(std::string str, std::wstring search)
|
||||
bool Utf8FitTo(const std::string& str, std::wstring search)
|
||||
{
|
||||
std::wstring temp;
|
||||
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ Tokens StrSplit(const std::string &src, const std::string &sep);
|
|||
void stripLineInvisibleChars(std::string &src);
|
||||
|
||||
std::string secsToTimeString(uint32 timeInSecs, bool shortText = false, bool hoursOnly = false);
|
||||
uint32 TimeStringToSecs(std::string timestring);
|
||||
uint32 TimeStringToSecs(const std::string& timestring);
|
||||
std::string TimeToTimestampStr(time_t t);
|
||||
|
||||
inline uint32 secsToTimeBitFields(time_t secs)
|
||||
|
|
@ -95,10 +95,10 @@ inline void ApplyPercentModFloatVar(float& var, float val, bool apply)
|
|||
var *= (apply?(100.0f+val)/100.0f : 100.0f / (100.0f+val));
|
||||
}
|
||||
|
||||
bool Utf8toWStr(std::string utf8str, std::wstring& wstr);
|
||||
bool Utf8toWStr(const std::string& utf8str, std::wstring& wstr);
|
||||
// in wsize==max size of buffer, out wsize==real string size
|
||||
bool Utf8toWStr(char const* utf8str, size_t csize, wchar_t* wstr, size_t& wsize);
|
||||
inline bool Utf8toWStr(std::string utf8str, wchar_t* wstr, size_t& wsize)
|
||||
inline bool Utf8toWStr(const std::string& utf8str, wchar_t* wstr, size_t& wsize)
|
||||
{
|
||||
return Utf8toWStr(utf8str.c_str(), utf8str.size(), wstr, wsize);
|
||||
}
|
||||
|
|
@ -280,9 +280,9 @@ inline void wstrToLower(std::wstring& str)
|
|||
|
||||
std::wstring GetMainPartOfName(std::wstring wname, uint32 declension);
|
||||
|
||||
bool utf8ToConsole(std::string utf8str, std::string& conStr);
|
||||
bool consoleToUtf8(std::string conStr,std::string& utf8str);
|
||||
bool Utf8FitTo(std::string str, std::wstring search);
|
||||
bool utf8ToConsole(const std::string& utf8str, std::string& conStr);
|
||||
bool consoleToUtf8(const std::string& conStr,std::string& utf8str);
|
||||
bool Utf8FitTo(const std::string& str, std::wstring search);
|
||||
|
||||
#if PLATFORM == PLATFORM_WINDOWS
|
||||
#define UTF8PRINTF(OUT,FRM,RESERR) \
|
||||
|
|
@ -311,6 +311,6 @@ bool Utf8FitTo(std::string str, std::wstring search);
|
|||
#endif
|
||||
|
||||
bool IsIPAddress(char const* ipaddress);
|
||||
uint32 CreatePIDFile(std::string filename);
|
||||
uint32 CreatePIDFile(const std::string& filename);
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
#ifndef __REVISION_NR_H__
|
||||
#define __REVISION_NR_H__
|
||||
#define REVISION_NR "6895"
|
||||
#define REVISION_NR "6902"
|
||||
#endif // __REVISION_NR_H__
|
||||
|
|
|
|||
|
|
@ -43,8 +43,8 @@ namespace VMAP
|
|||
G3D::Array<std::string> iMainFiles;
|
||||
G3D::Array<std::string> iSingeFiles;
|
||||
|
||||
void appendToMain(std::string pStr) { iMainFiles.append(pStr); }
|
||||
void appendToSingle(std::string pStr) { iSingeFiles.append(pStr); }
|
||||
void appendToMain(const std::string& pStr) { iMainFiles.append(pStr); }
|
||||
void appendToSingle(const std::string& pStr) { iSingeFiles.append(pStr); }
|
||||
|
||||
size_t size() { return (iMainFiles.size() + iSingeFiles.size()); }
|
||||
};
|
||||
|
|
@ -113,7 +113,7 @@ namespace VMAP
|
|||
|
||||
const NameCollection getFilenamesForCoordinate(unsigned int pMapId, int xPos, int yPos);
|
||||
|
||||
static unsigned int getMapIdFromFilename(std::string pName)
|
||||
static unsigned int getMapIdFromFilename(const std::string& pName)
|
||||
{
|
||||
size_t spos;
|
||||
|
||||
|
|
@ -126,8 +126,8 @@ namespace VMAP
|
|||
}
|
||||
|
||||
const G3D::Array<unsigned int>& getMaps() const { return iMapIds; }
|
||||
bool isAlreadyProcessedSingleFile(std::string pName) const { return iProcesseSingleFiles.containsKey(pName); }
|
||||
void addAlreadyProcessedSingleFile(std::string pName) { iProcesseSingleFiles.set(pName,pName); }
|
||||
bool isAlreadyProcessedSingleFile(const std::string& pName) const { return iProcesseSingleFiles.containsKey(pName); }
|
||||
void addAlreadyProcessedSingleFile(const std::string& pName) { iProcesseSingleFiles.set(pName,pName); }
|
||||
|
||||
inline void addWorldAreaMap(unsigned int pMapId)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue