Update fmt lib with submodule

This commit is contained in:
KimLS 2019-03-10 00:10:47 -08:00
parent ee1fcdf5fa
commit 777f182282
27 changed files with 66 additions and 25 deletions

View File

@ -340,17 +340,18 @@ ENDIF(EQEMU_BUILD_LUA)
INCLUDE_DIRECTORIES(SYSTEM "${ZLIB_INCLUDE_DIRS}") INCLUDE_DIRECTORIES(SYSTEM "${ZLIB_INCLUDE_DIRS}")
INCLUDE_DIRECTORIES(SYSTEM "${MySQL_INCLUDE_DIR}") INCLUDE_DIRECTORIES(SYSTEM "${MySQL_INCLUDE_DIR}")
INCLUDE_DIRECTORIES(SYSTEM "${CMAKE_CURRENT_SOURCE_DIR}/common/glm") INCLUDE_DIRECTORIES(SYSTEM "${CMAKE_CURRENT_SOURCE_DIR}/submodules/glm")
INCLUDE_DIRECTORIES(SYSTEM "${CMAKE_CURRENT_SOURCE_DIR}/libs/cereal") INCLUDE_DIRECTORIES(SYSTEM "${CMAKE_CURRENT_SOURCE_DIR}/submodules/cereal/include")
INCLUDE_DIRECTORIES(SYSTEM "${CMAKE_CURRENT_SOURCE_DIR}/submodules/fmt/include")
INCLUDE_DIRECTORIES(SYSTEM "${CMAKE_CURRENT_SOURCE_DIR}/libs/libuv/include" ) INCLUDE_DIRECTORIES(SYSTEM "${CMAKE_CURRENT_SOURCE_DIR}/libs/libuv/include" )
INCLUDE_DIRECTORIES(SYSTEM "${CMAKE_CURRENT_SOURCE_DIR}/libs/libuv/src") INCLUDE_DIRECTORIES(SYSTEM "${CMAKE_CURRENT_SOURCE_DIR}/libs/libuv/src")
INCLUDE_DIRECTORIES(SYSTEM "${CMAKE_CURRENT_SOURCE_DIR}/libs/format")
INCLUDE_DIRECTORIES(SYSTEM "${CMAKE_CURRENT_SOURCE_DIR}/libs/recast/detour/include") INCLUDE_DIRECTORIES(SYSTEM "${CMAKE_CURRENT_SOURCE_DIR}/libs/recast/detour/include")
INCLUDE_DIRECTORIES(SYSTEM "${CMAKE_CURRENT_SOURCE_DIR}/libs/recast/recast/include") INCLUDE_DIRECTORIES(SYSTEM "${CMAKE_CURRENT_SOURCE_DIR}/libs/recast/recast/include")
IF(EQEMU_BUILD_SERVER OR EQEMU_BUILD_LOGIN OR EQEMU_BUILD_TESTS OR EQEMU_BUILD_HC) IF(EQEMU_BUILD_SERVER OR EQEMU_BUILD_LOGIN OR EQEMU_BUILD_TESTS OR EQEMU_BUILD_HC)
ADD_SUBDIRECTORY(common) ADD_SUBDIRECTORY(common)
ADD_SUBDIRECTORY(libs) ADD_SUBDIRECTORY(libs)
ADD_SUBDIRECTORY(submodules/fmt)
ENDIF(EQEMU_BUILD_SERVER OR EQEMU_BUILD_LOGIN OR EQEMU_BUILD_TESTS OR EQEMU_BUILD_HC) ENDIF(EQEMU_BUILD_SERVER OR EQEMU_BUILD_LOGIN OR EQEMU_BUILD_TESTS OR EQEMU_BUILD_HC)
IF(EQEMU_BUILD_SERVER) IF(EQEMU_BUILD_SERVER)
ADD_SUBDIRECTORY(shared_memory) ADD_SUBDIRECTORY(shared_memory)

View File

