Skip to content

Commit

Permalink
Backported forgotten vanilla/wotlk changes
Browse files Browse the repository at this point in the history
  • Loading branch information
danielsreichenbach authored and killerwife committed Apr 25, 2021
1 parent 61dde8f commit c422b4f
Show file tree
Hide file tree
Showing 22 changed files with 63 additions and 33 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -90,3 +90,4 @@ cmake_install.cmake

# recastnavigation directory needs exception
!dep/recastnavigation/RecastDemo/Build/
/_build/
2 changes: 1 addition & 1 deletion src/framework/GameSystem/TypeContainer.h
Expand Up @@ -49,7 +49,7 @@ struct ContainerUnorderedMap< TypeList<H, T>, KEY_TYPE >
ContainerUnorderedMap<T, KEY_TYPE> _TailElements;
};

template < class OBJECT_TYPES, class KEY_TYPE = OBJECT_HANDLE >
template<class OBJECT_TYPES, class KEY_TYPE = OBJECT_HANDLE>
class TypeUnorderedMapContainer
{
public:
Expand Down
2 changes: 1 addition & 1 deletion src/framework/Platform/CompilerDefs.h
Expand Up @@ -63,6 +63,6 @@
# pragma warning(disable:4355) // 'this' : used in base member initializer list
# pragma warning(disable:4251) // 'function': was declared deprecated
#endif // __SHOW_STUPID_WARNINGS__
#endif
#endif // __GNUC__

#endif
1 change: 0 additions & 1 deletion src/framework/Platform/Define.h
Expand Up @@ -22,7 +22,6 @@
#include "Platform/CompilerDefs.h"

#include <cstdint>

#include <sys/types.h>

#define MANGOS_LITTLEENDIAN 0
Expand Down
1 change: 0 additions & 1 deletion src/framework/Policies/ThreadingModel.h
Expand Up @@ -146,7 +146,6 @@ namespace MaNGOS

static MUTEX si_mtx;
};

}

template<class T, class MUTEX> MUTEX MaNGOS::ClassLevelLockable<T, MUTEX>::si_mtx;
Expand Down
10 changes: 5 additions & 5 deletions src/framework/Utilities/Callback.h
Expand Up @@ -48,7 +48,7 @@ struct null { null() {} };