@ -136,6 +136,7 @@ SET(common_headers
eqemu_config.h eqemu_config.h
eqemu_config_elements.h eqemu_config_elements.h
eqemu_logsys.h eqemu_logsys.h
eqemu_logsys_fmt.h
eq_limits.h eq_limits.h
eq_packet.h eq_packet.h
eq_stream_ident.h eq_stream_ident.h

View File

@ -21,7 +21,6 @@
#ifndef EQEMU_LOGSYS_H #ifndef EQEMU_LOGSYS_H
#define EQEMU_LOGSYS_H #define EQEMU_LOGSYS_H
#include <fmt/format.h>
#include <iostream> #include <iostream>
#include <fstream> #include <fstream>
#include <stdio.h> #include <stdio.h>
@ -164,7 +163,7 @@ namespace Logs {
#define LogF(debug_level, log_category, message, ...) do {\ #define LogF(debug_level, log_category, message, ...) do {\
if (LogSys.log_settings[log_category].is_category_enabled == 1)\ if (LogSys.log_settings[log_category].is_category_enabled == 1)\
LogSys.OutF(debug_level, log_category, message, ##__VA_ARGS__);\ OutF(LogSys, debug_level, log_category, message, ##__VA_ARGS__);\
} while (0) } while (0)
class EQEmuLogSys { class EQEmuLogSys {
@ -197,13 +196,6 @@ public:
void SetCurrentTimeStamp(char* time_stamp); void SetCurrentTimeStamp(char* time_stamp);
void StartFileLogs(const std::string &log_name = ""); void StartFileLogs(const std::string &log_name = "");
template <typename... Args>
void OutF(Logs::DebugLevel debug_level, uint16 log_category, const char *fmt, const Args&... args)
{
std::string log_str = fmt::format(fmt, args...);
Out(debug_level, log_category, log_str);
}
/** /**
* LogSettings Struct * LogSettings Struct
* *

30
common/eqemu_logsys_fmt.h Normal file
View File

@ -0,0 +1,30 @@
/**
* EQEmulator: Everquest Server Emulator
* Copyright (C) 2001-2019 EQEmulator Development Team (https://github.com/EQEmu/Server)
*
* 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; version 2 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY except by those people which sell it, which
* are required to give you total support for your newly bought product;
* 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
*
*/
#pragma once
#include <fmt/format.h>
template <typename... Args>
void OutF(EQEmuLogSys &ls, Logs::DebugLevel debug_level, uint16 log_category, const char *fmt, const Args&... args)
{
std::string log_str = fmt::format(fmt, args...);
ls.Out(debug_level, log_category, log_str);
}

View File

@ -4,6 +4,7 @@
#include "../eqemu_logsys.h" #include "../eqemu_logsys.h"
#include "../servertalk.h" #include "../servertalk.h"
#include "../rulesys.h" #include "../rulesys.h"
#include <fmt/format.h>
EQ::Net::ConsoleServerConnection::ConsoleServerConnection(ConsoleServer *parent, std::shared_ptr<TCPConnection> connection) EQ::Net::ConsoleServerConnection::ConsoleServerConnection(ConsoleServer *parent, std::shared_ptr<TCPConnection> connection)
{ {

View File

@ -2,6 +2,7 @@
#include "../event/event_loop.h" #include "../event/event_loop.h"
#include "../event/task.h" #include "../event/task.h"
#include "../eqemu_logsys.h" #include "../eqemu_logsys.h"
#include "../eqemu_logsys_fmt.h"
#include "../data_verification.h" #include "../data_verification.h"
#include "crc32.h" #include "crc32.h"
#include <zlib.h> #include <zlib.h>

View File

@ -1,5 +1,6 @@
#include "eqstream.h" #include "eqstream.h"
#include "../eqemu_logsys.h" #include "../eqemu_logsys.h"
#include "../eqemu_logsys_fmt.h"
EQ::Net::EQStreamManager::EQStreamManager(EQStreamManagerOptions &options) : m_daybreak(options.daybreak_options) EQ::Net::EQStreamManager::EQStreamManager(EQStreamManagerOptions &options) : m_daybreak(options.daybreak_options)
{ {

View File

@ -1,7 +1,7 @@
#include "packet.h" #include "packet.h"
#include "endian.h" #include "endian.h"
#include <fmt/format.h>
#include <cctype> #include <cctype>
#include <fmt/format.h>
void EQ::Net::Packet::PutInt8(size_t offset, int8_t value) void EQ::Net::Packet::PutInt8(size_t offset, int8_t value)
{ {

View File

@ -1,6 +1,7 @@
#include "servertalk_client_connection.h" #include "servertalk_client_connection.h"
#include "dns.h" #include "dns.h"
#include "../eqemu_logsys.h" #include "../eqemu_logsys.h"
#include "../eqemu_logsys_fmt.h"
EQ::Net::ServertalkClient::ServertalkClient(const std::string &addr, int port, bool ipv6, const std::string &identifier, const std::string &credentials) EQ::Net::ServertalkClient::ServertalkClient(const std::string &addr, int port, bool ipv6, const std::string &identifier, const std::string &credentials)
: m_timer(std::unique_ptr<EQ::Timer>(new EQ::Timer(100, true, std::bind(&EQ::Net::ServertalkClient::Connect, this)))) : m_timer(std::unique_ptr<EQ::Timer>(new EQ::Timer(100, true, std::bind(&EQ::Net::ServertalkClient::Connect, this))))

View File

@ -1,6 +1,7 @@
#include "servertalk_legacy_client_connection.h" #include "servertalk_legacy_client_connection.h"
#include "dns.h" #include "dns.h"
#include "../eqemu_logsys.h" #include "../eqemu_logsys.h"
#include "../eqemu_logsys_fmt.h"
EQ::Net::ServertalkLegacyClient::ServertalkLegacyClient(const std::string &addr, int port, bool ipv6) EQ::Net::ServertalkLegacyClient::ServertalkLegacyClient(const std::string &addr, int port, bool ipv6)
: m_timer(std::unique_ptr<EQ::Timer>(new EQ::Timer(100, true, std::bind(&EQ::Net::ServertalkLegacyClient::Connect, this)))) : m_timer(std::unique_ptr<EQ::Timer>(new EQ::Timer(100, true, std::bind(&EQ::Net::ServertalkLegacyClient::Connect, this))))

View File

@ -1,6 +1,7 @@
#include "servertalk_server_connection.h" #include "servertalk_server_connection.h"
#include "servertalk_server.h" #include "servertalk_server.h"
#include "../eqemu_logsys.h" #include "../eqemu_logsys.h"
#include "../eqemu_logsys_fmt.h"
#include "../util/uuid.h" #include "../util/uuid.h"
EQ::Net::ServertalkServerConnection::ServertalkServerConnection(std::shared_ptr<EQ::Net::TCPConnection> c, EQ::Net::ServertalkServer *parent, bool encrypted, bool allow_downgrade) EQ::Net::ServertalkServerConnection::ServertalkServerConnection(std::shared_ptr<EQ::Net::TCPConnection> c, EQ::Net::ServertalkServer *parent, bool encrypted, bool allow_downgrade)

View File

@ -4,7 +4,7 @@
#include "../common/types.h" #include "../common/types.h"
#include "../common/packet_functions.h" #include "../common/packet_functions.h"
#include "../common/eq_packet_structs.h" #include "../common/eq_packet_structs.h"
#include "../net/packet.h" #include "../common/net/packet.h"
#include <cereal/cereal.hpp> #include <cereal/cereal.hpp>
#include <cereal/types/string.hpp> #include <cereal/types/string.hpp>

View File

@ -3,5 +3,4 @@ IF(EQEMU_BUILD_LUA)
ENDIF(EQEMU_BUILD_LUA) ENDIF(EQEMU_BUILD_LUA)
ADD_SUBDIRECTORY(libuv) ADD_SUBDIRECTORY(libuv)
ADD_SUBDIRECTORY(format)
ADD_SUBDIRECTORY(recast) ADD_SUBDIRECTORY(recast)

View File

@ -20,6 +20,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#include "login_structures.h" #include "login_structures.h"
#include "../common/misc_functions.h" #include "../common/misc_functions.h"
#include "../common/eqemu_logsys.h" #include "../common/eqemu_logsys.h"
#include "../common/eqemu_logsys_fmt.h"
extern LoginServer server; extern LoginServer server;

View File

@ -22,6 +22,7 @@ extern LoginServer server;
extern bool run_server; extern bool run_server;
#include "../common/eqemu_logsys.h" #include "../common/eqemu_logsys.h"
#include "../common/eqemu_logsys_fmt.h"
ClientManager::ClientManager() ClientManager::ClientManager()
{ {

View File

@ -22,6 +22,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#include "database_mysql.h" #include "database_mysql.h"
#include "login_server.h" #include "login_server.h"
#include "../common/eqemu_logsys.h" #include "../common/eqemu_logsys.h"
#include "../common/eqemu_logsys_fmt.h"
#include "../common/string_util.h" #include "../common/string_util.h"
extern LoginServer server; extern LoginServer server;

View File

@ -21,6 +21,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#include <stdlib.h> #include <stdlib.h>
#include "../common/eqemu_logsys.h" #include "../common/eqemu_logsys.h"
#include "../common/eqemu_logsys_fmt.h"
extern LoginServer server; extern LoginServer server;
extern bool run_server; extern bool run_server;

View File

@ -20,6 +20,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#include "../common/global_define.h" #include "../common/global_define.h"
#include "../common/string_util.h" #include "../common/string_util.h"
#include "../common/eqemu_logsys.h" #include "../common/eqemu_logsys.h"
#include "../common/eqemu_logsys_fmt.h"
#include "../common/misc_functions.h" #include "../common/misc_functions.h"
#include "clientlist.h" #include "clientlist.h"

View File

@ -18,7 +18,7 @@
#ifndef WORLDSERVER_H #ifndef WORLDSERVER_H
#define WORLDSERVER_H #define WORLDSERVER_H
#include "../net/servertalk_client_connection.h" #include "../common/net/servertalk_client_connection.h"
#include "../common/eq_packet_structs.h" #include "../common/eq_packet_structs.h"
#include <memory> #include <memory>

View File

@ -9,6 +9,7 @@
#include "zoneserver.h" #include "zoneserver.h"
#include "../common/string_util.h" #include "../common/string_util.h"
#include "../common/md5.h" #include "../common/md5.h"
#include <fmt/format.h>
extern ClientList client_list; extern ClientList client_list;
extern ZSList zoneserver_list; extern ZSList zoneserver_list;

View File

@ -19,8 +19,8 @@
#define LAUNCHERLINK_H_ #define LAUNCHERLINK_H_
#include "../common/timer.h" #include "../common/timer.h"
#include "../net/servertalk_server_connection.h" #include "../common/net/servertalk_server_connection.h"
#include "../event/timer.h" #include "../common/event/timer.h"
#include <memory> #include <memory>
#include <string> #include <string>
#include <vector> #include <vector>

View File

@ -19,7 +19,7 @@
#define LAUNCHERLIST_H_ #define LAUNCHERLIST_H_
#include "../common/types.h" #include "../common/types.h"
#include "../net/servertalk_server_connection.h" #include "../common/net/servertalk_server_connection.h"
#include <map> #include <map>
#include <vector> #include <vector>
#include <string> #include <string>

View File

@ -24,11 +24,13 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#include "../common/version.h" #include "../common/version.h"
#include "../common/servertalk.h" #include "../common/servertalk.h"
#include "../common/misc_functions.h" #include "../common/misc_functions.h"
#include "login_server.h"
#include "login_server_list.h"
#include "../common/eq_packet_structs.h" #include "../common/eq_packet_structs.h"
#include "../common/packet_dump.h" #include "../common/packet_dump.h"
#include "../common/string_util.h" #include "../common/string_util.h"
#include "../common/eqemu_logsys.h"
#include "../common/eqemu_logsys_fmt.h"
#include "login_server.h"
#include "login_server_list.h"
#include "zoneserver.h" #include "zoneserver.h"
#include "worlddb.h" #include "worlddb.h"
#include "zonelist.h" #include "zonelist.h"

View File

@ -25,6 +25,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#include "../common/string_util.h" #include "../common/string_util.h"
#include "../common/eqemu_logsys.h" #include "../common/eqemu_logsys.h"
#include "../common/eqemu_logsys_fmt.h"
#include "../common/queue.h" #include "../common/queue.h"
#include "../common/timer.h" #include "../common/timer.h"
#include "../common/eq_packet.h" #include "../common/eq_packet.h"

View File

@ -19,9 +19,9 @@
#define ZONESERVER_H #define ZONESERVER_H
#include "world_tcp_connection.h" #include "world_tcp_connection.h"
#include "../net/servertalk_server.h" #include "../common/net/servertalk_server.h"
#include "../event/timer.h" #include "../common/event/timer.h"
#include "../timer.h" #include "../common/timer.h"
#include "console.h" #include "console.h"
#include <string.h> #include <string.h>
#include <string> #include <string>

View File

@ -42,6 +42,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#include "../common/eqemu_exception.h" #include "../common/eqemu_exception.h"
#include "../common/spdat.h" #include "../common/spdat.h"
#include "../common/eqemu_logsys.h" #include "../common/eqemu_logsys.h"
#include "../common/eqemu_logsys_fmt.h"
#include "zone_config.h" #include "zone_config.h"
#include "masterentity.h" #include "masterentity.h"

View File

@ -24,6 +24,8 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#include "../common/rulesys.h" #include "../common/rulesys.h"
#include "../common/string_util.h" #include "../common/string_util.h"
#include "../common/misc_functions.h" #include "../common/misc_functions.h"
#include "../common/eqemu_logsys.h"
#include "../common/eqemu_logsys_fmt.h"
#include "map.h" #include "map.h"
#include "npc.h" #include "npc.h"