namespace MaNGOS
{
template < class Class, typename ParamType1 = void, typename ParamType2 = void, typename ParamType3 = void, typename ParamType4 = void >
template<class Class, typename ParamType1 = void, typename ParamType2 = void, typename ParamType3 = void, typename ParamType4 = void>
class _Callback
{
protected:
Expand Down Expand Up @@ -180,7 +180,7 @@ namespace MaNGOS

/// ---- Statics ----

template < typename ParamType1 = void, typename ParamType2 = void, typename ParamType3 = void, typename ParamType4 = void >
template<typename ParamType1 = void, typename ParamType2 = void, typename ParamType3 = void, typename ParamType4 = void>
class _SCallback
{
protected:
Expand Down Expand Up @@ -329,7 +329,7 @@ namespace MaNGOS
void Execute() { CB::_Execute(); }
};

template < class Class, typename ParamType1 = void, typename ParamType2 = void, typename ParamType3 = void, typename ParamType4 = void >
template<class Class, typename ParamType1 = void, typename ParamType2 = void, typename ParamType3 = void, typename ParamType4 = void>
class Callback : public _ICallback<_Callback<Class, ParamType1, ParamType2, ParamType3, ParamType4> >
{
private:
Expand Down Expand Up @@ -432,7 +432,7 @@ namespace MaNGOS
QueryResult* GetResult() { return CB::m_param1; }
};

template < class Class, typename ParamType1 = void, typename ParamType2 = void, typename ParamType3 = void >
template<class Class, typename ParamType1 = void, typename ParamType2 = void, typename ParamType3 = void>
class QueryCallback : public _IQueryCallback<_Callback<Class, QueryResult*, ParamType1, ParamType2, ParamType3> >
{
private:
Expand Down Expand Up @@ -493,7 +493,7 @@ namespace MaNGOS

/// ---- Statics ----

template < typename ParamType1 = void, typename ParamType2 = void, typename ParamType3 = void >
template<typename ParamType1 = void, typename ParamType2 = void, typename ParamType3 = void>
class SQueryCallback : public _IQueryCallback<_SCallback<QueryResult*, ParamType1, ParamType2, ParamType3> >
{
private:
Expand Down
14 changes: 14 additions & 0 deletions src/framework/Utilities/EventProcessor.cpp
Expand Up @@ -107,6 +107,20 @@ void EventProcessor::AddEvent(BasicEvent* Event, uint64 e_time, bool set_addtime
m_events.insert(std::pair<uint64, BasicEvent*>(e_time, Event));
}

void EventProcessor::ModifyEventTime(BasicEvent* Event, uint64 msTime)
{
for (auto itr = m_events.begin(); itr != m_events.end(); ++itr)
{
if (itr->second != Event)
continue;

Event->m_execTime = msTime;
m_events.erase(itr);
m_events.insert(std::pair<uint64, BasicEvent*>(msTime, Event));
break;
}
}

uint64 EventProcessor::CalculateTime(uint64 t_offset) const
{
return m_time + t_offset;
Expand Down
1 change: 1 addition & 0 deletions src/framework/Utilities/EventProcessor.h
Expand Up @@ -68,6 +68,7 @@ class EventProcessor
void KillAllEvents(bool force);
void KillEvent(BasicEvent* Event);
void AddEvent(BasicEvent* Event, uint64 e_time, bool set_addtime = true);
void ModifyEventTime(BasicEvent* event, uint64 msTime);
uint64 CalculateTime(uint64 t_offset) const;
EventList& GetEvents() { return m_events; }

Expand Down
1 change: 0 additions & 1 deletion src/framework/Utilities/LinkedList.h
Expand Up @@ -154,7 +154,6 @@ class LinkedListHead
typedef _Ty& reference;
typedef _Ty const& const_reference;


Iterator()
: _Ptr(nullptr)
{
Expand Down
1 change: 0 additions & 1 deletion src/shared/ByteBuffer.h
Expand Up @@ -234,7 +234,6 @@ class ByteBuffer
return *this;
}


uint8 operator[](size_t pos) const
{
return read<uint8>(pos);
Expand Down
1 change: 1 addition & 0 deletions src/shared/Common.h
Expand Up @@ -62,6 +62,7 @@ typedef std::chrono::time_point<std::chrono::system_clock, std::chrono::millisec
# define I32FMT "%08I32X"
# define I64FMT "%016I64X"

# pragma warning ( disable : 4251 )
#else

# define stricmp strcasecmp
Expand Down
5 changes: 2 additions & 3 deletions src/shared/Database/Database.cpp
Expand Up @@ -453,13 +453,13 @@ bool Database::CheckRequiredField(char const* table_name, char const* required_n
return true;
}

// check fail, prepare readabale error message
// check fail, prepare readable error message

// search current required_* field in DB
const char* db_name;
if (!strcmp(table_name, "db_version"))
db_name = "WORLD";
else if (!strcmp(table_name, "character_db_version"))
else if (!strcmp(table_name, "character_db_version") || !strcmp(table_name, "playerbot_db_version"))
db_name = "CHARACTER";
else if (!strcmp(table_name, "realmd_db_version"))
db_name = "REALMD";
Expand Down Expand Up @@ -622,4 +622,3 @@ std::string Database::GetStmtString(const int stmtId) const

return std::string();
}

1 change: 0 additions & 1 deletion src/shared/Database/DatabaseMysql.cpp
Expand Up @@ -302,7 +302,6 @@ SqlPreparedStatement* MySQLConnection::CreateStatement(const std::string& fmt)
return new MySqlPreparedStatement(fmt, *this, mMysql);
}


//////////////////////////////////////////////////////////////////////////
MySqlPreparedStatement::MySqlPreparedStatement(const std::string& fmt, SqlConnection& conn, MYSQL* mysql) : SqlPreparedStatement(fmt, conn),
m_pMySQLConn(mysql), m_stmt(nullptr), m_pInputArgs(nullptr), m_pResult(nullptr), m_pResultMetadata(nullptr)
Expand Down
1 change: 0 additions & 1 deletion src/shared/Database/DatabasePostgre.cpp
Expand Up @@ -43,7 +43,6 @@ DatabasePostgre::DatabasePostgre()

DatabasePostgre::~DatabasePostgre()
{

}

SqlConnection* DatabasePostgre::CreateConnection()
Expand Down
1 change: 0 additions & 1 deletion src/shared/Database/Field.cpp
Expand Up @@ -17,4 +17,3 @@
*/

//#include "DatabaseEnv.h"

4 changes: 2 additions & 2 deletions src/shared/Metric/Measurement.cpp
Expand Up @@ -43,7 +43,7 @@ std::stringstream& operator<<(std::stringstream& out, const Measurement& measure
out << " ";

MANGOS_ASSERT(measurement._fields.size() > 0);

const auto& last = measurement._fields.rbegin()->first;
for (const auto& field : measurement._fields)
{
Expand All @@ -57,7 +57,7 @@ std::stringstream& operator<<(std::stringstream& out, const Measurement& measure
else if (field.second.type() == typeid(float))
out << boost::any_cast<float>(field.second);
else if (field.second.type() == typeid(bool))
out << (boost::any_cast<bool>(field.second) ? "t" : "f");
out << boost::any_cast<bool>(field.second) ? "t" : "f";
else if (field.second.type() == typeid(std::string))
out << boost::any_cast<std::string>(field.second);
else
Expand Down
24 changes: 24 additions & 0 deletions src/shared/Network/NetworkThread.cpp
@@ -0,0 +1,24 @@
/*
* This file is part of the CMaNGOS Project. See AUTHORS file for Copyright information
*
* 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 Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/

#include <thread>
#include <chrono>

#include "NetworkThread.hpp"

using namespace MaNGOS;
3 changes: 0 additions & 3 deletions src/shared/PosixDaemon.cpp
Expand Up @@ -49,7 +49,6 @@ void daemonSignal(int s)
exit(EXIT_FAILURE);
}


void startDaemon(uint32_t timeout)
{
parent_pid = getpid();
Expand Down Expand Up @@ -124,7 +123,6 @@ void detachDaemon()
}
}


void exitDaemon()
{
if (parent_pid && parent_pid != getpid())
Expand All @@ -133,7 +131,6 @@ void exitDaemon()
}
}


struct WatchDog
{
~WatchDog()
Expand Down
1 change: 1 addition & 0 deletions src/shared/ProgressBar.h
Expand Up @@ -15,6 +15,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/

#ifndef MANGOSSERVER_PROGRESSBAR_H
#define MANGOSSERVER_PROGRESSBAR_H

Expand Down
10 changes: 5 additions & 5 deletions src/shared/ServiceWin32.cpp
@@ -1,10 +1,10 @@
/*
* This file is part of the CMaNGOS Project. See AUTHORS file for Copyright information
*
* 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 Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* 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 Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
Expand All @@ -13,7 +13,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/

#ifdef _WIN32
Expand Down
10 changes: 5 additions & 5 deletions src/shared/ServiceWin32.h
@@ -1,10 +1,10 @@
/*
* This file is part of the CMaNGOS Project. See AUTHORS file for Copyright information
*
* 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 Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* 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 Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
Expand All @@ -13,7 +13,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/

#ifdef _WIN32
Expand Down
1 change: 0 additions & 1 deletion src/shared/WheatyExceptionReport.cpp
Expand Up @@ -622,7 +622,6 @@ void WheatyExceptionReport::WriteStackDetails(
_tprintf(_T("\r\n"));
}
}

}

//////////////////////////////////////////////////////////////////////////////
Expand Down

0 comments on commit c422b4f

Please sign in to comment.