forked from metin2/server
Merge pull request 'Refactored the logging code' (#14) from log-rewrite into master
Reviewed-on: metin2/server#14
This commit is contained in:
commit
bba0294107
|
@ -12,7 +12,7 @@ ENV VCPKG_FORCE_SYSTEM_BINARIES=1
|
|||
# Install vcpkg and the required libraries
|
||||
RUN git clone https://github.com/Microsoft/vcpkg.git
|
||||
RUN bash ./vcpkg/bootstrap-vcpkg.sh
|
||||
RUN ./vcpkg/vcpkg install boost-system cryptopp effolkronium-random libmysql libevent lzo
|
||||
RUN ./vcpkg/vcpkg install boost-system cryptopp effolkronium-random libmysql libevent lzo fmt spdlog
|
||||
|
||||
COPY . .
|
||||
|
||||
|
|
|
@ -39,7 +39,7 @@ Install `vcpkg` according to the [lastest instructions](https://vcpkg.io/en/gett
|
|||
|
||||
Build and install the required libraries:
|
||||
```shell
|
||||
vcpkg install boost-system cryptopp effolkronium-random libmysql libevent lzo
|
||||
vcpkg install boost-system cryptopp effolkronium-random libmysql libevent lzo fmt spdlog
|
||||
```
|
||||
|
||||
Then, it's time to build your binaries. Your commands should look along the lines of:
|
||||
|
@ -80,6 +80,7 @@ goodies you wish. Also, a lot of time.
|
|||
- Switched to the [effolkronium/random PRNG](https://github.com/effolkronium/random) instead of the standard C functions.
|
||||
- Refactored macros to modern C++ functions.
|
||||
- Network settings are manually configurable through the `PUBLIC_IP`, `PUBLIC_BIND_IP`, `INTERNAL_IP`, `INTERNAL_BIND_IP` settings in the `CONFIG` file. (Might need further work)
|
||||
- Refactored logging to use [spdlog](https://github.com/gabime/spdlog) for more consistent function calls.
|
||||
|
||||
## 4. Bugfixes
|
||||
**WARNING: This project is based on the "kraizy" leak. That was over 10 years ago.
|
||||
|
@ -102,7 +103,6 @@ This is a very serious security risk and one of the reasons this project is stil
|
|||
- Migrate `conf.txt` and `CONFIG` to a modern dotenv-like format, which would enable pretty nice Docker images.
|
||||
- Add a health check to the Docker image.
|
||||
- Use the [fmt](https://fmt.dev/latest/index.html) library for safe and modern string formatting.
|
||||
- Use a modern logging library to clean up the current mess.
|
||||
- Handle kernel signals (SIGTERM, SIGHUP etc.) for gracefully shutting down the game server.
|
||||
- Improve memory safety.
|
||||
- Use fixed width integer types instead of Microsoft-style typedefs.
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
#ifndef __INC_METIN2_UTILS_H__
|
||||
#define __INC_METIN2_UTILS_H__
|
||||
|
||||
/*----- atoi function -----*/
|
||||
inline bool str_to_number (bool& out, const char *in)
|
||||
{
|
||||
|
@ -72,3 +75,5 @@ inline bool str_to_number (float& out, const char *in)
|
|||
}
|
||||
|
||||
/*----- atoi function -----*/
|
||||
|
||||
#endif
|
||||
|
|
|
@ -10,6 +10,6 @@
|
|||
#define __COMPILER__ "@METIN2_COMPILER@"
|
||||
#define __CPU_TARGET__ "@METIN2_CPU_TARGET@"
|
||||
|
||||
void WriteVersion(std::ostream& out);
|
||||
void WriteVersion();
|
||||
|
||||
#endif
|
||||
|
|
|
@ -11,18 +11,22 @@ include_directories(src)
|
|||
|
||||
add_executable(${PROJECT_NAME} ${sources})
|
||||
|
||||
# Set the default log level based on the build type
|
||||
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
|
||||
message(STATUS "This is a debug build. Log level will be set to 'trace' for target '${PROJECT_NAME}'.")
|
||||
target_compile_definitions(${PROJECT_NAME} PRIVATE SPDLOG_ACTIVE_LEVEL=SPDLOG_LEVEL_TRACE)
|
||||
endif()
|
||||
|
||||
# Find dependencies
|
||||
|
||||
#
|
||||
# vcpkg dependencies
|
||||
#
|
||||
|
||||
# Boost
|
||||
find_package(Boost COMPONENTS system REQUIRED)
|
||||
target_link_libraries (${PROJECT_NAME} PRIVATE Boost::boost Boost::system)
|
||||
|
||||
# Pthreads
|
||||
set(THREADS_PREFER_PTHREAD_FLAG ON)
|
||||
find_package(Threads REQUIRED)
|
||||
target_link_libraries(${PROJECT_NAME} PRIVATE Threads::Threads)
|
||||
|
||||
# LibBSD
|
||||
target_link_libraries(${PROJECT_NAME} PRIVATE bsd)
|
||||
|
||||
# Libevent
|
||||
find_package(Libevent CONFIG REQUIRED)
|
||||
target_link_libraries(${PROJECT_NAME} PRIVATE libevent::core libevent::extra libevent::pthreads)
|
||||
|
@ -31,4 +35,16 @@ target_link_libraries(${PROJECT_NAME} PRIVATE libevent::core libevent::extra lib
|
|||
find_package(effolkronium_random CONFIG REQUIRED)
|
||||
target_link_libraries(${PROJECT_NAME} PRIVATE effolkronium_random)
|
||||
|
||||
#
|
||||
# System-provided dependencies
|
||||
#
|
||||
|
||||
# Pthreads
|
||||
set(THREADS_PREFER_PTHREAD_FLAG ON)
|
||||
find_package(Threads REQUIRED)
|
||||
target_link_libraries(${PROJECT_NAME} PRIVATE Threads::Threads)
|
||||
|
||||
# LibBSD
|
||||
target_link_libraries(${PROJECT_NAME} PRIVATE bsd)
|
||||
|
||||
target_link_libraries(${PROJECT_NAME} PRIVATE libpoly libsql libthecore)
|
||||
|
|
|
@ -406,13 +406,13 @@ AuctionResult AuctionManager::EnrollInAuction(CItemCache* item_cache, TAuctionIt
|
|||
CItemCache* c = GetItemCache (item_info.item_id);
|
||||
if (c != NULL)
|
||||
{
|
||||
sys_err ("item id : %d is already in AuctionManager", item_info.item_id);
|
||||
SPDLOG_ERROR("item id : {} is already in AuctionManager", item_info.item_id);
|
||||
return AUCTION_FAIL;
|
||||
}
|
||||
|
||||
if (!Auction.InsertItemInfo (&item_info))
|
||||
{
|
||||
sys_err ("item id : %d is already in AuctionBoard", item_info.item_id);
|
||||
SPDLOG_ERROR("item id : {} is already in AuctionBoard", item_info.item_id);
|
||||
return AUCTION_FAIL;
|
||||
}
|
||||
|
||||
|
@ -429,19 +429,19 @@ AuctionResult AuctionManager::EnrollInSale(CItemCache* item_cache, TSaleItemInfo
|
|||
CItemCache* c = GetItemCache (item_info.item_id);
|
||||
if (c != NULL)
|
||||
{
|
||||
sys_err ("item id : %d is already in AuctionManager", item_info.item_id);
|
||||
SPDLOG_ERROR("item id : {} is already in AuctionManager", item_info.item_id);
|
||||
return AUCTION_FAIL;
|
||||
}
|
||||
|
||||
if (!Wish.GetItemInfoCache (WishBoard::Key (item_info.item_num, item_info.wisher_id)))
|
||||
{
|
||||
sys_err ("item_num : %d, wisher_id : %d is not in wish auction.", item_info.item_num, item_info.wisher_id);
|
||||
SPDLOG_ERROR("item_num : {}, wisher_id : {} is not in wish auction.", item_info.item_num, item_info.wisher_id);
|
||||
return AUCTION_FAIL;
|
||||
}
|
||||
|
||||
if (!Sale.InsertItemInfo (&item_info))
|
||||
{
|
||||
sys_err ("item id : %d is already in SaleBoard", item_info.item_id);
|
||||
SPDLOG_ERROR("item id : {} is already in SaleBoard", item_info.item_id);
|
||||
return AUCTION_FAIL;
|
||||
}
|
||||
|
||||
|
@ -457,7 +457,7 @@ AuctionResult AuctionManager::EnrollInWish(TWishItemInfo &item_info)
|
|||
{
|
||||
if (!Wish.InsertItemInfo (&item_info))
|
||||
{
|
||||
sys_err ("wisher_id : %d, item_num : %d is already in WishBoard", item_info.offer_id, item_info.item_num);
|
||||
SPDLOG_ERROR("wisher_id : {}, item_num : {} is already in WishBoard", item_info.offer_id, item_info.item_num);
|
||||
return AUCTION_FAIL;
|
||||
}
|
||||
|
||||
|
@ -469,7 +469,7 @@ AuctionResult AuctionManager::Bid(DWORD bidder_id, const char* bidder_name, DWOR
|
|||
CItemCache* c = GetItemCache (item_id);
|
||||
if (c == NULL)
|
||||
{
|
||||
sys_err ("item id : %d does not exist in auction.", item_id);
|
||||
SPDLOG_ERROR("item id : {} does not exist in auction.", item_id);
|
||||
return AUCTION_FAIL;
|
||||
}
|
||||
|
||||
|
@ -506,7 +506,7 @@ AuctionResult AuctionManager::Impur(DWORD purchaser_id, const char* purchaser_na
|
|||
CItemCache* c = GetItemCache (item_id);
|
||||
if (c == NULL)
|
||||
{
|
||||
sys_err ("item id : %d does not exist in auction.", item_id);
|
||||
SPDLOG_ERROR("item id : {} does not exist in auction.", item_id);
|
||||
return AUCTION_FAIL;
|
||||
}
|
||||
|
||||
|
@ -533,14 +533,14 @@ AuctionResult AuctionManager::GetAuctionedItem (DWORD actor_id, DWORD item_id, T
|
|||
CItemCache* c = GetItemCache (item_id);
|
||||
if (c == NULL)
|
||||
{
|
||||
sys_err ("item id : %d does not exist in auction.", item_id);
|
||||
SPDLOG_ERROR("item id : {} does not exist in auction.", item_id);
|
||||
return AUCTION_FAIL;
|
||||
}
|
||||
|
||||
CAuctionItemInfoCache* item_info_cache = Auction.GetItemInfoCache(item_id);
|
||||
if (item_info_cache == NULL)
|
||||
{
|
||||
sys_err ("how can this accident happen?");
|
||||
SPDLOG_ERROR("how can this accident happen?");
|
||||
return AUCTION_FAIL;
|
||||
}
|
||||
|
||||
|
@ -561,14 +561,14 @@ AuctionResult AuctionManager::BuySoldItem (DWORD actor_id, DWORD item_id, TPlaye
|
|||
CItemCache* c = GetItemCache (item_id);
|
||||
if (c == NULL)
|
||||
{
|
||||
sys_err ("item id : %d does not exist in auction.", item_id);
|
||||
SPDLOG_ERROR("item id : {} does not exist in auction.", item_id);
|
||||
return AUCTION_FAIL;
|
||||
}
|
||||
|
||||
CSaleItemInfoCache* item_info_cache = Sale.GetItemInfoCache(item_id);
|
||||
if (item_info_cache == NULL)
|
||||
{
|
||||
sys_err ("how can this accident happen?");
|
||||
SPDLOG_ERROR("how can this accident happen?");
|
||||
return AUCTION_FAIL;
|
||||
}
|
||||
|
||||
|
@ -584,14 +584,14 @@ AuctionResult AuctionManager::CancelAuction (DWORD actor_id, DWORD item_id, TPla
|
|||
CItemCache* c = GetItemCache (item_id);
|
||||
if (c == NULL)
|
||||
{
|
||||
sys_err ("item id : %d does not exist in auction.", item_id);
|
||||
SPDLOG_ERROR("item id : {} does not exist in auction.", item_id);
|
||||
return AUCTION_FAIL;
|
||||
}
|
||||
|
||||
CAuctionItemInfoCache* item_info_cache = Auction.GetItemInfoCache(item_id);
|
||||
if (item_info_cache == NULL)
|
||||
{
|
||||
sys_err ("how can this accident happen?");
|
||||
SPDLOG_ERROR("how can this accident happen?");
|
||||
return AUCTION_FAIL;
|
||||
}
|
||||
TAuctionItemInfo* item_info = item_info_cache->Get(false);
|
||||
|
@ -618,14 +618,14 @@ AuctionResult AuctionManager::CancelSale (DWORD actor_id, DWORD item_id, TPlayer
|
|||
CItemCache* c = GetItemCache (item_id);
|
||||
if (c == NULL)
|
||||
{
|
||||
sys_err ("item id : %d does not exist in auction.", item_id);
|
||||
SPDLOG_ERROR("item id : {} does not exist in auction.", item_id);
|
||||
return AUCTION_FAIL;
|
||||
}
|
||||
|
||||
CSaleItemInfoCache* item_info_cache = Sale.GetItemInfoCache(item_id);
|
||||
if (item_info_cache == NULL)
|
||||
{
|
||||
sys_err ("how can this accident happen?");
|
||||
SPDLOG_ERROR("how can this accident happen?");
|
||||
return AUCTION_FAIL;
|
||||
}
|
||||
TSaleItemInfo* item_info = item_info_cache->Get(false);
|
||||
|
@ -639,13 +639,13 @@ AuctionResult AuctionManager::DeleteAuctionItem (DWORD actor_id, DWORD item_id)
|
|||
{
|
||||
if (DeleteItemCache (item_id) == false)
|
||||
{
|
||||
sys_err ("item id : %d does not exist in auction.", item_id);
|
||||
SPDLOG_ERROR("item id : {} does not exist in auction.", item_id);
|
||||
return AUCTION_FAIL;
|
||||
}
|
||||
|
||||
if (Auction.DeleteItemInfoCache (item_id) == NULL)
|
||||
{
|
||||
sys_err ("how can this accident happen?");
|
||||
SPDLOG_ERROR("how can this accident happen?");
|
||||
return AUCTION_FAIL;
|
||||
}
|
||||
return AUCTION_SUCCESS;
|
||||
|
@ -655,13 +655,13 @@ AuctionResult AuctionManager::DeleteSaleItem (DWORD actor_id, DWORD item_id)
|
|||
{
|
||||
if (DeleteItemCache (item_id) == false)
|
||||
{
|
||||
sys_err ("item id : %d does not exist in auction.", item_id);
|
||||
SPDLOG_ERROR("item id : {} does not exist in auction.", item_id);
|
||||
return AUCTION_FAIL;
|
||||
}
|
||||
|
||||
if (Sale.DeleteItemInfoCache (item_id) == NULL)
|
||||
{
|
||||
sys_err ("how can this accident happen?");
|
||||
SPDLOG_ERROR("how can this accident happen?");
|
||||
return AUCTION_FAIL;
|
||||
}
|
||||
return AUCTION_SUCCESS;
|
||||
|
@ -672,7 +672,7 @@ AuctionResult AuctionManager::ReBid(DWORD bidder_id, const char* bidder_name, DW
|
|||
CItemCache* c = GetItemCache (item_id);
|
||||
if (c == NULL)
|
||||
{
|
||||
sys_err ("item id : %d does not exist in auction.", item_id);
|
||||
SPDLOG_ERROR("item id : {} does not exist in auction.", item_id);
|
||||
return AUCTION_FAIL;
|
||||
}
|
||||
|
||||
|
|
|
@ -50,7 +50,7 @@ bool CBlockCountry::Load()
|
|||
|
||||
if (pMsg->Get()->uiNumRows == 0)
|
||||
{
|
||||
sys_err(" DirectQuery failed(%s)", szQuery);
|
||||
SPDLOG_ERROR(" DirectQuery failed({})", szQuery);
|
||||
delete pMsg;
|
||||
return false;
|
||||
}
|
||||
|
@ -64,7 +64,7 @@ bool CBlockCountry::Load()
|
|||
strlcpy(block_ip->country, row[2], sizeof(block_ip->country));
|
||||
|
||||
m_block_ip.push_back(block_ip);
|
||||
sys_log(0, "BLOCKED_IP : %u - %u", block_ip->ip_from, block_ip->ip_to);
|
||||
SPDLOG_DEBUG("BLOCKED_IP : {} - {}", block_ip->ip_from, block_ip->ip_to);
|
||||
|
||||
}
|
||||
delete pMsg;
|
||||
|
@ -79,7 +79,7 @@ bool CBlockCountry::Load()
|
|||
|
||||
if (pMsg->Get()->uiNumRows == 0)
|
||||
{
|
||||
sys_err(" DirectQuery failed(%s)", szQuery);
|
||||
SPDLOG_ERROR(" DirectQuery failed({})", szQuery);
|
||||
delete pMsg;
|
||||
return true;
|
||||
}
|
||||
|
@ -91,7 +91,7 @@ bool CBlockCountry::Load()
|
|||
|
||||
m_block_exception.push_back(strdup(login));
|
||||
|
||||
sys_log(0, "BLOCK_EXCEPTION = %s", login);
|
||||
SPDLOG_DEBUG("BLOCK_EXCEPTION = {}", login);
|
||||
|
||||
}
|
||||
delete pMsg;
|
||||
|
@ -129,7 +129,7 @@ bool CBlockCountry::IsBlockedCountryIp(const char *user_ip)
|
|||
|
||||
void CBlockCountry::SendBlockedCountryIp(CPeer *peer)
|
||||
{
|
||||
sys_log(0, "SendBlockedCountryIp start");
|
||||
SPDLOG_DEBUG("SendBlockedCountryIp start");
|
||||
BLOCK_IP *block_ip;
|
||||
BLOCK_IP_VECTOR::iterator iter;
|
||||
TPacketBlockCountryIp packet;
|
||||
|
@ -145,9 +145,9 @@ void CBlockCountry::SendBlockedCountryIp(CPeer *peer)
|
|||
peer->Encode(&packet, sizeof(packet));
|
||||
}
|
||||
|
||||
sys_log(0, "[DONE] CBlockCountry::SendBlockedCountryIp() : count = %d",
|
||||
SPDLOG_DEBUG("[DONE] CBlockCountry::SendBlockedCountryIp() : count = {}",
|
||||
m_block_ip.size());
|
||||
sys_log(0, "SendBlockedCountryIp end");
|
||||
SPDLOG_DEBUG("SendBlockedCountryIp end");
|
||||
} /* end of CBlockCountry::SendBlockedCountryIp() */
|
||||
|
||||
|
||||
|
|
|
@ -44,8 +44,7 @@ void CItemCache::Delete()
|
|||
|
||||
//char szQuery[QUERY_MAX_LEN];
|
||||
//szQuery[QUERY_MAX_LEN] = '\0';
|
||||
if (g_test_server)
|
||||
sys_log(0, "ItemCache::Delete : DELETE %u", m_data.id);
|
||||
SPDLOG_TRACE("ItemCache::Delete : DELETE {}", m_data.id);
|
||||
|
||||
m_data.vnum = 0;
|
||||
m_bNeedQuery = true;
|
||||
|
@ -64,8 +63,7 @@ void CItemCache::OnFlush()
|
|||
snprintf(szQuery, sizeof(szQuery), "DELETE FROM item%s WHERE id=%u", GetTablePostfix(), m_data.id);
|
||||
CDBManager::instance().ReturnQuery(szQuery, QID_ITEM_DESTROY, 0, NULL);
|
||||
|
||||
if (g_test_server)
|
||||
sys_log(0, "ItemCache::Flush : DELETE %u %s", m_data.id, szQuery);
|
||||
SPDLOG_TRACE("ItemCache::Flush : DELETE {} {}", m_data.id, szQuery);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -141,8 +139,7 @@ void CItemCache::OnFlush()
|
|||
char szItemQuery[QUERY_MAX_LEN + QUERY_MAX_LEN + 100];
|
||||
snprintf(szItemQuery, sizeof(szItemQuery), "REPLACE INTO item%s (%s) VALUES(%s)", GetTablePostfix(), szColumns, szValues);
|
||||
|
||||
if (g_test_server)
|
||||
sys_log(0, "ItemCache::Flush :REPLACE (%s)", szItemQuery);
|
||||
SPDLOG_TRACE("ItemCache::Flush :REPLACE ({})", szItemQuery);
|
||||
|
||||
CDBManager::instance().ReturnQuery(szItemQuery, QID_ITEM_SAVE, 0, NULL);
|
||||
|
||||
|
@ -167,8 +164,7 @@ CPlayerTableCache::~CPlayerTableCache()
|
|||
|
||||
void CPlayerTableCache::OnFlush()
|
||||
{
|
||||
if (g_test_server)
|
||||
sys_log(0, "PlayerTableCache::Flush : %s", m_data.name);
|
||||
SPDLOG_TRACE("PlayerTableCache::Flush : {}", m_data.name);
|
||||
|
||||
char szQuery[QUERY_MAX_LEN];
|
||||
CreatePlayerSaveQuery(szQuery, sizeof(szQuery), &m_data);
|
||||
|
@ -211,7 +207,7 @@ void CItemPriceListTableCache::UpdateList(const TItemPriceListTable* pUpdateList
|
|||
|
||||
if (pUpdateList->byCount > SHOP_PRICELIST_MAX_NUM)
|
||||
{
|
||||
sys_err("Count overflow!");
|
||||
SPDLOG_ERROR("Count overflow!");
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -238,8 +234,8 @@ void CItemPriceListTableCache::UpdateList(const TItemPriceListTable* pUpdateList
|
|||
|
||||
m_bNeedQuery = true;
|
||||
|
||||
sys_log(0,
|
||||
"ItemPriceListTableCache::UpdateList : OwnerID[%u] Update [%u] Items, Delete [%u] Items, Total [%u] Items",
|
||||
SPDLOG_DEBUG(
|
||||
"ItemPriceListTableCache::UpdateList : OwnerID[{}] Update [{}] Items, Delete [{}] Items, Total [{}] Items",
|
||||
m_data.dwOwnerID, pUpdateList->byCount, nDeletedNum, m_data.byCount);
|
||||
}
|
||||
|
||||
|
@ -266,7 +262,7 @@ void CItemPriceListTableCache::OnFlush()
|
|||
CDBManager::instance().ReturnQuery(szQuery, QID_ITEMPRICE_SAVE, 0, NULL);
|
||||
}
|
||||
|
||||
sys_log(0, "ItemPriceListTableCache::Flush : OwnerID[%u] Update [%u]Items", m_data.dwOwnerID, m_data.byCount);
|
||||
SPDLOG_DEBUG("ItemPriceListTableCache::Flush : OwnerID[{}] Update [{}]Items", m_data.dwOwnerID, m_data.byCount);
|
||||
|
||||
m_bNeedQuery = false;
|
||||
}
|
||||
|
@ -287,8 +283,7 @@ void CAuctionItemInfoCache::Delete()
|
|||
if (m_data.item_num == 0)
|
||||
return;
|
||||
|
||||
if (g_test_server)
|
||||
sys_log(0, "CAuctionItemInfoCache::Delete : DELETE %u", m_data.item_id);
|
||||
SPDLOG_TRACE("CAuctionItemInfoCache::Delete : DELETE {}", m_data.item_id);
|
||||
|
||||
m_data.item_num = 0;
|
||||
m_bNeedQuery = true;
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -16,84 +16,84 @@ bool CClientManager::InitializeTables()
|
|||
{
|
||||
if (!InitializeMobTable())
|
||||
{
|
||||
sys_err("InitializeMobTable FAILED");
|
||||
SPDLOG_ERROR("InitializeMobTable FAILED");
|
||||
return false;
|
||||
}
|
||||
if (!MirrorMobTableIntoDB())
|
||||
{
|
||||
sys_err("MirrorMobTableIntoDB FAILED");
|
||||
SPDLOG_ERROR("MirrorMobTableIntoDB FAILED");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!InitializeItemTable())
|
||||
{
|
||||
sys_err("InitializeItemTable FAILED");
|
||||
SPDLOG_ERROR("InitializeItemTable FAILED");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!MirrorItemTableIntoDB())
|
||||
{
|
||||
sys_err("MirrorItemTableIntoDB FAILED");
|
||||
SPDLOG_ERROR("MirrorItemTableIntoDB FAILED");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!InitializeShopTable())
|
||||
{
|
||||
sys_err("InitializeShopTable FAILED");
|
||||
SPDLOG_ERROR("InitializeShopTable FAILED");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!InitializeSkillTable())
|
||||
{
|
||||
sys_err("InitializeSkillTable FAILED");
|
||||
SPDLOG_ERROR("InitializeSkillTable FAILED");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!InitializeRefineTable())
|
||||
{
|
||||
sys_err("InitializeRefineTable FAILED");
|
||||
SPDLOG_ERROR("InitializeRefineTable FAILED");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!InitializeItemAttrTable())
|
||||
{
|
||||
sys_err("InitializeItemAttrTable FAILED");
|
||||
SPDLOG_ERROR("InitializeItemAttrTable FAILED");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!InitializeItemRareTable())
|
||||
{
|
||||
sys_err("InitializeItemRareTable FAILED");
|
||||
SPDLOG_ERROR("InitializeItemRareTable FAILED");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!InitializeBanwordTable())
|
||||
{
|
||||
sys_err("InitializeBanwordTable FAILED");
|
||||
SPDLOG_ERROR("InitializeBanwordTable FAILED");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!InitializeLandTable())
|
||||
{
|
||||
sys_err("InitializeLandTable FAILED");
|
||||
SPDLOG_ERROR("InitializeLandTable FAILED");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!InitializeObjectProto())
|
||||
{
|
||||
sys_err("InitializeObjectProto FAILED");
|
||||
SPDLOG_ERROR("InitializeObjectProto FAILED");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!InitializeObjectTable())
|
||||
{
|
||||
sys_err("InitializeObjectTable FAILED");
|
||||
SPDLOG_ERROR("InitializeObjectTable FAILED");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!InitializeMonarch())
|
||||
{
|
||||
sys_err("InitializeMonarch FAILED");
|
||||
SPDLOG_ERROR("InitializeMonarch FAILED");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -117,7 +117,7 @@ bool CClientManager::InitializeRefineTable()
|
|||
|
||||
if (m_pRefineTable)
|
||||
{
|
||||
sys_log(0, "RELOAD: refine_proto");
|
||||
SPDLOG_DEBUG("RELOAD: refine_proto");
|
||||
delete [] m_pRefineTable;
|
||||
m_pRefineTable = NULL;
|
||||
}
|
||||
|
@ -153,7 +153,7 @@ bool CClientManager::InitializeRefineTable()
|
|||
}
|
||||
}
|
||||
|
||||
sys_log(0, "REFINE: id %ld cost %d prob %d mat1 %lu cnt1 %d", prt->id, prt->cost, prt->prob, prt->materials[0].vnum, prt->materials[0].count);
|
||||
SPDLOG_TRACE("REFINE: id {} cost {} prob {} mat1 {} cnt1 {}", prt->id, prt->cost, prt->prob, prt->materials[0].vnum, prt->materials[0].count);
|
||||
|
||||
prt++;
|
||||
}
|
||||
|
@ -203,7 +203,7 @@ bool CClientManager::InitializeMobTable()
|
|||
cCsvTable nameData;
|
||||
if(!nameData.Load("mob_names.txt",'\t'))
|
||||
{
|
||||
fprintf(stderr, "mob_names.txt 파일을 읽어오지 못했습니다\n");
|
||||
SPDLOG_ERROR("mob_names.txt 파일을 읽어오지 못했습니다");
|
||||
isNameFile = false;
|
||||
} else {
|
||||
nameData.Next(); //설명row 생략.
|
||||
|
@ -224,7 +224,7 @@ bool CClientManager::InitializeMobTable()
|
|||
cCsvTable test_data;
|
||||
if(!test_data.Load("mob_proto_test.txt",'\t'))
|
||||
{
|
||||
fprintf(stderr, "테스트 파일이 없습니다. 그대로 진행합니다.\n");
|
||||
SPDLOG_ERROR("테스트 파일이 없습니다. 그대로 진행합니다.");
|
||||
isTestFile = false;
|
||||
}
|
||||
//2. (c)[test_map_mobTableByVnum](vnum:TMobTable) 맵 생성.
|
||||
|
@ -243,7 +243,7 @@ bool CClientManager::InitializeMobTable()
|
|||
|
||||
if (!Set_Proto_Mob_Table(test_mob_table, test_data, localMap))
|
||||
{
|
||||
fprintf(stderr, "몹 프로토 테이블 셋팅 실패.\n");
|
||||
SPDLOG_ERROR("몹 프로토 테이블 셋팅 실패.");
|
||||
}
|
||||
|
||||
test_map_mobTableByVnum.insert(std::map<DWORD, TMobTable *>::value_type(test_mob_table->dwVnum, test_mob_table));
|
||||
|
@ -264,7 +264,7 @@ bool CClientManager::InitializeMobTable()
|
|||
//1. 파일 읽기.
|
||||
cCsvTable data;
|
||||
if(!data.Load("mob_proto.txt",'\t')) {
|
||||
fprintf(stderr, "mob_proto.txt 파일을 읽어오지 못했습니다\n");
|
||||
SPDLOG_ERROR("mob_proto.txt 파일을 읽어오지 못했습니다");
|
||||
return false;
|
||||
}
|
||||
data.Next(); //설명 row 넘어가기
|
||||
|
@ -283,14 +283,14 @@ bool CClientManager::InitializeMobTable()
|
|||
data.Destroy();
|
||||
if(!data.Load("mob_proto.txt",'\t'))
|
||||
{
|
||||
fprintf(stderr, "mob_proto.txt 파일을 읽어오지 못했습니다\n");
|
||||
SPDLOG_ERROR("mob_proto.txt 파일을 읽어오지 못했습니다");
|
||||
return false;
|
||||
}
|
||||
data.Next(); //맨 윗줄 제외 (아이템 칼럼을 설명하는 부분)
|
||||
//2.2 크기에 맞게 mob_table 생성
|
||||
if (!m_vec_mobTable.empty())
|
||||
{
|
||||
sys_log(0, "RELOAD: mob_proto");
|
||||
SPDLOG_DEBUG("RELOAD: mob_proto");
|
||||
m_vec_mobTable.clear();
|
||||
}
|
||||
m_vec_mobTable.resize(data.m_File.GetRowCount()-1 + addNumber);
|
||||
|
@ -378,7 +378,7 @@ bool CClientManager::InitializeMobTable()
|
|||
|
||||
if (!Set_Proto_Mob_Table(mob_table, data, localMap))
|
||||
{
|
||||
fprintf(stderr, "몹 프로토 테이블 셋팅 실패.\n");
|
||||
SPDLOG_ERROR("몹 프로토 테이블 셋팅 실패.");
|
||||
}
|
||||
|
||||
|
||||
|
@ -388,7 +388,7 @@ bool CClientManager::InitializeMobTable()
|
|||
vnumSet.insert(mob_table->dwVnum);
|
||||
|
||||
|
||||
sys_log(1, "MOB #%-5d %-24s %-24s level: %-3u rank: %u empire: %d", mob_table->dwVnum, mob_table->szName, mob_table->szLocaleName, mob_table->bLevel, mob_table->bRank, mob_table->bEmpire);
|
||||
SPDLOG_TRACE("MOB #{:<5} {:24} {:24} level: {:<3} rank: {} empire: {}", mob_table->dwVnum, mob_table->szName, mob_table->szLocaleName, mob_table->bLevel, mob_table->bRank, mob_table->bEmpire);
|
||||
++mob_table;
|
||||
|
||||
}
|
||||
|
@ -402,7 +402,7 @@ bool CClientManager::InitializeMobTable()
|
|||
test_data;
|
||||
if(!test_data.Load("mob_proto_test.txt",'\t'))
|
||||
{
|
||||
fprintf(stderr, "테스트 파일이 없습니다. 그대로 진행합니다.\n");
|
||||
SPDLOG_ERROR("테스트 파일이 없습니다. 그대로 진행합니다.");
|
||||
isTestFile = false;
|
||||
}
|
||||
if(isTestFile) {
|
||||
|
@ -419,10 +419,10 @@ bool CClientManager::InitializeMobTable()
|
|||
|
||||
if (!Set_Proto_Mob_Table(mob_table, test_data, localMap))
|
||||
{
|
||||
fprintf(stderr, "몹 프로토 테이블 셋팅 실패.\n");
|
||||
SPDLOG_ERROR("몹 프로토 테이블 셋팅 실패.");
|
||||
}
|
||||
|
||||
sys_log(0, "MOB #%-5d %-24s %-24s level: %-3u rank: %u empire: %d", mob_table->dwVnum, mob_table->szName, mob_table->szLocaleName, mob_table->bLevel, mob_table->bRank, mob_table->bEmpire);
|
||||
SPDLOG_DEBUG("MOB #{:<5} {:24} {:24} level: {:<3} rank: {} empire: {}", mob_table->dwVnum, mob_table->szName, mob_table->szLocaleName, mob_table->bLevel, mob_table->bRank, mob_table->bEmpire);
|
||||
++mob_table;
|
||||
|
||||
}
|
||||
|
@ -453,7 +453,7 @@ bool CClientManager::InitializeShopTable()
|
|||
|
||||
if (!pRes2->uiNumRows)
|
||||
{
|
||||
sys_err("InitializeShopTable : Table count is zero.");
|
||||
SPDLOG_ERROR("InitializeShopTable : Table count is zero.");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -508,7 +508,7 @@ bool CClientManager::InitializeShopTable()
|
|||
while (it != map_shop.end())
|
||||
{
|
||||
memcpy((m_pShopTable + i), (it++)->second, sizeof(TShopTable));
|
||||
sys_log(0, "SHOP: #%d items: %d", (m_pShopTable + i)->dwVnum, (m_pShopTable + i)->byItemCount);
|
||||
SPDLOG_DEBUG("SHOP: #{} items: {}", (m_pShopTable + i)->dwVnum, (m_pShopTable + i)->byItemCount);
|
||||
++i;
|
||||
}
|
||||
|
||||
|
@ -529,7 +529,7 @@ bool CClientManager::InitializeQuestItemTable()
|
|||
|
||||
if (!pRes->uiNumRows)
|
||||
{
|
||||
sys_err("query error or no rows: %s", query);
|
||||
SPDLOG_ERROR("query error or no rows: {}", query);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -556,7 +556,7 @@ bool CClientManager::InitializeQuestItemTable()
|
|||
|
||||
if (m_map_itemTableByVnum.find(tbl.dwVnum) != m_map_itemTableByVnum.end())
|
||||
{
|
||||
sys_err("QUEST_ITEM_ERROR! %lu vnum already exist! (name %s)", tbl.dwVnum, tbl.szLocaleName);
|
||||
SPDLOG_ERROR("QUEST_ITEM_ERROR! {} vnum already exist! (name {})", tbl.dwVnum, tbl.szLocaleName);
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -603,7 +603,7 @@ bool CClientManager::InitializeItemTable()
|
|||
cCsvTable nameData;
|
||||
if(!nameData.Load("item_names.txt",'\t'))
|
||||
{
|
||||
fprintf(stderr, "item_names.txt 파일을 읽어오지 못했습니다\n");
|
||||
SPDLOG_ERROR("item_names.txt 파일을 읽어오지 못했습니다");
|
||||
isNameFile = false;
|
||||
} else {
|
||||
nameData.Next();
|
||||
|
@ -622,7 +622,7 @@ bool CClientManager::InitializeItemTable()
|
|||
cCsvTable test_data;
|
||||
if(!test_data.Load("item_proto_test.txt",'\t'))
|
||||
{
|
||||
fprintf(stderr, "item_proto_test.txt 파일을 읽어오지 못했습니다\n");
|
||||
SPDLOG_ERROR("item_proto_test.txt 파일을 읽어오지 못했습니다");
|
||||
//return false;
|
||||
} else {
|
||||
test_data.Next(); //설명 로우 넘어가기.
|
||||
|
@ -639,7 +639,7 @@ bool CClientManager::InitializeItemTable()
|
|||
|
||||
if (!Set_Proto_Item_Table(test_item_table, test_data, localMap))
|
||||
{
|
||||
fprintf(stderr, "아이템 프로토 테이블 셋팅 실패.\n");
|
||||
SPDLOG_ERROR("아이템 프로토 테이블 셋팅 실패.");
|
||||
}
|
||||
|
||||
test_map_itemTableByVnum.insert(std::map<DWORD, TItemTable *>::value_type(test_item_table->dwVnum, test_item_table));
|
||||
|
@ -666,14 +666,14 @@ bool CClientManager::InitializeItemTable()
|
|||
cCsvTable data;
|
||||
if(!data.Load("item_proto.txt",'\t'))
|
||||
{
|
||||
fprintf(stderr, "item_proto.txt 파일을 읽어오지 못했습니다\n");
|
||||
SPDLOG_ERROR("item_proto.txt 파일을 읽어오지 못했습니다");
|
||||
return false;
|
||||
}
|
||||
data.Next(); //맨 윗줄 제외 (아이템 칼럼을 설명하는 부분)
|
||||
|
||||
if (!m_vec_itemTable.empty())
|
||||
{
|
||||
sys_log(0, "RELOAD: item_proto");
|
||||
SPDLOG_DEBUG("RELOAD: item_proto");
|
||||
m_vec_itemTable.clear();
|
||||
m_map_itemTableByVnum.clear();
|
||||
}
|
||||
|
@ -693,7 +693,7 @@ bool CClientManager::InitializeItemTable()
|
|||
data.Destroy();
|
||||
if(!data.Load("item_proto.txt",'\t'))
|
||||
{
|
||||
fprintf(stderr, "item_proto.txt 파일을 읽어오지 못했습니다\n");
|
||||
SPDLOG_ERROR("item_proto.txt 파일을 읽어오지 못했습니다");
|
||||
return false;
|
||||
}
|
||||
data.Next(); //맨 윗줄 제외 (아이템 칼럼을 설명하는 부분)
|
||||
|
@ -715,7 +715,7 @@ bool CClientManager::InitializeItemTable()
|
|||
|
||||
if (!Set_Proto_Item_Table(item_table, data, localMap))
|
||||
{
|
||||
fprintf(stderr, "아이템 프로토 테이블 셋팅 실패.\n");
|
||||
SPDLOG_ERROR("아이템 프로토 테이블 셋팅 실패.");
|
||||
}
|
||||
|
||||
|
||||
|
@ -782,7 +782,7 @@ bool CClientManager::InitializeItemTable()
|
|||
test_data.Destroy();
|
||||
if(!test_data.Load("item_proto_test.txt",'\t'))
|
||||
{
|
||||
fprintf(stderr, "item_proto_test.txt 파일을 읽어오지 못했습니다\n");
|
||||
SPDLOG_ERROR("item_proto_test.txt 파일을 읽어오지 못했습니다");
|
||||
//return false;
|
||||
} else {
|
||||
test_data.Next(); //설명 로우 넘어가기.
|
||||
|
@ -798,7 +798,7 @@ bool CClientManager::InitializeItemTable()
|
|||
|
||||
if (!Set_Proto_Item_Table(item_table, test_data, localMap))
|
||||
{
|
||||
fprintf(stderr, "아이템 프로토 테이블 셋팅 실패.\n");
|
||||
SPDLOG_ERROR("아이템 프로토 테이블 셋팅 실패.");
|
||||
}
|
||||
|
||||
|
||||
|
@ -823,7 +823,7 @@ bool CClientManager::InitializeItemTable()
|
|||
{
|
||||
TItemTable * item_table = &(*(it++));
|
||||
|
||||
sys_log(1, "ITEM: #%-5lu %-24s %-24s VAL: %ld %ld %ld %ld %ld %ld WEAR %lu ANTI %lu IMMUNE %lu REFINE %lu REFINE_SET %u MAGIC_PCT %u",
|
||||
SPDLOG_TRACE("ITEM: #{:<5} {:24} {:24} VAL: {} {} {} {} {} {} WEAR {} ANTI {} IMMUNE {} REFINE {} REFINE_SET {} MAGIC_PCT {}",
|
||||
item_table->dwVnum,
|
||||
item_table->szName,
|
||||
item_table->szLocaleName,
|
||||
|
@ -865,13 +865,13 @@ bool CClientManager::InitializeSkillTable()
|
|||
|
||||
if (!pRes->uiNumRows)
|
||||
{
|
||||
sys_err("no result from skill_proto");
|
||||
SPDLOG_ERROR("no result from skill_proto");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!m_vec_skillTable.empty())
|
||||
{
|
||||
sys_log(0, "RELOAD: skill_proto");
|
||||
SPDLOG_DEBUG("RELOAD: skill_proto");
|
||||
m_vec_skillTable.clear();
|
||||
}
|
||||
|
||||
|
@ -929,7 +929,7 @@ bool CClientManager::InitializeSkillTable()
|
|||
str_to_number(t.bSkillAttrType, data[col++]);
|
||||
str_to_number(t.dwTargetRange, data[col++]);
|
||||
|
||||
sys_log(0, "SKILL: #%d %s flag %u point %s affect %u cooldown %s", t.dwVnum, t.szName, t.dwFlag, t.szPointOn, t.dwAffectFlag, t.szCooldownPoly);
|
||||
SPDLOG_TRACE("SKILL: #{} {} flag {} point {} affect {} cooldown {}", t.dwVnum, t.szName, t.dwFlag, t.szPointOn, t.dwAffectFlag, t.szCooldownPoly);
|
||||
|
||||
m_vec_skillTable.push_back(t);
|
||||
}
|
||||
|
@ -961,7 +961,7 @@ bool CClientManager::InitializeBanwordTable()
|
|||
}
|
||||
}
|
||||
|
||||
sys_log(0, "BANWORD: total %d", m_vec_banwordTable.size());
|
||||
SPDLOG_DEBUG("BANWORD: total {}", m_vec_banwordTable.size());
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -977,13 +977,13 @@ bool CClientManager::InitializeItemAttrTable()
|
|||
|
||||
if (!pRes->uiNumRows)
|
||||
{
|
||||
sys_err("no result from item_attr");
|
||||
SPDLOG_ERROR("no result from item_attr");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!m_vec_itemAttrTable.empty())
|
||||
{
|
||||
sys_log(0, "RELOAD: item_attr");
|
||||
SPDLOG_DEBUG("RELOAD: item_attr");
|
||||
m_vec_itemAttrTable.clear();
|
||||
}
|
||||
|
||||
|
@ -1016,7 +1016,7 @@ bool CClientManager::InitializeItemAttrTable()
|
|||
str_to_number(t.bMaxLevelBySet[ATTRIBUTE_SET_SHIELD], data[col++]);
|
||||
str_to_number(t.bMaxLevelBySet[ATTRIBUTE_SET_EAR], data[col++]);
|
||||
|
||||
sys_log(0, "ITEM_ATTR: %-20s %4lu { %3d %3d %3d %3d %3d } { %d %d %d %d %d %d %d }",
|
||||
SPDLOG_TRACE("ITEM_ATTR: {:20} {:4} ( {:3} {:3} {:3} {:3} {:3} ) ( {} {} {} {} {} {} {} )",
|
||||
t.szApply,
|
||||
t.dwProb,
|
||||
t.lValues[0],
|
||||
|
@ -1051,13 +1051,13 @@ bool CClientManager::InitializeItemRareTable()
|
|||
|
||||
if (!pRes->uiNumRows)
|
||||
{
|
||||
sys_err("no result from item_attr_rare");
|
||||
SPDLOG_ERROR("no result from item_attr_rare");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!m_vec_itemRareTable.empty())
|
||||
{
|
||||
sys_log(0, "RELOAD: item_attr_rare");
|
||||
SPDLOG_DEBUG("RELOAD: item_attr_rare");
|
||||
m_vec_itemRareTable.clear();
|
||||
}
|
||||
|
||||
|
@ -1090,7 +1090,7 @@ bool CClientManager::InitializeItemRareTable()
|
|||
str_to_number(t.bMaxLevelBySet[ATTRIBUTE_SET_SHIELD], data[col++]);
|
||||
str_to_number(t.bMaxLevelBySet[ATTRIBUTE_SET_EAR], data[col++]);
|
||||
|
||||
sys_log(0, "ITEM_RARE: %-20s %4lu { %3d %3d %3d %3d %3d } { %d %d %d %d %d %d %d }",
|
||||
SPDLOG_TRACE("ITEM_RARE: {:20} {:4} ( {:3} {:3} {:3} {:3} {:3} ) ( {} {} {} {} {} {} {} )",
|
||||
t.szApply,
|
||||
t.dwProb,
|
||||
t.lValues[0],
|
||||
|
@ -1129,7 +1129,7 @@ bool CClientManager::InitializeLandTable()
|
|||
|
||||
if (!m_vec_kLandTable.empty())
|
||||
{
|
||||
sys_log(0, "RELOAD: land");
|
||||
SPDLOG_DEBUG("RELOAD: land");
|
||||
m_vec_kLandTable.clear();
|
||||
}
|
||||
|
||||
|
@ -1156,7 +1156,7 @@ bool CClientManager::InitializeLandTable()
|
|||
str_to_number(t.bGuildLevelLimit, data[col++]);
|
||||
str_to_number(t.dwPrice, data[col++]);
|
||||
|
||||
sys_log(0, "LAND: %lu map %-4ld %7ldx%-7ld w %-4ld h %-4ld", t.dwID, t.lMapIndex, t.x, t.y, t.width, t.height);
|
||||
SPDLOG_TRACE("LAND: {} map {:<4} {:7}x{:<7} w {:<4} h {:<4}", t.dwID, t.lMapIndex, t.x, t.y, t.width, t.height);
|
||||
|
||||
m_vec_kLandTable.push_back(t);
|
||||
}
|
||||
|
@ -1232,7 +1232,7 @@ bool CClientManager::InitializeObjectProto()
|
|||
|
||||
if (!m_vec_kObjectProto.empty())
|
||||
{
|
||||
sys_log(0, "RELOAD: object_proto");
|
||||
SPDLOG_DEBUG("RELOAD: object_proto");
|
||||
m_vec_kObjectProto.clear();
|
||||
}
|
||||
|
||||
|
@ -1280,7 +1280,7 @@ bool CClientManager::InitializeObjectProto()
|
|||
t.lNPCY = std::max(t.lRegion[1], t.lRegion[3])+300;
|
||||
// END_OF_ADD_BUILDING_NPC
|
||||
|
||||
sys_log(0, "OBJ_PROTO: vnum %lu price %lu mat %lu %lu",
|
||||
SPDLOG_TRACE("OBJ_PROTO: vnum {} price {} mat {} {}",
|
||||
t.dwVnum, t.dwPrice, t.kMaterials[0].dwItemVnum, t.kMaterials[0].dwCount);
|
||||
|
||||
m_vec_kObjectProto.push_back(t);
|
||||
|
@ -1301,7 +1301,7 @@ bool CClientManager::InitializeObjectTable()
|
|||
|
||||
if (!m_map_pkObjectTable.empty())
|
||||
{
|
||||
sys_log(0, "RELOAD: object");
|
||||
SPDLOG_DEBUG("RELOAD: object");
|
||||
m_map_pkObjectTable.clear();
|
||||
}
|
||||
|
||||
|
@ -1327,7 +1327,7 @@ bool CClientManager::InitializeObjectTable()
|
|||
str_to_number(k->zRot, data[col++]);
|
||||
str_to_number(k->lLife, data[col++]);
|
||||
|
||||
sys_log(0, "OBJ: %lu vnum %lu map %-4ld %7ldx%-7ld life %ld",
|
||||
SPDLOG_DEBUG("OBJ: {} vnum {} map {:<4} {:7}x{:<7} life {}",
|
||||
k->dwID, k->dwVnum, k->lMapIndex, k->x, k->y, k->lLife);
|
||||
|
||||
m_map_pkObjectTable.insert(std::make_pair(k->dwID, k));
|
||||
|
|
|
@ -21,7 +21,7 @@ void CClientManager::LoadEventFlag()
|
|||
TPacketSetEventFlag p;
|
||||
strlcpy(p.szFlagName, row[0], sizeof(p.szFlagName));
|
||||
str_to_number(p.lValue, row[1]);
|
||||
sys_log(0, "EventFlag Load %s %d", p.szFlagName, p.lValue);
|
||||
SPDLOG_DEBUG("EventFlag Load {} {}", p.szFlagName, p.lValue);
|
||||
m_map_lEventFlag.insert(std::make_pair(std::string(p.szFlagName), p.lValue));
|
||||
ForwardPacket(HEADER_DG_SET_EVENT_FLAG, &p, sizeof(TPacketSetEventFlag));
|
||||
}
|
||||
|
@ -56,10 +56,10 @@ void CClientManager::SetEventFlag(TPacketSetEventFlag* p)
|
|||
|
||||
//CDBManager::instance().ReturnQuery(szQuery, QID_QUEST_SAVE, 0, NULL);
|
||||
CDBManager::instance().AsyncQuery(szQuery);
|
||||
sys_log(0, "HEADER_GD_SET_EVENT_FLAG : Changed CClientmanager::SetEventFlag(%s %d) ", p->szFlagName, p->lValue);
|
||||
SPDLOG_DEBUG("HEADER_GD_SET_EVENT_FLAG : Changed CClientmanager::SetEventFlag({} {}) ", p->szFlagName, p->lValue);
|
||||
return;
|
||||
}
|
||||
sys_log(0, "HEADER_GD_SET_EVENT_FLAG : No Changed CClientmanager::SetEventFlag(%s %d) ", p->szFlagName, p->lValue);
|
||||
SPDLOG_DEBUG("HEADER_GD_SET_EVENT_FLAG : No Changed CClientmanager::SetEventFlag({} {}) ", p->szFlagName, p->lValue);
|
||||
}
|
||||
|
||||
void CClientManager::SendEventFlagsOnSetup(CPeer* peer)
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
|
||||
void CClientManager::GuildCreate(CPeer * peer, DWORD dwGuildID)
|
||||
{
|
||||
sys_log(0, "GuildCreate %u", dwGuildID);
|
||||
SPDLOG_DEBUG("GuildCreate {}", dwGuildID);
|
||||
ForwardPacket(HEADER_DG_GUILD_LOAD, &dwGuildID, sizeof(DWORD));
|
||||
|
||||
CGuildManager::instance().Load(dwGuildID);
|
||||
|
@ -18,14 +18,14 @@ void CClientManager::GuildCreate(CPeer * peer, DWORD dwGuildID)
|
|||
|
||||
void CClientManager::GuildChangeGrade(CPeer* peer, TPacketGuild* p)
|
||||
{
|
||||
sys_log(0, "GuildChangeGrade %u %u", p->dwGuild, p->dwInfo);
|
||||
SPDLOG_DEBUG("GuildChangeGrade {} {}", p->dwGuild, p->dwInfo);
|
||||
ForwardPacket(HEADER_DG_GUILD_CHANGE_GRADE, p, sizeof(TPacketGuild));
|
||||
}
|
||||
|
||||
void CClientManager::GuildAddMember(CPeer* peer, TPacketGDGuildAddMember * p)
|
||||
{
|
||||
CGuildManager::instance().TouchGuild(p->dwGuild);
|
||||
sys_log(0, "GuildAddMember %u %u", p->dwGuild, p->dwPID);
|
||||
SPDLOG_DEBUG("GuildAddMember {} {}", p->dwGuild, p->dwPID);
|
||||
|
||||
char szQuery[512];
|
||||
|
||||
|
@ -42,7 +42,7 @@ void CClientManager::GuildAddMember(CPeer* peer, TPacketGDGuildAddMember * p)
|
|||
|
||||
if (pmsg->Get()->uiNumRows == 0)
|
||||
{
|
||||
sys_err("Query failed when getting guild member data %s", pmsg->stQuery.c_str());
|
||||
SPDLOG_ERROR("Query failed when getting guild member data {}", pmsg->stQuery.c_str());
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -67,7 +67,7 @@ void CClientManager::GuildAddMember(CPeer* peer, TPacketGDGuildAddMember * p)
|
|||
|
||||
void CClientManager::GuildRemoveMember(CPeer* peer, TPacketGuild* p)
|
||||
{
|
||||
sys_log(0, "GuildRemoveMember %u %u", p->dwGuild, p->dwInfo);
|
||||
SPDLOG_DEBUG("GuildRemoveMember {} {}", p->dwGuild, p->dwInfo);
|
||||
|
||||
char szQuery[512];
|
||||
snprintf(szQuery, sizeof(szQuery), "DELETE FROM guild_member%s WHERE pid=%u and guild_id=%u", GetTablePostfix(), p->dwInfo, p->dwGuild);
|
||||
|
@ -81,25 +81,25 @@ void CClientManager::GuildRemoveMember(CPeer* peer, TPacketGuild* p)
|
|||
|
||||
void CClientManager::GuildSkillUpdate(CPeer* peer, TPacketGuildSkillUpdate* p)
|
||||
{
|
||||
sys_log(0, "GuildSkillUpdate %d", p->amount);
|
||||
SPDLOG_DEBUG("GuildSkillUpdate {}", p->amount);
|
||||
ForwardPacket(HEADER_DG_GUILD_SKILL_UPDATE, p, sizeof(TPacketGuildSkillUpdate));
|
||||
}
|
||||
|
||||
void CClientManager::GuildExpUpdate(CPeer* peer, TPacketGuildExpUpdate* p)
|
||||
{
|
||||
sys_log(0, "GuildExpUpdate %d", p->amount);
|
||||
SPDLOG_DEBUG("GuildExpUpdate {}", p->amount);
|
||||
ForwardPacket(HEADER_DG_GUILD_EXP_UPDATE, p, sizeof(TPacketGuildExpUpdate), 0, peer);
|
||||
}
|
||||
|
||||
void CClientManager::GuildChangeMemberData(CPeer* peer, TPacketGuildChangeMemberData* p)
|
||||
{
|
||||
sys_log(0, "GuildChangeMemberData %u %u %d %d", p->pid, p->offer, p->level, p->grade);
|
||||
SPDLOG_DEBUG("GuildChangeMemberData {} {} {} {}", p->pid, p->offer, p->level, p->grade);
|
||||
ForwardPacket(HEADER_DG_GUILD_CHANGE_MEMBER_DATA, p, sizeof(TPacketGuildChangeMemberData), 0, peer);
|
||||
}
|
||||
|
||||
void CClientManager::GuildDisband(CPeer* peer, TPacketGuild* p)
|
||||
{
|
||||
sys_log(0, "GuildDisband %u", p->dwGuild);
|
||||
SPDLOG_DEBUG("GuildDisband {}", p->dwGuild);
|
||||
|
||||
char szQuery[512];
|
||||
|
||||
|
@ -141,12 +141,12 @@ void CClientManager::GuildWar(CPeer* peer, TPacketGuildWar* p)
|
|||
switch (p->bWar)
|
||||
{
|
||||
case GUILD_WAR_SEND_DECLARE:
|
||||
sys_log(0, "GuildWar: GUILD_WAR_SEND_DECLARE type(%s) guild(%d - %d)", __GetWarType(p->bType), p->dwGuildFrom, p->dwGuildTo);
|
||||
SPDLOG_DEBUG("GuildWar: GUILD_WAR_SEND_DECLARE type({}) guild({} - {})", __GetWarType(p->bType), p->dwGuildFrom, p->dwGuildTo);
|
||||
CGuildManager::instance().AddDeclare(p->bType, p->dwGuildFrom, p->dwGuildTo);
|
||||
break;
|
||||
|
||||
case GUILD_WAR_REFUSE:
|
||||
sys_log(0, "GuildWar: GUILD_WAR_REFUSE type(%s) guild(%d - %d)", __GetWarType(p->bType), p->dwGuildFrom, p->dwGuildTo);
|
||||
SPDLOG_DEBUG("GuildWar: GUILD_WAR_REFUSE type({}) guild({} - {})", __GetWarType(p->bType), p->dwGuildFrom, p->dwGuildTo);
|
||||
CGuildManager::instance().RemoveDeclare(p->dwGuildFrom, p->dwGuildTo);
|
||||
break;
|
||||
/*
|
||||
|
@ -160,10 +160,10 @@ void CClientManager::GuildWar(CPeer* peer, TPacketGuildWar* p)
|
|||
*/
|
||||
|
||||
case GUILD_WAR_WAIT_START:
|
||||
sys_log(0, "GuildWar: GUILD_WAR_WAIT_START type(%s) guild(%d - %d)", __GetWarType(p->bType), p->dwGuildFrom, p->dwGuildTo);
|
||||
SPDLOG_DEBUG("GuildWar: GUILD_WAR_WAIT_START type({}) guild({} - {})", __GetWarType(p->bType), p->dwGuildFrom, p->dwGuildTo);
|
||||
case GUILD_WAR_RESERVE: // 길드전 예약
|
||||
if (p->bWar != GUILD_WAR_WAIT_START)
|
||||
sys_log(0, "GuildWar: GUILD_WAR_RESERVE type(%s) guild(%d - %d)", __GetWarType(p->bType), p->dwGuildFrom, p->dwGuildTo);
|
||||
SPDLOG_DEBUG("GuildWar: GUILD_WAR_RESERVE type({}) guild({} - {})", __GetWarType(p->bType), p->dwGuildFrom, p->dwGuildTo);
|
||||
CGuildManager::instance().RemoveDeclare(p->dwGuildFrom, p->dwGuildTo);
|
||||
|
||||
if (!CGuildManager::instance().ReserveWar(p))
|
||||
|
@ -174,23 +174,23 @@ void CClientManager::GuildWar(CPeer* peer, TPacketGuildWar* p)
|
|||
break;
|
||||
|
||||
case GUILD_WAR_ON_WAR: // 길드전을 시작 시킨다. (필드전은 바로 시작 됨)
|
||||
sys_log(0, "GuildWar: GUILD_WAR_ON_WAR type(%s) guild(%d - %d)", __GetWarType(p->bType), p->dwGuildFrom, p->dwGuildTo);
|
||||
SPDLOG_DEBUG("GuildWar: GUILD_WAR_ON_WAR type({}) guild({} - {})", __GetWarType(p->bType), p->dwGuildFrom, p->dwGuildTo);
|
||||
CGuildManager::instance().RemoveDeclare(p->dwGuildFrom, p->dwGuildTo);
|
||||
CGuildManager::instance().StartWar(p->bType, p->dwGuildFrom, p->dwGuildTo);
|
||||
break;
|
||||
|
||||
case GUILD_WAR_OVER: // 길드전 정상 종료
|
||||
sys_log(0, "GuildWar: GUILD_WAR_OVER type(%s) guild(%d - %d)", __GetWarType(p->bType), p->dwGuildFrom, p->dwGuildTo);
|
||||
SPDLOG_DEBUG("GuildWar: GUILD_WAR_OVER type({}) guild({} - {})", __GetWarType(p->bType), p->dwGuildFrom, p->dwGuildTo);
|
||||
CGuildManager::instance().RecvWarOver(p->dwGuildFrom, p->dwGuildTo, p->bType, p->lWarPrice);
|
||||
break;
|
||||
|
||||
case GUILD_WAR_END: // 길드전 비정상 종료
|
||||
sys_log(0, "GuildWar: GUILD_WAR_END type(%s) guild(%d - %d)", __GetWarType(p->bType), p->dwGuildFrom, p->dwGuildTo);
|
||||
SPDLOG_DEBUG("GuildWar: GUILD_WAR_END type({}) guild({} - {})", __GetWarType(p->bType), p->dwGuildFrom, p->dwGuildTo);
|
||||
CGuildManager::instance().RecvWarEnd(p->dwGuildFrom, p->dwGuildTo);
|
||||
return; // NOTE: RecvWarEnd에서 패킷을 보내므로 따로 브로드캐스팅 하지 않는다.
|
||||
|
||||
case GUILD_WAR_CANCEL :
|
||||
sys_log(0, "GuildWar: GUILD_WAR_CANCEL type(%s) guild(%d - %d)", __GetWarType(p->bType), p->dwGuildFrom, p->dwGuildTo);
|
||||
SPDLOG_DEBUG("GuildWar: GUILD_WAR_CANCEL type({}) guild({} - {})", __GetWarType(p->bType), p->dwGuildFrom, p->dwGuildTo);
|
||||
CGuildManager::instance().CancelWar(p->dwGuildFrom, p->dwGuildTo);
|
||||
break;
|
||||
}
|
||||
|
@ -205,20 +205,20 @@ void CClientManager::GuildWarScore(CPeer* peer, TPacketGuildWarScore * p)
|
|||
|
||||
void CClientManager::GuildChangeLadderPoint(TPacketGuildLadderPoint* p)
|
||||
{
|
||||
sys_log(0, "GuildChangeLadderPoint Recv %u %d", p->dwGuild, p->lChange);
|
||||
SPDLOG_DEBUG("GuildChangeLadderPoint Recv {} {}", p->dwGuild, p->lChange);
|
||||
CGuildManager::instance().ChangeLadderPoint(p->dwGuild, p->lChange);
|
||||
}
|
||||
|
||||
void CClientManager::GuildUseSkill(TPacketGuildUseSkill* p)
|
||||
{
|
||||
sys_log(0, "GuildUseSkill Recv %u %d", p->dwGuild, p->dwSkillVnum);
|
||||
SPDLOG_DEBUG("GuildUseSkill Recv {} {}", p->dwGuild, p->dwSkillVnum);
|
||||
CGuildManager::instance().UseSkill(p->dwGuild, p->dwSkillVnum, p->dwCooltime);
|
||||
SendGuildSkillUsable(p->dwGuild, p->dwSkillVnum, false);
|
||||
}
|
||||
|
||||
void CClientManager::SendGuildSkillUsable(DWORD guild_id, DWORD dwSkillVnum, bool bUsable)
|
||||
{
|
||||
sys_log(0, "SendGuildSkillUsable Send %u %d %s", guild_id, dwSkillVnum, bUsable?"true":"false");
|
||||
SPDLOG_DEBUG("SendGuildSkillUsable Send {} {} {}", guild_id, dwSkillVnum, bUsable?"true":"false");
|
||||
|
||||
TPacketGuildSkillUsableChange p;
|
||||
|
||||
|
|
|
@ -11,7 +11,6 @@
|
|||
extern std::string g_stLocale;
|
||||
extern bool CreatePlayerTableFromRes(MYSQL_RES * res, TPlayerTable * pkTab);
|
||||
extern int g_test_server;
|
||||
extern int g_log;
|
||||
|
||||
bool CClientManager::InsertLogonAccount(const char * c_pszLogin, DWORD dwHandle, const char * c_pszIP)
|
||||
{
|
||||
|
@ -49,7 +48,7 @@ bool CClientManager::DeleteLogonAccount(const char * c_pszLogin, DWORD dwHandle)
|
|||
|
||||
if (pkLD->GetConnectedPeerHandle() != dwHandle)
|
||||
{
|
||||
sys_err("%s tried to logout in other peer handle %lu, current handle %lu", szLogin, dwHandle, pkLD->GetConnectedPeerHandle());
|
||||
SPDLOG_ERROR("{} tried to logout in other peer handle {}, current handle {}", szLogin, dwHandle, pkLD->GetConnectedPeerHandle());
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -87,7 +86,7 @@ void CClientManager::QUERY_LOGIN_BY_KEY(CPeer * pkPeer, DWORD dwHandle, TPacketG
|
|||
|
||||
if (!pkLoginData)
|
||||
{
|
||||
sys_log(0, "LOGIN_BY_KEY key not exist %s %lu", szLogin, p->dwLoginKey);
|
||||
SPDLOG_DEBUG("LOGIN_BY_KEY key not exist {} {}", szLogin, p->dwLoginKey);
|
||||
pkPeer->EncodeReturn(HEADER_DG_LOGIN_NOT_EXIST, dwHandle);
|
||||
return;
|
||||
}
|
||||
|
@ -96,7 +95,7 @@ void CClientManager::QUERY_LOGIN_BY_KEY(CPeer * pkPeer, DWORD dwHandle, TPacketG
|
|||
|
||||
if (FindLogonAccount(r.login))
|
||||
{
|
||||
sys_log(0, "LOGIN_BY_KEY already login %s %lu", r.login, p->dwLoginKey);
|
||||
SPDLOG_DEBUG("LOGIN_BY_KEY already login {} {}", r.login, p->dwLoginKey);
|
||||
TPacketDGLoginAlready ptog;
|
||||
strlcpy(ptog.szLogin, szLogin, sizeof(ptog.szLogin));
|
||||
pkPeer->EncodeHeader(HEADER_DG_LOGIN_ALREADY, dwHandle, sizeof(TPacketDGLoginAlready));
|
||||
|
@ -106,7 +105,7 @@ void CClientManager::QUERY_LOGIN_BY_KEY(CPeer * pkPeer, DWORD dwHandle, TPacketG
|
|||
|
||||
if (strcasecmp(r.login, szLogin))
|
||||
{
|
||||
sys_log(0, "LOGIN_BY_KEY login differ %s %lu input %s", r.login, p->dwLoginKey, szLogin);
|
||||
SPDLOG_DEBUG("LOGIN_BY_KEY login differ {} {} input {}", r.login, p->dwLoginKey, szLogin);
|
||||
pkPeer->EncodeReturn(HEADER_DG_LOGIN_NOT_EXIST, dwHandle);
|
||||
return;
|
||||
}
|
||||
|
@ -115,7 +114,7 @@ void CClientManager::QUERY_LOGIN_BY_KEY(CPeer * pkPeer, DWORD dwHandle, TPacketG
|
|||
{
|
||||
const DWORD * pdwClientKey = pkLoginData->GetClientKey();
|
||||
|
||||
sys_log(0, "LOGIN_BY_KEY client key differ %s %lu %lu %lu %lu, %lu %lu %lu %lu",
|
||||
SPDLOG_DEBUG("LOGIN_BY_KEY client key differ {} {} {} {} {}, {} {} {} {}",
|
||||
r.login,
|
||||
p->adwClientKey[0], p->adwClientKey[1], p->adwClientKey[2], p->adwClientKey[3],
|
||||
pdwClientKey[0], pdwClientKey[1], pdwClientKey[2], pdwClientKey[3]);
|
||||
|
@ -137,7 +136,7 @@ void CClientManager::QUERY_LOGIN_BY_KEY(CPeer * pkPeer, DWORD dwHandle, TPacketG
|
|||
info->pAccountTable = pkTab;
|
||||
strlcpy(info->ip, p->szIP, sizeof(info->ip));
|
||||
|
||||
sys_log(0, "LOGIN_BY_KEY success %s %lu %s", r.login, p->dwLoginKey, info->ip);
|
||||
SPDLOG_DEBUG("LOGIN_BY_KEY success {} {} {}", r.login, p->dwLoginKey, info->ip);
|
||||
char szQuery[QUERY_MAX_LEN];
|
||||
snprintf(szQuery, sizeof(szQuery), "SELECT pid1, pid2, pid3, pid4, empire FROM player_index%s WHERE id=%u", GetTablePostfix(), r.id);
|
||||
CDBManager::instance().ReturnQuery(szQuery, QID_LOGIN_BY_KEY, pkPeer->GetHandle(), info);
|
||||
|
@ -164,11 +163,11 @@ void CClientManager::RESULT_LOGIN_BY_KEY(CPeer * peer, SQLMsg * msg)
|
|||
snprintf(szQuery, sizeof(szQuery), "SELECT pid1, pid2, pid3, pid4, empire FROM player_index%s WHERE id=%u", GetTablePostfix(), account_id);
|
||||
std::unique_ptr<SQLMsg> pMsg(CDBManager::instance().DirectQuery(szQuery, SQL_PLAYER));
|
||||
|
||||
sys_log(0, "RESULT_LOGIN_BY_KEY FAIL player_index's NULL : ID:%d", account_id);
|
||||
SPDLOG_DEBUG("RESULT_LOGIN_BY_KEY FAIL player_index's NULL : ID:{}", account_id);
|
||||
|
||||
if (pMsg->Get()->uiNumRows == 0)
|
||||
{
|
||||
sys_log(0, "RESULT_LOGIN_BY_KEY FAIL player_index's NULL : ID:%d", account_id);
|
||||
SPDLOG_DEBUG("RESULT_LOGIN_BY_KEY FAIL player_index's NULL : ID:{}", account_id);
|
||||
|
||||
// PLAYER_INDEX_CREATE_BUG_FIX
|
||||
//snprintf(szQuery, sizeof(szQuery), "INSERT IGNORE INTO player_index%s (id) VALUES(%lu)", GetTablePostfix(), info->pAccountTable->id);
|
||||
|
@ -332,14 +331,14 @@ void CreateAccountPlayerDataFromRes(MYSQL_RES * pRes, TAccountTable * pkTab)
|
|||
str_to_number(pkTab->players[j].bChangeName, row[col++]);
|
||||
}
|
||||
|
||||
sys_log(0, "%s %lu %lu hair %u",
|
||||
SPDLOG_DEBUG("{} {} {} hair {}",
|
||||
pkTab->players[j].szName, pkTab->players[j].x, pkTab->players[j].y, pkTab->players[j].wHairPart);
|
||||
break;
|
||||
}
|
||||
}
|
||||
/*
|
||||
if (j == PLAYER_PER_ACCOUNT)
|
||||
sys_err("cannot find player_id on this account (login: %s id %lu account %lu %lu %lu)",
|
||||
SPDLOG_ERROR("cannot find player_id on this account (login: {} id {} account {} {} {})",
|
||||
pkTab->login, player_id,
|
||||
pkTab->players[0].dwID,
|
||||
pkTab->players[1].dwID,
|
||||
|
@ -358,7 +357,7 @@ void CClientManager::RESULT_LOGIN(CPeer * peer, SQLMsg * msg)
|
|||
// 계정이 없네?
|
||||
if (msg->Get()->uiNumRows == 0)
|
||||
{
|
||||
sys_log(0, "RESULT_LOGIN: no account");
|
||||
SPDLOG_DEBUG("RESULT_LOGIN: no account");
|
||||
peer->EncodeHeader(HEADER_DG_LOGIN_NOT_EXIST, info->dwHandle, 0);
|
||||
delete info;
|
||||
return;
|
||||
|
@ -368,7 +367,7 @@ void CClientManager::RESULT_LOGIN(CPeer * peer, SQLMsg * msg)
|
|||
|
||||
if (!info->pAccountTable)
|
||||
{
|
||||
sys_log(0, "RESULT_LOGIN: no account : WRONG_PASSWD");
|
||||
SPDLOG_DEBUG("RESULT_LOGIN: no account : WRONG_PASSWD");
|
||||
peer->EncodeReturn(HEADER_DG_LOGIN_WRONG_PASSWD, info->dwHandle);
|
||||
delete info;
|
||||
}
|
||||
|
@ -407,7 +406,7 @@ void CClientManager::RESULT_LOGIN(CPeer * peer, SQLMsg * msg)
|
|||
// 다른 컨넥션이 이미 로그인 해버렸다면.. 이미 접속했다고 보내야 한다.
|
||||
if (!InsertLogonAccount(info->pAccountTable->login, peer->GetHandle(), info->ip))
|
||||
{
|
||||
sys_log(0, "RESULT_LOGIN: already logon %s", info->pAccountTable->login);
|
||||
SPDLOG_DEBUG("RESULT_LOGIN: already logon {}", info->pAccountTable->login);
|
||||
|
||||
TPacketDGLoginAlready p;
|
||||
strlcpy(p.szLogin, info->pAccountTable->login, sizeof(p.szLogin));
|
||||
|
@ -417,7 +416,7 @@ void CClientManager::RESULT_LOGIN(CPeer * peer, SQLMsg * msg)
|
|||
}
|
||||
else
|
||||
{
|
||||
sys_log(0, "RESULT_LOGIN: login success %s rows: %lu", info->pAccountTable->login, msg->Get()->uiNumRows);
|
||||
SPDLOG_DEBUG("RESULT_LOGIN: login success {} rows: {}", info->pAccountTable->login, msg->Get()->uiNumRows);
|
||||
|
||||
if (msg->Get()->uiNumRows > 0)
|
||||
CreateAccountPlayerDataFromRes(msg->Get()->pSQLResult, info->pAccountTable);
|
||||
|
@ -456,23 +455,20 @@ void CClientManager::QUERY_LOGOUT(CPeer * peer, DWORD dwHandle,const char * data
|
|||
{
|
||||
if (pLoginData->GetAccountRef().players[n].dwID == 0)
|
||||
{
|
||||
if (g_test_server)
|
||||
sys_log(0, "LOGOUT %s %d", packet->login, pLoginData->GetAccountRef().players[n].dwID);
|
||||
SPDLOG_TRACE("LOGOUT {} {}", packet->login, pLoginData->GetAccountRef().players[n].dwID);
|
||||
continue;
|
||||
}
|
||||
|
||||
pid[n] = pLoginData->GetAccountRef().players[n].dwID;
|
||||
|
||||
if (g_log)
|
||||
sys_log(0, "LOGOUT InsertLogoutPlayer %s %d", packet->login, pid[n]);
|
||||
SPDLOG_TRACE("LOGOUT InsertLogoutPlayer {} {}", packet->login, pid[n]);
|
||||
|
||||
InsertLogoutPlayer(pid[n]);
|
||||
}
|
||||
|
||||
if (DeleteLogonAccount(packet->login, peer->GetHandle()))
|
||||
{
|
||||
if (g_log)
|
||||
sys_log(0, "LOGOUT %s ", packet->login);
|
||||
SPDLOG_TRACE("LOGOUT {} ", packet->login);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -13,11 +13,11 @@ void CClientManager::QUERY_PARTY_CREATE(CPeer* peer, TPacketPartyCreate* p)
|
|||
{
|
||||
pm.insert(make_pair(p->dwLeaderPID, TPartyMember()));
|
||||
ForwardPacket(HEADER_DG_PARTY_CREATE, p, sizeof(TPacketPartyCreate), peer->GetChannel(), peer);
|
||||
sys_log(0, "PARTY Create [%lu]", p->dwLeaderPID);
|
||||
SPDLOG_DEBUG("PARTY Create [{}]", p->dwLeaderPID);
|
||||
}
|
||||
else
|
||||
{
|
||||
sys_err("PARTY Create - Already exists [%lu]", p->dwLeaderPID);
|
||||
SPDLOG_ERROR("PARTY Create - Already exists [{}]", p->dwLeaderPID);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -28,13 +28,13 @@ void CClientManager::QUERY_PARTY_DELETE(CPeer* peer, TPacketPartyDelete* p)
|
|||
|
||||
if (it == pm.end())
|
||||
{
|
||||
sys_err("PARTY Delete - Non exists [%lu]", p->dwLeaderPID);
|
||||
SPDLOG_ERROR("PARTY Delete - Non exists [{}]", p->dwLeaderPID);
|
||||
return;
|
||||
}
|
||||
|
||||
pm.erase(it);
|
||||
ForwardPacket(HEADER_DG_PARTY_DELETE, p, sizeof(TPacketPartyDelete), peer->GetChannel(), peer);
|
||||
sys_log(0, "PARTY Delete [%lu]", p->dwLeaderPID);
|
||||
SPDLOG_DEBUG("PARTY Delete [{}]", p->dwLeaderPID);
|
||||
}
|
||||
|
||||
void CClientManager::QUERY_PARTY_ADD(CPeer* peer, TPacketPartyAdd* p)
|
||||
|
@ -44,7 +44,7 @@ void CClientManager::QUERY_PARTY_ADD(CPeer* peer, TPacketPartyAdd* p)
|
|||
|
||||
if (it == pm.end())
|
||||
{
|
||||
sys_err("PARTY Add - Non exists [%lu]", p->dwLeaderPID);
|
||||
SPDLOG_ERROR("PARTY Add - Non exists [{}]", p->dwLeaderPID);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -52,10 +52,10 @@ void CClientManager::QUERY_PARTY_ADD(CPeer* peer, TPacketPartyAdd* p)
|
|||
{
|
||||
it->second.insert(std::make_pair(p->dwPID, TPartyInfo()));
|
||||
ForwardPacket(HEADER_DG_PARTY_ADD, p, sizeof(TPacketPartyAdd), peer->GetChannel(), peer);
|
||||
sys_log(0, "PARTY Add [%lu] to [%lu]", p->dwPID, p->dwLeaderPID);
|
||||
SPDLOG_DEBUG("PARTY Add [{}] to [{}]", p->dwPID, p->dwLeaderPID);
|
||||
}
|
||||
else
|
||||
sys_err("PARTY Add - Already [%lu] in party [%lu]", p->dwPID, p->dwLeaderPID);
|
||||
SPDLOG_ERROR("PARTY Add - Already [{}] in party [{}]", p->dwPID, p->dwLeaderPID);
|
||||
}
|
||||
|
||||
void CClientManager::QUERY_PARTY_REMOVE(CPeer* peer, TPacketPartyRemove* p)
|
||||
|
@ -65,7 +65,7 @@ void CClientManager::QUERY_PARTY_REMOVE(CPeer* peer, TPacketPartyRemove* p)
|
|||
|
||||
if (it == pm.end())
|
||||
{
|
||||
sys_err("PARTY Remove - Non exists [%lu] cannot remove [%lu]",p->dwLeaderPID, p->dwPID);
|
||||
SPDLOG_ERROR("PARTY Remove - Non exists [{}] cannot remove [{}]",p->dwLeaderPID, p->dwPID);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -75,10 +75,10 @@ void CClientManager::QUERY_PARTY_REMOVE(CPeer* peer, TPacketPartyRemove* p)
|
|||
{
|
||||
it->second.erase(pit);
|
||||
ForwardPacket(HEADER_DG_PARTY_REMOVE, p, sizeof(TPacketPartyRemove), peer->GetChannel(), peer);
|
||||
sys_log(0, "PARTY Remove [%lu] to [%lu]", p->dwPID, p->dwLeaderPID);
|
||||
SPDLOG_DEBUG("PARTY Remove [{}] to [{}]", p->dwPID, p->dwLeaderPID);
|
||||
}
|
||||
else
|
||||
sys_err("PARTY Remove - Cannot find [%lu] in party [%lu]", p->dwPID, p->dwLeaderPID);
|
||||
SPDLOG_ERROR("PARTY Remove - Cannot find [{}] in party [{}]", p->dwPID, p->dwLeaderPID);
|
||||
}
|
||||
|
||||
void CClientManager::QUERY_PARTY_STATE_CHANGE(CPeer* peer, TPacketPartyStateChange* p)
|
||||
|
@ -88,7 +88,7 @@ void CClientManager::QUERY_PARTY_STATE_CHANGE(CPeer* peer, TPacketPartyStateChan
|
|||
|
||||
if (it == pm.end())
|
||||
{
|
||||
sys_err("PARTY StateChange - Non exists [%lu] cannot state change [%lu]",p->dwLeaderPID, p->dwPID);
|
||||
SPDLOG_ERROR("PARTY StateChange - Non exists [{}] cannot state change [{}]",p->dwLeaderPID, p->dwPID);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -96,7 +96,7 @@ void CClientManager::QUERY_PARTY_STATE_CHANGE(CPeer* peer, TPacketPartyStateChan
|
|||
|
||||
if (pit == it->second.end())
|
||||
{
|
||||
sys_err("PARTY StateChange - Cannot find [%lu] in party [%lu]", p->dwPID, p->dwLeaderPID);
|
||||
SPDLOG_ERROR("PARTY StateChange - Cannot find [{}] in party [{}]", p->dwPID, p->dwLeaderPID);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -106,7 +106,7 @@ void CClientManager::QUERY_PARTY_STATE_CHANGE(CPeer* peer, TPacketPartyStateChan
|
|||
pit->second.bRole = 0;
|
||||
|
||||
ForwardPacket(HEADER_DG_PARTY_STATE_CHANGE, p, sizeof(TPacketPartyStateChange), peer->GetChannel(), peer);
|
||||
sys_log(0, "PARTY StateChange [%lu] at [%lu] from %d %d",p->dwPID, p->dwLeaderPID, p->bRole, p->bFlag);
|
||||
SPDLOG_DEBUG("PARTY StateChange [{}] at [{}] from {} {}",p->dwPID, p->dwLeaderPID, p->bRole, p->bFlag);
|
||||
}
|
||||
|
||||
void CClientManager::QUERY_PARTY_SET_MEMBER_LEVEL(CPeer* peer, TPacketPartySetMemberLevel* p)
|
||||
|
@ -116,7 +116,7 @@ void CClientManager::QUERY_PARTY_SET_MEMBER_LEVEL(CPeer* peer, TPacketPartySetMe
|
|||
|
||||
if (it == pm.end())
|
||||
{
|
||||
sys_err("PARTY SetMemberLevel - Non exists [%lu] cannot level change [%lu]",p->dwLeaderPID, p->dwPID);
|
||||
SPDLOG_ERROR("PARTY SetMemberLevel - Non exists [{}] cannot level change [{}]",p->dwLeaderPID, p->dwPID);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -124,12 +124,12 @@ void CClientManager::QUERY_PARTY_SET_MEMBER_LEVEL(CPeer* peer, TPacketPartySetMe
|
|||
|
||||
if (pit == it->second.end())
|
||||
{
|
||||
sys_err("PARTY SetMemberLevel - Cannot find [%lu] in party [%lu]", p->dwPID, p->dwLeaderPID);
|
||||
SPDLOG_ERROR("PARTY SetMemberLevel - Cannot find [{}] in party [{}]", p->dwPID, p->dwLeaderPID);
|
||||
return;
|
||||
}
|
||||
|
||||
pit->second.bLevel = p->bLevel;
|
||||
|
||||
ForwardPacket(HEADER_DG_PARTY_SET_MEMBER_LEVEL, p, sizeof(TPacketPartySetMemberLevel), peer->GetChannel());
|
||||
sys_log(0, "PARTY SetMemberLevel pid [%lu] level %d",p->dwPID, p->bLevel);
|
||||
SPDLOG_DEBUG("PARTY SetMemberLevel pid [{}] level {}",p->dwPID, p->bLevel);
|
||||
}
|
||||
|
|
|
@ -13,7 +13,6 @@ extern bool g_bHotBackup;
|
|||
|
||||
extern std::string g_stLocale;
|
||||
extern int g_test_server;
|
||||
extern int g_log;
|
||||
|
||||
//
|
||||
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
|
@ -236,7 +235,7 @@ void CClientManager::QUERY_PLAYER_LOAD(CPeer * peer, DWORD dwHandle, TPlayerLoad
|
|||
|
||||
if (!pkLD || pkLD->IsPlay())
|
||||
{
|
||||
sys_log(0, "PLAYER_LOAD_ERROR: LoginData %p IsPlay %d", pkLD, pkLD ? pkLD->IsPlay() : 0);
|
||||
SPDLOG_DEBUG("PLAYER_LOAD_ERROR: LoginData {} IsPlay {}", (void*) pkLD, pkLD ? pkLD->IsPlay() : 0);
|
||||
peer->EncodeHeader(HEADER_DG_PLAYER_LOAD_FAILED, dwHandle, 0);
|
||||
return;
|
||||
}
|
||||
|
@ -265,7 +264,7 @@ void CClientManager::QUERY_PLAYER_LOAD(CPeer * peer, DWORD dwHandle, TPlayerLoad
|
|||
|
||||
TItemCacheSet * pSet = GetItemCacheSet(pTab->id);
|
||||
|
||||
sys_log(0, "[PLAYER_LOAD] ID %s pid %d gold %d ", pTab->name, pTab->id, pTab->gold);
|
||||
SPDLOG_DEBUG("[PLAYER_LOAD] ID {} pid {} gold {} ", pTab->name, pTab->id, pTab->gold);
|
||||
|
||||
//--------------------------------------------
|
||||
// 아이템 & AFFECT & QUEST 로딩 :
|
||||
|
@ -293,8 +292,7 @@ void CClientManager::QUERY_PLAYER_LOAD(CPeer * peer, DWORD dwHandle, TPlayerLoad
|
|||
memcpy(&s_items[dwCount++], p, sizeof(TPlayerItem));
|
||||
}
|
||||
|
||||
if (g_test_server)
|
||||
sys_log(0, "ITEM_CACHE: HIT! %s count: %u", pTab->name, dwCount);
|
||||
SPDLOG_TRACE("ITEM_CACHE: HIT! {} count: {}", pTab->name, dwCount);
|
||||
|
||||
peer->EncodeHeader(HEADER_DG_ITEM_LOAD, dwHandle, sizeof(DWORD) + sizeof(TPlayerItem) * dwCount);
|
||||
peer->EncodeDWORD(dwCount);
|
||||
|
@ -354,7 +352,7 @@ void CClientManager::QUERY_PLAYER_LOAD(CPeer * peer, DWORD dwHandle, TPlayerLoad
|
|||
//----------------------------------
|
||||
else
|
||||
{
|
||||
sys_log(0, "[PLAYER_LOAD] Load from PlayerDB pid[%d]", packet->player_id);
|
||||
SPDLOG_DEBUG("[PLAYER_LOAD] Load from PlayerDB pid[{}]", packet->player_id);
|
||||
|
||||
char queryStr[QUERY_MAX_LEN];
|
||||
|
||||
|
@ -554,26 +552,26 @@ void CClientManager::RESULT_COMPOSITE_PLAYER(CPeer * peer, SQLMsg * pMsg, DWORD
|
|||
MYSQL_RES * pSQLResult = pMsg->Get()->pSQLResult;
|
||||
if (!pSQLResult)
|
||||
{
|
||||
sys_err("null MYSQL_RES QID %u", dwQID);
|
||||
SPDLOG_ERROR("null MYSQL_RES QID {}", dwQID);
|
||||
return;
|
||||
}
|
||||
|
||||
switch (dwQID)
|
||||
{
|
||||
case QID_PLAYER:
|
||||
sys_log(0, "QID_PLAYER %u %u", info->dwHandle, info->player_id);
|
||||
SPDLOG_DEBUG("QID_PLAYER {} {}", info->dwHandle, info->player_id);
|
||||
RESULT_PLAYER_LOAD(peer, pSQLResult, info.get());
|
||||
|
||||
break;
|
||||
|
||||
case QID_ITEM:
|
||||
sys_log(0, "QID_ITEM %u", info->dwHandle);
|
||||
SPDLOG_DEBUG("QID_ITEM {}", info->dwHandle);
|
||||
RESULT_ITEM_LOAD(peer, pSQLResult, info->dwHandle, info->player_id);
|
||||
break;
|
||||
|
||||
case QID_QUEST:
|
||||
{
|
||||
sys_log(0, "QID_QUEST %u", info->dwHandle);
|
||||
SPDLOG_DEBUG("QID_QUEST {}", info->dwHandle);
|
||||
RESULT_QUEST_LOAD(peer, pSQLResult, info->dwHandle, info->player_id);
|
||||
//aid얻기
|
||||
ClientHandleInfo* temp1 = info.get();
|
||||
|
@ -586,42 +584,42 @@ void CClientManager::RESULT_COMPOSITE_PLAYER(CPeer * peer, SQLMsg * pMsg, DWORD
|
|||
break;
|
||||
if( pLoginData1 == NULL )
|
||||
break;
|
||||
sys_log(0,"info of pLoginData1 before call ItemAwardfunction %d",pLoginData1);
|
||||
SPDLOG_DEBUG("info of pLoginData1 before call ItemAwardfunction {}", (void*) pLoginData1);
|
||||
ItemAward(peer,pLoginData1->GetAccountRef().login);
|
||||
}
|
||||
break;
|
||||
|
||||
case QID_AFFECT:
|
||||
sys_log(0, "QID_AFFECT %u", info->dwHandle);
|
||||
SPDLOG_DEBUG("QID_AFFECT {}", info->dwHandle);
|
||||
RESULT_AFFECT_LOAD(peer, pSQLResult, info->dwHandle);
|
||||
break;
|
||||
/*
|
||||
case QID_PLAYER_ITEM_QUEST_AFFECT:
|
||||
sys_log(0, "QID_PLAYER_ITEM_QUEST_AFFECT %u", info->dwHandle);
|
||||
SPDLOG_DEBUG("QID_PLAYER_ITEM_QUEST_AFFECT {}", info->dwHandle);
|
||||
RESULT_PLAYER_LOAD(peer, pSQLResult, info->dwHandle);
|
||||
|
||||
if (!pMsg->Next())
|
||||
{
|
||||
sys_err("RESULT_COMPOSITE_PLAYER: QID_PLAYER_ITEM_QUEST_AFFECT: ITEM FAILED");
|
||||
SPDLOG_ERROR("RESULT_COMPOSITE_PLAYER: QID_PLAYER_ITEM_QUEST_AFFECT: ITEM FAILED");
|
||||
return;
|
||||
}
|
||||
|
||||
case QID_ITEM_QUEST_AFFECT:
|
||||
sys_log(0, "QID_ITEM_QUEST_AFFECT %u", info->dwHandle);
|
||||
SPDLOG_DEBUG("QID_ITEM_QUEST_AFFECT {}", info->dwHandle);
|
||||
RESULT_ITEM_LOAD(peer, pSQLResult, info->dwHandle, info->player_id);
|
||||
|
||||
if (!pMsg->Next())
|
||||
{
|
||||
sys_err("RESULT_COMPOSITE_PLAYER: QID_PLAYER_ITEM_QUEST_AFFECT: QUEST FAILED");
|
||||
SPDLOG_ERROR("RESULT_COMPOSITE_PLAYER: QID_PLAYER_ITEM_QUEST_AFFECT: QUEST FAILED");
|
||||
return;
|
||||
}
|
||||
|
||||
case QID_QUEST_AFFECT:
|
||||
sys_log(0, "QID_QUEST_AFFECT %u", info->dwHandle);
|
||||
SPDLOG_DEBUG("QID_QUEST_AFFECT {}", info->dwHandle);
|
||||
RESULT_QUEST_LOAD(peer, pSQLResult, info->dwHandle);
|
||||
|
||||
if (!pMsg->Next())
|
||||
sys_err("RESULT_COMPOSITE_PLAYER: QID_PLAYER_ITEM_QUEST_AFFECT: AFFECT FAILED");
|
||||
SPDLOG_ERROR("RESULT_COMPOSITE_PLAYER: QID_PLAYER_ITEM_QUEST_AFFECT: AFFECT FAILED");
|
||||
else
|
||||
RESULT_AFFECT_LOAD(peer, pSQLResult, info->dwHandle);
|
||||
|
||||
|
@ -645,7 +643,7 @@ void CClientManager::RESULT_PLAYER_LOAD(CPeer * peer, MYSQL_RES * pRes, ClientHa
|
|||
|
||||
if (!pkLD || pkLD->IsPlay())
|
||||
{
|
||||
sys_log(0, "PLAYER_LOAD_ERROR: LoginData %p IsPlay %d", pkLD, pkLD ? pkLD->IsPlay() : 0);
|
||||
SPDLOG_DEBUG("PLAYER_LOAD_ERROR: LoginData {} IsPlay {}", (void*) pkLD, pkLD ? pkLD->IsPlay() : 0);
|
||||
peer->EncodeHeader(HEADER_DG_PLAYER_LOAD_FAILED, pkInfo->dwHandle, 0);
|
||||
return;
|
||||
}
|
||||
|
@ -683,7 +681,7 @@ void CClientManager::RESULT_ITEM_LOAD(CPeer * peer, MYSQL_RES * pRes, DWORD dwHa
|
|||
CreateItemCacheSet(dwPID);
|
||||
|
||||
// ITEM_LOAD_LOG_ATTACH_PID
|
||||
sys_log(0, "ITEM_LOAD: count %u pid %u", dwCount, dwPID);
|
||||
SPDLOG_DEBUG("ITEM_LOAD: count {} pid {}", dwCount, dwPID);
|
||||
// END_OF_ITEM_LOAD_LOG_ATTACH_PID
|
||||
|
||||
if (dwCount)
|
||||
|
@ -725,7 +723,7 @@ void CClientManager::RESULT_AFFECT_LOAD(CPeer * peer, MYSQL_RES * pRes, DWORD dw
|
|||
str_to_number(r.lSPCost, row[6]);
|
||||
}
|
||||
|
||||
sys_log(0, "AFFECT_LOAD: count %d PID %u", s_elements.size(), dwPID);
|
||||
SPDLOG_DEBUG("AFFECT_LOAD: count {} PID {}", s_elements.size(), dwPID);
|
||||
|
||||
DWORD dwCount = s_elements.size();
|
||||
|
||||
|
@ -764,7 +762,7 @@ void CClientManager::RESULT_QUEST_LOAD(CPeer * peer, MYSQL_RES * pRes, DWORD dwH
|
|||
str_to_number(r.lValue, row[3]);
|
||||
}
|
||||
|
||||
sys_log(0, "QUEST_LOAD: count %d PID %u", s_table.size(), s_table[0].dwPID);
|
||||
SPDLOG_DEBUG("QUEST_LOAD: count {} PID {}", s_table.size(), s_table[0].dwPID);
|
||||
|
||||
DWORD dwCount = s_table.size();
|
||||
|
||||
|
@ -778,8 +776,7 @@ void CClientManager::RESULT_QUEST_LOAD(CPeer * peer, MYSQL_RES * pRes, DWORD dwH
|
|||
*/
|
||||
void CClientManager::QUERY_PLAYER_SAVE(CPeer * peer, DWORD dwHandle, TPlayerTable * pkTab)
|
||||
{
|
||||
if (g_test_server)
|
||||
sys_log(0, "PLAYER_SAVE: %s", pkTab->name);
|
||||
SPDLOG_TRACE("PLAYER_SAVE: {}", pkTab->name);
|
||||
|
||||
PutPlayerCache(pkTab);
|
||||
}
|
||||
|
@ -829,7 +826,7 @@ void CClientManager::__QUERY_PLAYER_CREATE(CPeer *peer, DWORD dwHandle, TPlayerC
|
|||
if (row[0] && dwPID > 0)
|
||||
{
|
||||
peer->EncodeHeader(HEADER_DG_PLAYER_CREATE_ALREADY, dwHandle, 0);
|
||||
sys_log(0, "ALREADY EXIST AccountChrIdx %d ID %d", packet->account_index, dwPID);
|
||||
SPDLOG_DEBUG("ALREADY EXIST AccountChrIdx {} ID {}", packet->account_index, dwPID);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -861,7 +858,7 @@ void CClientManager::__QUERY_PLAYER_CREATE(CPeer *peer, DWORD dwHandle, TPlayerC
|
|||
|
||||
if (*row[0] != '0')
|
||||
{
|
||||
sys_log(0, "ALREADY EXIST name %s, row[0] %s query %s", packet->player_table.name, row[0], queryStr);
|
||||
SPDLOG_DEBUG("ALREADY EXIST name {}, row[0] {} query {}", packet->player_table.name, row[0], queryStr);
|
||||
peer->EncodeHeader(HEADER_DG_PLAYER_CREATE_ALREADY, dwHandle, 0);
|
||||
return;
|
||||
}
|
||||
|
@ -886,7 +883,7 @@ void CClientManager::__QUERY_PLAYER_CREATE(CPeer *peer, DWORD dwHandle, TPlayerC
|
|||
packet->player_table.job, packet->player_table.voice, packet->player_table.dir, packet->player_table.x, packet->player_table.y, packet->player_table.z,
|
||||
packet->player_table.hp, packet->player_table.sp, packet->player_table.sRandomHP, packet->player_table.sRandomSP, packet->player_table.stat_point, packet->player_table.stamina, packet->player_table.part_base, packet->player_table.part_base, packet->player_table.gold);
|
||||
|
||||
sys_log(0, "PlayerCreate accountid %d name %s level %d gold %d, st %d ht %d job %d",
|
||||
SPDLOG_DEBUG("PlayerCreate accountid {} name {} level {} gold {}, st {} ht {} job {}",
|
||||
packet->account_id,
|
||||
packet->player_table.name,
|
||||
packet->player_table.level,
|
||||
|
@ -899,20 +896,18 @@ void CClientManager::__QUERY_PLAYER_CREATE(CPeer *peer, DWORD dwHandle, TPlayerC
|
|||
|
||||
CDBManager::instance().EscapeString(text, packet->player_table.skills, sizeof(packet->player_table.skills));
|
||||
queryLen += snprintf(queryStr + queryLen, sizeof(queryStr) - queryLen, "'%s', ", text);
|
||||
if (g_test_server)
|
||||
sys_log(0, "Create_Player queryLen[%d] TEXT[%s]", queryLen, text);
|
||||
SPDLOG_TRACE("Create_Player queryLen[{}] TEXT[{}]", queryLen, text);
|
||||
|
||||
CDBManager::instance().EscapeString(text, packet->player_table.quickslot, sizeof(packet->player_table.quickslot));
|
||||
queryLen += snprintf(queryStr + queryLen, sizeof(queryStr) - queryLen, "'%s')", text);
|
||||
|
||||
std::unique_ptr<SQLMsg> pMsg2(CDBManager::instance().DirectQuery(queryStr));
|
||||
if (g_test_server)
|
||||
sys_log(0, "Create_Player queryLen[%d] TEXT[%s]", queryLen, text);
|
||||
SPDLOG_TRACE("Create_Player queryLen[{}] TEXT[{}]", queryLen, text);
|
||||
|
||||
if (pMsg2->Get()->uiAffectedRows <= 0)
|
||||
{
|
||||
peer->EncodeHeader(HEADER_DG_PLAYER_CREATE_ALREADY, dwHandle, 0);
|
||||
sys_log(0, "ALREADY EXIST3 query: %s AffectedRows %lu", queryStr, pMsg2->Get()->uiAffectedRows);
|
||||
SPDLOG_DEBUG("ALREADY EXIST3 query: {} AffectedRows {}", queryStr, pMsg2->Get()->uiAffectedRows);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -924,7 +919,7 @@ void CClientManager::__QUERY_PLAYER_CREATE(CPeer *peer, DWORD dwHandle, TPlayerC
|
|||
|
||||
if (pMsg3->Get()->uiAffectedRows <= 0)
|
||||
{
|
||||
sys_err("QUERY_ERROR: %s", queryStr);
|
||||
SPDLOG_ERROR("QUERY_ERROR: {}", queryStr);
|
||||
|
||||
snprintf(queryStr, sizeof(queryStr), "DELETE FROM player%s WHERE id=%d", GetTablePostfix(), player_id);
|
||||
CDBManager::instance().DirectQuery(queryStr);
|
||||
|
@ -954,7 +949,7 @@ void CClientManager::__QUERY_PLAYER_CREATE(CPeer *peer, DWORD dwHandle, TPlayerC
|
|||
peer->EncodeHeader(HEADER_DG_PLAYER_CREATE_SUCCESS, dwHandle, sizeof(TPacketDGCreateSuccess));
|
||||
peer->Encode(&pack, sizeof(TPacketDGCreateSuccess));
|
||||
|
||||
sys_log(0, "7 name %s job %d", pack.player.szName, pack.player.byJob);
|
||||
SPDLOG_DEBUG("7 name {} job {}", pack.player.szName, pack.player.byJob);
|
||||
|
||||
s_createTimeByAccountID[packet->account_id] = time(0);
|
||||
}
|
||||
|
@ -985,7 +980,7 @@ void CClientManager::__QUERY_PLAYER_DELETE(CPeer* peer, DWORD dwHandle, TPlayerD
|
|||
{
|
||||
if (strlen(r.social_id) < 7 || strncmp(packet->private_code, r.social_id + strlen(r.social_id) - 7, 7))
|
||||
{
|
||||
sys_log(0, "PLAYER_DELETE FAILED len(%d)", strlen(r.social_id));
|
||||
SPDLOG_DEBUG("PLAYER_DELETE FAILED len({})", strlen(r.social_id));
|
||||
peer->EncodeHeader(HEADER_DG_PLAYER_DELETE_FAILED, dwHandle, 1);
|
||||
peer->EncodeBYTE(packet->account_index);
|
||||
return;
|
||||
|
@ -998,7 +993,7 @@ void CClientManager::__QUERY_PLAYER_DELETE(CPeer* peer, DWORD dwHandle, TPlayerD
|
|||
|
||||
if (pTab->level >= m_iPlayerDeleteLevelLimit)
|
||||
{
|
||||
sys_log(0, "PLAYER_DELETE FAILED LEVEL %u >= DELETE LIMIT %d", pTab->level, m_iPlayerDeleteLevelLimit);
|
||||
SPDLOG_DEBUG("PLAYER_DELETE FAILED LEVEL {} >= DELETE LIMIT {}", pTab->level, m_iPlayerDeleteLevelLimit);
|
||||
peer->EncodeHeader(HEADER_DG_PLAYER_DELETE_FAILED, dwHandle, 1);
|
||||
peer->EncodeBYTE(packet->account_index);
|
||||
return;
|
||||
|
@ -1006,7 +1001,7 @@ void CClientManager::__QUERY_PLAYER_DELETE(CPeer* peer, DWORD dwHandle, TPlayerD
|
|||
|
||||
if (pTab->level < m_iPlayerDeleteLevelLimitLower)
|
||||
{
|
||||
sys_log(0, "PLAYER_DELETE FAILED LEVEL %u < DELETE LIMIT %d", pTab->level, m_iPlayerDeleteLevelLimitLower);
|
||||
SPDLOG_DEBUG("PLAYER_DELETE FAILED LEVEL {} < DELETE LIMIT {}", pTab->level, m_iPlayerDeleteLevelLimitLower);
|
||||
peer->EncodeHeader(HEADER_DG_PLAYER_DELETE_FAILED, dwHandle, 1);
|
||||
peer->EncodeBYTE(packet->account_index);
|
||||
return;
|
||||
|
@ -1022,7 +1017,7 @@ void CClientManager::__QUERY_PLAYER_DELETE(CPeer* peer, DWORD dwHandle, TPlayerD
|
|||
ClientHandleInfo * pi = new ClientHandleInfo(dwHandle, packet->player_id);
|
||||
pi->account_index = packet->account_index;
|
||||
|
||||
sys_log(0, "PLAYER_DELETE TRY: %s %d pid%d", packet->login, packet->player_id, packet->account_index + 1);
|
||||
SPDLOG_DEBUG("PLAYER_DELETE TRY: {} {} pid{}", packet->login, packet->player_id, packet->account_index + 1);
|
||||
CDBManager::instance().ReturnQuery(szQuery, QID_PLAYER_DELETE, peer->GetHandle(), pi);
|
||||
}
|
||||
|
||||
|
@ -1049,7 +1044,7 @@ void CClientManager::__RESULT_PLAYER_DELETE(CPeer *peer, SQLMsg* msg)
|
|||
|
||||
if (deletedLevelLimit >= m_iPlayerDeleteLevelLimit && !IsChinaEventServer())
|
||||
{
|
||||
sys_log(0, "PLAYER_DELETE FAILED LEVEL %u >= DELETE LIMIT %d", deletedLevelLimit, m_iPlayerDeleteLevelLimit);
|
||||
SPDLOG_DEBUG("PLAYER_DELETE FAILED LEVEL {} >= DELETE LIMIT {}", deletedLevelLimit, m_iPlayerDeleteLevelLimit);
|
||||
peer->EncodeHeader(HEADER_DG_PLAYER_DELETE_FAILED, pi->dwHandle, 1);
|
||||
peer->EncodeBYTE(pi->account_index);
|
||||
return;
|
||||
|
@ -1057,7 +1052,7 @@ void CClientManager::__RESULT_PLAYER_DELETE(CPeer *peer, SQLMsg* msg)
|
|||
|
||||
if (deletedLevelLimit < m_iPlayerDeleteLevelLimitLower)
|
||||
{
|
||||
sys_log(0, "PLAYER_DELETE FAILED LEVEL %u < DELETE LIMIT %d", deletedLevelLimit, m_iPlayerDeleteLevelLimitLower);
|
||||
SPDLOG_DEBUG("PLAYER_DELETE FAILED LEVEL {} < DELETE LIMIT {}", deletedLevelLimit, m_iPlayerDeleteLevelLimitLower);
|
||||
peer->EncodeHeader(HEADER_DG_PLAYER_DELETE_FAILED, pi->dwHandle, 1);
|
||||
peer->EncodeBYTE(pi->account_index);
|
||||
return;
|
||||
|
@ -1071,7 +1066,7 @@ void CClientManager::__RESULT_PLAYER_DELETE(CPeer *peer, SQLMsg* msg)
|
|||
|
||||
if (pIns->Get()->uiAffectedRows == 0 || pIns->Get()->uiAffectedRows == (uint32_t)-1)
|
||||
{
|
||||
sys_log(0, "PLAYER_DELETE FAILED %u CANNOT INSERT TO player%s_deleted", dwPID, GetTablePostfix());
|
||||
SPDLOG_DEBUG("PLAYER_DELETE FAILED {} CANNOT INSERT TO player{}_deleted", dwPID, GetTablePostfix());
|
||||
|
||||
peer->EncodeHeader(HEADER_DG_PLAYER_DELETE_FAILED, pi->dwHandle, 1);
|
||||
peer->EncodeBYTE(pi->account_index);
|
||||
|
@ -1079,7 +1074,7 @@ void CClientManager::__RESULT_PLAYER_DELETE(CPeer *peer, SQLMsg* msg)
|
|||
}
|
||||
|
||||
// 삭제 성공
|
||||
sys_log(0, "PLAYER_DELETE SUCCESS %u", dwPID);
|
||||
SPDLOG_DEBUG("PLAYER_DELETE SUCCESS {}", dwPID);
|
||||
|
||||
char account_index_string[16];
|
||||
|
||||
|
@ -1123,7 +1118,7 @@ void CClientManager::__RESULT_PLAYER_DELETE(CPeer *peer, SQLMsg* msg)
|
|||
|
||||
if (pMsg->Get()->uiAffectedRows == 0 || pMsg->Get()->uiAffectedRows == (uint32_t)-1)
|
||||
{
|
||||
sys_log(0, "PLAYER_DELETE FAIL WHEN UPDATE account table");
|
||||
SPDLOG_DEBUG("PLAYER_DELETE FAIL WHEN UPDATE account table");
|
||||
peer->EncodeHeader(HEADER_DG_PLAYER_DELETE_FAILED, pi->dwHandle, 1);
|
||||
peer->EncodeBYTE(pi->account_index);
|
||||
return;
|
||||
|
@ -1158,7 +1153,7 @@ void CClientManager::__RESULT_PLAYER_DELETE(CPeer *peer, SQLMsg* msg)
|
|||
else
|
||||
{
|
||||
// 삭제 실패
|
||||
sys_log(0, "PLAYER_DELETE FAIL NO ROW");
|
||||
SPDLOG_DEBUG("PLAYER_DELETE FAIL NO ROW");
|
||||
peer->EncodeHeader(HEADER_DG_PLAYER_DELETE_FAILED, pi->dwHandle, 1);
|
||||
peer->EncodeBYTE(pi->account_index);
|
||||
}
|
||||
|
@ -1217,7 +1212,7 @@ void CClientManager::QUERY_HIGHSCORE_REGISTER(CPeer* peer, TPacketGDHighscore *
|
|||
char szQuery[128];
|
||||
snprintf(szQuery, sizeof(szQuery), "SELECT value FROM highscore%s WHERE board='%s' AND pid = %u", GetTablePostfix(), data->szBoard, data->dwPID);
|
||||
|
||||
sys_log(0, "HEADER_GD_HIGHSCORE_REGISTER: PID %u", data->dwPID);
|
||||
SPDLOG_DEBUG("HEADER_GD_HIGHSCORE_REGISTER: PID {}", data->dwPID);
|
||||
|
||||
ClientHandleInfo * pi = new ClientHandleInfo(0);
|
||||
strlcpy(pi->login, data->szBoard, sizeof(pi->login));
|
||||
|
@ -1289,8 +1284,7 @@ void CClientManager::InsertLogoutPlayer(DWORD pid)
|
|||
if (it != m_map_logout.end())
|
||||
{
|
||||
// 존재할경우 시간만 갱신
|
||||
if (g_log)
|
||||
sys_log(0, "LOGOUT: Update player time pid(%d)", pid);
|
||||
SPDLOG_TRACE("LOGOUT: Update player time pid({})", pid);
|
||||
|
||||
it->second->time = time(0);
|
||||
return;
|
||||
|
@ -1301,8 +1295,7 @@ void CClientManager::InsertLogoutPlayer(DWORD pid)
|
|||
pLogout->time = time(0);
|
||||
m_map_logout.insert(std::make_pair(pid, pLogout));
|
||||
|
||||
if (g_log)
|
||||
sys_log(0, "LOGOUT: Insert player pid(%d)", pid);
|
||||
SPDLOG_TRACE("LOGOUT: Insert player pid({})", pid);
|
||||
}
|
||||
|
||||
void CClientManager::DeleteLogoutPlayer(DWORD pid)
|
||||
|
|
|
@ -171,7 +171,7 @@ bool CConfig::GetParam(const char*key, int index, DWORD *Param)
|
|||
|
||||
str_to_number(*Param, szParam[index]);
|
||||
|
||||
sys_log(0, "GetParam %d", *Param);
|
||||
SPDLOG_DEBUG("GetParam {}", *Param);
|
||||
return true;
|
||||
}
|
||||
const char * CConfig::Get(const char* key)
|
||||
|
|
|
@ -98,7 +98,7 @@ int CDBManager::Connect(int iSlot, const char * db_address, const int db_port, c
|
|||
if (iSlot < 0 || iSlot >= SQL_MAX_NUM)
|
||||
return false;
|
||||
|
||||
sys_log(0, "CREATING DIRECT_SQL");
|
||||
SPDLOG_INFO("CREATING DIRECT_SQL");
|
||||
m_directSQL[iSlot] = new CAsyncSQL2;
|
||||
if (!m_directSQL[iSlot]->Setup(db_address, user, pwd, db_name, g_stLocale.c_str(), true, db_port))
|
||||
{
|
||||
|
@ -107,7 +107,7 @@ int CDBManager::Connect(int iSlot, const char * db_address, const int db_port, c
|
|||
}
|
||||
|
||||
|
||||
sys_log(0, "CREATING MAIN_SQL");
|
||||
SPDLOG_INFO("CREATING MAIN_SQL");
|
||||
m_mainSQL[iSlot] = new CAsyncSQL2;
|
||||
if (!m_mainSQL[iSlot]->Setup(db_address, user, pwd, db_name, g_stLocale.c_str(), false, db_port))
|
||||
{
|
||||
|
@ -115,7 +115,7 @@ int CDBManager::Connect(int iSlot, const char * db_address, const int db_port, c
|
|||
return false;
|
||||
}
|
||||
|
||||
sys_log(0, "CREATING ASYNC_SQL");
|
||||
SPDLOG_INFO("CREATING ASYNC_SQL");
|
||||
m_asyncSQL[iSlot] = new CAsyncSQL2;
|
||||
if (!m_asyncSQL[iSlot]->Setup(db_address, user, pwd, db_name, g_stLocale.c_str(), false, db_port))
|
||||
{
|
||||
|
@ -137,7 +137,7 @@ extern int g_query_count[2];
|
|||
void CDBManager::ReturnQuery(const char * c_pszQuery, int iType, IDENT dwIdent, void * udata, int iSlot)
|
||||
{
|
||||
assert(iSlot < SQL_MAX_NUM);
|
||||
//sys_log(0, "ReturnQuery %s", c_pszQuery);
|
||||
//SPDLOG_DEBUG("ReturnQuery {}", c_pszQuery);
|
||||
CQueryInfo * p = new CQueryInfo;
|
||||
|
||||
p->iType = iType;
|
||||
|
@ -166,14 +166,14 @@ unsigned int CDBManager::EscapeString(void *to, const void *from, unsigned int l
|
|||
void CDBManager::SetLocale(const char * szLocale)
|
||||
{
|
||||
const std::string stLocale(szLocale);
|
||||
sys_log(0, "SetLocale start" );
|
||||
SPDLOG_DEBUG("SetLocale start");
|
||||
for (int n = 0; n < SQL_MAX_NUM; ++n)
|
||||
{
|
||||
m_mainSQL[n]->SetLocale(stLocale);
|
||||
m_directSQL[n]->SetLocale(stLocale);
|
||||
m_asyncSQL[n]->SetLocale(stLocale);
|
||||
}
|
||||
sys_log(0, "End setlocale %s", szLocale);
|
||||
SPDLOG_DEBUG("End setlocale {}", szLocale);
|
||||
}
|
||||
|
||||
void CDBManager::QueryLocaleSet()
|
||||
|
|
|
@ -145,8 +145,8 @@ void CGuildManager::ParseResult(SQLResult * pRes)
|
|||
str_to_number(r_info.gold, row[6]);
|
||||
str_to_number(r_info.level, row[7]);
|
||||
|
||||
sys_log(0,
|
||||
"GuildWar: %-24s ladder %-5d win %-3d draw %-3d loss %-3d",
|
||||
SPDLOG_DEBUG(
|
||||
"GuildWar: {:24} ladder {:<5} win {:<3} draw {:<3} loss {:<3}",
|
||||
r_info.szName,
|
||||
r_info.ladder_point,
|
||||
r_info.win,
|
||||
|
@ -170,17 +170,17 @@ void CGuildManager::Initialize()
|
|||
*str = '\0';
|
||||
|
||||
if (!polyPower.Analyze(str))
|
||||
sys_err("cannot set power poly: %s", str);
|
||||
SPDLOG_ERROR("cannot set power poly: {}", str);
|
||||
else
|
||||
sys_log(0, "POWER_POLY: %s", str);
|
||||
SPDLOG_DEBUG("POWER_POLY: {}", str);
|
||||
|
||||
if (!CConfig::instance().GetValue("POLY_HANDICAP", str, sizeof(str)))
|
||||
*str = '\0';
|
||||
|
||||
if (!polyHandicap.Analyze(str))
|
||||
sys_err("cannot set handicap poly: %s", str);
|
||||
SPDLOG_ERROR("cannot set handicap poly: {}", str);
|
||||
else
|
||||
sys_log(0, "HANDICAP_POLY: %s", str);
|
||||
SPDLOG_DEBUG("HANDICAP_POLY: {}", str);
|
||||
|
||||
QueryRanking();
|
||||
}
|
||||
|
@ -234,7 +234,7 @@ void CGuildManager::ResultRanking(MYSQL_RES * pRes)
|
|||
if (iLadderPoint != iLastLadderPoint)
|
||||
++iRank;
|
||||
|
||||
sys_log(0, "GUILD_RANK: %-24s %2d %d", row[1], iRank, iLadderPoint);
|
||||
SPDLOG_DEBUG("GUILD_RANK: {:24} {:2} {}", row[1], iRank, iLadderPoint);
|
||||
|
||||
map_kLadderPointRankingByGID.insert(std::make_pair(dwGID, iRank));
|
||||
}
|
||||
|
@ -250,7 +250,7 @@ void CGuildManager::Update()
|
|||
{
|
||||
// UNKNOWN_GUILD_MANAGE_UPDATE_LOG
|
||||
/*
|
||||
sys_log(0, "GuildManager::Update size %d now %d top %d, %s(%u) vs %s(%u)",
|
||||
SPDLOG_DEBUG("GuildManager::Update size {} now {} top {}, {}({}) vs {}({})",
|
||||
m_WarMap.size(),
|
||||
now,
|
||||
m_pqOnWar.top().first,
|
||||
|
@ -307,7 +307,7 @@ void CGuildManager::Update()
|
|||
p.dwGuildTo = ws.GID[1];
|
||||
|
||||
CClientManager::instance().ForwardPacket(HEADER_DG_GUILD_WAR, &p, sizeof(p));
|
||||
sys_log(0, "GuildWar: GUILD sending start of wait start war %d %d", ws.GID[0], ws.GID[1]);
|
||||
SPDLOG_DEBUG("GuildWar: GUILD sending start of wait start war {} {}", ws.GID[0], ws.GID[1]);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -402,7 +402,7 @@ bool CGuildManager::IsHalfWinLadderPoint(DWORD dwGuildWinner, DWORD dwGuildLoser
|
|||
|
||||
void CGuildManager::ProcessDraw(DWORD dwGuildID1, DWORD dwGuildID2)
|
||||
{
|
||||
sys_log(0, "GuildWar: \tThe war between %d and %d is ended in draw", dwGuildID1, dwGuildID2);
|
||||
SPDLOG_DEBUG("GuildWar: \tThe war between {} and {} is ended in draw", dwGuildID1, dwGuildID2);
|
||||
|
||||
GuildWarDraw(dwGuildID1);
|
||||
GuildWarDraw(dwGuildID2);
|
||||
|
@ -416,7 +416,7 @@ void CGuildManager::ProcessWinLose(DWORD dwGuildWinner, DWORD dwGuildLoser)
|
|||
{
|
||||
GuildWarWin(dwGuildWinner);
|
||||
GuildWarLose(dwGuildLoser);
|
||||
sys_log(0, "GuildWar: \tWinner : %d Loser : %d", dwGuildWinner, dwGuildLoser);
|
||||
SPDLOG_DEBUG("GuildWar: \tWinner : {} Loser : {}", dwGuildWinner, dwGuildLoser);
|
||||
|
||||
int iPoint = GetLadderPoint(dwGuildLoser);
|
||||
int gain = (int)(iPoint * 0.05);
|
||||
|
@ -425,7 +425,7 @@ void CGuildManager::ProcessWinLose(DWORD dwGuildWinner, DWORD dwGuildLoser)
|
|||
if (IsHalfWinLadderPoint(dwGuildWinner, dwGuildLoser))
|
||||
gain /= 2;
|
||||
|
||||
sys_log(0, "GuildWar: \tgain : %d loss : %d", gain, loss);
|
||||
SPDLOG_DEBUG("GuildWar: \tgain : {} loss : {}", gain, loss);
|
||||
|
||||
ChangeLadderPoint(dwGuildWinner, gain);
|
||||
ChangeLadderPoint(dwGuildLoser, -loss);
|
||||
|
@ -435,7 +435,7 @@ void CGuildManager::ProcessWinLose(DWORD dwGuildWinner, DWORD dwGuildLoser)
|
|||
|
||||
void CGuildManager::RemoveWar(DWORD GID1, DWORD GID2)
|
||||
{
|
||||
sys_log(0, "GuildWar: RemoveWar(%d, %d)", GID1, GID2);
|
||||
SPDLOG_DEBUG("GuildWar: RemoveWar({}, {})", GID1, GID2);
|
||||
|
||||
if (GID1 > GID2)
|
||||
std::swap(GID2, GID1);
|
||||
|
@ -469,13 +469,13 @@ void CGuildManager::WarEnd(DWORD GID1, DWORD GID2, bool bForceDraw)
|
|||
if (GID1 > GID2)
|
||||
std::swap(GID2, GID1);
|
||||
|
||||
sys_log(0, "GuildWar: WarEnd %d %d", GID1, GID2);
|
||||
SPDLOG_DEBUG("GuildWar: WarEnd {} {}", GID1, GID2);
|
||||
|
||||
itertype(m_WarMap[GID1]) itWarMap = m_WarMap[GID1].find(GID2);
|
||||
|
||||
if (itWarMap == m_WarMap[GID1].end())
|
||||
{
|
||||
sys_err("GuildWar: war not exist or already ended. [1]");
|
||||
SPDLOG_ERROR("GuildWar: war not exist or already ended. [1]");
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -484,7 +484,7 @@ void CGuildManager::WarEnd(DWORD GID1, DWORD GID2, bool bForceDraw)
|
|||
|
||||
if (!pData || pData->bEnd)
|
||||
{
|
||||
sys_err("GuildWar: war not exist or already ended. [2]");
|
||||
SPDLOG_ERROR("GuildWar: war not exist or already ended. [2]");
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -527,7 +527,7 @@ void CGuildManager::WarEnd(DWORD GID1, DWORD GID2, bool bForceDraw)
|
|||
//
|
||||
void CGuildManager::RecvWarOver(DWORD dwGuildWinner, DWORD dwGuildLoser, bool bDraw, int lWarPrice)
|
||||
{
|
||||
sys_log(0, "GuildWar: RecvWarOver : winner %u vs %u draw? %d war_price %d", dwGuildWinner, dwGuildLoser, bDraw ? 1 : 0, lWarPrice);
|
||||
SPDLOG_DEBUG("GuildWar: RecvWarOver : winner {} vs {} draw? {} war_price {}", dwGuildWinner, dwGuildLoser, bDraw ? 1 : 0, lWarPrice);
|
||||
|
||||
DWORD GID1 = dwGuildWinner;
|
||||
DWORD GID2 = dwGuildLoser;
|
||||
|
@ -570,13 +570,13 @@ void CGuildManager::RecvWarOver(DWORD dwGuildWinner, DWORD dwGuildLoser, bool bD
|
|||
|
||||
void CGuildManager::RecvWarEnd(DWORD GID1, DWORD GID2)
|
||||
{
|
||||
sys_log(0, "GuildWar: RecvWarEnded : %u vs %u", GID1, GID2);
|
||||
SPDLOG_DEBUG("GuildWar: RecvWarEnded : {} vs {}", GID1, GID2);
|
||||
WarEnd(GID1, GID2, true); // 무조건 비정상 종료 시켜야 한다.
|
||||
}
|
||||
|
||||
void CGuildManager::StartWar(BYTE bType, DWORD GID1, DWORD GID2, CGuildWarReserve * pkReserve)
|
||||
{
|
||||
sys_log(0, "GuildWar: StartWar(%d,%d,%d)", bType, GID1, GID2);
|
||||
SPDLOG_DEBUG("GuildWar: StartWar({},{},{})", bType, GID1, GID2);
|
||||
|
||||
if (GID1 > GID2)
|
||||
std::swap(GID1, GID2);
|
||||
|
@ -610,7 +610,7 @@ void CGuildManager::UpdateScore(DWORD dwGainGID, DWORD dwOppGID, int iScoreDelta
|
|||
|
||||
if (!p || p->bEnd)
|
||||
{
|
||||
sys_err("GuildWar: war not exist or already ended.");
|
||||
SPDLOG_ERROR("GuildWar: war not exist or already ended.");
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -634,7 +634,7 @@ void CGuildManager::UpdateScore(DWORD dwGainGID, DWORD dwOppGID, int iScoreDelta
|
|||
iNewBetScore = p->iBetScore[1];
|
||||
}
|
||||
|
||||
sys_log(0, "GuildWar: SendGuildWarScore guild %u wartype %u score_delta %d betscore_delta %d result %u, %u",
|
||||
SPDLOG_DEBUG("GuildWar: SendGuildWarScore guild {} wartype {} score_delta {} betscore_delta {} result {}, {}",
|
||||
dwGainGID, p->bType, iScoreDelta, iBetScoreDelta, iNewScore, iNewBetScore);
|
||||
|
||||
CClientManager::instance().for_each_peer(FSendGuildWarScore(dwGainGID, dwOppGID, iNewScore, iNewBetScore));
|
||||
|
@ -648,7 +648,7 @@ void CGuildManager::AddDeclare(BYTE bType, DWORD guild_from, DWORD guild_to)
|
|||
if (m_DeclareMap.find(di) == m_DeclareMap.end())
|
||||
m_DeclareMap.insert(di);
|
||||
|
||||
sys_log(0, "GuildWar: AddDeclare(Type:%d,from:%d,to:%d)", bType, guild_from, guild_to);
|
||||
SPDLOG_DEBUG("GuildWar: AddDeclare(Type:{},from:{},to:{})", bType, guild_from, guild_to);
|
||||
}
|
||||
|
||||
void CGuildManager::RemoveDeclare(DWORD guild_from, DWORD guild_to)
|
||||
|
@ -663,7 +663,7 @@ void CGuildManager::RemoveDeclare(DWORD guild_from, DWORD guild_to)
|
|||
if (it != m_DeclareMap.end())
|
||||
m_DeclareMap.erase(it);
|
||||
|
||||
sys_log(0, "GuildWar: RemoveDeclare(from:%d,to:%d)", guild_from, guild_to);
|
||||
SPDLOG_DEBUG("GuildWar: RemoveDeclare(from:{},to:{})", guild_from, guild_to);
|
||||
}
|
||||
|
||||
bool CGuildManager::TakeBetPrice(DWORD dwGuildTo, DWORD dwGuildFrom, int lWarPrice)
|
||||
|
@ -673,14 +673,14 @@ bool CGuildManager::TakeBetPrice(DWORD dwGuildTo, DWORD dwGuildFrom, int lWarPri
|
|||
|
||||
if (it_from == m_map_kGuild.end() || it_to == m_map_kGuild.end())
|
||||
{
|
||||
sys_log(0, "TakeBetPrice: guild not exist %u %u",
|
||||
SPDLOG_DEBUG("TakeBetPrice: guild not exist {} {}",
|
||||
dwGuildFrom, dwGuildTo);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (it_from->second.gold < lWarPrice || it_to->second.gold < lWarPrice)
|
||||
{
|
||||
sys_log(0, "TakeBetPrice: not enough gold %u %d to %u %d",
|
||||
SPDLOG_DEBUG("TakeBetPrice: not enough gold {} {} to {} {}",
|
||||
dwGuildFrom, it_from->second.gold, dwGuildTo, it_to->second.gold);
|
||||
return false;
|
||||
}
|
||||
|
@ -704,8 +704,8 @@ bool CGuildManager::WaitStart(TPacketGuildWar * p)
|
|||
TGuildWaitStartInfo info(p->bType, p->dwGuildFrom, p->dwGuildTo, p->lWarPrice, p->lInitialScore, NULL);
|
||||
m_pqWaitStart.push(std::make_pair(dwCurTime + GetGuildWarWaitStartDuration(), info));
|
||||
|
||||
sys_log(0,
|
||||
"GuildWar: WaitStart g1 %d g2 %d price %d start at %u",
|
||||
SPDLOG_DEBUG(
|
||||
"GuildWar: WaitStart g1 {} g2 {} price {} start at {}",
|
||||
p->dwGuildFrom,
|
||||
p->dwGuildTo,
|
||||
p->lWarPrice,
|
||||
|
@ -742,8 +742,8 @@ void CGuildManager::ChangeLadderPoint(DWORD GID, int change)
|
|||
snprintf(buf, sizeof(buf), "UPDATE guild%s SET ladder_point=%d WHERE id=%u", GetTablePostfix(), r.ladder_point, GID);
|
||||
CDBManager::instance().AsyncQuery(buf);
|
||||
|
||||
sys_log(0, "GuildManager::ChangeLadderPoint %u %d", GID, r.ladder_point);
|
||||
sys_log(0, "%s", buf);
|
||||
SPDLOG_DEBUG("GuildManager::ChangeLadderPoint {} {}", GID, r.ladder_point);
|
||||
SPDLOG_DEBUG("{}", buf);
|
||||
|
||||
// Packet 보내기
|
||||
TPacketGuildLadder p;
|
||||
|
@ -760,14 +760,14 @@ void CGuildManager::ChangeLadderPoint(DWORD GID, int change)
|
|||
void CGuildManager::UseSkill(DWORD GID, DWORD dwSkillVnum, DWORD dwCooltime)
|
||||
{
|
||||
// GUILD_SKILL_COOLTIME_BUG_FIX
|
||||
sys_log(0, "UseSkill(gid=%d, skill=%d) CoolTime(%d:%d)", GID, dwSkillVnum, dwCooltime, CClientManager::instance().GetCurrentTime() + dwCooltime);
|
||||
SPDLOG_DEBUG("UseSkill(gid={}, skill={}) CoolTime({}:{})", GID, dwSkillVnum, dwCooltime, CClientManager::instance().GetCurrentTime() + dwCooltime);
|
||||
m_pqSkill.push(std::make_pair(CClientManager::instance().GetCurrentTime() + dwCooltime, TGuildSkillUsed(GID, dwSkillVnum)));
|
||||
// END_OF_GUILD_SKILL_COOLTIME_BUG_FIX
|
||||
}
|
||||
|
||||
void CGuildManager::MoneyChange(DWORD dwGuild, DWORD dwGold)
|
||||
{
|
||||
sys_log(0, "GuildManager::MoneyChange %d %d", dwGuild, dwGold);
|
||||
SPDLOG_DEBUG("GuildManager::MoneyChange {} {}", dwGuild, dwGold);
|
||||
|
||||
TPacketDGGuildMoneyChange p;
|
||||
p.dwGuild = dwGuild;
|
||||
|
@ -788,12 +788,12 @@ void CGuildManager::DepositMoney(DWORD dwGuild, INT iGold)
|
|||
|
||||
if (it == m_map_kGuild.end())
|
||||
{
|
||||
sys_err("No guild by id %u", dwGuild);
|
||||
SPDLOG_ERROR("No guild by id {}", dwGuild);
|
||||
return;
|
||||
}
|
||||
|
||||
it->second.gold += iGold;
|
||||
sys_log(0, "GUILD: %u Deposit %u Total %d", dwGuild, iGold, it->second.gold);
|
||||
SPDLOG_DEBUG("GUILD: {} Deposit {} Total {}", dwGuild, iGold, it->second.gold);
|
||||
|
||||
MoneyChange(dwGuild, it->second.gold);
|
||||
}
|
||||
|
@ -804,7 +804,7 @@ void CGuildManager::WithdrawMoney(CPeer* peer, DWORD dwGuild, INT iGold)
|
|||
|
||||
if (it == m_map_kGuild.end())
|
||||
{
|
||||
sys_err("No guild by id %u", dwGuild);
|
||||
SPDLOG_ERROR("No guild by id {}", dwGuild);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -812,7 +812,7 @@ void CGuildManager::WithdrawMoney(CPeer* peer, DWORD dwGuild, INT iGold)
|
|||
if (it->second.gold >= iGold)
|
||||
{
|
||||
it->second.gold -= iGold;
|
||||
sys_log(0, "GUILD: %u Withdraw %d Total %d", dwGuild, iGold, it->second.gold);
|
||||
SPDLOG_DEBUG("GUILD: {} Withdraw {} Total {}", dwGuild, iGold, it->second.gold);
|
||||
|
||||
TPacketDGGuildMoneyWithdraw p;
|
||||
p.dwGuild = dwGuild;
|
||||
|
@ -830,7 +830,7 @@ void CGuildManager::WithdrawMoneyReply(DWORD dwGuild, BYTE bGiveSuccess, INT iGo
|
|||
if (it == m_map_kGuild.end())
|
||||
return;
|
||||
|
||||
sys_log(0, "GuildManager::WithdrawMoneyReply : guild %u success %d gold %d", dwGuild, bGiveSuccess, iGold);
|
||||
SPDLOG_DEBUG("GuildManager::WithdrawMoneyReply : guild {} success {} gold {}", dwGuild, bGiveSuccess, iGold);
|
||||
|
||||
if (!bGiveSuccess)
|
||||
it->second.gold += iGold;
|
||||
|
@ -938,16 +938,16 @@ void CGuildManager::BootReserveWar()
|
|||
if (i == 0 || (int) t.dwTime - CClientManager::instance().GetCurrentTime() < 0)
|
||||
{
|
||||
if (i == 0)
|
||||
sys_log(0, "%s : DB was shutdowned while war is being.", buf);
|
||||
SPDLOG_DEBUG("{} : DB was shutdowned while war is being.", buf);
|
||||
else
|
||||
sys_log(0, "%s : left time lower than 5 minutes, will be canceled", buf);
|
||||
SPDLOG_DEBUG("{} : left time lower than 5 minutes, will be canceled", buf);
|
||||
|
||||
pkReserve->Draw();
|
||||
delete pkReserve;
|
||||
}
|
||||
else
|
||||
{
|
||||
sys_log(0, "%s : OK", buf);
|
||||
SPDLOG_DEBUG("{} : OK", buf);
|
||||
m_map_kWarReserve.insert(std::make_pair(t.dwID, pkReserve));
|
||||
}
|
||||
}
|
||||
|
@ -1024,7 +1024,7 @@ bool CGuildManager::ReserveWar(TPacketGuildWar * p)
|
|||
polyPower.SetVar("mc", mc);
|
||||
|
||||
t.lPowerFrom = (int) polyPower.Eval();
|
||||
sys_log(0, "GuildWar: %u lvp %d rkp %d alv %d mc %d power %d", GID1, lvp, rkp, alv, mc, t.lPowerFrom);
|
||||
SPDLOG_DEBUG("GuildWar: {} lvp {} rkp {} alv {} mc {} power {}", GID1, lvp, rkp, alv, mc, t.lPowerFrom);
|
||||
|
||||
// 파워 계산
|
||||
TGuild & k2 = TouchGuild(GID2);
|
||||
|
@ -1040,7 +1040,7 @@ bool CGuildManager::ReserveWar(TPacketGuildWar * p)
|
|||
polyPower.SetVar("mc", mc);
|
||||
|
||||
t.lPowerTo = (int) polyPower.Eval();
|
||||
sys_log(0, "GuildWar: %u lvp %d rkp %d alv %d mc %d power %d", GID2, lvp, rkp, alv, mc, t.lPowerTo);
|
||||
SPDLOG_DEBUG("GuildWar: {} lvp {} rkp {} alv {} mc {} power {}", GID2, lvp, rkp, alv, mc, t.lPowerTo);
|
||||
|
||||
// 핸디캡 계산
|
||||
if (t.lPowerTo > t.lPowerFrom)
|
||||
|
@ -1055,7 +1055,7 @@ bool CGuildManager::ReserveWar(TPacketGuildWar * p)
|
|||
}
|
||||
|
||||
t.lHandicap = (int) polyHandicap.Eval();
|
||||
sys_log(0, "GuildWar: handicap %d", t.lHandicap);
|
||||
SPDLOG_DEBUG("GuildWar: handicap {}", t.lHandicap);
|
||||
|
||||
// 쿼리
|
||||
char szQuery[512];
|
||||
|
@ -1069,7 +1069,7 @@ bool CGuildManager::ReserveWar(TPacketGuildWar * p)
|
|||
|
||||
if (pmsg->Get()->uiAffectedRows == 0 || pmsg->Get()->uiInsertID == 0 || pmsg->Get()->uiAffectedRows == (uint32_t)-1)
|
||||
{
|
||||
sys_err("GuildWar: Cannot insert row");
|
||||
SPDLOG_ERROR("GuildWar: Cannot insert row");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -1101,7 +1101,7 @@ void CGuildManager::ProcessReserveWar()
|
|||
TGuild & r_1 = m_map_kGuild[r.dwGuildFrom];
|
||||
TGuild & r_2 = m_map_kGuild[r.dwGuildTo];
|
||||
|
||||
sys_log(0, "GuildWar: started GID1 %u GID2 %u %d time %d min %d", r.dwGuildFrom, r.dwGuildTo, r.bStarted, dwCurTime - r.dwTime, iMin);
|
||||
SPDLOG_DEBUG("GuildWar: started GID1 {} GID2 {} {} time {} min {}", r.dwGuildFrom, r.dwGuildTo, r.bStarted, dwCurTime - r.dwTime, iMin);
|
||||
|
||||
if (iMin <= 0)
|
||||
{
|
||||
|
@ -1152,7 +1152,7 @@ bool CGuildManager::Bet(DWORD dwID, const char * c_pszLogin, DWORD dwGold, DWORD
|
|||
|
||||
if (it == m_map_kWarReserve.end())
|
||||
{
|
||||
sys_log(0, "WAR_RESERVE: Bet: cannot find reserve war by id %u", dwID);
|
||||
SPDLOG_DEBUG("WAR_RESERVE: Bet: cannot find reserve war by id {}", dwID);
|
||||
snprintf(szQuery, sizeof(szQuery), "INSERT INTO item_award (login, vnum, socket0, given_time) VALUES('%s', %d, %u, NOW())",
|
||||
c_pszLogin, ITEM_ELK_VNUM, dwGold);
|
||||
CDBManager::instance().AsyncQuery(szQuery);
|
||||
|
@ -1161,7 +1161,7 @@ bool CGuildManager::Bet(DWORD dwID, const char * c_pszLogin, DWORD dwGold, DWORD
|
|||
|
||||
if (!it->second->Bet(c_pszLogin, dwGold, dwGuild))
|
||||
{
|
||||
sys_log(0, "WAR_RESERVE: Bet: cannot bet id %u, login %s, gold %u, guild %u", dwID, c_pszLogin, dwGold, dwGuild);
|
||||
SPDLOG_DEBUG("WAR_RESERVE: Bet: cannot bet id {}, login {}, gold {}, guild {}", dwID, c_pszLogin, dwGold, dwGuild);
|
||||
snprintf(szQuery, sizeof(szQuery), "INSERT INTO item_award (login, vnum, socket0, given_time) VALUES('%s', %d, %u, NOW())",
|
||||
c_pszLogin, ITEM_ELK_VNUM, dwGold);
|
||||
CDBManager::instance().AsyncQuery(szQuery);
|
||||
|
@ -1271,19 +1271,19 @@ bool CGuildWarReserve::Bet(const char * pszLogin, DWORD dwGold, DWORD dwGuild)
|
|||
|
||||
if (m_data.dwGuildFrom != dwGuild && m_data.dwGuildTo != dwGuild)
|
||||
{
|
||||
sys_log(0, "GuildWarReserve::Bet: invalid guild id");
|
||||
SPDLOG_DEBUG("GuildWarReserve::Bet: invalid guild id");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (m_data.bStarted)
|
||||
{
|
||||
sys_log(0, "GuildWarReserve::Bet: war is already started");
|
||||
SPDLOG_DEBUG("GuildWarReserve::Bet: war is already started");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (mapBet.find(pszLogin) != mapBet.end())
|
||||
{
|
||||
sys_log(0, "GuildWarReserve::Bet: failed. already bet");
|
||||
SPDLOG_DEBUG("GuildWarReserve::Bet: failed. already bet");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -1295,7 +1295,7 @@ bool CGuildWarReserve::Bet(const char * pszLogin, DWORD dwGold, DWORD dwGuild)
|
|||
|
||||
if (pmsg->Get()->uiAffectedRows == 0 || pmsg->Get()->uiAffectedRows == (uint32_t)-1)
|
||||
{
|
||||
sys_log(0, "GuildWarReserve::Bet: failed. cannot insert row to guild_war_bet table");
|
||||
SPDLOG_DEBUG("GuildWarReserve::Bet: failed. cannot insert row to guild_war_bet table");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -1311,7 +1311,7 @@ bool CGuildWarReserve::Bet(const char * pszLogin, DWORD dwGold, DWORD dwGuild)
|
|||
|
||||
CDBManager::instance().AsyncQuery(szQuery);
|
||||
|
||||
sys_log(0, "GuildWarReserve::Bet: success. %s %u war_id %u bet %u : %u", pszLogin, dwGuild, m_data.dwID, m_data.dwBetFrom, m_data.dwBetTo);
|
||||
SPDLOG_DEBUG("GuildWarReserve::Bet: success. {} {} war_id {} bet {} : {}", pszLogin, dwGuild, m_data.dwID, m_data.dwBetFrom, m_data.dwBetTo);
|
||||
mapBet.insert(std::make_pair(pszLogin, std::make_pair(dwGuild, dwGold)));
|
||||
|
||||
TPacketGDGuildWarBet pckBet;
|
||||
|
@ -1338,7 +1338,7 @@ void CGuildWarReserve::Draw()
|
|||
if (mapBet.empty())
|
||||
return;
|
||||
|
||||
sys_log(0, "WAR_REWARD: Draw. war_id %u", m_data.dwID);
|
||||
SPDLOG_DEBUG("WAR_REWARD: Draw. war_id {}", m_data.dwID);
|
||||
|
||||
itertype(mapBet) it = mapBet.begin();
|
||||
|
||||
|
@ -1368,7 +1368,7 @@ void CGuildWarReserve::Draw()
|
|||
|
||||
if (iRow > 0)
|
||||
{
|
||||
sys_log(0, "WAR_REWARD: QUERY: %s", szQuery);
|
||||
SPDLOG_DEBUG("WAR_REWARD: QUERY: {}", szQuery);
|
||||
CDBManager::instance().AsyncQuery(szQuery);
|
||||
}
|
||||
|
||||
|
@ -1381,18 +1381,18 @@ void CGuildWarReserve::End(int iScoreFrom, int iScoreTo)
|
|||
{
|
||||
DWORD dwWinner;
|
||||
|
||||
sys_log(0, "WAR_REWARD: End: From %u %d To %u %d", m_data.dwGuildFrom, iScoreFrom, m_data.dwGuildTo, iScoreTo);
|
||||
SPDLOG_DEBUG("WAR_REWARD: End: From {} {} To {} {}", m_data.dwGuildFrom, iScoreFrom, m_data.dwGuildTo, iScoreTo);
|
||||
|
||||
if (m_data.lPowerFrom > m_data.lPowerTo)
|
||||
{
|
||||
if (m_data.lHandicap > iScoreFrom - iScoreTo)
|
||||
{
|
||||
sys_log(0, "WAR_REWARD: End: failed to overcome handicap, From is strong but To won");
|
||||
SPDLOG_DEBUG("WAR_REWARD: End: failed to overcome handicap, From is strong but To won");
|
||||
dwWinner = m_data.dwGuildTo;
|
||||
}
|
||||
else
|
||||
{
|
||||
sys_log(0, "WAR_REWARD: End: success to overcome handicap, From win!");
|
||||
SPDLOG_DEBUG("WAR_REWARD: End: success to overcome handicap, From win!");
|
||||
dwWinner = m_data.dwGuildFrom;
|
||||
}
|
||||
}
|
||||
|
@ -1400,12 +1400,12 @@ void CGuildWarReserve::End(int iScoreFrom, int iScoreTo)
|
|||
{
|
||||
if (m_data.lHandicap > iScoreTo - iScoreFrom)
|
||||
{
|
||||
sys_log(0, "WAR_REWARD: End: failed to overcome handicap, To is strong but From won");
|
||||
SPDLOG_DEBUG("WAR_REWARD: End: failed to overcome handicap, To is strong but From won");
|
||||
dwWinner = m_data.dwGuildFrom;
|
||||
}
|
||||
else
|
||||
{
|
||||
sys_log(0, "WAR_REWARD: End: success to overcome handicap, To win!");
|
||||
SPDLOG_DEBUG("WAR_REWARD: End: success to overcome handicap, To win!");
|
||||
dwWinner = m_data.dwGuildTo;
|
||||
}
|
||||
}
|
||||
|
@ -1427,17 +1427,17 @@ void CGuildWarReserve::End(int iScoreFrom, int iScoreTo)
|
|||
dwWinnerBet = m_data.dwBetTo;
|
||||
else
|
||||
{
|
||||
sys_err("WAR_REWARD: fatal error, winner does not exist!");
|
||||
SPDLOG_ERROR("WAR_REWARD: fatal error, winner does not exist!");
|
||||
return;
|
||||
}
|
||||
|
||||
if (dwWinnerBet == 0)
|
||||
{
|
||||
sys_err("WAR_REWARD: total bet money on winner is zero");
|
||||
SPDLOG_ERROR("WAR_REWARD: total bet money on winner is zero");
|
||||
return;
|
||||
}
|
||||
|
||||
sys_log(0, "WAR_REWARD: End: Total bet: %u, Winner bet: %u", dwTotalBet, dwWinnerBet);
|
||||
SPDLOG_DEBUG("WAR_REWARD: End: Total bet: {}, Winner bet: {}", dwTotalBet, dwWinnerBet);
|
||||
|
||||
itertype(mapBet) it = mapBet.begin();
|
||||
|
||||
|
@ -1459,7 +1459,7 @@ void CGuildWarReserve::End(int iScoreFrom, int iScoreTo)
|
|||
double ratio = (double) it->second.second / dwWinnerBet;
|
||||
|
||||
// 10% 세금 공제 후 분배
|
||||
sys_log(0, "WAR_REWARD: %s %u ratio %f", it->first.c_str(), it->second.second, ratio);
|
||||
SPDLOG_DEBUG("WAR_REWARD: {} {} ratio {}", it->first.c_str(), it->second.second, ratio);
|
||||
|
||||
DWORD dwGold = (DWORD) (dwTotalBet * ratio * 0.9);
|
||||
|
||||
|
@ -1480,7 +1480,7 @@ void CGuildWarReserve::End(int iScoreFrom, int iScoreTo)
|
|||
|
||||
if (iRow > 0)
|
||||
{
|
||||
sys_log(0, "WAR_REWARD: query: %s", szQuery);
|
||||
SPDLOG_DEBUG("WAR_REWARD: query: {}", szQuery);
|
||||
CDBManager::instance().AsyncQuery(szQuery);
|
||||
}
|
||||
|
||||
|
|
|
@ -68,13 +68,13 @@ bool PlayerHB::Query(DWORD id)
|
|||
|
||||
if (pos < 0)
|
||||
{
|
||||
sys_err("cannot find %s ", szFind);
|
||||
// sys_err("cannot find %s in %s", szFind, m_stCreateTableQuery.c_str());
|
||||
SPDLOG_ERROR("cannot find {} ", szFind);
|
||||
// SPDLOG_ERROR("cannot find {} in {}", szFind, m_stCreateTableQuery.c_str());
|
||||
return false;
|
||||
}
|
||||
|
||||
snprintf(szQuery, sizeof(szQuery), "CREATE TABLE IF NOT EXISTS %s%s", szTableName, m_stCreateTableQuery.c_str() + strlen(szFind));
|
||||
// sys_log(0, "%s", szQuery);
|
||||
// SPDLOG_DEBUG("{}", szQuery);
|
||||
std::unique_ptr<SQLMsg> pMsg(CDBManager::instance().DirectQuery(szQuery, SQL_HOTBACKUP));
|
||||
m_stTableName = szTableName;
|
||||
}
|
||||
|
|
|
@ -60,7 +60,7 @@ void ItemAwardManager::Load(SQLMsg * pMsg)
|
|||
strcpy(cmdStr,whyStr); //명령어 얻는 과정에서 토큰쓰면 원본도 토큰화 되기 때문
|
||||
char command[20] = "";
|
||||
strcpy(command,CClientManager::instance().GetCommand(cmdStr).c_str()); // command 얻기
|
||||
//sys_err("%d, %s",pItemAward->dwID,command);
|
||||
//SPDLOG_ERROR("{}, {}",pItemAward->dwID,command);
|
||||
if( !(strcmp(command,"GIFT") )) // command 가 GIFT이면
|
||||
{
|
||||
TPacketItemAwardInfromer giftData;
|
||||
|
@ -74,7 +74,7 @@ void ItemAwardManager::Load(SQLMsg * pMsg)
|
|||
m_map_award.insert(std::make_pair(dwID, kData));
|
||||
|
||||
printf("ITEM_AWARD load id %u bMall %d \n", kData->dwID, kData->bMall);
|
||||
sys_log(0, "ITEM_AWARD: load id %lu login %s vnum %lu count %u socket %lu", kData->dwID, kData->szLogin, kData->dwVnum, kData->dwCount, kData->dwSocket0);
|
||||
SPDLOG_DEBUG("ITEM_AWARD: load id {} login {} vnum {} count {} socket {}", kData->dwID, kData->szLogin, kData->dwVnum, kData->dwCount, kData->dwSocket0);
|
||||
std::set<TItemAward *> & kSet = m_map_kSetAwardByLogin[kData->szLogin];
|
||||
kSet.insert(kData);
|
||||
|
||||
|
@ -99,7 +99,7 @@ void ItemAwardManager::Taken(DWORD dwAwardID, DWORD dwItemID)
|
|||
|
||||
if (it == m_map_award.end())
|
||||
{
|
||||
sys_log(0, "ITEM_AWARD: Taken ID not exist %lu", dwAwardID);
|
||||
SPDLOG_DEBUG("ITEM_AWARD: Taken ID not exist {}", dwAwardID);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -79,7 +79,7 @@ TItemIDRangeTable CItemIDRangeManager::GetRange()
|
|||
}
|
||||
|
||||
for (int i = 0; i < 10; ++i)
|
||||
sys_err("ItemIDRange: NO MORE ITEM ID RANGE");
|
||||
SPDLOG_ERROR("ItemIDRange: NO MORE ITEM ID RANGE");
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
@ -112,7 +112,7 @@ bool CItemIDRangeManager::BuildRange(DWORD dwMin, DWORD dwMax, TItemIDRangeTable
|
|||
|
||||
if ((dwMax < dwItemMaxID) || (dwMax - dwItemMaxID < cs_dwMinimumRemainCount))
|
||||
{
|
||||
sys_log(0, "ItemIDRange: Build %u ~ %u start: %u\tNOT USE remain count is below %u",
|
||||
SPDLOG_DEBUG("ItemIDRange: Build {} ~ {} start: {}\tNOT USE remain count is below {}",
|
||||
dwMin, dwMax, dwItemMaxID, cs_dwMinimumRemainCount);
|
||||
}
|
||||
else
|
||||
|
@ -136,12 +136,12 @@ bool CItemIDRangeManager::BuildRange(DWORD dwMin, DWORD dwMax, TItemIDRangeTable
|
|||
|
||||
if (count > 0)
|
||||
{
|
||||
sys_err("ItemIDRange: Build: %u ~ %u\thave a item", range.dwUsableItemIDMin, range.dwMax);
|
||||
SPDLOG_ERROR("ItemIDRange: Build: {} ~ {}\thave a item", range.dwUsableItemIDMin, range.dwMax);
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
sys_log(0, "ItemIDRange: Build: %u ~ %u start:%u", range.dwMin, range.dwMax, range.dwUsableItemIDMin);
|
||||
SPDLOG_TRACE("ItemIDRange: Build: {} ~ {} start:{}", range.dwMin, range.dwMax, range.dwUsableItemIDMin);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,16 +2,18 @@
|
|||
#ifndef __INC_METIN_II_ITEM_ID_RANGE_MANAGER_H__
|
||||
#define __INC_METIN_II_ITEM_ID_RANGE_MANAGER_H__
|
||||
|
||||
namespace {
|
||||
static const uint32_t cs_dwMaxItemID = 4290000000UL;
|
||||
static const uint32_t cs_dwMinimumRange = 10000000UL;
|
||||
static const uint32_t cs_dwMinimumRemainCount = 10000UL;
|
||||
}
|
||||
|
||||
class CItemIDRangeManager : public singleton<CItemIDRangeManager>
|
||||
{
|
||||
private :
|
||||
const static DWORD cs_dwMaxItemID = 4290000000UL;
|
||||
const static DWORD cs_dwMinimumRange = 10000000UL;
|
||||
const static DWORD cs_dwMinimumRemainCount = 10000UL;
|
||||
|
||||
private:
|
||||
std::list<TItemIDRangeTable> m_listData;
|
||||
|
||||
public :
|
||||
public:
|
||||
CItemIDRangeManager();
|
||||
|
||||
void Build();
|
||||
|
|
|
@ -78,11 +78,11 @@ void CLoginData::SetPlay(bool bOn)
|
|||
{
|
||||
if (bOn)
|
||||
{
|
||||
sys_log(0, "SetPlay on %lu %s", GetKey(), m_data.login);
|
||||
SPDLOG_DEBUG("SetPlay on {} {}", GetKey(), m_data.login);
|
||||
SetLogonTime();
|
||||
}
|
||||
else
|
||||
sys_log(0, "SetPlay off %lu %s", GetKey(), m_data.login);
|
||||
SPDLOG_DEBUG("SetPlay off {} {}", GetKey(), m_data.login);
|
||||
|
||||
m_bPlay = bOn;
|
||||
m_lastPlayTime = CClientManager::instance().GetCurrentTime();
|
||||
|
|
|
@ -38,8 +38,6 @@ int g_iItemCacheFlushSeconds = 60*5;
|
|||
//g_iLogoutSeconds 수치는 g_iPlayerCacheFlushSeconds 와 g_iItemCacheFlushSeconds 보다 길어야 한다.
|
||||
int g_iLogoutSeconds = 60*10;
|
||||
|
||||
int g_log = 1;
|
||||
|
||||
|
||||
// MYSHOP_PRICE_LIST
|
||||
int g_iItemPriceListTableCacheFlushSeconds = 540;
|
||||
|
@ -52,9 +50,9 @@ extern const char * _malloc_options;
|
|||
void emergency_sig(int sig)
|
||||
{
|
||||
if (sig == SIGSEGV)
|
||||
sys_log(0, "SIGNAL: SIGSEGV");
|
||||
SPDLOG_DEBUG("SIGNAL: SIGSEGV");
|
||||
else if (sig == SIGUSR1)
|
||||
sys_log(0, "SIGNAL: SIGUSR1");
|
||||
SPDLOG_DEBUG("SIGNAL: SIGUSR1");
|
||||
|
||||
if (sig == SIGSEGV)
|
||||
abort();
|
||||
|
@ -62,7 +60,8 @@ void emergency_sig(int sig)
|
|||
|
||||
int main()
|
||||
{
|
||||
WriteVersion(std::cout);
|
||||
WriteVersion();
|
||||
log_init();
|
||||
|
||||
#ifdef __FreeBSD__
|
||||
_malloc_options = "A";
|
||||
|
@ -93,7 +92,7 @@ int main()
|
|||
#ifdef __AUCTION__
|
||||
AuctionManager::instance().Initialize();
|
||||
#endif
|
||||
sys_log(0, "Metin2DBCacheServer Start\n");
|
||||
SPDLOG_DEBUG("Metin2DBCacheServer Start");
|
||||
|
||||
CClientManager::instance().MainLoop();
|
||||
|
||||
|
@ -113,9 +112,11 @@ int main()
|
|||
break;
|
||||
|
||||
usleep(1000);
|
||||
sys_log(0, "WAITING_QUERY_COUNT %d", iCount);
|
||||
SPDLOG_DEBUG("WAITING_QUERY_COUNT {}", iCount);
|
||||
}
|
||||
|
||||
log_destroy();
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
@ -133,45 +134,31 @@ int Start()
|
|||
{
|
||||
if (!CConfig::instance().LoadFile("conf.txt"))
|
||||
{
|
||||
fprintf(stderr, "Loading conf.txt failed.\n");
|
||||
SPDLOG_ERROR("Loading conf.txt failed.");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!CConfig::instance().GetValue("TEST_SERVER", &g_test_server))
|
||||
{
|
||||
fprintf(stderr, "Real Server\n");
|
||||
SPDLOG_INFO("Real Server");
|
||||
}
|
||||
else
|
||||
fprintf(stderr, "Test Server\n");
|
||||
|
||||
if (!CConfig::instance().GetValue("LOG", &g_log))
|
||||
{
|
||||
fprintf(stderr, "Log Off");
|
||||
g_log= 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
g_log = 1;
|
||||
fprintf(stderr, "Log On");
|
||||
}
|
||||
|
||||
SPDLOG_INFO("Test Server");
|
||||
|
||||
int tmpValue;
|
||||
|
||||
int heart_beat = 50;
|
||||
if (!CConfig::instance().GetValue("CLIENT_HEART_FPS", &heart_beat))
|
||||
{
|
||||
fprintf(stderr, "Cannot find CLIENT_HEART_FPS configuration.\n");
|
||||
SPDLOG_ERROR("Cannot find CLIENT_HEART_FPS configuration.");
|
||||
return false;
|
||||
}
|
||||
|
||||
log_set_expiration_days(3);
|
||||
|
||||
if (CConfig::instance().GetValue("LOG_KEEP_DAYS", &tmpValue))
|
||||
if (CConfig::instance().GetValue("LOG_LEVEL", &tmpValue))
|
||||
{
|
||||
tmpValue = std::clamp(tmpValue, 3, 30);
|
||||
log_set_expiration_days(tmpValue);
|
||||
fprintf(stderr, "Setting log keeping days to %d\n", tmpValue);
|
||||
SPDLOG_INFO("Setting log level to {}", tmpValue);
|
||||
tmpValue = std::clamp(tmpValue, SPDLOG_LEVEL_TRACE, SPDLOG_LEVEL_OFF);
|
||||
log_set_level(tmpValue);
|
||||
}
|
||||
|
||||
thecore_init(heart_beat, emptybeat);
|
||||
|
@ -182,12 +169,12 @@ int Start()
|
|||
if (CConfig::instance().GetValue("LOCALE", szBuf, 256))
|
||||
{
|
||||
g_stLocale = szBuf;
|
||||
sys_log(0, "LOCALE set to %s", g_stLocale.c_str());
|
||||
SPDLOG_INFO("LOCALE set to {}", g_stLocale.c_str());
|
||||
|
||||
// CHINA_DISABLE_HOTBACKUP
|
||||
if ("gb2312" == g_stLocale)
|
||||
{
|
||||
sys_log(0, "CIBN_LOCALE: DISABLE_HOTBACKUP");
|
||||
SPDLOG_INFO("CIBN_LOCALE: DISABLE_HOTBACKUP");
|
||||
g_bHotBackup = false;
|
||||
}
|
||||
// END_OF_CHINA_DISABLE_HOTBACKUP
|
||||
|
@ -198,7 +185,7 @@ int Start()
|
|||
{
|
||||
if (iDisableHotBackup)
|
||||
{
|
||||
sys_log(0, "CONFIG: DISABLE_HOTBACKUP");
|
||||
SPDLOG_INFO("CONFIG: DISABLE_HOTBACKUP");
|
||||
g_bHotBackup = false;
|
||||
}
|
||||
}
|
||||
|
@ -206,7 +193,7 @@ int Start()
|
|||
|
||||
if (!CConfig::instance().GetValue("TABLE_POSTFIX", szBuf, 256))
|
||||
{
|
||||
sys_err("TABLE_POSTFIX not configured use default");
|
||||
SPDLOG_WARN("TABLE_POSTFIX not configured use default");
|
||||
szBuf[0] = '\0';
|
||||
}
|
||||
|
||||
|
@ -215,20 +202,20 @@ int Start()
|
|||
if (CConfig::instance().GetValue("PLAYER_CACHE_FLUSH_SECONDS", szBuf, 256))
|
||||
{
|
||||
str_to_number(g_iPlayerCacheFlushSeconds, szBuf);
|
||||
sys_log(0, "PLAYER_CACHE_FLUSH_SECONDS: %d", g_iPlayerCacheFlushSeconds);
|
||||
SPDLOG_INFO("PLAYER_CACHE_FLUSH_SECONDS: {}", g_iPlayerCacheFlushSeconds);
|
||||
}
|
||||
|
||||
if (CConfig::instance().GetValue("ITEM_CACHE_FLUSH_SECONDS", szBuf, 256))
|
||||
{
|
||||
str_to_number(g_iItemCacheFlushSeconds, szBuf);
|
||||
sys_log(0, "ITEM_CACHE_FLUSH_SECONDS: %d", g_iItemCacheFlushSeconds);
|
||||
SPDLOG_INFO("ITEM_CACHE_FLUSH_SECONDS: {}", g_iItemCacheFlushSeconds);
|
||||
}
|
||||
|
||||
// MYSHOP_PRICE_LIST
|
||||
if (CConfig::instance().GetValue("ITEM_PRICELIST_CACHE_FLUSH_SECONDS", szBuf, 256))
|
||||
{
|
||||
str_to_number(g_iItemPriceListTableCacheFlushSeconds, szBuf);
|
||||
sys_log(0, "ITEM_PRICELIST_CACHE_FLUSH_SECONDS: %d", g_iItemPriceListTableCacheFlushSeconds);
|
||||
SPDLOG_INFO("ITEM_PRICELIST_CACHE_FLUSH_SECONDS: {}", g_iItemPriceListTableCacheFlushSeconds);
|
||||
}
|
||||
// END_OF_MYSHOP_PRICE_LIST
|
||||
//
|
||||
|
@ -241,7 +228,7 @@ int Start()
|
|||
int iIDStart;
|
||||
if (!CConfig::instance().GetValue("PLAYER_ID_START", &iIDStart))
|
||||
{
|
||||
sys_err("PLAYER_ID_START not configured");
|
||||
SPDLOG_ERROR("PLAYER_ID_START not configured");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -249,7 +236,7 @@ int Start()
|
|||
|
||||
if (CConfig::instance().GetValue("NAME_COLUMN", szBuf, 256))
|
||||
{
|
||||
fprintf(stderr, "%s %s", g_stLocaleNameColumn.c_str(), szBuf);
|
||||
SPDLOG_INFO("{} {}", g_stLocaleNameColumn, szBuf);
|
||||
g_stLocaleNameColumn = szBuf;
|
||||
}
|
||||
|
||||
|
@ -260,7 +247,7 @@ int Start()
|
|||
if (CConfig::instance().GetValue("SQL_PLAYER", line, 256))
|
||||
{
|
||||
sscanf(line, " %s %s %s %s %d ", szAddr, szDB, szUser, szPassword, &iPort);
|
||||
sys_log(0, "connecting to MySQL server (player)");
|
||||
SPDLOG_DEBUG("Connecting to MySQL server (player)");
|
||||
|
||||
int iRetry = 5;
|
||||
|
||||
|
@ -268,27 +255,25 @@ int Start()
|
|||
{
|
||||
if (CDBManager::instance().Connect(SQL_PLAYER, szAddr, iPort, szDB, szUser, szPassword))
|
||||
{
|
||||
sys_log(0, " OK");
|
||||
SPDLOG_INFO("Connected to MySQL server (player)");
|
||||
break;
|
||||
}
|
||||
|
||||
sys_log(0, " failed, retrying in 5 seconds");
|
||||
fprintf(stderr, " failed, retrying in 5 seconds");
|
||||
SPDLOG_ERROR("Connection to MySQL server (player) failed, retrying in 5 seconds");
|
||||
sleep(5);
|
||||
} while (iRetry--);
|
||||
fprintf(stderr, "Success PLAYER\n");
|
||||
SetPlayerDBName(szDB);
|
||||
}
|
||||
else
|
||||
{
|
||||
sys_err("SQL_PLAYER not configured");
|
||||
SPDLOG_ERROR("SQL_PLAYER not configured");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (CConfig::instance().GetValue("SQL_ACCOUNT", line, 256))
|
||||
{
|
||||
sscanf(line, " %s %s %s %s %d ", szAddr, szDB, szUser, szPassword, &iPort);
|
||||
sys_log(0, "connecting to MySQL server (account)");
|
||||
SPDLOG_DEBUG("connecting to MySQL server (account)");
|
||||
|
||||
int iRetry = 5;
|
||||
|
||||
|
@ -296,26 +281,26 @@ int Start()
|
|||
{
|
||||
if (CDBManager::instance().Connect(SQL_ACCOUNT, szAddr, iPort, szDB, szUser, szPassword))
|
||||
{
|
||||
sys_log(0, " OK");
|
||||
SPDLOG_DEBUG(" OK");
|
||||
break;
|
||||
}
|
||||
|
||||
sys_log(0, " failed, retrying in 5 seconds");
|
||||
fprintf(stderr, " failed, retrying in 5 seconds");
|
||||
SPDLOG_DEBUG(" failed, retrying in 5 seconds");
|
||||
SPDLOG_ERROR(" failed, retrying in 5 seconds");
|
||||
sleep(5);
|
||||
} while (iRetry--);
|
||||
fprintf(stderr, "Success ACCOUNT\n");
|
||||
SPDLOG_INFO("Success ACCOUNT");
|
||||
}
|
||||
else
|
||||
{
|
||||
sys_err("SQL_ACCOUNT not configured");
|
||||
SPDLOG_ERROR("SQL_ACCOUNT not configured");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (CConfig::instance().GetValue("SQL_COMMON", line, 256))
|
||||
{
|
||||
sscanf(line, " %s %s %s %s %d ", szAddr, szDB, szUser, szPassword, &iPort);
|
||||
sys_log(0, "connecting to MySQL server (common)");
|
||||
SPDLOG_DEBUG("connecting to MySQL server (common)");
|
||||
|
||||
int iRetry = 5;
|
||||
|
||||
|
@ -323,26 +308,26 @@ int Start()
|
|||
{
|
||||
if (CDBManager::instance().Connect(SQL_COMMON, szAddr, iPort, szDB, szUser, szPassword))
|
||||
{
|
||||
sys_log(0, " OK");
|
||||
SPDLOG_DEBUG(" OK");
|
||||
break;
|
||||
}
|
||||
|
||||
sys_log(0, " failed, retrying in 5 seconds");
|
||||
fprintf(stderr, " failed, retrying in 5 seconds");
|
||||
SPDLOG_DEBUG(" failed, retrying in 5 seconds");
|
||||
SPDLOG_ERROR(" failed, retrying in 5 seconds");
|
||||
sleep(5);
|
||||
} while (iRetry--);
|
||||
fprintf(stderr, "Success COMMON\n");
|
||||
SPDLOG_INFO("Success COMMON");
|
||||
}
|
||||
else
|
||||
{
|
||||
sys_err("SQL_COMMON not configured");
|
||||
SPDLOG_ERROR("SQL_COMMON not configured");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (CConfig::instance().GetValue("SQL_HOTBACKUP", line, 256))
|
||||
{
|
||||
sscanf(line, " %s %s %s %s %d ", szAddr, szDB, szUser, szPassword, &iPort);
|
||||
sys_log(0, "connecting to MySQL server (hotbackup)");
|
||||
SPDLOG_DEBUG("connecting to MySQL server (hotbackup)");
|
||||
|
||||
int iRetry = 5;
|
||||
|
||||
|
@ -350,37 +335,35 @@ int Start()
|
|||
{
|
||||
if (CDBManager::instance().Connect(SQL_HOTBACKUP, szAddr, iPort, szDB, szUser, szPassword))
|
||||
{
|
||||
sys_log(0, " OK");
|
||||
SPDLOG_DEBUG(" OK");
|
||||
break;
|
||||
}
|
||||
|
||||
sys_log(0, " failed, retrying in 5 seconds");
|
||||
fprintf(stderr, " failed, retrying in 5 seconds");
|
||||
SPDLOG_DEBUG(" failed, retrying in 5 seconds");
|
||||
SPDLOG_ERROR(" failed, retrying in 5 seconds");
|
||||
sleep(5);
|
||||
}
|
||||
while (iRetry--);
|
||||
|
||||
fprintf(stderr, "Success HOTBACKUP\n");
|
||||
SPDLOG_INFO("Success HOTBACKUP");
|
||||
}
|
||||
else
|
||||
{
|
||||
sys_err("SQL_HOTBACKUP not configured");
|
||||
SPDLOG_ERROR("SQL_HOTBACKUP not configured");
|
||||
return false;
|
||||
}
|
||||
|
||||
sys_log(0, "ClientManager initialization.. ");
|
||||
|
||||
if (!CClientManager::instance().Initialize())
|
||||
{
|
||||
sys_log(0, " failed");
|
||||
SPDLOG_ERROR("ClientManager initialization failed");
|
||||
return false;
|
||||
}
|
||||
|
||||
sys_log(0, " OK");
|
||||
SPDLOG_INFO("ClientManager initialization OK");
|
||||
|
||||
if (!PlayerHB::instance().Initialize())
|
||||
{
|
||||
sys_err("cannot initialize player hotbackup");
|
||||
SPDLOG_ERROR("cannot initialize player hotbackup");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -44,7 +44,7 @@ namespace marriage
|
|||
unique_ptr<SQLMsg> pmsg(CDBManager::instance().DirectQuery(szQuery));
|
||||
|
||||
SQLResult * pRes = pmsg->Get();
|
||||
sys_log(0, "MarriageList(size=%lu)", pRes->uiNumRows);
|
||||
SPDLOG_DEBUG("MarriageList(size={})", pRes->uiNumRows);
|
||||
|
||||
if (pRes->uiNumRows > 0)
|
||||
{
|
||||
|
@ -65,7 +65,7 @@ namespace marriage
|
|||
m_MarriageByPID.insert(make_pair(pid1, pMarriage));
|
||||
m_MarriageByPID.insert(make_pair(pid2, pMarriage));
|
||||
|
||||
sys_log(0, "Marriage %lu: LP:%d TM:%u ST:%d %10lu:%16s %10lu:%16s ", uiRow, love_point, time, is_married, pid1, name1, pid2, name2);
|
||||
SPDLOG_DEBUG("Marriage {}: LP:{} TM:{} ST:{} {:10}:{:16} {:10}:{:16} ", uiRow, love_point, time, is_married, pid1, name1, pid2, name2);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
|
@ -92,7 +92,7 @@ namespace marriage
|
|||
DWORD now = CClientManager::instance().GetCurrentTime();
|
||||
if (IsMarried(dwPID1) || IsMarried(dwPID2))
|
||||
{
|
||||
sys_err("cannot marry already married character. %d - %d", dwPID1, dwPID2);
|
||||
SPDLOG_ERROR("cannot marry already married character. {} - {}", dwPID1, dwPID2);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -106,11 +106,11 @@ namespace marriage
|
|||
SQLResult* res = pmsg->Get();
|
||||
if (res->uiAffectedRows == 0 || res->uiAffectedRows == (uint32_t)-1)
|
||||
{
|
||||
sys_err("cannot insert marriage");
|
||||
SPDLOG_ERROR("cannot insert marriage");
|
||||
return;
|
||||
}
|
||||
|
||||
sys_log(0, "MARRIAGE ADD %u %u", dwPID1, dwPID2);
|
||||
SPDLOG_DEBUG("MARRIAGE ADD {} {}", dwPID1, dwPID2);
|
||||
|
||||
TMarriage* pMarriage = new TMarriage(dwPID1, dwPID2, 0, now, 0, szName1, szName2);
|
||||
m_Marriages.insert(pMarriage);
|
||||
|
@ -131,7 +131,7 @@ namespace marriage
|
|||
TMarriage* pMarriage = Get(dwPID1);
|
||||
if (!pMarriage || pMarriage->GetOther(dwPID1) != dwPID2)
|
||||
{
|
||||
sys_err("not under marriage : %u %u", dwPID1, dwPID2);
|
||||
SPDLOG_ERROR("not under marriage : {} {}", dwPID1, dwPID2);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -146,11 +146,11 @@ namespace marriage
|
|||
SQLResult* res = pmsg->Get();
|
||||
if (res->uiAffectedRows == 0 || res->uiAffectedRows == (uint32_t)-1)
|
||||
{
|
||||
sys_err("cannot update marriage : PID:%u %u", dwPID1, dwPID2);
|
||||
SPDLOG_ERROR("cannot update marriage : PID:{} {}", dwPID1, dwPID2);
|
||||
return;
|
||||
}
|
||||
|
||||
sys_log(0, "MARRIAGE UPDATE PID:%u %u LP:%u ST:%d", dwPID1, dwPID2, iLovePoint, byMarried);
|
||||
SPDLOG_DEBUG("MARRIAGE UPDATE PID:{} {} LP:{} ST:{}", dwPID1, dwPID2, iLovePoint, byMarried);
|
||||
pMarriage->love_point = iLovePoint;
|
||||
pMarriage->is_married = byMarried;
|
||||
|
||||
|
@ -168,7 +168,7 @@ namespace marriage
|
|||
|
||||
if (pMarriage)
|
||||
{
|
||||
sys_log(0, "Break Marriage pid1 %d pid2 %d Other %d", dwPID1, dwPID2, pMarriage->GetOther(dwPID1));
|
||||
SPDLOG_DEBUG("Break Marriage pid1 {} pid2 {} Other {}", dwPID1, dwPID2, pMarriage->GetOther(dwPID1));
|
||||
}
|
||||
if (!pMarriage || pMarriage->GetOther(dwPID1) != dwPID2)
|
||||
{
|
||||
|
@ -176,9 +176,9 @@ namespace marriage
|
|||
|
||||
for (; it != m_MarriageByPID.end(); ++it)
|
||||
{
|
||||
sys_log(0, "Marriage List pid1 %d pid2 %d", it->second->pid1, it->second->pid2);
|
||||
SPDLOG_DEBUG("Marriage List pid1 {} pid2 {}", it->second->pid1, it->second->pid2);
|
||||
}
|
||||
sys_err("not under marriage : PID:%u %u", dwPID1, dwPID2);
|
||||
SPDLOG_ERROR("not under marriage : PID:{} {}", dwPID1, dwPID2);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -192,11 +192,11 @@ namespace marriage
|
|||
SQLResult* res = pmsg->Get();
|
||||
if (res->uiAffectedRows == 0 || res->uiAffectedRows == (uint32_t)-1)
|
||||
{
|
||||
sys_err("cannot delete marriage : PID:%u %u", dwPID1, dwPID2);
|
||||
SPDLOG_ERROR("cannot delete marriage : PID:{} {}", dwPID1, dwPID2);
|
||||
return;
|
||||
}
|
||||
|
||||
sys_log(0, "MARRIAGE REMOVE PID:%u %u", dwPID1, dwPID2);
|
||||
SPDLOG_DEBUG("MARRIAGE REMOVE PID:{} {}", dwPID1, dwPID2);
|
||||
|
||||
m_Marriages.erase(pMarriage);
|
||||
m_MarriageByPID.erase(dwPID1);
|
||||
|
@ -215,13 +215,13 @@ namespace marriage
|
|||
TMarriage* pMarriage = Get(dwPID1);
|
||||
if (!pMarriage || pMarriage->GetOther(dwPID1) != dwPID2)
|
||||
{
|
||||
sys_err("not under marriage : PID:%u %u", dwPID1, dwPID2);
|
||||
SPDLOG_ERROR("not under marriage : PID:{} {}", dwPID1, dwPID2);
|
||||
return;
|
||||
}
|
||||
|
||||
if (pMarriage->is_married)
|
||||
{
|
||||
sys_err("already married, cannot change engage to marry : PID:%u %u", dwPID1, dwPID2);
|
||||
SPDLOG_ERROR("already married, cannot change engage to marry : PID:{} {}", dwPID1, dwPID2);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -236,11 +236,11 @@ namespace marriage
|
|||
SQLResult* res = pmsg->Get();
|
||||
if (res->uiAffectedRows == 0 || res->uiAffectedRows == (uint32_t)-1)
|
||||
{
|
||||
sys_err("cannot change engage to marriage : PID:%u %u", dwPID1, dwPID2);
|
||||
SPDLOG_ERROR("cannot change engage to marriage : PID:{} {}", dwPID1, dwPID2);
|
||||
return;
|
||||
}
|
||||
|
||||
sys_log(0, "MARRIAGE ENGAGE->MARRIAGE PID:%u %u", dwPID1, dwPID2);
|
||||
SPDLOG_DEBUG("MARRIAGE ENGAGE->MARRIAGE PID:{} {}", dwPID1, dwPID2);
|
||||
pMarriage->is_married = 1;
|
||||
|
||||
TPacketMarriageUpdate p;
|
||||
|
@ -313,7 +313,7 @@ namespace marriage
|
|||
itertype(m_mapRunningWedding) it = m_mapRunningWedding.find(make_pair(dwPID1, dwPID2));
|
||||
if (it == m_mapRunningWedding.end())
|
||||
{
|
||||
sys_err("try to end wedding %u %u", dwPID1, dwPID2);
|
||||
SPDLOG_ERROR("try to end wedding {} {}", dwPID1, dwPID2);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
#include "stdafx.h"
|
||||
|
||||
#include "Monarch.h"
|
||||
#include <common/utils.h>
|
||||
#include "Main.h"
|
||||
|
@ -53,8 +55,7 @@ void CMonarch::ElectMonarch()
|
|||
|
||||
++s[idx];
|
||||
|
||||
if (g_test_server)
|
||||
sys_log (0, "[MONARCH_VOTE] pid(%d) come to vote candidacy pid(%d)", it->second->pid, m_vec_MonarchCandidacy[idx].pid);
|
||||
SPDLOG_TRACE("[MONARCH_VOTE] pid({}) come to vote candidacy pid({})", it->second->pid, m_vec_MonarchCandidacy[idx].pid);
|
||||
}
|
||||
|
||||
delete [] s;
|
||||
|
@ -167,8 +168,7 @@ bool CMonarch::TakeMoney(int Empire, DWORD pid, int64_t Money)
|
|||
|
||||
CDBManager::instance().AsyncQuery(szQuery);
|
||||
|
||||
if (g_test_server)
|
||||
sys_log(0, "[MONARCH] Take money empire(%d) money(%lld)", Empire, m_MonarchInfo.money[Empire]);
|
||||
SPDLOG_TRACE("[MONARCH] Take money empire({}) money({})", Empire, m_MonarchInfo.money[Empire]);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -197,8 +197,7 @@ bool CMonarch::LoadMonarch()
|
|||
str_to_number(p->money[Empire], row[idx++]);
|
||||
strlcpy(p->date[Empire], row[idx++], sizeof(p->date[Empire]));
|
||||
|
||||
if (g_test_server)
|
||||
sys_log(0, "[LOAD_MONARCH] Empire %d pid %d money %lld windate %s", Empire, p->pid[Empire], p->money[Empire], p->date[Empire]);
|
||||
SPDLOG_TRACE("[LOAD_MONARCH] Empire {} pid {} money {} windate {}", Empire, p->pid[Empire], p->money[Empire], p->date[Empire]);
|
||||
}
|
||||
|
||||
delete pMsg;
|
||||
|
@ -230,8 +229,7 @@ bool CMonarch::SetMonarch(const char * name)
|
|||
strlcpy(p->name[Empire], row[idx++], sizeof(p->name[Empire]));
|
||||
p->money[Empire] = atoll(row[idx++]);
|
||||
|
||||
if (g_test_server)
|
||||
sys_log(0, "[Set_MONARCH] Empire %d pid %d money %lld windate %s", Empire, p->pid[Empire], p->money[Empire], p->date[Empire]);
|
||||
SPDLOG_TRACE("[Set_MONARCH] Empire {} pid {} money {} windate {}", Empire, p->pid[Empire], p->money[Empire], p->date[Empire]);
|
||||
}
|
||||
delete pMsg;
|
||||
|
||||
|
@ -278,7 +276,7 @@ bool CMonarch::DelMonarch(const char * name)
|
|||
|
||||
if (pMsg->Get()->uiNumRows == 0)
|
||||
{
|
||||
sys_err(" DirectQuery failed(%s)", szQuery);
|
||||
SPDLOG_ERROR(" DirectQuery failed({})", szQuery);
|
||||
delete pMsg;
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -29,15 +29,15 @@ void CPeer::OnAccept()
|
|||
static DWORD current_handle = 0;
|
||||
m_dwHandle = ++current_handle;
|
||||
|
||||
sys_log(0, "Connection accepted. (host: %s handle: %u)", m_host, m_dwHandle);
|
||||
SPDLOG_DEBUG("Connection accepted. (host: {} handle: {})", m_host, m_dwHandle);
|
||||
}
|
||||
|
||||
void CPeer::OnClose()
|
||||
{
|
||||
m_state = STATE_CLOSE;
|
||||
|
||||
sys_log(0, "Connection closed. (host: %s)", m_host);
|
||||
sys_log(0, "ItemIDRange: returned. %u ~ %u", m_itemRange.dwMin, m_itemRange.dwMax);
|
||||
SPDLOG_DEBUG("Connection closed. (host: {})", m_host);
|
||||
SPDLOG_DEBUG("ItemIDRange: returned. {} ~ {}", m_itemRange.dwMin, m_itemRange.dwMax);
|
||||
|
||||
CItemIDRangeManager::instance().UpdateRange(m_itemRange.dwMin, m_itemRange.dwMax);
|
||||
|
||||
|
@ -69,7 +69,7 @@ bool CPeer::PeekPacket(int & iBytesProceed, BYTE & header, DWORD & dwHandle, DWO
|
|||
|
||||
const char * buf = (const char *) GetRecvBuffer(iBytesProceed + 9);
|
||||
if (!buf) {
|
||||
sys_err("PeekPacket: Failed to get network buffer!");
|
||||
SPDLOG_ERROR("PeekPacket: Failed to get network buffer!");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -87,7 +87,7 @@ bool CPeer::PeekPacket(int & iBytesProceed, BYTE & header, DWORD & dwHandle, DWO
|
|||
// Ensure that all the data was fully received
|
||||
if (iBytesProceed + dwLength + 9 > (DWORD) GetRecvLength())
|
||||
{
|
||||
sys_log(0, "PeekPacket: not enough buffer size: len %u, recv %d",
|
||||
SPDLOG_DEBUG("PeekPacket: not enough buffer size: len {}, recv {}",
|
||||
9+dwLength, GetRecvLength()-iBytesProceed);
|
||||
return false;
|
||||
}
|
||||
|
@ -95,7 +95,7 @@ bool CPeer::PeekPacket(int & iBytesProceed, BYTE & header, DWORD & dwHandle, DWO
|
|||
// Ensure that all the required data is available in a contiguous area
|
||||
buf = (const char *) GetRecvBuffer(iBytesProceed + dwLength + 9);
|
||||
if (!buf) {
|
||||
sys_err("PeekPacket: Failed to get network buffer!");
|
||||
SPDLOG_ERROR("PeekPacket: Failed to get network buffer!");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -112,7 +112,7 @@ void CPeer::EncodeHeader(BYTE header, DWORD dwHandle, DWORD dwSize)
|
|||
{
|
||||
HEADER h;
|
||||
|
||||
sys_log(1, "EncodeHeader %u handle %u size %u", header, dwHandle, dwSize);
|
||||
SPDLOG_TRACE("EncodeHeader {} handle {} size {}", header, dwHandle, dwSize);
|
||||
|
||||
h.bHeader = header;
|
||||
h.dwHandle = dwHandle;
|
||||
|
@ -149,7 +149,7 @@ void CPeer::SendSpareItemIDRange()
|
|||
|
||||
if (SetSpareItemIDRange(CItemIDRangeManager::instance().GetRange()) == false)
|
||||
{
|
||||
sys_log(0, "ItemIDRange: spare range set error");
|
||||
SPDLOG_DEBUG("ItemIDRange: spare range set error");
|
||||
m_itemSpareRange.dwMin = m_itemSpareRange.dwMax = m_itemSpareRange.dwUsableItemIDMin = 0;
|
||||
}
|
||||
|
||||
|
@ -163,7 +163,7 @@ bool CPeer::SetItemIDRange(TItemIDRangeTable itemRange)
|
|||
if (itemRange.dwMin == 0 || itemRange.dwMax == 0 || itemRange.dwUsableItemIDMin == 0) return false;
|
||||
|
||||
m_itemRange = itemRange;
|
||||
sys_log(0, "ItemIDRange: SET %s %u ~ %u start: %u", GetPublicIP(), m_itemRange.dwMin, m_itemRange.dwMax, m_itemRange.dwUsableItemIDMin);
|
||||
SPDLOG_DEBUG("ItemIDRange: SET {} {} ~ {} start: {}", GetPublicIP(), m_itemRange.dwMin, m_itemRange.dwMax, m_itemRange.dwUsableItemIDMin);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -173,7 +173,7 @@ bool CPeer::SetSpareItemIDRange(TItemIDRangeTable itemRange)
|
|||
if (itemRange.dwMin == 0 || itemRange.dwMax == 0 || itemRange.dwUsableItemIDMin == 0) return false;
|
||||
|
||||
m_itemSpareRange = itemRange;
|
||||
sys_log(0, "ItemIDRange: SPARE SET %s %u ~ %u start: %u", GetPublicIP(), m_itemSpareRange.dwMin, m_itemSpareRange.dwMax,
|
||||
SPDLOG_DEBUG("ItemIDRange: SPARE SET {} {} ~ {} start: {}", GetPublicIP(), m_itemSpareRange.dwMin, m_itemSpareRange.dwMax,
|
||||
m_itemSpareRange.dwUsableItemIDMin);
|
||||
|
||||
return true;
|
||||
|
@ -183,14 +183,14 @@ bool CPeer::CheckItemIDRangeCollision(TItemIDRangeTable itemRange)
|
|||
{
|
||||
if (m_itemRange.dwMin < itemRange.dwMax && m_itemRange.dwMax > itemRange.dwMin)
|
||||
{
|
||||
sys_err("ItemIDRange: Collision!! this %u ~ %u check %u ~ %u",
|
||||
SPDLOG_ERROR("ItemIDRange: Collision!! this {} ~ {} check {} ~ {}",
|
||||
m_itemRange.dwMin, m_itemRange.dwMax, itemRange.dwMin, itemRange.dwMax);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (m_itemSpareRange.dwMin < itemRange.dwMax && m_itemSpareRange.dwMax > itemRange.dwMin)
|
||||
{
|
||||
sys_err("ItemIDRange: Collision with spare range this %u ~ %u check %u ~ %u",
|
||||
SPDLOG_ERROR("ItemIDRange: Collision with spare range this {} ~ {} check {} ~ {}",
|
||||
m_itemSpareRange.dwMin, m_itemSpareRange.dwMax, itemRange.dwMin, itemRange.dwMax);
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -23,12 +23,12 @@ void CPeerBase::Destroy()
|
|||
bool CPeerBase::Accept(bufferevent* bufev, sockaddr* addr)
|
||||
{
|
||||
if (!bufev) {
|
||||
sys_err("Cannot accept empty bufferevent!");
|
||||
SPDLOG_ERROR("Cannot accept empty bufferevent!");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (m_bufferevent != nullptr) {
|
||||
sys_err("Peer is already initialized");
|
||||
SPDLOG_ERROR("Peer is already initialized");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -57,7 +57,7 @@ bool CPeerBase::Accept(bufferevent* bufev, sockaddr* addr)
|
|||
// Trigger the OnAccept event
|
||||
OnAccept();
|
||||
|
||||
sys_log(0, "ACCEPT FROM %s", m_host);
|
||||
SPDLOG_DEBUG("ACCEPT FROM {}", m_host);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -86,12 +86,12 @@ void CPeerBase::Encode(const void* data, size_t size)
|
|||
{
|
||||
if (!m_bufferevent)
|
||||
{
|
||||
sys_err("Bufferevent not ready!");
|
||||
SPDLOG_ERROR("Bufferevent not ready!");
|
||||
return;
|
||||
}
|
||||
|
||||
if (bufferevent_write(m_bufferevent, data, size) != 0) {
|
||||
sys_err("Buffer write error!");
|
||||
SPDLOG_ERROR("Buffer write error!");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -100,7 +100,7 @@ void CPeerBase::RecvEnd(size_t proceed_bytes)
|
|||
{
|
||||
if (!m_bufferevent)
|
||||
{
|
||||
sys_err("Bufferevent not ready!");
|
||||
SPDLOG_ERROR("Bufferevent not ready!");
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -112,7 +112,7 @@ size_t CPeerBase::GetRecvLength()
|
|||
{
|
||||
if (!m_bufferevent)
|
||||
{
|
||||
sys_err("Bufferevent not ready!");
|
||||
SPDLOG_ERROR("Bufferevent not ready!");
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -124,7 +124,7 @@ const void * CPeerBase::GetRecvBuffer(ssize_t ensure_bytes)
|
|||
{
|
||||
if (!m_bufferevent)
|
||||
{
|
||||
sys_err("Bufferevent not ready!");
|
||||
SPDLOG_ERROR("Bufferevent not ready!");
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
@ -136,7 +136,7 @@ size_t CPeerBase::GetSendLength()
|
|||
{
|
||||
if (!m_bufferevent)
|
||||
{
|
||||
sys_err("Bufferevent not ready!");
|
||||
SPDLOG_ERROR("Bufferevent not ready!");
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -84,7 +84,7 @@ void CPrivManager::AddCharPriv(DWORD pid, BYTE type, int value)
|
|||
{
|
||||
if (MAX_PRIV_NUM <= type)
|
||||
{
|
||||
sys_err("PRIV_MANAGER: AddCharPriv: wrong char priv type(%u) recved", type);
|
||||
SPDLOG_ERROR("PRIV_MANAGER: AddCharPriv: wrong char priv type({}) recved", type);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -108,7 +108,7 @@ void CPrivManager::AddCharPriv(DWORD pid, BYTE type, int value)
|
|||
m_aPrivChar[type].insert(std::make_pair(pid, p));
|
||||
|
||||
// TODO send packet
|
||||
sys_log(0, "AddCharPriv %d %d %d", pid, type, value);
|
||||
SPDLOG_DEBUG("AddCharPriv {} {} {}", pid, type, value);
|
||||
SendChangeCharPriv(pid, type, value);
|
||||
}
|
||||
|
||||
|
@ -119,7 +119,7 @@ void CPrivManager::AddGuildPriv(DWORD guild_id, BYTE type, int value, time_t dur
|
|||
{
|
||||
if (MAX_PRIV_NUM <= type)
|
||||
{
|
||||
sys_err("PRIV_MANAGER: AddGuildPriv: wrong guild priv type(%u) recved", type);
|
||||
SPDLOG_ERROR("PRIV_MANAGER: AddGuildPriv: wrong guild priv type({}) recved", type);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -141,14 +141,14 @@ void CPrivManager::AddGuildPriv(DWORD guild_id, BYTE type, int value, time_t dur
|
|||
SendChangeGuildPriv(guild_id, type, value, end);
|
||||
// END_OF_ADD_GUILD_PRIV_TIME
|
||||
|
||||
sys_log(0, "Guild Priv guild(%d) type(%d) value(%d) duration_sec(%d)", guild_id, type, value, duration_sec);
|
||||
SPDLOG_DEBUG("Guild Priv guild({}) type({}) value({}) duration_sec({})", guild_id, type, value, duration_sec);
|
||||
}
|
||||
|
||||
void CPrivManager::AddEmpirePriv(BYTE empire, BYTE type, int value, time_t duration_sec)
|
||||
{
|
||||
if (MAX_PRIV_NUM <= type)
|
||||
{
|
||||
sys_err("PRIV_MANAGER: AddEmpirePriv: wrong empire priv type(%u) recved", type);
|
||||
SPDLOG_ERROR("PRIV_MANAGER: AddEmpirePriv: wrong empire priv type({}) recved", type);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -173,7 +173,7 @@ void CPrivManager::AddEmpirePriv(BYTE empire, BYTE type, int value, time_t durat
|
|||
SendChangeEmpirePriv(empire, type, value, end);
|
||||
// END_OF_ADD_EMPIRE_PRIV_TIME
|
||||
|
||||
sys_log(0, "Empire Priv empire(%d) type(%d) value(%d) duration_sec(%d)", empire, type, value, duration_sec);
|
||||
SPDLOG_DEBUG("Empire Priv empire({}) type({}) value({}) duration_sec({})", empire, type, value, duration_sec);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -206,7 +206,7 @@ int get_Item_SubType_Value(int type_value, string inputString)
|
|||
// assert ¾È ¸ÔÈ÷´Â µí..
|
||||
if (_countof(arSubType) <= type_value)
|
||||
{
|
||||
sys_err("SubType : Out of range!! (type_value: %d, count of registered subtype: %d", type_value, _countof(arSubType));
|
||||
SPDLOG_ERROR("SubType : Out of range!! (type_value: {}, count of registered subtype: {}", type_value, _countof(arSubType));
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
@ -683,7 +683,7 @@ bool Set_Proto_Mob_Table(TMobTable *mobTable, cCsvTable &csvTable,std::map<int,c
|
|||
str_to_number(mobTable->bDeathBlowPoint, csvTable.AsStringByIndex(col++));
|
||||
str_to_number(mobTable->bRevivePoint, csvTable.AsStringByIndex(col++));
|
||||
|
||||
sys_log(0, "MOB #%-5d %-24s level: %-3u rank: %u empire: %d", mobTable->dwVnum, mobTable->szLocaleName, mobTable->bLevel, mobTable->bRank, mobTable->bEmpire);
|
||||
SPDLOG_TRACE("MOB #{:<5} {:24} level: {:<3} rank: {} empire: {}", mobTable->dwVnum, mobTable->szLocaleName, mobTable->bLevel, mobTable->bRank, mobTable->bEmpire);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -739,9 +739,9 @@ bool Set_Proto_Item_Table(TItemTable *itemTable, cCsvTable &csvTable,std::map<in
|
|||
for (int j = 0; j < i; ++j)
|
||||
dataStream << dataArray[j] << ",";
|
||||
|
||||
//fprintf(stderr, "ItemProto Reading Failed : Invalid value.\n");
|
||||
sys_err("ItemProto Reading Failed : Invalid value. (index: %d, col: %d, value: %s)", i, col, csvTable.AsStringByIndex(col));
|
||||
sys_err("\t%d ~ %d Values: %s", 0, i, dataStream.str().c_str());
|
||||
//SPDLOG_ERROR("ItemProto Reading Failed : Invalid value.");
|
||||
SPDLOG_ERROR("ItemProto Reading Failed : Invalid value. (index: {}, col: {}, value: {})", i, col, csvTable.AsStringByIndex(col));
|
||||
SPDLOG_ERROR("\t{} ~ {} Values: {}", 0, i, dataStream.str().c_str());
|
||||
|
||||
exit(0);
|
||||
}
|
||||
|
@ -768,7 +768,7 @@ bool Set_Proto_Item_Table(TItemTable *itemTable, cCsvTable &csvTable,std::map<in
|
|||
int end_vnum = atoi(s_end_vnum.c_str());
|
||||
if (0 == start_vnum || (0 != end_vnum && end_vnum < start_vnum))
|
||||
{
|
||||
sys_err ("INVALID VNUM %s", s.c_str());
|
||||
SPDLOG_ERROR("INVALID VNUM {}", s.c_str());
|
||||
return false;
|
||||
}
|
||||
itemTable->dwVnum = start_vnum;
|
||||
|
|
|
@ -1,15 +1,8 @@
|
|||
#include <fmt/core.h>
|
||||
#include <version.h>
|
||||
|
||||
void WriteVersion(std::ostream& out) {
|
||||
out << "Metin2 DB Cache version " << __COMMIT_TAG__ << " "
|
||||
<< "(rev. " << __REVISION__ << ", date: " << __COMMIT_DATE__ << ")"
|
||||
<< std::endl;
|
||||
|
||||
out << "OS: " << __OS_NAME__ << ", "
|
||||
<< "target arch: " << __CPU_TARGET__ << ", "
|
||||
<< "compiler: " << __COMPILER__
|
||||
<< std::endl;
|
||||
|
||||
out << std::endl;
|
||||
void WriteVersion() {
|
||||
fmt::println("Metin2 DB Cache version {} (rev. {}, date: {})", __COMMIT_TAG__, __REVISION__, __COMMIT_DATE__);
|
||||
fmt::println("OS: {}, target arch: {}, compiler: {}", __OS_NAME__, __CPU_TARGET__, __COMPILER__);
|
||||
}
|
||||
|
||||
|
|
|
@ -8,10 +8,21 @@ file(GLOB_RECURSE sources
|
|||
|
||||
# Add the src directory to the include path
|
||||
include_directories(src)
|
||||
|
||||
add_executable(${PROJECT_NAME} ${sources})
|
||||
|
||||
# Set the default log level based on the build type
|
||||
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
|
||||
message(STATUS "This is a debug build. Log level will be set to 'trace' for target '${PROJECT_NAME}'.")
|
||||
target_compile_definitions(${PROJECT_NAME} PRIVATE SPDLOG_ACTIVE_LEVEL=SPDLOG_LEVEL_TRACE)
|
||||
endif()
|
||||
|
||||
# Find dependencies
|
||||
|
||||
#
|
||||
# vcpkg dependencies
|
||||
#
|
||||
|
||||
# MySQL
|
||||
find_package(unofficial-libmysql REQUIRED)
|
||||
target_link_libraries(${PROJECT_NAME} unofficial::libmysql::libmysql)
|
||||
|
@ -28,11 +39,6 @@ target_link_libraries (${PROJECT_NAME} Boost::boost)
|
|||
find_package(Libevent CONFIG REQUIRED)
|
||||
target_link_libraries(${PROJECT_NAME} libevent::core libevent::extra libevent::pthreads)
|
||||
|
||||
# DevIL
|
||||
find_package(DevIL REQUIRED)
|
||||
include_directories(${IL_INCLUDE_DIR})
|
||||
target_link_libraries(${PROJECT_NAME} ${IL_LIBRARIES})
|
||||
|
||||
# LZO
|
||||
find_package(LZO REQUIRED)
|
||||
if (LZO_FOUND)
|
||||
|
@ -40,6 +46,19 @@ if (LZO_FOUND)
|
|||
target_link_libraries(${PROJECT_NAME} ${LZO_LIBRARIES})
|
||||
endif (LZO_FOUND)
|
||||
|
||||
# effolkronium/random
|
||||
find_package(effolkronium_random CONFIG REQUIRED)
|
||||
target_link_libraries(${PROJECT_NAME} effolkronium_random)
|
||||
|
||||
#
|
||||
# System-provided dependencies
|
||||
#
|
||||
|
||||
# DevIL
|
||||
find_package(DevIL REQUIRED)
|
||||
include_directories(${IL_INCLUDE_DIR})
|
||||
target_link_libraries(${PROJECT_NAME} ${IL_LIBRARIES})
|
||||
|
||||
# Pthreads
|
||||
set(THREADS_PREFER_PTHREAD_FLAG ON)
|
||||
find_package(Threads REQUIRED)
|
||||
|
@ -48,8 +67,8 @@ target_link_libraries(${PROJECT_NAME} Threads::Threads)
|
|||
# LibBSD
|
||||
target_link_libraries(${PROJECT_NAME} bsd)
|
||||
|
||||
# effolkronium/random
|
||||
find_package(effolkronium_random CONFIG REQUIRED)
|
||||
target_link_libraries(${PROJECT_NAME} effolkronium_random)
|
||||
#
|
||||
# Project-provided dependencies
|
||||
#
|
||||
|
||||
target_link_libraries(${PROJECT_NAME} libgame libpoly libsql libthecore liblua)
|
||||
|
|
|
@ -31,7 +31,7 @@ time_t UseBlueDragonSkill(LPCHARACTER pChar, unsigned int idx)
|
|||
{
|
||||
case 0:
|
||||
{
|
||||
sys_log(0, "BlueDragon: Using Skill Breath");
|
||||
SPDLOG_DEBUG("BlueDragon: Using Skill Breath");
|
||||
|
||||
FSkillBreath f(pChar);
|
||||
|
||||
|
@ -43,7 +43,7 @@ time_t UseBlueDragonSkill(LPCHARACTER pChar, unsigned int idx)
|
|||
|
||||
case 1:
|
||||
{
|
||||
sys_log(0, "BlueDragon: Using Skill Weak Breath");
|
||||
SPDLOG_DEBUG("BlueDragon: Using Skill Weak Breath");
|
||||
|
||||
FSkillWeakBreath f(pChar);
|
||||
|
||||
|
@ -55,7 +55,7 @@ time_t UseBlueDragonSkill(LPCHARACTER pChar, unsigned int idx)
|
|||
|
||||
case 2:
|
||||
{
|
||||
sys_log(0, "BlueDragon: Using Skill EarthQuake");
|
||||
SPDLOG_DEBUG("BlueDragon: Using Skill EarthQuake");
|
||||
|
||||
FSkillEarthQuake f(pChar);
|
||||
|
||||
|
@ -71,7 +71,7 @@ time_t UseBlueDragonSkill(LPCHARACTER pChar, unsigned int idx)
|
|||
break;
|
||||
|
||||
default:
|
||||
sys_err("BlueDragon: Wrong Skill Index: %d", idx);
|
||||
SPDLOG_ERROR("BlueDragon: Wrong Skill Index: {}", idx);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -32,7 +32,7 @@ unsigned int BlueDragon_GetSkillFactor(const size_t cnt, ...)
|
|||
{
|
||||
va_end(vl);
|
||||
lua_settop( L, stack_top );
|
||||
sys_err("BlueDragon: wrong key list");
|
||||
SPDLOG_ERROR("BlueDragon: wrong key list");
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -43,7 +43,7 @@ unsigned int BlueDragon_GetSkillFactor(const size_t cnt, ...)
|
|||
{
|
||||
va_end(vl);
|
||||
lua_settop( L, stack_top );
|
||||
sys_err("BlueDragon: wrong key table %s", key);
|
||||
SPDLOG_ERROR("BlueDragon: wrong key table {}", key);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
@ -53,7 +53,7 @@ unsigned int BlueDragon_GetSkillFactor(const size_t cnt, ...)
|
|||
if (false == lua_isnumber(L, -1))
|
||||
{
|
||||
lua_settop( L, stack_top );
|
||||
sys_err("BlueDragon: Last key is not a number");
|
||||
SPDLOG_ERROR("BlueDragon: Last key is not a number");
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -86,7 +86,7 @@ unsigned int BlueDragon_GetRangeFactor(const char* key, const int val)
|
|||
{
|
||||
lua_settop( L, stack_top );
|
||||
|
||||
sys_err("BlueDragon: no required table %s", key);
|
||||
SPDLOG_ERROR("BlueDragon: no required table {}", key);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -100,7 +100,7 @@ unsigned int BlueDragon_GetRangeFactor(const char* key, const int val)
|
|||
{
|
||||
lua_settop( L, stack_top );
|
||||
|
||||
sys_err("BlueDragon: wrong table index %s %d", key, i);
|
||||
SPDLOG_ERROR("BlueDragon: wrong table index {} {}", key, i);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -111,7 +111,7 @@ unsigned int BlueDragon_GetRangeFactor(const char* key, const int val)
|
|||
{
|
||||
lua_settop( L, stack_top );
|
||||
|
||||
sys_err("BlueDragon: no min value set %s", key);
|
||||
SPDLOG_ERROR("BlueDragon: no min value set {}", key);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -126,7 +126,7 @@ unsigned int BlueDragon_GetRangeFactor(const char* key, const int val)
|
|||
{
|
||||
lua_settop( L, stack_top );
|
||||
|
||||
sys_err("BlueDragon: no max value set %s", key);
|
||||
SPDLOG_ERROR("BlueDragon: no max value set {}", key);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -143,7 +143,7 @@ unsigned int BlueDragon_GetRangeFactor(const char* key, const int val)
|
|||
{
|
||||
lua_settop( L, stack_top );
|
||||
|
||||
sys_err("BlueDragon: no pct value set %s", key);
|
||||
SPDLOG_ERROR("BlueDragon: no pct value set {}", key);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -184,7 +184,7 @@ unsigned int BlueDragon_GetIndexFactor(const char* container, const size_t idx,
|
|||
{
|
||||
lua_settop( L, stack_top );
|
||||
|
||||
sys_err("BlueDragon: no required table %s", key);
|
||||
SPDLOG_ERROR("BlueDragon: no required table {}", key);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -194,7 +194,7 @@ unsigned int BlueDragon_GetIndexFactor(const char* container, const size_t idx,
|
|||
{
|
||||
lua_settop( L, stack_top );
|
||||
|
||||
sys_err("BlueDragon: wrong table index %s %d", key, idx);
|
||||
SPDLOG_ERROR("BlueDragon: wrong table index {} {}", key, idx);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -205,7 +205,7 @@ unsigned int BlueDragon_GetIndexFactor(const char* container, const size_t idx,
|
|||
{
|
||||
lua_settop( L, stack_top );
|
||||
|
||||
sys_err("BlueDragon: no min value set %s", key);
|
||||
SPDLOG_ERROR("BlueDragon: no min value set {}", key);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -30,7 +30,7 @@ struct FSkillBreath
|
|||
|
||||
if ((signed)BlueDragon_GetSkillFactor(2, "Skill0", "damage_area") < DISTANCE_APPROX(pAttacker->GetX()-ch->GetX(), pAttacker->GetY()-ch->GetY()))
|
||||
{
|
||||
sys_log(0, "BlueDragon: Breath too far (%d)", DISTANCE_APPROX(pAttacker->GetX()-ch->GetX(), pAttacker->GetY()-ch->GetY()) );
|
||||
SPDLOG_DEBUG("BlueDragon: Breath too far ({})", DISTANCE_APPROX(pAttacker->GetX()-ch->GetX(), pAttacker->GetY()-ch->GetY()) );
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -124,7 +124,7 @@ struct FSkillBreath
|
|||
|
||||
ch->Damage( pAttacker, dam, DAMAGE_TYPE_ICE );
|
||||
|
||||
sys_log(0, "BlueDragon: Breath to %s pct(%d) dam(%d) overlap(%d)", ch->GetName(), pct, dam, overlapDamageCount);
|
||||
SPDLOG_DEBUG("BlueDragon: Breath to {} pct({}) dam({}) overlap({})", ch->GetName(), pct, dam, overlapDamageCount);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -155,7 +155,7 @@ struct FSkillWeakBreath
|
|||
|
||||
if ((signed)BlueDragon_GetSkillFactor(2, "Skill1", "damage_area") < DISTANCE_APPROX(pAttacker->GetX()-ch->GetX(), pAttacker->GetY()-ch->GetY()))
|
||||
{
|
||||
sys_log(0, "BlueDragon: Breath too far (%d)", DISTANCE_APPROX(pAttacker->GetX()-ch->GetX(), pAttacker->GetY()-ch->GetY()) );
|
||||
SPDLOG_DEBUG("BlueDragon: Breath too far ({})", DISTANCE_APPROX(pAttacker->GetX()-ch->GetX(), pAttacker->GetY()-ch->GetY()) );
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -166,7 +166,7 @@ struct FSkillWeakBreath
|
|||
|
||||
ch->Damage( pAttacker, dam, DAMAGE_TYPE_ICE );
|
||||
|
||||
sys_log(0, "BlueDragon: WeakBreath to %s addPct(%d) dam(%d)", ch->GetName(), addPct, dam);
|
||||
SPDLOG_DEBUG("BlueDragon: WeakBreath to {} addPct({}) dam({})", ch->GetName(), addPct, dam);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -209,7 +209,7 @@ struct FSkillEarthQuake
|
|||
|
||||
if ((signed)BlueDragon_GetSkillFactor(2, "Skill2", "damage_area") < DISTANCE_APPROX(pAttacker->GetX()-ch->GetX(), pAttacker->GetY()-ch->GetY()))
|
||||
{
|
||||
sys_log(0, "BlueDragon: Breath too far (%d)", DISTANCE_APPROX(pAttacker->GetX()-ch->GetX(), pAttacker->GetY()-ch->GetY()) );
|
||||
SPDLOG_DEBUG("BlueDragon: Breath too far ({})", DISTANCE_APPROX(pAttacker->GetX()-ch->GetX(), pAttacker->GetY()-ch->GetY()) );
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -274,7 +274,7 @@ struct FSkillEarthQuake
|
|||
|
||||
SkillAttackAffect( ch, 1000, IMMUNE_STUN, AFFECT_STUN, POINT_NONE, 0, AFF_STUN, sec, "BDRAGON_STUN" );
|
||||
|
||||
sys_log(0, "BlueDragon: EarthQuake to %s addPct(%d) dam(%d) sec(%d)", ch->GetName(), addPct, dam, sec);
|
||||
SPDLOG_DEBUG("BlueDragon: EarthQuake to {} addPct({}) dam({}) sec({})", ch->GetName(), addPct, dam, sec);
|
||||
|
||||
|
||||
VECTOR vec;
|
||||
|
|
|
@ -37,7 +37,7 @@ bool CClientPackageCryptInfo::LoadPackageCryptFile( const char* pCryptFile )
|
|||
|
||||
if (0 == iCryptKeySize)
|
||||
{
|
||||
sys_log(0, "[PackageCryptInfo] failed to load crypt key. (file: %s, key size: %d)", pCryptFile, iCryptKeySize);
|
||||
SPDLOG_WARN("[PackageCryptInfo] failed to load crypt key. (file: {}, key size: {})", pCryptFile, iCryptKeySize);
|
||||
m_nCryptKeyPackageCnt -= iPackageCnt;
|
||||
}
|
||||
else
|
||||
|
@ -47,7 +47,7 @@ bool CClientPackageCryptInfo::LoadPackageCryptFile( const char* pCryptFile )
|
|||
|
||||
memcpy( &m_vecPackageCryptKeys[nCurKeySize], &iCryptKeySize, sizeof(int));
|
||||
fread( &m_vecPackageCryptKeys[nCurKeySize + sizeof(int)], sizeof(BYTE), iCryptKeySize, fp );
|
||||
sys_log(0, "[PackageCryptInfo] %s loaded. (key size: %d, count: %d, total: %d)", pCryptFile, iCryptKeySize, iPackageCnt, m_nCryptKeyPackageCnt);
|
||||
SPDLOG_WARN("[PackageCryptInfo] {} loaded. (key size: {}, count: {}, total: {})", pCryptFile, iCryptKeySize, iPackageCnt, m_nCryptKeyPackageCnt);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -81,7 +81,7 @@ bool CClientPackageCryptInfo::LoadPackageCryptFile( const char* pCryptFile )
|
|||
|
||||
fread(&dwSDBFileCnt, sizeof(DWORD), 1, fp);
|
||||
|
||||
sys_log(0, "[PackageCryptInfo] SDB Loaded. (Name Hash : %d, Stream Size: %d, File Count: %d)", dwPackageNameHash,dwPackageStreamSize, dwSDBFileCnt);
|
||||
SPDLOG_INFO("[PackageCryptInfo] SDB Loaded. (Name Hash : {}, Stream Size: {}, File Count: {})", dwPackageNameHash,dwPackageStreamSize, dwSDBFileCnt);
|
||||
|
||||
for( int j = 0; j < (int)dwSDBFileCnt; ++j )
|
||||
{
|
||||
|
@ -91,7 +91,7 @@ bool CClientPackageCryptInfo::LoadPackageCryptFile( const char* pCryptFile )
|
|||
strRelatedMapName.resize( dwMapNameSize );
|
||||
fread(&strRelatedMapName[0], sizeof(BYTE), dwMapNameSize, fp);
|
||||
|
||||
sys_log(0, "[PackageCryptInfo] \t SDB each file info loaded.(MapName: %s, NameHash: %X)", strRelatedMapName.c_str(), dwFileNameHash);
|
||||
SPDLOG_INFO("[PackageCryptInfo] \t SDB each file info loaded.(MapName: {}, NameHash: {})", strRelatedMapName.c_str(), dwFileNameHash);
|
||||
|
||||
BYTE bSDBStreamSize;
|
||||
std::vector<BYTE> vecSDBStream;
|
||||
|
@ -152,16 +152,16 @@ bool CClientPackageCryptInfo::LoadPackageCryptInfo( const char* pCryptInfoDir )
|
|||
//if (strncmp( &(pDirEnt->d_name[0]), szPrefixCryptInfoFile, strlen(szPrefixCryptInfoFile)) )
|
||||
if (std::string::npos == std::string(pDirEnt->d_name).find(szPrefixCryptInfoFile))
|
||||
{
|
||||
sys_log(0, "[PackageCryptInfo] %s is not crypt file. pass!", pDirEnt->d_name);
|
||||
SPDLOG_DEBUG("[PackageCryptInfo] {} is not crypt file. pass!", pDirEnt->d_name);
|
||||
continue;
|
||||
}
|
||||
|
||||
std::string strFullPathName = std::string(pCryptInfoDir) + std::string(pDirEnt->d_name);
|
||||
|
||||
sys_log(0, "[PackageCryptInfo] Try to load crypt file: %s", strFullPathName.c_str());
|
||||
SPDLOG_DEBUG("[PackageCryptInfo] Try to load crypt file: {}", strFullPathName.c_str());
|
||||
|
||||
if (false == LoadPackageCryptFile( strFullPathName.c_str() ))
|
||||
sys_err("[PackageCryptInfo] Failed to load %s", strFullPathName.c_str());
|
||||
SPDLOG_DEBUG("[PackageCryptInfo] Failed to load {}", strFullPathName.c_str());
|
||||
}
|
||||
|
||||
closedir(pDir);
|
||||
|
@ -207,15 +207,13 @@ bool CClientPackageCryptInfo::GetRelatedMapSDBStreams(const char* pMapName, BYTE
|
|||
TPackageSDBMap::iterator it = m_mapPackageSDB.find( strLowerMapName.c_str() );
|
||||
if( it == m_mapPackageSDB.end() || it->second.vecSDBInfos.size() == 0 )
|
||||
{
|
||||
//sys_err("GetRelatedMapSDBStreams Failed(%s)", strLowerMapName.c_str());
|
||||
SPDLOG_ERROR("GetRelatedMapSDBStreams Failed({})", strLowerMapName.c_str());
|
||||
return false;
|
||||
}
|
||||
|
||||
*ppData = it->second.GetSerializedStream();
|
||||
iDataSize = it->second.GetSize();
|
||||
|
||||
//sys_log(0, "GetRelatedMapSDBStreams Size(%d)", iDataSize);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -84,7 +84,7 @@ EVENTFUNC( DragonLair_Collapse_Event )
|
|||
|
||||
if ( pInfo == NULL )
|
||||
{
|
||||
sys_err( "DragonLair_Collapse_Event> <Factor> Null pointer" );
|
||||
SPDLOG_ERROR("DragonLair_Collapse_Event> <Factor> Null pointer" );
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -146,7 +146,7 @@ DWORD CDragonLair::GetEstimatedTime() const
|
|||
|
||||
void CDragonLair::OnDragonDead(LPCHARACTER pDragon)
|
||||
{
|
||||
sys_log(0, "DragonLair: 도라곤이 죽어써효");
|
||||
SPDLOG_DEBUG("DragonLair: 도라곤이 죽어써효");
|
||||
|
||||
LogManager::instance().DragonSlayLog( GuildID_, pDragon->GetMobTable().dwVnum, StartTime_, get_global_time() );
|
||||
}
|
||||
|
@ -174,7 +174,7 @@ bool CDragonLairManager::Start(int MapIndexFrom, int BaseMapIndex, DWORD GuildID
|
|||
{
|
||||
int instanceMapIndex = SECTREE_MANAGER::instance().CreatePrivateMap(BaseMapIndex);
|
||||
if (instanceMapIndex == 0) {
|
||||
sys_err("CDragonLairManager::Start() : no private map index available");
|
||||
SPDLOG_ERROR("CDragonLairManager::Start() : no private map index available");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -203,8 +203,6 @@ bool CDragonLairManager::Start(int MapIndexFrom, int BaseMapIndex, DWORD GuildID
|
|||
|
||||
strMapBasePath += "/" + pRegionInfo->strMapName + "/instance_regen.txt";
|
||||
|
||||
sys_log(0, "%s", strMapBasePath.c_str());
|
||||
|
||||
regen_do(strMapBasePath.c_str(), instanceMapIndex, pTargetMap->m_setting.iBaseX, pTargetMap->m_setting.iBaseY, NULL, true);
|
||||
|
||||
return true;
|
||||
|
|
|
@ -147,7 +147,7 @@ bool DSManager::RefreshItemAttributes(LPITEM pDS)
|
|||
{
|
||||
if (!pDS->IsDragonSoul())
|
||||
{
|
||||
sys_err ("This item(ID : %d) is not DragonSoul.", pDS->GetID());
|
||||
SPDLOG_ERROR("This item(ID : {}) is not DragonSoul.", pDS->GetID());
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -159,13 +159,13 @@ bool DSManager::RefreshItemAttributes(LPITEM pDS)
|
|||
|
||||
if (!m_pTable->GetBasicApplys(ds_type, vec_basic_applys))
|
||||
{
|
||||
sys_err ("There is no BasicApply about %d type dragon soul.", ds_type);
|
||||
SPDLOG_ERROR("There is no BasicApply about {} type dragon soul.", ds_type);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!m_pTable->GetAdditionalApplys(ds_type, vec_addtional_applys))
|
||||
{
|
||||
sys_err ("There is no AdditionalApply about %d type dragon soul.", ds_type);
|
||||
SPDLOG_ERROR("There is no AdditionalApply about {} type dragon soul.", ds_type);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -173,7 +173,7 @@ bool DSManager::RefreshItemAttributes(LPITEM pDS)
|
|||
int basic_apply_num, add_min, add_max;
|
||||
if (!m_pTable->GetApplyNumSettings(ds_type, grade_idx, basic_apply_num, add_min, add_max))
|
||||
{
|
||||
sys_err ("In ApplyNumSettings, INVALID VALUES Group type(%d), GRADE idx(%d)", ds_type, grade_idx);
|
||||
SPDLOG_ERROR("In ApplyNumSettings, INVALID VALUES Group type({}), GRADE idx({})", ds_type, grade_idx);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -217,7 +217,7 @@ bool DSManager::PutAttributes(LPITEM pDS)
|
|||
{
|
||||
if (!pDS->IsDragonSoul())
|
||||
{
|
||||
sys_err ("This item(ID : %d) is not DragonSoul.", pDS->GetID());
|
||||
SPDLOG_ERROR("This item(ID : {}) is not DragonSoul.", pDS->GetID());
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -229,12 +229,12 @@ bool DSManager::PutAttributes(LPITEM pDS)
|
|||
|
||||
if (!m_pTable->GetBasicApplys(ds_type, vec_basic_applys))
|
||||
{
|
||||
sys_err ("There is no BasicApply about %d type dragon soul.", ds_type);
|
||||
SPDLOG_ERROR("There is no BasicApply about {} type dragon soul.", ds_type);
|
||||
return false;
|
||||
}
|
||||
if (!m_pTable->GetAdditionalApplys(ds_type, vec_addtional_applys))
|
||||
{
|
||||
sys_err ("There is no AdditionalApply about %d type dragon soul.", ds_type);
|
||||
SPDLOG_ERROR("There is no AdditionalApply about {} type dragon soul.", ds_type);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -242,7 +242,7 @@ bool DSManager::PutAttributes(LPITEM pDS)
|
|||
int basic_apply_num, add_min, add_max;
|
||||
if (!m_pTable->GetApplyNumSettings(ds_type, grade_idx, basic_apply_num, add_min, add_max))
|
||||
{
|
||||
sys_err ("In ApplyNumSettings, INVALID VALUES Group type(%d), GRADE idx(%d)", ds_type, grade_idx);
|
||||
SPDLOG_ERROR("In ApplyNumSettings, INVALID VALUES Group type({}), GRADE idx({})", ds_type, grade_idx);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -276,7 +276,7 @@ bool DSManager::PutAttributes(LPITEM pDS)
|
|||
}
|
||||
if (!MakeDistinctRandomNumberSet(list_probs, random_set))
|
||||
{
|
||||
sys_err ("MakeDistinctRandomNumberSet error.");
|
||||
SPDLOG_ERROR("MakeDistinctRandomNumberSet error.");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -350,7 +350,7 @@ bool DSManager::ExtractDragonHeart(LPCHARACTER ch, LPITEM pItem, LPITEM pExtract
|
|||
float sum = 0.f;
|
||||
if (-1 == idx)
|
||||
{
|
||||
sys_err ("Gamble is failed. ds_type(%d), grade_idx(%d)", ds_type, grade_idx);
|
||||
SPDLOG_ERROR("Gamble is failed. ds_type({}), grade_idx({})", ds_type, grade_idx);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -375,8 +375,8 @@ bool DSManager::ExtractDragonHeart(LPCHARACTER ch, LPITEM pItem, LPITEM pExtract
|
|||
|
||||
if (NULL == pDH)
|
||||
{
|
||||
sys_err ("Cannot create DRAGON_HEART(%d).", DRAGON_HEART_VNUM);
|
||||
return NULL;
|
||||
SPDLOG_ERROR("Cannot create DRAGON_HEART({}).", (int) DRAGON_HEART_VNUM);
|
||||
return false;
|
||||
}
|
||||
|
||||
pItem->SetCount(pItem->GetCount() - 1);
|
||||
|
@ -402,7 +402,7 @@ bool DSManager::PullOut(LPCHARACTER ch, TItemPos DestCell, LPITEM& pItem, LPITEM
|
|||
{
|
||||
if (NULL == ch || NULL == pItem)
|
||||
{
|
||||
sys_err ("NULL POINTER. ch(%p) or pItem(%p)", ch, pItem);
|
||||
SPDLOG_ERROR("NULL POINTER. ch({}) or pItem({})", (void*) ch, (void*) pItem);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -514,7 +514,7 @@ bool DSManager::DoRefineGrade(LPCHARACTER ch, TItemPos (&aItemPoses)[DRAGON_SOUL
|
|||
|
||||
if (!ch->DragonSoul_RefineWindow_CanRefine())
|
||||
{
|
||||
sys_err ("%s do not activate DragonSoulRefineWindow. But how can he come here?", ch->GetName());
|
||||
SPDLOG_ERROR("{} do not activate DragonSoulRefineWindow. But how can he come here?", ch->GetName());
|
||||
ch->ChatPacket(CHAT_TYPE_INFO, "[SYSTEM ERROR]You cannot upgrade dragon soul without refine window.");
|
||||
return false;
|
||||
}
|
||||
|
@ -595,7 +595,7 @@ bool DSManager::DoRefineGrade(LPCHARACTER ch, TItemPos (&aItemPoses)[DRAGON_SOUL
|
|||
// 클라에서 한번 갯수 체크를 하기 때문에 count != need_count라면 invalid 클라일 가능성이 크다.
|
||||
if (count != need_count)
|
||||
{
|
||||
sys_err ("Possiblity of invalid client. Name %s", ch->GetName());
|
||||
SPDLOG_ERROR("Possiblity of invalid client. Name {}", ch->GetName());
|
||||
BYTE bSubHeader = count < need_count? DS_SUB_HEADER_REFINE_FAIL_NOT_ENOUGH_MATERIAL : DS_SUB_HEADER_REFINE_FAIL_TOO_MUCH_MATERIAL;
|
||||
SendRefineResultPacket(ch, bSubHeader, NPOS);
|
||||
return false;
|
||||
|
@ -610,7 +610,7 @@ bool DSManager::DoRefineGrade(LPCHARACTER ch, TItemPos (&aItemPoses)[DRAGON_SOUL
|
|||
|
||||
if (-1 == (result_grade = Gamble(vec_probs)))
|
||||
{
|
||||
sys_err ("Gamble failed. See RefineGardeTables' probabilities");
|
||||
SPDLOG_ERROR("Gamble failed. See RefineGardeTables' probabilities");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -618,7 +618,7 @@ bool DSManager::DoRefineGrade(LPCHARACTER ch, TItemPos (&aItemPoses)[DRAGON_SOUL
|
|||
|
||||
if (NULL == pResultItem)
|
||||
{
|
||||
sys_err ("INVALID DRAGON SOUL(%d)", MakeDragonSoulVnum(ds_type, (BYTE)result_grade, 0, 0));
|
||||
SPDLOG_ERROR("INVALID DRAGON SOUL({})", MakeDragonSoulVnum(ds_type, (BYTE)result_grade, 0, 0));
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -674,7 +674,7 @@ bool DSManager::DoRefineStep(LPCHARACTER ch, TItemPos (&aItemPoses)[DRAGON_SOUL_
|
|||
|
||||
if (!ch->DragonSoul_RefineWindow_CanRefine())
|
||||
{
|
||||
sys_err ("%s do not activate DragonSoulRefineWindow. But how can he come here?", ch->GetName());
|
||||
SPDLOG_ERROR("{} do not activate DragonSoulRefineWindow. But how can he come here?", ch->GetName());
|
||||
ch->ChatPacket(CHAT_TYPE_INFO, "[SYSTEM ERROR]You cannot use dragon soul refine window.");
|
||||
return false;
|
||||
}
|
||||
|
@ -747,7 +747,7 @@ bool DSManager::DoRefineStep(LPCHARACTER ch, TItemPos (&aItemPoses)[DRAGON_SOUL_
|
|||
// 클라에서 한번 갯수 체크를 하기 때문에 count != need_count라면 invalid 클라일 가능성이 크다.
|
||||
if (count != need_count)
|
||||
{
|
||||
sys_err ("Possiblity of invalid client. Name %s", ch->GetName());
|
||||
SPDLOG_ERROR("Possiblity of invalid client. Name {}", ch->GetName());
|
||||
BYTE bSubHeader = count < need_count? DS_SUB_HEADER_REFINE_FAIL_NOT_ENOUGH_MATERIAL : DS_SUB_HEADER_REFINE_FAIL_TOO_MUCH_MATERIAL;
|
||||
SendRefineResultPacket(ch, bSubHeader, NPOS);
|
||||
return false;
|
||||
|
@ -764,7 +764,7 @@ bool DSManager::DoRefineStep(LPCHARACTER ch, TItemPos (&aItemPoses)[DRAGON_SOUL_
|
|||
|
||||
if (-1 == (result_step = Gamble(vec_probs)))
|
||||
{
|
||||
sys_err ("Gamble failed. See RefineStepTables' probabilities");
|
||||
SPDLOG_ERROR("Gamble failed. See RefineStepTables' probabilities");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -772,7 +772,7 @@ bool DSManager::DoRefineStep(LPCHARACTER ch, TItemPos (&aItemPoses)[DRAGON_SOUL_
|
|||
|
||||
if (NULL == pResultItem)
|
||||
{
|
||||
sys_err ("INVALID DRAGON SOUL(%d)", MakeDragonSoulVnum(ds_type, grade_idx, (BYTE)result_step, 0));
|
||||
SPDLOG_ERROR("INVALID DRAGON SOUL({})", MakeDragonSoulVnum(ds_type, grade_idx, (BYTE)result_step, 0));
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -835,7 +835,7 @@ bool DSManager::DoRefineStrength(LPCHARACTER ch, TItemPos (&aItemPoses)[DRAGON_S
|
|||
|
||||
if (!ch->DragonSoul_RefineWindow_CanRefine())
|
||||
{
|
||||
sys_err ("%s do not activate DragonSoulRefineWindow. But how can he come here?", ch->GetName());
|
||||
SPDLOG_ERROR("{} do not activate DragonSoulRefineWindow. But how can he come here?", ch->GetName());
|
||||
ch->ChatPacket(CHAT_TYPE_INFO, "[SYSTEM ERROR]You cannot use dragon soul refine window.");
|
||||
return false;
|
||||
}
|
||||
|
@ -953,7 +953,7 @@ bool DSManager::DoRefineStrength(LPCHARACTER ch, TItemPos (&aItemPoses)[DRAGON_S
|
|||
pResult = ITEM_MANAGER::instance().CreateItem(MakeDragonSoulVnum(bType, bGrade, bStep, bStrength + 1));
|
||||
if (NULL == pResult)
|
||||
{
|
||||
sys_err ("INVALID DRAGON SOUL(%d)", MakeDragonSoulVnum(bType, bGrade, bStep, bStrength + 1));
|
||||
SPDLOG_ERROR("INVALID DRAGON SOUL({})", MakeDragonSoulVnum(bType, bGrade, bStep, bStrength + 1));
|
||||
return false;
|
||||
}
|
||||
pDragonSoul->RemoveFromCharacter();
|
||||
|
@ -978,7 +978,7 @@ bool DSManager::DoRefineStrength(LPCHARACTER ch, TItemPos (&aItemPoses)[DRAGON_S
|
|||
pResult = ITEM_MANAGER::instance().CreateItem(MakeDragonSoulVnum(bType, bGrade, bStep, bStrength - 1));
|
||||
if (NULL == pResult)
|
||||
{
|
||||
sys_err ("INVALID DRAGON SOUL(%d)", MakeDragonSoulVnum(bType, bGrade, bStep, bStrength - 1));
|
||||
SPDLOG_ERROR("INVALID DRAGON SOUL({})", MakeDragonSoulVnum(bType, bGrade, bStep, bStrength - 1));
|
||||
return false;
|
||||
}
|
||||
pDragonSoul->CopyAttributeTo(pResult);
|
||||
|
|
|
@ -14,7 +14,7 @@ static Pixel * LoadOldGuildMarkImageFile()
|
|||
|
||||
if (!fp)
|
||||
{
|
||||
sys_err("cannot open %s", OLD_MARK_INDEX_FILENAME);
|
||||
SPDLOG_ERROR("cannot open {}", OLD_MARK_INDEX_FILENAME);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
@ -69,7 +69,7 @@ bool GuildMarkConvert(const std::vector<DWORD> & vecGuildID)
|
|||
pkImage->PutData(0, 0, 512, 512, oldImagePtr);
|
||||
pkImage->Save("guild_mark_real.tga");
|
||||
*/
|
||||
sys_log(0, "Guild Mark Converting Start.");
|
||||
SPDLOG_INFO("Guild Mark Converting Start.");
|
||||
|
||||
char line[256];
|
||||
DWORD guild_id;
|
||||
|
@ -82,7 +82,7 @@ bool GuildMarkConvert(const std::vector<DWORD> & vecGuildID)
|
|||
|
||||
if (find(vecGuildID.begin(), vecGuildID.end(), guild_id) == vecGuildID.end())
|
||||
{
|
||||
sys_log(0, " skipping guild ID %u", guild_id);
|
||||
SPDLOG_INFO(" skipping guild ID {}", guild_id);
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -92,7 +92,7 @@ bool GuildMarkConvert(const std::vector<DWORD> & vecGuildID)
|
|||
|
||||
if (row >= 42)
|
||||
{
|
||||
sys_err("invalid mark_id %u", mark_id);
|
||||
SPDLOG_ERROR("invalid mark_id {}", mark_id);
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -128,7 +128,7 @@ bool GuildMarkConvert(const std::vector<DWORD> & vecGuildID)
|
|||
system("move /Y guild_mark.tga guild_mark.tga.removable");
|
||||
#endif
|
||||
|
||||
sys_log(0, "Guild Mark Converting Complete.");
|
||||
SPDLOG_INFO("Guild Mark Converting Complete.");
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -56,7 +56,7 @@ bool CGuildMarkImage::Save(const char* c_szFileName)
|
|||
|
||||
bool CGuildMarkImage::Build(const char * c_szFileName)
|
||||
{
|
||||
sys_log(0, "GuildMarkImage: creating new file %s", c_szFileName);
|
||||
SPDLOG_INFO("GuildMarkImage: creating new file {}", c_szFileName);
|
||||
|
||||
Destroy();
|
||||
Create();
|
||||
|
@ -70,7 +70,7 @@ bool CGuildMarkImage::Build(const char * c_szFileName)
|
|||
|
||||
if (!ilTexImage(WIDTH, HEIGHT, 1, 4, IL_BGRA, IL_UNSIGNED_BYTE, data))
|
||||
{
|
||||
sys_err("GuildMarkImage: cannot initialize image");
|
||||
SPDLOG_ERROR("GuildMarkImage: cannot initialize image");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -95,19 +95,19 @@ bool CGuildMarkImage::Load(const char * c_szFileName)
|
|||
|
||||
if (!ilLoad(IL_TYPE_UNKNOWN, (const ILstring) c_szFileName))
|
||||
{
|
||||
sys_err("GuildMarkImage: %s cannot open file.", c_szFileName);
|
||||
SPDLOG_ERROR("GuildMarkImage: {} cannot open file.", c_szFileName);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (ilGetInteger(IL_IMAGE_WIDTH) != WIDTH)
|
||||
{
|
||||
sys_err("GuildMarkImage: %s width must be %u", c_szFileName, WIDTH);
|
||||
SPDLOG_ERROR("GuildMarkImage: {} width must be {}", c_szFileName, (int) WIDTH);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (ilGetInteger(IL_IMAGE_HEIGHT) != HEIGHT)
|
||||
{
|
||||
sys_err("GuildMarkImage: %s height must be %u", c_szFileName, HEIGHT);
|
||||
SPDLOG_ERROR("GuildMarkImage: {} height must be {}", c_szFileName, (int) HEIGHT);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -139,7 +139,7 @@ bool CGuildMarkImage::SaveMark(DWORD posMark, BYTE * pbImage)
|
|||
{
|
||||
if (posMark >= MARK_TOTAL_COUNT)
|
||||
{
|
||||
sys_err("GuildMarkImage::CopyMarkFromData: Invalid mark position %u", posMark);
|
||||
SPDLOG_ERROR("GuildMarkImage::CopyMarkFromData: Invalid mark position {}", posMark);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -178,13 +178,13 @@ bool CGuildMarkImage::SaveBlockFromCompressedData(DWORD posBlock, const BYTE * p
|
|||
|
||||
if (LZO_E_OK != lzo1x_decompress_safe(pbComp, dwCompSize, (BYTE *) apxBuf, &sizeBuf, CLZO::Instance().GetWorkMemory()))
|
||||
{
|
||||
sys_err("GuildMarkImage::CopyBlockFromCompressedData: cannot decompress, compressed size = %u", dwCompSize);
|
||||
SPDLOG_ERROR("GuildMarkImage::CopyBlockFromCompressedData: cannot decompress, compressed size = {}", dwCompSize);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (sizeBuf != sizeof(apxBuf))
|
||||
{
|
||||
sys_err("GuildMarkImage::CopyBlockFromCompressedData: image corrupted, decompressed size = %u", sizeBuf);
|
||||
SPDLOG_ERROR("GuildMarkImage::CopyBlockFromCompressedData: image corrupted, decompressed size = {}", sizeBuf);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -200,7 +200,7 @@ bool CGuildMarkImage::SaveBlockFromCompressedData(DWORD posBlock, const BYTE * p
|
|||
void CGuildMarkImage::BuildAllBlocks() // À̹ÌÁö Àüü¸¦ ºí·°È
|
||||
{
|
||||
Pixel apxBuf[SGuildMarkBlock::SIZE];
|
||||
sys_log(0, "GuildMarkImage::BuildAllBlocks");
|
||||
SPDLOG_INFO("GuildMarkImage::BuildAllBlocks");
|
||||
|
||||
for (UINT row = 0; row < BLOCK_ROW_COUNT; ++row)
|
||||
for (UINT col = 0; col < BLOCK_COL_COUNT; ++col)
|
||||
|
@ -290,10 +290,9 @@ void SGuildMarkBlock::Compress(const Pixel * pxBuf)
|
|||
|
||||
if (LZO_E_OK != lzo1x_1_compress((const BYTE *) pxBuf, sizeof(Pixel) * SGuildMarkBlock::SIZE, m_abCompBuf, &m_sizeCompBuf, CLZO::Instance().GetWorkMemory()))
|
||||
{
|
||||
sys_err("SGuildMarkBlock::Compress: Error! %u > %u", sizeof(Pixel) * SGuildMarkBlock::SIZE, m_sizeCompBuf);
|
||||
SPDLOG_ERROR("SGuildMarkBlock::Compress: Error! {} > {}", sizeof(Pixel) * SGuildMarkBlock::SIZE, m_sizeCompBuf);
|
||||
return;
|
||||
}
|
||||
|
||||
//sys_log(0, "SGuildMarkBlock::Compress %u > %u", sizeof(Pixel) * SGuildMarkBlock::SIZE, m_sizeCompBuf);
|
||||
m_crc = GetCRC32((const char *) pxBuf, sizeof(Pixel) * SGuildMarkBlock::SIZE);
|
||||
}
|
||||
|
|
|
@ -80,7 +80,7 @@ bool CGuildMarkManager::SaveMarkIndex()
|
|||
|
||||
if (!fp)
|
||||
{
|
||||
sys_err("MarkManager::SaveMarkIndex: cannot open index file.");
|
||||
SPDLOG_ERROR("MarkManager::SaveMarkIndex: cannot open index file.");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -88,7 +88,7 @@ bool CGuildMarkManager::SaveMarkIndex()
|
|||
fprintf(fp, "%u %u\n", it->first, it->second);
|
||||
|
||||
fclose(fp);
|
||||
sys_log(0, "MarkManager::SaveMarkIndex: index count %d", m_mapGID_MarkID.size());
|
||||
SPDLOG_INFO("MarkManager::SaveMarkIndex: index count {}", m_mapGID_MarkID.size());
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -116,7 +116,7 @@ void CGuildMarkManager::SaveMarkImage(DWORD imgIdx)
|
|||
|
||||
if (GetMarkImageFilename(imgIdx, path))
|
||||
if (!__GetImage(imgIdx)->Save(path.c_str()))
|
||||
sys_err("%s Save failed\n", path.c_str());
|
||||
SPDLOG_ERROR("{} Save failed", path.c_str());
|
||||
}
|
||||
|
||||
CGuildMarkImage * CGuildMarkManager::__GetImage(DWORD imgIdx)
|
||||
|
@ -152,7 +152,6 @@ bool CGuildMarkManager::AddMarkIDByGuildID(DWORD guildID, DWORD markID)
|
|||
if (markID >= MAX_IMAGE_COUNT * CGuildMarkImage::MARK_TOTAL_COUNT)
|
||||
return false;
|
||||
|
||||
//sys_log(0, "MarkManager: guild_id=%d mark_id=%d", guildID, markID);
|
||||
m_mapGID_MarkID.insert(std::map<DWORD, DWORD>::value_type(guildID, markID));
|
||||
m_setFreeMarkID.erase(markID);
|
||||
return true;
|
||||
|
@ -217,14 +216,14 @@ DWORD CGuildMarkManager::SaveMark(DWORD guildID, BYTE * pbMarkImage)
|
|||
{
|
||||
if ((idMark = __AllocMarkID(guildID)) == INVALID_MARK_ID)
|
||||
{
|
||||
sys_err("CGuildMarkManager: cannot alloc mark id %u", guildID);
|
||||
SPDLOG_ERROR("CGuildMarkManager: cannot alloc mark id {}", guildID);
|
||||
return false;
|
||||
}
|
||||
else
|
||||
sys_log(0, "SaveMark: mark id alloc %u", idMark);
|
||||
SPDLOG_INFO("SaveMark: mark id alloc {}", idMark);
|
||||
}
|
||||
else
|
||||
sys_log(0, "SaveMark: mark id found %u", idMark);
|
||||
SPDLOG_INFO("SaveMark: mark id found {}", idMark);
|
||||
|
||||
DWORD imgIdx = (idMark / CGuildMarkImage::MARK_TOTAL_COUNT);
|
||||
CGuildMarkImage * pkImage = __GetImage(imgIdx);
|
||||
|
@ -267,7 +266,7 @@ void CGuildMarkManager::GetDiffBlocks(DWORD imgIdx, const DWORD * crcList, std::
|
|||
// 클라이언트에서 서버에 없는 이미지를 요청할 수는 없다.
|
||||
if (m_mapIdx_Image.end() == m_mapIdx_Image.find(imgIdx))
|
||||
{
|
||||
sys_err("invalid idx %u", imgIdx);
|
||||
SPDLOG_ERROR("invalid idx {}", imgIdx);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -294,7 +293,7 @@ bool CGuildMarkManager::GetBlockCRCList(DWORD imgIdx, DWORD * crcList)
|
|||
// 클라이언트에서 서버에 없는 이미지를 요청할 수는 없다.
|
||||
if (m_mapIdx_Image.end() == m_mapIdx_Image.find(imgIdx))
|
||||
{
|
||||
sys_err("invalid idx %u", imgIdx);
|
||||
SPDLOG_ERROR("invalid idx {}", imgIdx);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -354,7 +353,7 @@ void CGuildMarkManager::SaveSymbol(const char* filename)
|
|||
FILE* fp = fopen(filename, "wb");
|
||||
if (!fp)
|
||||
{
|
||||
sys_err("Cannot open Symbol file (name: %s)", filename);
|
||||
SPDLOG_ERROR("Cannot open Symbol file (name: {})", filename);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -375,7 +374,7 @@ void CGuildMarkManager::SaveSymbol(const char* filename)
|
|||
|
||||
void CGuildMarkManager::UploadSymbol(DWORD guildID, int iSize, const BYTE* pbyData)
|
||||
{
|
||||
sys_log(0, "GuildSymbolUpload guildID %u Size %d", guildID, iSize);
|
||||
SPDLOG_INFO("GuildSymbolUpload guildID {} Size {}", guildID, iSize);
|
||||
|
||||
if (m_mapSymbol.find(guildID) == m_mapSymbol.end())
|
||||
m_mapSymbol.insert(std::make_pair(guildID, TGuildSymbol()));
|
||||
|
|
|
@ -90,7 +90,7 @@ bool COXEventManager::Enter(LPCHARACTER pkChar)
|
|||
{
|
||||
if (GetStatus() == OXEVENT_FINISH)
|
||||
{
|
||||
sys_log(0, "OXEVENT : map finished. but char enter. %s", pkChar->GetName());
|
||||
SPDLOG_WARN("OXEVENT : map finished. but char enter. {}", pkChar->GetName());
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -106,7 +106,7 @@ bool COXEventManager::Enter(LPCHARACTER pkChar)
|
|||
}
|
||||
else
|
||||
{
|
||||
sys_log(0, "OXEVENT : wrong pos enter %d %d", pos.x, pos.y);
|
||||
SPDLOG_ERROR("OXEVENT : wrong pos enter {} {}", pos.x, pos.y);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -190,7 +190,7 @@ EVENTFUNC(oxevent_timer)
|
|||
|
||||
if ( info == NULL )
|
||||
{
|
||||
sys_err( "oxevent_timer> <Factor> Null pointer" );
|
||||
SPDLOG_ERROR("oxevent_timer> <Factor> Null pointer" );
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -30,7 +30,7 @@ EVENTFUNC(petsystem_update_event)
|
|||
petsystem_event_info* info = dynamic_cast<petsystem_event_info*>( event->info );
|
||||
if ( info == NULL )
|
||||
{
|
||||
sys_err( "check_speedhack_event> <Factor> Null pointer" );
|
||||
SPDLOG_ERROR("check_speedhack_event> <Factor> Null pointer" );
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -166,7 +166,7 @@ DWORD CPetActor::Summon(const char* petName, LPITEM pSummonItem, bool bSpawnFar)
|
|||
|
||||
if (0 == m_pkChar)
|
||||
{
|
||||
sys_err("[CPetSystem::Summon] Failed to summon the pet. (vnum: %d)", m_dwVnum);
|
||||
SPDLOG_ERROR("[CPetSystem::Summon] Failed to summon the pet. (vnum: {})", m_dwVnum);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -223,7 +223,7 @@ bool CPetActor::_UpdateFollowAI()
|
|||
{
|
||||
if (0 == m_pkChar->m_pkMobData)
|
||||
{
|
||||
//sys_err("[CPetActor::_UpdateFollowAI] m_pkChar->m_pkMobData is NULL");
|
||||
SPDLOG_ERROR("[CPetActor::_UpdateFollowAI] m_pkChar->m_pkMobData is NULL");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -480,14 +480,14 @@ void CPetSystem::DeletePet(DWORD mobVnum)
|
|||
|
||||
if (m_petActorMap.end() == iter)
|
||||
{
|
||||
sys_err("[CPetSystem::DeletePet] Can't find pet on my list (VNUM: %d)", mobVnum);
|
||||
SPDLOG_ERROR("[CPetSystem::DeletePet] Can't find pet on my list (VNUM: {})", mobVnum);
|
||||
return;
|
||||
}
|
||||
|
||||
CPetActor* petActor = iter->second;
|
||||
|
||||
if (0 == petActor)
|
||||
sys_err("[CPetSystem::DeletePet] Null Pointer (petActor)");
|
||||
SPDLOG_ERROR("[CPetSystem::DeletePet] Null Pointer (petActor)");
|
||||
else
|
||||
delete petActor;
|
||||
|
||||
|
@ -508,7 +508,7 @@ void CPetSystem::DeletePet(CPetActor* petActor)
|
|||
}
|
||||
}
|
||||
|
||||
sys_err("[CPetSystem::DeletePet] Can't find petActor(0x%x) on my list(size: %d) ", petActor, m_petActorMap.size());
|
||||
SPDLOG_ERROR("[CPetSystem::DeletePet] Can't find petActor({}) on my list(size: {}) ", (void*) petActor, m_petActorMap.size());
|
||||
}
|
||||
|
||||
void CPetSystem::Unsummon(DWORD vnum, bool bDeleteFromList)
|
||||
|
@ -517,7 +517,7 @@ void CPetSystem::Unsummon(DWORD vnum, bool bDeleteFromList)
|
|||
|
||||
if (0 == actor)
|
||||
{
|
||||
sys_err("[CPetSystem::GetByVnum(%d)] Null Pointer (petActor)", vnum);
|
||||
SPDLOG_ERROR("[CPetSystem::GetByVnum({})] Null Pointer (petActor)", vnum);
|
||||
return;
|
||||
}
|
||||
actor->Unsummon();
|
||||
|
@ -576,7 +576,7 @@ CPetActor* CPetSystem::GetByVID(DWORD vid) const
|
|||
|
||||
if (0 == petActor)
|
||||
{
|
||||
sys_err("[CPetSystem::GetByVID(%d)] Null Pointer (petActor)", vid);
|
||||
SPDLOG_ERROR("[CPetSystem::GetByVID({})] Null Pointer (petActor)", vid);
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
|
@ -26,10 +26,10 @@ bool CSpeedServerManager::Initialize()
|
|||
{
|
||||
for (int i = 1; i < EMPIRE_MAX_NUM; i++)
|
||||
{
|
||||
sys_log (0,"speed manager init");
|
||||
SPDLOG_DEBUG("speed manager init");
|
||||
if(!Empire[i].Initialize (i))
|
||||
{
|
||||
sys_err ("EMPIRE %d Exp Bonus Manager Init fail",i);
|
||||
SPDLOG_ERROR("EMPIRE {} Exp Bonus Manager Init fail",i);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -39,7 +39,7 @@ bool CSpeedServerManager::Initialize()
|
|||
bool CSpeedServerEmpireExp::Initialize (BYTE e)
|
||||
{
|
||||
empire = e;
|
||||
sys_log (0, "empire exp init %d", empire);
|
||||
SPDLOG_DEBUG("empire exp init {}", empire);
|
||||
snprintf (file_name, sizeof(file_name), "%s/exp_bonus_table_%d.txt", LocaleService_GetBasePath().c_str(), empire);
|
||||
|
||||
for (int i = 1; i < 6; i++)
|
||||
|
@ -66,7 +66,7 @@ bool CSpeedServerEmpireExp::LoadWdayExpTable(int wday, char *str)
|
|||
char *t;
|
||||
char *h, *m, *e;
|
||||
int hour, min, exp;
|
||||
sys_log (0, "str %s", str);
|
||||
SPDLOG_DEBUG("str {}", str);
|
||||
strtok (str, delim);
|
||||
p = strtok (NULL, ";");
|
||||
n = strtok (NULL, ";");
|
||||
|
@ -78,11 +78,11 @@ bool CSpeedServerEmpireExp::LoadWdayExpTable(int wday, char *str)
|
|||
m = strtok (NULL, delim);
|
||||
if (!str_to_number (hour, h) || !str_to_number (min, m) || !str_to_number (exp, e))
|
||||
{
|
||||
sys_log (0, "h m e : %s %s %s",h, m, e);
|
||||
sys_err ("Invalid argument. Please insert hh:mm exp");
|
||||
SPDLOG_DEBUG("h m e : {} {} {}",h, m, e);
|
||||
SPDLOG_ERROR("Invalid argument. Please insert hh:mm exp");
|
||||
return false;
|
||||
}
|
||||
sys_log (0, "h m e : %s %s %s",h, m, e);
|
||||
SPDLOG_DEBUG("h m e : {} {} {}",h, m, e);
|
||||
|
||||
lst.push_back (HME (hour, min, exp));
|
||||
p = strtok (n, ";");
|
||||
|
@ -100,7 +100,7 @@ bool CSpeedServerEmpireExp::WriteExpTable()
|
|||
{
|
||||
FILE *fp;
|
||||
|
||||
sys_log (0, "write");
|
||||
SPDLOG_DEBUG("write");
|
||||
if (0==file_name || 0==file_name[0])
|
||||
return false;
|
||||
|
||||
|
@ -140,7 +140,7 @@ bool CSpeedServerEmpireExp::LoadExpTable()
|
|||
char temp[256];
|
||||
const char *delim = " \t\r\n";
|
||||
|
||||
sys_log (0, "load");
|
||||
SPDLOG_DEBUG("load");
|
||||
if (0==file_name || 0==file_name[0])
|
||||
return false;
|
||||
|
||||
|
@ -198,7 +198,7 @@ bool CSpeedServerEmpireExp::LoadExpTable()
|
|||
|
||||
v = strtok (temp, delim);
|
||||
v = strtok (NULL, delim);
|
||||
sys_log (0, "holiday %s", v);
|
||||
SPDLOG_DEBUG("holiday {}", v);
|
||||
|
||||
p = strtok (NULL, ";");
|
||||
n = strtok (NULL, ";");
|
||||
|
@ -210,11 +210,11 @@ bool CSpeedServerEmpireExp::LoadExpTable()
|
|||
m = strtok (NULL, delim);
|
||||
if (!str_to_number (hour, h) || !str_to_number (min, m) || !str_to_number (exp, e))
|
||||
{
|
||||
sys_log (0, "h m e : %s %s %s",h, m, e);
|
||||
sys_err ("Invalid argument. Please insert hh:mm exp");
|
||||
SPDLOG_DEBUG("h m e : {} {} {}",h, m, e);
|
||||
SPDLOG_ERROR("Invalid argument. Please insert hh:mm exp");
|
||||
return false;
|
||||
}
|
||||
sys_log (0, "h m e : %s %s %s",h, m, e);
|
||||
SPDLOG_DEBUG("h m e : {} {} {}",h, m, e);
|
||||
|
||||
lst.push_back (HME (hour, min, exp));
|
||||
p = strtok (n, ";");
|
||||
|
@ -225,11 +225,11 @@ bool CSpeedServerEmpireExp::LoadExpTable()
|
|||
|| !str_to_number ( mon, strtok (NULL, "."))
|
||||
|| !str_to_number ( day, strtok (NULL, ".")))
|
||||
{
|
||||
sys_err ("Invalid Date");
|
||||
SPDLOG_ERROR("Invalid Date");
|
||||
return false;
|
||||
}
|
||||
|
||||
sys_log (0, "y m d %d %d %d",year, mon, day);
|
||||
SPDLOG_DEBUG("y m d {} {} {}",year, mon, day);
|
||||
|
||||
holiday_map.insert (std::pair <Date, std::list <HME> > (Date (year - 1900, mon - 1, day), lst));
|
||||
}
|
||||
|
@ -265,7 +265,7 @@ void CSpeedServerManager::InitWdayExpTableOfEmpire (BYTE empire, int wday)
|
|||
{
|
||||
if (empire > EMPIRE_MAX_NUM)
|
||||
{
|
||||
sys_err ("invalid empire");
|
||||
SPDLOG_ERROR("invalid empire");
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -294,7 +294,7 @@ std::list <HME>& CSpeedServerEmpireExp::GetHolidayExpTable(Date date, bool &is_e
|
|||
else
|
||||
{
|
||||
is_exist = false;
|
||||
sys_err ("Cannot find Holiday %d %d %d",date.year, date.mon, date.day);
|
||||
SPDLOG_ERROR("Cannot find Holiday {} {} {}",date.year, date.mon, date.day);
|
||||
}
|
||||
return it->second;
|
||||
}
|
||||
|
@ -318,7 +318,7 @@ void CSpeedServerManager::InitHolidayExpTableOfEmpire (BYTE empire, Date date)
|
|||
{
|
||||
if (empire > EMPIRE_MAX_NUM)
|
||||
{
|
||||
sys_err ("invalid empire");
|
||||
SPDLOG_ERROR("invalid empire");
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -327,7 +327,7 @@ void CSpeedServerManager::InitHolidayExpTableOfEmpire (BYTE empire, Date date)
|
|||
|
||||
void CSpeedServerEmpireExp::InitHolidayExpTable(Date date)
|
||||
{
|
||||
sys_log (0, "init holiday");
|
||||
SPDLOG_DEBUG("init holiday");
|
||||
std::map <Date, std::list <HME> >::iterator it = holiday_map.find(date);
|
||||
if (it == holiday_map.end())
|
||||
{
|
||||
|
|
|
@ -11,7 +11,6 @@
|
|||
#include "char.h"
|
||||
#include "item.h"
|
||||
#include "ani.h"
|
||||
#include "dev_log.h"
|
||||
|
||||
const char* FN_race_name(int race)
|
||||
{
|
||||
|
@ -141,7 +140,7 @@ bool ANI::load()
|
|||
{
|
||||
if (false == load_one_race(race, dir_name[race]))
|
||||
{
|
||||
sys_err("ANI directory = %s", dir_name[race]);
|
||||
SPDLOG_ERROR("ANI directory = {}", dir_name[race]);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -200,7 +199,7 @@ bool ANI::load_one_race(int race, const char *dir_name)
|
|||
|
||||
for (int weapon = WEAPON_SWORD; weapon < WEAPON_NUM_TYPES; ++weapon)
|
||||
{
|
||||
dev_log(LOG_DEB0, "ANI (%s,%s)", FN_race_name(race), FN_weapon_type(weapon));
|
||||
SPDLOG_TRACE("ANI ({},{})", FN_race_name(race), FN_weapon_type(weapon));
|
||||
|
||||
for (BYTE combo = 1; combo <= 8; ++combo)
|
||||
{
|
||||
|
@ -212,11 +211,11 @@ bool ANI::load_one_race(int race, const char *dir_name)
|
|||
m_speed[race][1][weapon][combo] = load_one_weapon(dir_name, weapon, combo, true);
|
||||
m_speed[race][1][weapon][0] = std::min(m_speed[race][1][weapon][0], m_speed[race][1][weapon][combo]); // ÃÖ¼Ò°ª
|
||||
|
||||
dev_log(LOG_DEB0, "combo%02d speed=%d horse=%d",
|
||||
SPDLOG_TRACE("combo{:02} speed={} horse={}",
|
||||
combo, m_speed[race][0][weapon][combo], m_speed[race][1][weapon][combo]);
|
||||
}
|
||||
|
||||
dev_log(LOG_DEB0, "minspeed=%u", m_speed[race][0][weapon][0]);
|
||||
SPDLOG_TRACE("minspeed={}", m_speed[race][0][weapon][0]);
|
||||
}
|
||||
|
||||
return true;
|
||||
|
@ -331,7 +330,7 @@ DWORD ani_attack_speed(LPCHARACTER ch)
|
|||
int weapon = item->GetSubType();
|
||||
|
||||
/*
|
||||
dev_log(LOG_DEB0, "%s : (race,weapon) = (%s,%s) POINT_ATT_SPEED = %d",
|
||||
SPDLOG_TRACE("{} : (race,weapon) = ({},{}) POINT_ATT_SPEED = {}",
|
||||
ch->GetName(),
|
||||
FN_race_name(race),
|
||||
FN_weapon_type(weapon),
|
||||
|
|
|
@ -67,7 +67,7 @@ bool CArenaManager::AddArena(DWORD mapIdx, WORD startA_X, WORD startA_Y, WORD st
|
|||
|
||||
if (pArenaMap->AddArena(mapIdx, startA_X, startA_Y, startB_X, startB_Y) == false)
|
||||
{
|
||||
sys_log(0, "CArenaManager::AddArena - AddMap Error MapID: %d", mapIdx);
|
||||
SPDLOG_ERROR("CArenaManager::AddArena - AddMap Error MapID: {}", mapIdx);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -80,7 +80,7 @@ bool CArenaMap::AddArena(DWORD mapIdx, WORD startA_X, WORD startA_Y, WORD startB
|
|||
{
|
||||
if (iter->CheckArea(startA_X, startA_Y, startB_X, startB_Y) == false)
|
||||
{
|
||||
sys_log(0, "CArenaMap::AddArena - Same Start Position set. stA(%d, %d) stB(%d, %d)", startA_X, startA_Y, startB_X, startB_Y);
|
||||
SPDLOG_ERROR("CArenaMap::AddArena - Same Start Position set. stA({}, {}) stB({}, {})", startA_X, startA_Y, startB_X, startB_Y);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -111,7 +111,7 @@ void CArenaMap::Destroy()
|
|||
{
|
||||
itertype(m_listArena) iter = m_listArena.begin();
|
||||
|
||||
sys_log(0, "ARENA: ArenaMap will be destroy. mapIndex(%d)", m_dwMapIndex);
|
||||
SPDLOG_DEBUG("ARENA: ArenaMap will be destroy. mapIndex({})", m_dwMapIndex);
|
||||
|
||||
for (; iter != m_listArena.end(); iter++)
|
||||
{
|
||||
|
@ -212,7 +212,7 @@ EVENTFUNC(ready_to_start_event)
|
|||
|
||||
if ( info == NULL )
|
||||
{
|
||||
sys_err( "ready_to_start_event> <Factor> Null pointer" );
|
||||
SPDLOG_ERROR("ready_to_start_event> <Factor> Null pointer" );
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -220,7 +220,7 @@ EVENTFUNC(ready_to_start_event)
|
|||
|
||||
if (pArena == NULL)
|
||||
{
|
||||
sys_err("ARENA: Arena start event info is null.");
|
||||
SPDLOG_ERROR("ARENA: Arena start event info is null.");
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -229,18 +229,18 @@ EVENTFUNC(ready_to_start_event)
|
|||
|
||||
if (chA == NULL || chB == NULL)
|
||||
{
|
||||
sys_err("ARENA: Player err in event func ready_start_event");
|
||||
SPDLOG_ERROR("ARENA: Player err in event func ready_start_event");
|
||||
|
||||
if (chA != NULL)
|
||||
{
|
||||
chA->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("대련 상대가 사라져 대련을 종료합니다."));
|
||||
sys_log(0, "ARENA: Oppernent is disappered. MyPID(%d) OppPID(%d)", pArena->GetPlayerAPID(), pArena->GetPlayerBPID());
|
||||
SPDLOG_DEBUG("ARENA: Oppernent is disappered. MyPID({}) OppPID({})", pArena->GetPlayerAPID(), pArena->GetPlayerBPID());
|
||||
}
|
||||
|
||||
if (chB != NULL)
|
||||
{
|
||||
chB->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("대련 상대가 사라져 대련을 종료합니다."));
|
||||
sys_log(0, "ARENA: Oppernent is disappered. MyPID(%d) OppPID(%d)", pArena->GetPlayerBPID(), pArena->GetPlayerAPID());
|
||||
SPDLOG_DEBUG("ARENA: Oppernent is disappered. MyPID({}) OppPID({})", pArena->GetPlayerBPID(), pArena->GetPlayerAPID());
|
||||
}
|
||||
|
||||
pArena->SendChatPacketToObserver(CHAT_TYPE_NOTICE, LC_TEXT("대련 상대가 사라져 대련을 종료합니다."));
|
||||
|
@ -370,7 +370,7 @@ EVENTFUNC(ready_to_start_event)
|
|||
chB->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("대련장 문제로 인하여 대련을 종료합니다."));
|
||||
pArena->SendChatPacketToObserver(CHAT_TYPE_INFO, LC_TEXT("대련장 문제로 인하여 대련을 종료합니다."));
|
||||
|
||||
sys_log(0, "ARENA: Something wrong in event func. info->state(%d)", info->state);
|
||||
SPDLOG_DEBUG("ARENA: Something wrong in event func. info->state({})", info->state);
|
||||
|
||||
pArena->EndDuel();
|
||||
|
||||
|
@ -388,7 +388,7 @@ EVENTFUNC(duel_time_out)
|
|||
|
||||
if ( info == NULL )
|
||||
{
|
||||
sys_err( "duel_time_out> <Factor> Null pointer" );
|
||||
SPDLOG_ERROR("duel_time_out> <Factor> Null pointer" );
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -396,7 +396,7 @@ EVENTFUNC(duel_time_out)
|
|||
|
||||
if (pArena == NULL)
|
||||
{
|
||||
sys_err("ARENA: Time out event error");
|
||||
SPDLOG_ERROR("ARENA: Time out event error");
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -408,13 +408,13 @@ EVENTFUNC(duel_time_out)
|
|||
if (chA != NULL)
|
||||
{
|
||||
chA->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("대련 상대가 사라져 대련을 종료합니다."));
|
||||
sys_log(0, "ARENA: Oppernent is disappered. MyPID(%d) OppPID(%d)", pArena->GetPlayerAPID(), pArena->GetPlayerBPID());
|
||||
SPDLOG_DEBUG("ARENA: Oppernent is disappered. MyPID({}) OppPID({})", pArena->GetPlayerAPID(), pArena->GetPlayerBPID());
|
||||
}
|
||||
|
||||
if (chB != NULL)
|
||||
{
|
||||
chB->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("대련 상대가 사라져 대련을 종료합니다."));
|
||||
sys_log(0, "ARENA: Oppernent is disappered. MyPID(%d) OppPID(%d)", pArena->GetPlayerBPID(), pArena->GetPlayerAPID());
|
||||
SPDLOG_DEBUG("ARENA: Oppernent is disappered. MyPID({}) OppPID({})", pArena->GetPlayerBPID(), pArena->GetPlayerAPID());
|
||||
}
|
||||
|
||||
pArena->SendChatPacketToObserver(CHAT_TYPE_INFO, LC_TEXT("대련 상대가 사라져 대련을 종료합니다."));
|
||||
|
@ -445,7 +445,7 @@ EVENTFUNC(duel_time_out)
|
|||
|
||||
info->state++;
|
||||
|
||||
sys_log(0, "ARENA: Because of time over, duel is end. PIDA(%d) vs PIDB(%d)", pArena->GetPlayerAPID(), pArena->GetPlayerBPID());
|
||||
SPDLOG_DEBUG("ARENA: Because of time over, duel is end. PIDA({}) vs PIDB({})", pArena->GetPlayerAPID(), pArena->GetPlayerBPID());
|
||||
|
||||
return PASSES_PER_SEC(10);
|
||||
break;
|
||||
|
@ -496,7 +496,7 @@ bool CArena::StartDuel(LPCHARACTER pCharFrom, LPCHARACTER pCharTo, int nSetPoint
|
|||
pCharTo->PointChange(POINT_HP, pCharTo->GetMaxHP() - pCharTo->GetHP());
|
||||
pCharTo->PointChange(POINT_SP, pCharTo->GetMaxSP() - pCharTo->GetSP());
|
||||
|
||||
sys_log(0, "ARENA: Start Duel with PID_A(%d) vs PID_B(%d)", GetPlayerAPID(), GetPlayerBPID());
|
||||
SPDLOG_DEBUG("ARENA: Start Duel with PID_A({}) vs PID_B({})", GetPlayerAPID(), GetPlayerBPID());
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -577,7 +577,7 @@ void CArena::EndDuel()
|
|||
|
||||
m_mapObserver.clear();
|
||||
|
||||
sys_log(0, "ARENA: End Duel PID_A(%d) vs PID_B(%d)", GetPlayerAPID(), GetPlayerBPID());
|
||||
SPDLOG_DEBUG("ARENA: End Duel PID_A({}) vs PID_B({})", GetPlayerAPID(), GetPlayerBPID());
|
||||
|
||||
Clear();
|
||||
}
|
||||
|
@ -756,7 +756,7 @@ bool CArena::OnDead(DWORD dwPIDA, DWORD dwPIDB)
|
|||
pCharB->ChatPacket(CHAT_TYPE_NOTICE, LC_TEXT("%s 님이 대련에서 승리하였습니다."), pCharA->GetName());
|
||||
SendChatPacketToObserver(CHAT_TYPE_NOTICE, LC_TEXT("%s 님이 대련에서 승리하였습니다."), pCharA->GetName());
|
||||
|
||||
sys_log(0, "ARENA: Duel is end. Winner %s(%d) Loser %s(%d)",
|
||||
SPDLOG_DEBUG("ARENA: Duel is end. Winner {}({}) Loser {}({})",
|
||||
pCharA->GetName(), GetPlayerAPID(), pCharB->GetName(), GetPlayerBPID());
|
||||
}
|
||||
else
|
||||
|
@ -770,7 +770,7 @@ bool CArena::OnDead(DWORD dwPIDA, DWORD dwPIDB)
|
|||
|
||||
SendChatPacketToObserver(CHAT_TYPE_NOTICE, "%s %d : %d %s", pCharA->GetName(), m_dwSetPointOfA, m_dwSetPointOfB, pCharB->GetName());
|
||||
|
||||
sys_log(0, "ARENA: %s(%d) won a round vs %s(%d)",
|
||||
SPDLOG_DEBUG("ARENA: {}({}) won a round vs {}({})",
|
||||
pCharA->GetName(), GetPlayerAPID(), pCharB->GetName(), GetPlayerBPID());
|
||||
}
|
||||
}
|
||||
|
@ -783,7 +783,7 @@ bool CArena::OnDead(DWORD dwPIDA, DWORD dwPIDB)
|
|||
pCharB->ChatPacket(CHAT_TYPE_NOTICE, LC_TEXT("%s 님이 대련에서 승리하였습니다."), pCharB->GetName());
|
||||
SendChatPacketToObserver(CHAT_TYPE_NOTICE, LC_TEXT("%s 님이 대련에서 승리하였습니다."), pCharB->GetName());
|
||||
|
||||
sys_log(0, "ARENA: Duel is end. Winner(%d) Loser(%d)", GetPlayerBPID(), GetPlayerAPID());
|
||||
SPDLOG_DEBUG("ARENA: Duel is end. Winner({}) Loser({})", GetPlayerBPID(), GetPlayerAPID());
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -796,13 +796,13 @@ bool CArena::OnDead(DWORD dwPIDA, DWORD dwPIDB)
|
|||
|
||||
SendChatPacketToObserver(CHAT_TYPE_NOTICE, "%s %d : %d %s", pCharA->GetName(), m_dwSetPointOfA, m_dwSetPointOfB, pCharB->GetName());
|
||||
|
||||
sys_log(0, "ARENA : PID(%d) won a round. Opp(%d)", GetPlayerBPID(), GetPlayerAPID());
|
||||
SPDLOG_DEBUG("ARENA : PID({}) won a round. Opp({})", GetPlayerBPID(), GetPlayerAPID());
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// wtf
|
||||
sys_log(0, "ARENA : OnDead Error (%d, %d) (%d, %d)", m_dwPIDA, m_dwPIDB, dwPIDA, dwPIDB);
|
||||
SPDLOG_WARN("ARENA : OnDead Error ({}, {}) ({}, {})", m_dwPIDA, m_dwPIDB, dwPIDA, dwPIDB);
|
||||
}
|
||||
|
||||
int potion = quest::CQuestManager::instance().GetEventFlag("arena_potion_limit_count");
|
||||
|
@ -951,7 +951,7 @@ void CArena::OnDisconnect(DWORD pid)
|
|||
if (GetPlayerB() != NULL)
|
||||
GetPlayerB()->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("상대방 캐릭터가 접속을 종료하여 대련을 중지합니다."));
|
||||
|
||||
sys_log(0, "ARENA : Duel is end because of Opp(%d) is disconnect. MyPID(%d)", GetPlayerAPID(), GetPlayerBPID());
|
||||
SPDLOG_DEBUG("ARENA : Duel is end because of Opp({}) is disconnect. MyPID({})", GetPlayerAPID(), GetPlayerBPID());
|
||||
EndDuel();
|
||||
}
|
||||
else if (m_dwPIDB == pid)
|
||||
|
@ -959,7 +959,7 @@ void CArena::OnDisconnect(DWORD pid)
|
|||
if (GetPlayerA() != NULL)
|
||||
GetPlayerA()->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("상대방 캐릭터가 접속을 종료하여 대련을 중지합니다."));
|
||||
|
||||
sys_log(0, "ARENA : Duel is end because of Opp(%d) is disconnect. MyPID(%d)", GetPlayerBPID(), GetPlayerAPID());
|
||||
SPDLOG_DEBUG("ARENA : Duel is end because of Opp({}) is disconnect. MyPID({})", GetPlayerBPID(), GetPlayerAPID());
|
||||
EndDuel();
|
||||
}
|
||||
}
|
||||
|
@ -1057,7 +1057,7 @@ bool CArenaManager::RegisterObserverPtr(LPCHARACTER pChar, DWORD mapIdx, WORD Ob
|
|||
|
||||
if (iter == m_mapArenaMap.end())
|
||||
{
|
||||
sys_log(0, "ARENA : Cannot find ArenaMap. %d %d %d", mapIdx, ObserverX, ObserverY);
|
||||
SPDLOG_ERROR("ARENA : Cannot find ArenaMap. {} {} {}", mapIdx, ObserverX, ObserverY);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -1089,7 +1089,7 @@ bool CArena::RegisterObserverPtr(LPCHARACTER pChar)
|
|||
|
||||
if (iter == m_mapObserver.end())
|
||||
{
|
||||
sys_log(0, "ARENA : not in ob list");
|
||||
SPDLOG_ERROR("ARENA : not in ob list");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -576,7 +576,7 @@ void AuctionManager::Boot (const char* &data, WORD size)
|
|||
{
|
||||
if (decode_2bytes(data) != sizeof(TPlayerItem))
|
||||
{
|
||||
sys_err("TPlayerItem table size error");
|
||||
SPDLOG_ERROR("TPlayerItem table size error");
|
||||
thecore_shutdown();
|
||||
return;
|
||||
}
|
||||
|
@ -597,7 +597,7 @@ void AuctionManager::Boot (const char* &data, WORD size)
|
|||
}
|
||||
if (decode_2bytes(data) != sizeof(TAuctionItemInfo))
|
||||
{
|
||||
sys_err("TAuctionItemInfo table size error");
|
||||
SPDLOG_ERROR("TAuctionItemInfo table size error");
|
||||
thecore_shutdown();
|
||||
return;
|
||||
}
|
||||
|
@ -617,7 +617,7 @@ void AuctionManager::Boot (const char* &data, WORD size)
|
|||
}
|
||||
if (decode_2bytes(data) != sizeof(TSaleItemInfo))
|
||||
{
|
||||
sys_err("TSaleItemInfo table size error");
|
||||
SPDLOG_ERROR("TSaleItemInfo table size error");
|
||||
thecore_shutdown();
|
||||
return;
|
||||
}
|
||||
|
@ -638,7 +638,7 @@ void AuctionManager::Boot (const char* &data, WORD size)
|
|||
|
||||
if (decode_2bytes(data) != sizeof(TWishItemInfo))
|
||||
{
|
||||
sys_err("TWishItemInfo table size error");
|
||||
SPDLOG_ERROR("TWishItemInfo table size error");
|
||||
thecore_shutdown();
|
||||
return;
|
||||
}
|
||||
|
@ -659,7 +659,7 @@ void AuctionManager::Boot (const char* &data, WORD size)
|
|||
|
||||
if (decode_2bytes(data) != (sizeof(DWORD) + sizeof(DWORD) + sizeof(int)))
|
||||
{
|
||||
sys_err("my_bid table size error");
|
||||
SPDLOG_ERROR("my_bid table size error");
|
||||
thecore_shutdown();
|
||||
return;
|
||||
}
|
||||
|
@ -702,7 +702,7 @@ bool AuctionManager::InsertItem (TPlayerItem* player_item)
|
|||
|
||||
if (!item)
|
||||
{
|
||||
sys_err("cannot create item vnum %d id %u",player_item->vnum, player_item->id);
|
||||
SPDLOG_ERROR("cannot create item vnum {} id {}",player_item->vnum, player_item->id);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -756,7 +756,7 @@ bool AuctionManager::DeleteItem (DWORD item_id)
|
|||
// return false;
|
||||
// if (it->second + changing_amount < 0)
|
||||
// {
|
||||
// sys_err ("Cannot have money under 0.");
|
||||
// SPDLOG_ERROR("Cannot have money under 0.");
|
||||
// return false;
|
||||
// }
|
||||
//
|
||||
|
@ -876,7 +876,7 @@ void AuctionManager::enroll_auction (LPCHARACTER ch, LPITEM item, BYTE empire, i
|
|||
{
|
||||
if (ch != item->GetOwner())
|
||||
{
|
||||
sys_err ("Item %d's owner is %s, not %s",ch->GetName(), item->GetOwner()->GetName());
|
||||
SPDLOG_ERROR("Item {}'s owner is {}, not {}", ch->GetName(), item->GetOwner()->GetName());
|
||||
return;
|
||||
}
|
||||
if (item->IsEquipped())
|
||||
|
@ -887,14 +887,14 @@ void AuctionManager::enroll_auction (LPCHARACTER ch, LPITEM item, BYTE empire, i
|
|||
|
||||
if (GetAuctionItemInfo (item->GetID()))
|
||||
{
|
||||
sys_err ("Item %d is already in auction.", item->GetID());
|
||||
SPDLOG_ERROR("Item {} is already in auction.", item->GetID());
|
||||
ch->ChatPacket(CHAT_TYPE_INFO, "이미 등록한 거야. 도대체 뭐지?");
|
||||
return;
|
||||
}
|
||||
|
||||
if (item->GetWindow() == AUCTION)
|
||||
{
|
||||
sys_err ("Item %d is already in auction.", item->GetID());
|
||||
SPDLOG_ERROR("Item {} is already in auction.", item->GetID());
|
||||
ch->ChatPacket(CHAT_TYPE_INFO, "얜 또 뭐냐..");
|
||||
return;
|
||||
}
|
||||
|
@ -913,7 +913,7 @@ void AuctionManager::enroll_sale (LPCHARACTER ch, LPITEM item, DWORD wisher_id,
|
|||
{
|
||||
if (ch != item->GetOwner())
|
||||
{
|
||||
sys_err ("Item %d's owner is %s, not %s",ch->GetName(), item->GetOwner()->GetName());
|
||||
SPDLOG_ERROR("Item {}'s owner is {}, not {}", ch->GetName(), item->GetOwner()->GetName());
|
||||
return;
|
||||
}
|
||||
if (item->IsEquipped())
|
||||
|
@ -924,14 +924,14 @@ void AuctionManager::enroll_sale (LPCHARACTER ch, LPITEM item, DWORD wisher_id,
|
|||
|
||||
if (GetSaleItemInfo (item->GetID()))
|
||||
{
|
||||
sys_err ("Item %d is already in auction.", item->GetID());
|
||||
SPDLOG_ERROR("Item {} is already in auction.", item->GetID());
|
||||
ch->ChatPacket(CHAT_TYPE_INFO, "이미 등록한 거야. 도대체 뭐지?");
|
||||
return;
|
||||
}
|
||||
|
||||
if (item->GetWindow() == AUCTION)
|
||||
{
|
||||
sys_err ("Item %d is already in auction.", item->GetID());
|
||||
SPDLOG_ERROR("Item {} is already in auction.", item->GetID());
|
||||
ch->ChatPacket(CHAT_TYPE_INFO, "얜 또 뭐냐..");
|
||||
return;
|
||||
}
|
||||
|
@ -982,7 +982,7 @@ void AuctionManager::immediate_purchase (LPCHARACTER ch, DWORD item_id)
|
|||
|
||||
if (item_info == NULL)
|
||||
{
|
||||
sys_err ("Invild item id : %d", item_id);
|
||||
SPDLOG_ERROR("Invild item id : {}", item_id);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -1063,7 +1063,7 @@ void AuctionManager::rebid (LPCHARACTER ch, DWORD item_id, int bid_price)
|
|||
bool lock = mb.second;
|
||||
if (money == -1)
|
||||
{
|
||||
sys_err ("Do bid first. How can you rebid? pid %d, item_id %d",ch->GetPlayerID(), item_id);
|
||||
SPDLOG_ERROR("Do bid first. How can you rebid? pid {}, item_id {}", ch->GetPlayerID(), item_id);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -1095,7 +1095,7 @@ void AuctionManager::bid_cancel (LPCHARACTER ch, DWORD item_id)
|
|||
bool lock = mb.second;
|
||||
if (money == -1)
|
||||
{
|
||||
sys_err ("Do bid first. How can you bid cancel? pid %d, item_id %d",ch->GetPlayerID(), item_id);
|
||||
SPDLOG_ERROR("Do bid first. How can you bid cancel? pid {}, item_id {}",ch->GetPlayerID(), item_id);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -1303,7 +1303,7 @@ void AuctionManager::recv_result_auction (DWORD commander_id, TPacketDGResultAuc
|
|||
|
||||
if (!GetInventoryItem(player_item->id))
|
||||
{
|
||||
sys_err ("AUCTION_CMD %d : invalid item_id %d", cmd, item_id);
|
||||
SPDLOG_ERROR("AUCTION_CMD {} : invalid item_id {}", cmd, item_id);
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -1333,7 +1333,7 @@ void AuctionManager::recv_result_auction (DWORD commander_id, TPacketDGResultAuc
|
|||
{
|
||||
if (!Wish.DeleteItemInfo (commander_id, cmd_result->target))
|
||||
{
|
||||
sys_err ("Cannot cancel wish, invalid player_id : %d, item_num : %d", commander_id, cmd_result->target);
|
||||
SPDLOG_ERROR("Cannot cancel wish, invalid player_id : {}, item_num : {}", commander_id, cmd_result->target);
|
||||
}
|
||||
else if (ch != NULL)
|
||||
{
|
||||
|
|
|
@ -105,19 +105,19 @@ bool battle_is_attackable(LPCHARACTER ch, LPCHARACTER victim)
|
|||
int battle_melee_attack(LPCHARACTER ch, LPCHARACTER victim)
|
||||
{
|
||||
if (test_server&&ch->IsPC())
|
||||
sys_log(0, "battle_melee_attack : [%s] attack to [%s]", ch->GetName(), victim->GetName());
|
||||
SPDLOG_TRACE("battle_melee_attack : [{}] attack to [{}]", ch->GetName(), victim->GetName());
|
||||
|
||||
if (!victim || ch == victim)
|
||||
return BATTLE_NONE;
|
||||
|
||||
if (test_server&&ch->IsPC())
|
||||
sys_log(0, "battle_melee_attack : [%s] attack to [%s]", ch->GetName(), victim->GetName());
|
||||
SPDLOG_TRACE("battle_melee_attack : [{}] attack to [{}]", ch->GetName(), victim->GetName());
|
||||
|
||||
if (!battle_is_attackable(ch, victim))
|
||||
return BATTLE_NONE;
|
||||
|
||||
if (test_server&&ch->IsPC())
|
||||
sys_log(0, "battle_melee_attack : [%s] attack to [%s]", ch->GetName(), victim->GetName());
|
||||
SPDLOG_TRACE("battle_melee_attack : [{}] attack to [{}]", ch->GetName(), victim->GetName());
|
||||
|
||||
// °Å¸® üũ
|
||||
int distance = DISTANCE_APPROX(ch->GetX() - victim->GetX(), ch->GetY() - victim->GetY());
|
||||
|
@ -140,8 +140,7 @@ int battle_melee_attack(LPCHARACTER ch, LPCHARACTER victim)
|
|||
|
||||
if (distance > max)
|
||||
{
|
||||
if (test_server)
|
||||
sys_log(0, "VICTIM_FAR: %s distance: %d max: %d", ch->GetName(), distance, max);
|
||||
SPDLOG_TRACE("VICTIM_FAR: {} distance: {} max: {}", ch->GetName(), distance, max);
|
||||
|
||||
return BATTLE_NONE;
|
||||
}
|
||||
|
@ -367,7 +366,7 @@ void Item_GetDamage(LPITEM pkItem, int* pdamMin, int* pdamMax)
|
|||
}
|
||||
|
||||
if (pkItem->GetType() != ITEM_WEAPON)
|
||||
sys_err("Item_GetDamage - !ITEM_WEAPON vnum=%d, type=%d", pkItem->GetOriginalVnum(), pkItem->GetType());
|
||||
SPDLOG_ERROR("Item_GetDamage - !ITEM_WEAPON vnum={}, type={}", pkItem->GetOriginalVnum(), pkItem->GetType());
|
||||
|
||||
*pdamMin = pkItem->GetValue(3);
|
||||
*pdamMax = pkItem->GetValue(4);
|
||||
|
@ -394,7 +393,7 @@ int CalcMeleeDamage(LPCHARACTER pkAttacker, LPCHARACTER pkVictim, bool bIgnoreDe
|
|||
break;
|
||||
|
||||
case WEAPON_BOW:
|
||||
sys_err("CalcMeleeDamage should not handle bows (name: %s)", pkAttacker->GetName());
|
||||
SPDLOG_ERROR("CalcMeleeDamage should not handle bows (name: {})", pkAttacker->GetName());
|
||||
return 0;
|
||||
|
||||
default:
|
||||
|
@ -677,8 +676,7 @@ int battle_hit(LPCHARACTER pkAttacker, LPCHARACTER pkVictim)
|
|||
iDam = attMul * tempIDam + 0.5f;
|
||||
|
||||
//PROF_UNIT puHit("Hit");
|
||||
if (test_server)
|
||||
sys_log(0, "battle_hit : [%s] attack to [%s] : dam: %d", pkAttacker->GetName(), pkVictim->GetName(), iDam);
|
||||
SPDLOG_TRACE("battle_hit : [{}] attack to [{}] : dam: {}", pkAttacker->GetName(), pkVictim->GetName(), iDam);
|
||||
|
||||
//PROF_UNIT puDam("Dam");
|
||||
if (pkVictim->Damage(pkAttacker, iDam, DAMAGE_TYPE_NORMAL))
|
||||
|
@ -740,7 +738,7 @@ void SET_ATTACKED_TIME(LPCHARACTER ch, LPCHARACTER victim, DWORD current_time)
|
|||
bool IS_SPEED_HACK(LPCHARACTER ch, LPCHARACTER victim, DWORD current_time)
|
||||
{
|
||||
// 2013 09 11 CYH debugging log
|
||||
/*sys_log(0, "%s attack test log! time (delta, limit)=(%u, %u). ch->m_kAttackLog.dwvID(%u) victim->GetVID(%u)",
|
||||
/*SPDLOG_DEBUG("{} attack test log! time (delta, limit)=({}, {}). ch->m_kAttackLog.dwvID({}) victim->GetVID({})",
|
||||
ch->GetName(),
|
||||
current_time - ch->m_kAttackLog.dwTime,
|
||||
GET_ATTACK_SPEED(ch),
|
||||
|
@ -748,7 +746,7 @@ bool IS_SPEED_HACK(LPCHARACTER ch, LPCHARACTER victim, DWORD current_time)
|
|||
victim->GetVID()
|
||||
);
|
||||
|
||||
sys_log(0, "%s attack test log! time (delta, limit)=(%u, %u). victim->m_AttackedLog.dwPID(%u) ch->GetPlayerID(%u)",
|
||||
SPDLOG_DEBUG("{} attack test log! time (delta, limit)=({}, {}). victim->m_AttackedLog.dwPID({}) ch->GetPlayerID({})",
|
||||
ch->GetName(),
|
||||
current_time - victim->m_AttackedLog.dwAttackedTime,
|
||||
GET_ATTACK_SPEED(ch),
|
||||
|
@ -764,7 +762,7 @@ bool IS_SPEED_HACK(LPCHARACTER ch, LPCHARACTER victim, DWORD current_time)
|
|||
|
||||
if (test_server)
|
||||
{
|
||||
sys_log(0, "%s attack hack! time (delta, limit)=(%u, %u) hack_count %d",
|
||||
SPDLOG_TRACE("{} attack hack! time (delta, limit)=({}, {}) hack_count {}",
|
||||
ch->GetName(),
|
||||
current_time - ch->m_kAttackLog.dwTime,
|
||||
GET_ATTACK_SPEED(ch),
|
||||
|
@ -793,7 +791,7 @@ bool IS_SPEED_HACK(LPCHARACTER ch, LPCHARACTER victim, DWORD current_time)
|
|||
|
||||
if (test_server)
|
||||
{
|
||||
sys_log(0, "%s Attack Speed HACK! time (delta, limit)=(%u, %u), hack_count = %d",
|
||||
SPDLOG_TRACE("{} Attack Speed HACK! time (delta, limit)=({}, {}), hack_count = {}",
|
||||
ch->GetName(),
|
||||
current_time - victim->m_AttackedLog.dwAttackedTime,
|
||||
GET_ATTACK_SPEED(ch),
|
||||
|
|
|
@ -27,7 +27,7 @@ public:
|
|||
|
||||
if (level >= _countof(beltGradeByLevelTable))
|
||||
{
|
||||
sys_err("CBeltInventoryHelper::GetBeltGradeByRefineLevel - Overflow level (%d", level);
|
||||
SPDLOG_ERROR("CBeltInventoryHelper::GetBeltGradeByRefineLevel - Overflow level ({})", level);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -10,7 +10,6 @@
|
|||
#include "stdafx.h"
|
||||
#include "constants.h"
|
||||
#include "log.h"
|
||||
#include "dev_log.h"
|
||||
#include "locale_service.h"
|
||||
#include "item.h"
|
||||
#include "blend_item.h"
|
||||
|
@ -37,7 +36,7 @@ bool Blend_Item_init()
|
|||
char file_name[256];
|
||||
snprintf (file_name, sizeof(file_name), "%s/blend.txt", LocaleService_GetBasePath().c_str());
|
||||
|
||||
sys_log(0, "Blend_Item_init %s ", file_name);
|
||||
SPDLOG_INFO("Blend_Item_init {} ", file_name);
|
||||
|
||||
DO_ALL_BLEND_INFO(iter)
|
||||
{
|
||||
|
@ -48,7 +47,7 @@ bool Blend_Item_init()
|
|||
|
||||
if (false==Blend_Item_load(file_name))
|
||||
{
|
||||
sys_err("<Blend_Item_init> fail");
|
||||
SPDLOG_ERROR("<Blend_Item_init> fail");
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
@ -108,7 +107,7 @@ bool Blend_Item_load(char *file)
|
|||
|
||||
if (0 == (blend_item_info->apply_type = FN_get_apply_type(v)))
|
||||
{
|
||||
sys_err ("Invalid apply_type(%s)", v);
|
||||
SPDLOG_ERROR("Invalid apply_type({})", v);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -222,7 +221,7 @@ bool Blend_Item_set_value(LPITEM item)
|
|||
apply_value = blend_info->apply_value [FN_random_index()];
|
||||
apply_duration = blend_info->apply_duration [FN_random_index()];
|
||||
}
|
||||
sys_log (0, "blend_item : type : %d, value : %d, du : %d", apply_type, apply_value, apply_duration);
|
||||
SPDLOG_DEBUG("blend_item : type : {}, value : {}, du : {}", apply_type, apply_value, apply_duration);
|
||||
item->SetSocket(0, apply_type);
|
||||
item->SetSocket(1, apply_value);
|
||||
item->SetSocket(2, apply_duration);
|
||||
|
|
|
@ -10,7 +10,6 @@
|
|||
#include "stdafx.h"
|
||||
#include "constants.h"
|
||||
#include "block_country.h"
|
||||
#include "dev_log.h"
|
||||
|
||||
#define DEC_ITER(iter) std::vector<T_BLOCK_IP*>::iterator iter
|
||||
#define DO_ALL_BLOCKED_IP(iter) for ((iter)=s_blocked_ip.begin(); (iter)!=s_blocked_ip.end(); ++(iter))
|
||||
|
@ -36,7 +35,7 @@ std::set<std::string> s_block_exception;
|
|||
// static functions
|
||||
static void __add_block_exception(const char *login)
|
||||
{
|
||||
dev_log(LOG_DEB0, "BLOCK_EXCEPTION_ADD : %s", login);
|
||||
SPDLOG_TRACE("BLOCK_EXCEPTION_ADD : {}", login);
|
||||
|
||||
DEC_EXCEPTION_ITER(iter);
|
||||
std::string string_login(login);
|
||||
|
@ -52,7 +51,7 @@ dev_log(LOG_DEB0, "BLOCK_EXCEPTION_ADD : %s", login);
|
|||
|
||||
static void __del_block_exception(const char *login)
|
||||
{
|
||||
dev_log(LOG_DEB0, "BLOCK_EXCEPTION_DEL : %s", login);
|
||||
SPDLOG_TRACE("BLOCK_EXCEPTION_DEL : {}", login);
|
||||
|
||||
DEC_EXCEPTION_ITER(iter);
|
||||
std::string string_login(login);
|
||||
|
@ -80,7 +79,7 @@ void add_blocked_country_ip(TPacketBlockCountryIp *data)
|
|||
|
||||
s_blocked_ip.push_back(block_ip);
|
||||
|
||||
dev_log(LOG_DEB0, "BLOCKED_IP = %u - %u", block_ip->ip_from, block_ip->ip_to);
|
||||
SPDLOG_TRACE("BLOCKED_IP = {} - {}", block_ip->ip_from, block_ip->ip_to);
|
||||
}
|
||||
|
||||
|
||||
|
@ -119,7 +118,7 @@ bool is_blocked_country_ip(const char *user_ip)
|
|||
if (INADDR_NONE == in_address)
|
||||
#endif
|
||||
{
|
||||
dev_log(LOG_INFO, "BLOCKED_COUNTRY_IP (%s) : YES", user_ip);
|
||||
SPDLOG_INFO("BLOCKED_COUNTRY_IP ({}) : YES", user_ip);
|
||||
return true; // 아이피가 괴상하니 일단 블럭처리
|
||||
}
|
||||
ip_number = htonl(st_addr.s_addr);
|
||||
|
@ -129,12 +128,12 @@ bool is_blocked_country_ip(const char *user_ip)
|
|||
block_ip = *iter;
|
||||
if ( block_ip->ip_from <= ip_number && ip_number <= block_ip->ip_to )
|
||||
{
|
||||
dev_log(LOG_INFO, "BLOCKED_COUNTRY_IP (%s) : YES", user_ip);
|
||||
SPDLOG_INFO("BLOCKED_COUNTRY_IP ({}) : YES", user_ip);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
dev_log(LOG_INFO, "BLOCKED_COUNTRY_IP (%s) : NO", user_ip);
|
||||
SPDLOG_DEBUG("BLOCKED_COUNTRY_IP ({}) : NO", user_ip);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -51,7 +51,7 @@ void CBuffOnAttributes::RemoveBuffFromItem(LPITEM pItem)
|
|||
}
|
||||
else
|
||||
{
|
||||
sys_err ("Buff ERROR(type %d). This item(%d) attr_type(%d) was not in buff pool", m_bPointType, pItem->GetVnum(), attr.bType);
|
||||
SPDLOG_ERROR("Buff ERROR(type {}). This item({}) attr_type({}) was not in buff pool", m_bPointType, pItem->GetVnum(), attr.bType);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -96,7 +96,7 @@ void CObject::EncodeInsertPacket(LPENTITY entity)
|
|||
if (!(d = entity->GetDesc()))
|
||||
return;
|
||||
|
||||
sys_log(0, "ObjectInsertPacket vid %u vnum %u rot %f %f %f",
|
||||
SPDLOG_DEBUG("ObjectInsertPacket vid {} vnum {} rot {} {} {}",
|
||||
m_dwVID, m_data.dwVnum, m_data.xRot, m_data.yRot, m_data.zRot);
|
||||
|
||||
TPacketGCCharacterAdd pack;
|
||||
|
@ -132,7 +132,7 @@ void CObject::EncodeRemovePacket(LPENTITY entity)
|
|||
if (!(d = entity->GetDesc()))
|
||||
return;
|
||||
|
||||
sys_log(0, "ObjectRemovePacket vid %u", m_dwVID);
|
||||
SPDLOG_DEBUG("ObjectRemovePacket vid {}", m_dwVID);
|
||||
|
||||
TPacketGCCharacterDelete pack;
|
||||
|
||||
|
@ -153,7 +153,7 @@ bool CObject::Show(int lMapIndex, int x, int y)
|
|||
|
||||
if (!tree)
|
||||
{
|
||||
sys_err("cannot find sectree by %dx%d mapindex %d", x, y, lMapIndex);
|
||||
SPDLOG_ERROR("cannot find sectree by {}x{} mapindex {}", x, y, lMapIndex);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -292,7 +292,7 @@ void CObject::RegenNPC()
|
|||
|
||||
if (!m_chNPC)
|
||||
{
|
||||
sys_err("Cannot create guild npc");
|
||||
SPDLOG_ERROR("Cannot create guild npc");
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -461,7 +461,7 @@ void CLand::DeleteObject(DWORD dwID)
|
|||
if (!(pkObj = FindObject(dwID)))
|
||||
return;
|
||||
|
||||
sys_log(0, "Land::DeleteObject %u", dwID);
|
||||
SPDLOG_DEBUG("Land::DeleteObject {}", dwID);
|
||||
CManager::instance().UnregisterObject(pkObj);
|
||||
M2_DESTROY_CHARACTER (pkObj->GetNPC());
|
||||
|
||||
|
@ -506,14 +506,14 @@ bool CLand::RequestCreateObject(DWORD dwVnum, int lMapIndex, int x, int y, float
|
|||
|
||||
if (!pkProto)
|
||||
{
|
||||
sys_err("Invalid Object vnum %u", dwVnum);
|
||||
SPDLOG_ERROR("Invalid Object vnum {}", dwVnum);
|
||||
return false;
|
||||
}
|
||||
const TMapRegion * r = rkSecTreeMgr.GetMapRegion(lMapIndex);
|
||||
if (!r)
|
||||
return false;
|
||||
|
||||
sys_log(0, "RequestCreateObject(vnum=%u, map=%d, pos=(%d,%d), rot=(%.1f,%.1f,%.1f) region(%d,%d ~ %d,%d)",
|
||||
SPDLOG_DEBUG("RequestCreateObject(vnum={}, map={}, pos=({},{}), rot=({:.1f},{:.1f},{:.1f}) region({},{} ~ {},{})",
|
||||
dwVnum, lMapIndex, x, y, xRot, yRot, zRot, r->sx, r->sy, r->ex, r->ey);
|
||||
|
||||
x += r->sx;
|
||||
|
@ -539,7 +539,7 @@ bool CLand::RequestCreateObject(DWORD dwVnum, int lMapIndex, int x, int y, float
|
|||
|
||||
if (tsx < sx || tex > ex || tsy < sy || tey > ey)
|
||||
{
|
||||
sys_err("invalid position: object is outside of land region\nLAND: %d %d ~ %d %d\nOBJ: %d %d ~ %d %d", sx, sy, ex, ey, osx, osy, oex, oey);
|
||||
SPDLOG_ERROR("invalid position: object is outside of land region\nLAND: {} {} ~ {} {}\nOBJ: {} {} ~ {} {}", sx, sy, ex, ey, osx, osy, oex, oey);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -548,7 +548,7 @@ bool CLand::RequestCreateObject(DWORD dwVnum, int lMapIndex, int x, int y, float
|
|||
{
|
||||
if (rkSecTreeMgr.ForAttrRegion(lMapIndex, osx, osy, oex, oey, (int)zRot, ATTR_OBJECT, ATTR_REGION_MODE_CHECK))
|
||||
{
|
||||
sys_err("another object already exist");
|
||||
SPDLOG_ERROR("another object already exist");
|
||||
return false;
|
||||
}
|
||||
FIsIn f (osx, osy, oex, oey);
|
||||
|
@ -556,7 +556,7 @@ bool CLand::RequestCreateObject(DWORD dwVnum, int lMapIndex, int x, int y, float
|
|||
|
||||
if (f.bIn)
|
||||
{
|
||||
sys_err("another object already exist");
|
||||
SPDLOG_ERROR("another object already exist");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -581,12 +581,12 @@ void CLand::RequestDeleteObject(DWORD dwID)
|
|||
{
|
||||
if (!FindObject(dwID))
|
||||
{
|
||||
sys_err("no object by id %u", dwID);
|
||||
SPDLOG_ERROR("no object by id {}", dwID);
|
||||
return;
|
||||
}
|
||||
|
||||
db_clientdesc->DBPacket(HEADER_GD_DELETE_OBJECT, 0, &dwID, sizeof(DWORD));
|
||||
sys_log(0, "RequestDeleteObject id %u", dwID);
|
||||
SPDLOG_DEBUG("RequestDeleteObject id {}", dwID);
|
||||
}
|
||||
|
||||
void CLand::RequestDeleteObjectByVID(DWORD dwVID)
|
||||
|
@ -595,13 +595,13 @@ void CLand::RequestDeleteObjectByVID(DWORD dwVID)
|
|||
|
||||
if (!(pkObj = FindObjectByVID(dwVID)))
|
||||
{
|
||||
sys_err("no object by vid %u", dwVID);
|
||||
SPDLOG_ERROR("no object by vid {}", dwVID);
|
||||
return;
|
||||
}
|
||||
|
||||
DWORD dwID = pkObj->GetID();
|
||||
db_clientdesc->DBPacket(HEADER_GD_DELETE_OBJECT, 0, &dwID, sizeof(DWORD));
|
||||
sys_log(0, "RequestDeleteObject vid %u id %u", dwVID, dwID);
|
||||
SPDLOG_DEBUG("RequestDeleteObject vid {} id {}", dwVID, dwID);
|
||||
}
|
||||
|
||||
void CLand::SetOwner(DWORD dwGuild)
|
||||
|
@ -621,7 +621,7 @@ void CLand::RequestUpdate(DWORD dwGuild)
|
|||
a[1] = dwGuild;
|
||||
|
||||
db_clientdesc->DBPacket(HEADER_GD_UPDATE_LAND, 0, &a[0], sizeof(DWORD) * 2);
|
||||
sys_log(0, "RequestUpdate id %u guild %u", a[0], a[1]);
|
||||
SPDLOG_DEBUG("RequestUpdate id {} guild {}", a[0], a[1]);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -654,7 +654,7 @@ bool CManager::LoadObjectProto(const TObjectProto * pProto, int size) // from DB
|
|||
TObjectProto & r = m_vec_kObjectProto[i];
|
||||
|
||||
// BUILDING_NPC
|
||||
sys_log(0, "ObjectProto %u price %u upgrade %u upg_limit %u life %d NPC %u",
|
||||
SPDLOG_DEBUG("ObjectProto {} price {} upgrade {} upg_limit {} life {} NPC {}",
|
||||
r.dwVnum, r.dwPrice, r.dwUpgradeVnum, r.dwUpgradeLimitTime, r.lLife, r.dwNPCVnum);
|
||||
// END_OF_BUILDING_NPC
|
||||
|
||||
|
@ -665,11 +665,11 @@ bool CManager::LoadObjectProto(const TObjectProto * pProto, int size) // from DB
|
|||
|
||||
if (NULL == ITEM_MANAGER::instance().GetTable(r.kMaterials[j].dwItemVnum))
|
||||
{
|
||||
sys_err(" mat: ERROR!! no item by vnum %u", r.kMaterials[j].dwItemVnum);
|
||||
SPDLOG_ERROR(" mat: ERROR!! no item by vnum {}", r.kMaterials[j].dwItemVnum);
|
||||
return false;
|
||||
}
|
||||
|
||||
sys_log(0, " mat: %u %u", r.kMaterials[j].dwItemVnum, r.kMaterials[j].dwCount);
|
||||
SPDLOG_TRACE(" mat: {} {}", r.kMaterials[j].dwItemVnum, r.kMaterials[j].dwCount);
|
||||
}
|
||||
|
||||
m_map_pkObjectProto.insert(std::make_pair(r.dwVnum, &m_vec_kObjectProto[i]));
|
||||
|
@ -700,7 +700,7 @@ bool CManager::LoadLand(TLand * pTable) // from DB
|
|||
CLand * pkLand = M2_NEW CLand(pTable);
|
||||
m_map_pkLand.insert(std::make_pair(pkLand->GetID(), pkLand));
|
||||
|
||||
sys_log(0, "LAND: %u map %d %dx%d w %u h %u",
|
||||
SPDLOG_INFO("LAND: {} map {} {}x{} w {} h {}",
|
||||
pTable->dwID, pTable->lMapIndex, pTable->x, pTable->y, pTable->width, pTable->height);
|
||||
|
||||
return true;
|
||||
|
@ -712,7 +712,7 @@ void CManager::UpdateLand(TLand * pTable)
|
|||
|
||||
if (!pkLand)
|
||||
{
|
||||
sys_err("cannot find land by id %u", pTable->dwID);
|
||||
SPDLOG_ERROR("cannot find land by id {}", pTable->dwID);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -736,7 +736,7 @@ void CManager::UpdateLand(TLand * pTable)
|
|||
e.height = pTable->height;
|
||||
e.dwGuildID = pTable->dwGuildID;
|
||||
|
||||
sys_log(0, "BUILDING: UpdateLand %u pos %dx%d guild %u", e.dwID, e.x, e.y, e.dwGuildID);
|
||||
SPDLOG_INFO("BUILDING: UpdateLand {} pos {}x{} guild {}", e.dwID, e.x, e.y, e.dwGuildID);
|
||||
|
||||
CGuild *guild = CGuildManager::instance().FindGuild(pTable->dwGuildID);
|
||||
while (it != cont.end())
|
||||
|
@ -766,7 +766,7 @@ CLand * CManager::FindLand(DWORD dwID)
|
|||
|
||||
CLand * CManager::FindLand(int lMapIndex, int x, int y)
|
||||
{
|
||||
sys_log(0, "BUILDING: FindLand %d %d %d", lMapIndex, x, y);
|
||||
SPDLOG_DEBUG("BUILDING: FindLand {} {} {}", lMapIndex, x, y);
|
||||
|
||||
const TMapRegion * r = SECTREE_MANAGER::instance().GetMapRegion(lMapIndex);
|
||||
|
||||
|
@ -819,7 +819,7 @@ bool CManager::LoadObject(TObject * pTable, bool isBoot) // from DB
|
|||
|
||||
if (!pkLand)
|
||||
{
|
||||
sys_log(0, "Cannot find land by id %u", pTable->dwLandID);
|
||||
SPDLOG_ERROR("Cannot find land by id {}", pTable->dwLandID);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -827,11 +827,11 @@ bool CManager::LoadObject(TObject * pTable, bool isBoot) // from DB
|
|||
|
||||
if (!pkProto)
|
||||
{
|
||||
sys_err("Cannot find object %u in prototype (id %u)", pTable->dwVnum, pTable->dwID);
|
||||
SPDLOG_ERROR("Cannot find object {} in prototype (id {})", pTable->dwVnum, pTable->dwID);
|
||||
return false;
|
||||
}
|
||||
|
||||
sys_log(0, "OBJ: id %u vnum %u map %d pos %dx%d", pTable->dwID, pTable->dwVnum, pTable->lMapIndex, pTable->x, pTable->y);
|
||||
SPDLOG_DEBUG("OBJ: id {} vnum {} map {} pos {}x{}", pTable->dwID, pTable->dwVnum, pTable->lMapIndex, pTable->x, pTable->y);
|
||||
|
||||
LPOBJECT pkObj = M2_NEW CObject(pTable, pkProto);
|
||||
|
||||
|
@ -880,7 +880,7 @@ void CManager::FinalizeBoot()
|
|||
}
|
||||
|
||||
// BUILDING_NPC
|
||||
sys_log(0, "FinalizeBoot");
|
||||
SPDLOG_DEBUG("FinalizeBoot");
|
||||
// END_OF_BUILDING_NPC
|
||||
|
||||
itertype(m_map_pkLand) it2 = m_map_pkLand.begin();
|
||||
|
@ -892,7 +892,7 @@ void CManager::FinalizeBoot()
|
|||
const TLand & r = pkLand->GetData();
|
||||
|
||||
// LAND_MASTER_LOG
|
||||
sys_log(0, "LandMaster map_index=%d pos=(%d, %d)", r.lMapIndex, r.x, r.y);
|
||||
SPDLOG_DEBUG("LandMaster map_index={} pos=({}, {})", r.lMapIndex, r.x, r.y);
|
||||
// END_OF_LAND_MASTER_LOG
|
||||
|
||||
if (r.dwGuildID != 0)
|
||||
|
@ -911,7 +911,7 @@ void CManager::FinalizeBoot()
|
|||
|
||||
void CManager::DeleteObject(DWORD dwID) // from DB
|
||||
{
|
||||
sys_log(0, "OBJ_DEL: %u", dwID);
|
||||
SPDLOG_DEBUG("OBJ_DEL: {}", dwID);
|
||||
|
||||
itertype(m_map_pkObjByID) it = m_map_pkObjByID.find(dwID);
|
||||
|
||||
|
@ -975,7 +975,7 @@ void CManager::SendLandList(LPDESC d, int lMapIndex)
|
|||
++wCount;
|
||||
}
|
||||
|
||||
sys_log(0, "SendLandList map %d count %u elem_size: %d", lMapIndex, wCount, buf.size());
|
||||
SPDLOG_DEBUG("SendLandList map {} count {} elem_size: {}", lMapIndex, wCount, buf.size());
|
||||
|
||||
if (wCount != 0)
|
||||
{
|
||||
|
@ -996,13 +996,13 @@ void CManager::ClearLand(DWORD dwLandID)
|
|||
|
||||
if ( pLand == NULL )
|
||||
{
|
||||
sys_log(0, "LAND_CLEAR: there is no LAND id like %d", dwLandID);
|
||||
SPDLOG_WARN("LAND_CLEAR: there is no LAND id like {}", dwLandID);
|
||||
return;
|
||||
}
|
||||
|
||||
pLand->ClearLand();
|
||||
|
||||
sys_log(0, "LAND_CLEAR: request Land Clear. LandID: %d", pLand->GetID());
|
||||
SPDLOG_DEBUG("LAND_CLEAR: request Land Clear. LandID: {}", pLand->GetID());
|
||||
}
|
||||
|
||||
void CManager::ClearLandByGuildID(DWORD dwGuildID)
|
||||
|
@ -1011,13 +1011,13 @@ void CManager::ClearLandByGuildID(DWORD dwGuildID)
|
|||
|
||||
if ( pLand == NULL )
|
||||
{
|
||||
sys_log(0, "LAND_CLEAR: there is no GUILD id like %d", dwGuildID);
|
||||
SPDLOG_WARN("LAND_CLEAR: there is no GUILD id like {}", dwGuildID);
|
||||
return;
|
||||
}
|
||||
|
||||
pLand->ClearLand();
|
||||
|
||||
sys_log(0, "LAND_CLEAR: request Land Clear. LandID: %d", pLand->GetID());
|
||||
SPDLOG_DEBUG("LAND_CLEAR: request Land Clear. LandID: {}", pLand->GetID());
|
||||
}
|
||||
|
||||
void CLand::ClearLand()
|
||||
|
|
|
@ -241,7 +241,7 @@ EVENTFUNC(castle_siege_event)
|
|||
|
||||
if ( info == NULL )
|
||||
{
|
||||
sys_err( "castle_siege_event> <Factor> Null pointer" );
|
||||
SPDLOG_ERROR("castle_siege_event> <Factor> Null pointer" );
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -320,7 +320,7 @@ EVENTFUNC(castle_stone_event)
|
|||
|
||||
if (info == NULL)
|
||||
{
|
||||
sys_err( "castle_stone_event> <Factor> Null pointer" );
|
||||
SPDLOG_ERROR("castle_stone_event> <Factor> Null pointer" );
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -470,7 +470,7 @@ bool castle_boot()
|
|||
else
|
||||
{
|
||||
fclose(fp);
|
||||
sys_err("wrong empire number is null");
|
||||
SPDLOG_ERROR("wrong empire number is null");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -526,7 +526,7 @@ void castle_save()
|
|||
|
||||
if (NULL == fp)
|
||||
{
|
||||
sys_err("<FAIL> fopen(%s)", castle_file);
|
||||
SPDLOG_ERROR("<FAIL> fopen({})", castle_file);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -71,7 +71,7 @@ EVENTFUNC(affect_event)
|
|||
|
||||
if ( info == NULL )
|
||||
{
|
||||
sys_err( "affect_event> <Factor> Null pointer" );
|
||||
SPDLOG_ERROR("affect_event> <Factor> Null pointer" );
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -174,7 +174,7 @@ void CHARACTER::StartAffectEvent()
|
|||
char_event_info* info = AllocEventInfo<char_event_info>();
|
||||
info->ch = this;
|
||||
m_pkAffectEvent = event_create(affect_event, info, passes_per_sec);
|
||||
sys_log(1, "StartAffectEvent %s %p %p", GetName(), this, get_pointer(m_pkAffectEvent));
|
||||
SPDLOG_DEBUG("StartAffectEvent {} {} {}", GetName(), (void*) this, (void*) get_pointer(m_pkAffectEvent));
|
||||
}
|
||||
|
||||
void CHARACTER::ClearAffect(bool bSave)
|
||||
|
@ -357,7 +357,7 @@ void CHARACTER::SaveAffect()
|
|||
if (IS_NO_SAVE_AFFECT(pkAff->dwType))
|
||||
continue;
|
||||
|
||||
sys_log(1, "AFFECT_SAVE: %u %u %d %d", pkAff->dwType, pkAff->bApplyOn, pkAff->lApplyValue, pkAff->lDuration);
|
||||
SPDLOG_DEBUG("AFFECT_SAVE: {} {} {} {}", pkAff->dwType, pkAff->bApplyOn, pkAff->lApplyValue, pkAff->lDuration);
|
||||
|
||||
p.dwPID = GetPlayerID();
|
||||
p.elem.dwType = pkAff->dwType;
|
||||
|
@ -390,7 +390,7 @@ EVENTFUNC(load_affect_login_event)
|
|||
|
||||
if ( info == NULL )
|
||||
{
|
||||
sys_err( "load_affect_login_event_info> <Factor> Null pointer" );
|
||||
SPDLOG_ERROR("load_affect_login_event_info> <Factor> Null pointer" );
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -426,14 +426,14 @@ EVENTFUNC(load_affect_login_event)
|
|||
}
|
||||
else if (d->IsPhase(PHASE_GAME))
|
||||
{
|
||||
sys_log(1, "Affect Load by Event");
|
||||
SPDLOG_DEBUG("Affect Load by Event");
|
||||
ch->LoadAffect(info->count, (TPacketAffectElement*)info->data);
|
||||
M2_DELETE_ARRAY(info->data);
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
sys_err("input_db.cpp:quest_login_event INVALID PHASE pid %d", ch->GetPlayerID());
|
||||
SPDLOG_ERROR("input_db.cpp:quest_login_event INVALID PHASE pid {}", ch->GetPlayerID());
|
||||
M2_DELETE_ARRAY(info->data);
|
||||
return 0;
|
||||
}
|
||||
|
@ -445,8 +445,7 @@ void CHARACTER::LoadAffect(DWORD dwCount, TPacketAffectElement * pElements)
|
|||
|
||||
if (!GetDesc()->IsPhase(PHASE_GAME))
|
||||
{
|
||||
if (test_server)
|
||||
sys_log(0, "LOAD_AFFECT: Creating Event", GetName(), dwCount);
|
||||
SPDLOG_TRACE("LOAD_AFFECT: Creating Event", GetName(), dwCount);
|
||||
|
||||
load_affect_login_event_info* info = AllocEventInfo<load_affect_login_event_info>();
|
||||
|
||||
|
@ -462,8 +461,7 @@ void CHARACTER::LoadAffect(DWORD dwCount, TPacketAffectElement * pElements)
|
|||
|
||||
ClearAffect(true);
|
||||
|
||||
if (test_server)
|
||||
sys_log(0, "LOAD_AFFECT: %s count %d", GetName(), dwCount);
|
||||
SPDLOG_TRACE("LOAD_AFFECT: {} count {}", GetName(), dwCount);
|
||||
|
||||
TAffectFlag afOld = m_afAffectFlag;
|
||||
|
||||
|
@ -488,15 +486,12 @@ void CHARACTER::LoadAffect(DWORD dwCount, TPacketAffectElement * pElements)
|
|||
|
||||
if (pElements->bApplyOn >= POINT_MAX_NUM)
|
||||
{
|
||||
sys_err("invalid affect data %s ApplyOn %u ApplyValue %d",
|
||||
SPDLOG_ERROR("invalid affect data {} ApplyOn {} ApplyValue {}",
|
||||
GetName(), pElements->bApplyOn, pElements->lApplyValue);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (test_server)
|
||||
{
|
||||
sys_log(0, "Load Affect : Affect %s %d %d", GetName(), pElements->dwType, pElements->bApplyOn );
|
||||
}
|
||||
SPDLOG_TRACE("Load Affect : Affect {} {} {}", GetName(), pElements->dwType, pElements->bApplyOn );
|
||||
|
||||
CAffect* pkAff = CAffect::Acquire();
|
||||
m_list_pkAffect.push_back(pkAff);
|
||||
|
@ -544,7 +539,7 @@ bool CHARACTER::AddAffect(DWORD dwType, BYTE bApplyOn, int lApplyValue, DWORD dw
|
|||
|
||||
if (lDuration == 0)
|
||||
{
|
||||
sys_err("Character::AddAffect lDuration == 0 type %d", lDuration, dwType);
|
||||
SPDLOG_ERROR("Character::AddAffect lDuration == 0 type {}", lDuration, dwType);
|
||||
lDuration = 1;
|
||||
}
|
||||
|
||||
|
@ -587,8 +582,7 @@ bool CHARACTER::AddAffect(DWORD dwType, BYTE bApplyOn, int lApplyValue, DWORD dw
|
|||
|
||||
}
|
||||
|
||||
sys_log(1, "AddAffect %s type %d apply %d %d flag %u duration %d", GetName(), dwType, bApplyOn, lApplyValue, dwFlag, lDuration);
|
||||
sys_log(0, "AddAffect %s type %d apply %d %d flag %u duration %d", GetName(), dwType, bApplyOn, lApplyValue, dwFlag, lDuration);
|
||||
SPDLOG_DEBUG("AddAffect {} type {} apply {} {} flag {} duration {}", GetName(), dwType, bApplyOn, lApplyValue, dwFlag, lDuration);
|
||||
|
||||
pkAff->dwType = dwType;
|
||||
pkAff->bApplyOn = bApplyOn;
|
||||
|
@ -703,8 +697,7 @@ bool CHARACTER::RemoveAffect(CAffect * pkAff)
|
|||
}
|
||||
CheckMaximumPoints();
|
||||
|
||||
if (test_server)
|
||||
sys_log(0, "AFFECT_REMOVE: %s (flag %u apply: %u)", GetName(), pkAff->dwFlag, pkAff->bApplyOn);
|
||||
SPDLOG_TRACE("AFFECT_REMOVE: {} (flag {} apply: {})", GetName(), pkAff->dwFlag, pkAff->bApplyOn);
|
||||
|
||||
if (IsPC())
|
||||
{
|
||||
|
@ -801,7 +794,7 @@ bool CHARACTER::IsGoodAffect(BYTE bAffectType) const
|
|||
|
||||
void CHARACTER::RemoveBadAffect()
|
||||
{
|
||||
sys_log(0, "RemoveBadAffect %s", GetName());
|
||||
SPDLOG_DEBUG("RemoveBadAffect {}", GetName());
|
||||
// µ¶
|
||||
RemovePoison();
|
||||
RemoveFire();
|
||||
|
|
|
@ -26,7 +26,6 @@
|
|||
#include "exchange.h"
|
||||
#include "shop_manager.h"
|
||||
#include "castle.h"
|
||||
#include "dev_log.h"
|
||||
#include "ani.h"
|
||||
#include "BattleArena.h"
|
||||
#include "packet.h"
|
||||
|
@ -179,8 +178,7 @@ void CHARACTER::DistributeSP(LPCHARACTER pkKiller, int iMethod)
|
|||
|
||||
bool CHARACTER::Attack(LPCHARACTER pkVictim, BYTE bType)
|
||||
{
|
||||
if (test_server)
|
||||
sys_log(0, "[TEST_SERVER] Attack : %s type %d, MobBattleType %d", GetName(), bType, !GetMobBattleType() ? 0 : GetMobAttackRange());
|
||||
SPDLOG_TRACE("[TEST_SERVER] Attack : {} type {}, MobBattleType {}", GetName(), bType, !GetMobBattleType() ? 0 : GetMobAttackRange());
|
||||
//PROF_UNIT puAttack("Attack");
|
||||
if (!CanMove())
|
||||
return false;
|
||||
|
@ -238,7 +236,7 @@ bool CHARACTER::Attack(LPCHARACTER pkVictim, BYTE bType)
|
|||
break;
|
||||
|
||||
default:
|
||||
sys_err("Unhandled battle type %d", GetMobBattleType());
|
||||
SPDLOG_ERROR("Unhandled battle type {}", GetMobBattleType());
|
||||
iRet = BATTLE_NONE;
|
||||
break;
|
||||
}
|
||||
|
@ -249,18 +247,16 @@ bool CHARACTER::Attack(LPCHARACTER pkVictim, BYTE bType)
|
|||
{
|
||||
if (dwCurrentTime - m_dwLastSkillTime > 1500)
|
||||
{
|
||||
sys_log(1, "HACK: Too long skill using term. Name(%s) PID(%u) delta(%u)",
|
||||
SPDLOG_DEBUG("HACK: Too long skill using term. Name({}) PID({}) delta({})",
|
||||
GetName(), GetPlayerID(), (dwCurrentTime - m_dwLastSkillTime));
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
sys_log(1, "Attack call ComputeSkill %d %s", bType, pkVictim?pkVictim->GetName():"");
|
||||
SPDLOG_DEBUG("Attack call ComputeSkill {} {}", bType, pkVictim?pkVictim->GetName():"");
|
||||
iRet = ComputeSkill(bType, pkVictim);
|
||||
}
|
||||
|
||||
//if (test_server && IsPC())
|
||||
// sys_log(0, "%s Attack %s type %u ret %d", GetName(), pkVictim->GetName(), bType, iRet);
|
||||
if (iRet == BATTLE_DAMAGE || iRet == BATTLE_DEAD)
|
||||
{
|
||||
OnMove(true);
|
||||
|
@ -278,7 +274,7 @@ bool CHARACTER::Attack(LPCHARACTER pkVictim, BYTE bType)
|
|||
|
||||
void CHARACTER::DeathPenalty(BYTE bTown)
|
||||
{
|
||||
sys_log(1, "DEATH_PERNALY_CHECK(%s) town(%d)", GetName(), bTown);
|
||||
SPDLOG_DEBUG("DEATH_PERNALY_CHECK({}) town({})", GetName(), bTown);
|
||||
|
||||
Cube_close(this);
|
||||
|
||||
|
@ -289,14 +285,14 @@ void CHARACTER::DeathPenalty(BYTE bTown)
|
|||
|
||||
if (GetLevel() < 10)
|
||||
{
|
||||
sys_log(0, "NO_DEATH_PENALTY_LESS_LV10(%s)", GetName());
|
||||
SPDLOG_DEBUG("NO_DEATH_PENALTY_LESS_LV10({})", GetName());
|
||||
ChatPacket(CHAT_TYPE_INFO, LC_TEXT("용신의 가호로 경험치가 떨어지지 않았습니다."));
|
||||
return;
|
||||
}
|
||||
|
||||
if (Random::get(0, 2))
|
||||
{
|
||||
sys_log(0, "NO_DEATH_PENALTY_LUCK(%s)", GetName());
|
||||
SPDLOG_DEBUG("NO_DEATH_PENALTY_LUCK({})", GetName());
|
||||
ChatPacket(CHAT_TYPE_INFO, LC_TEXT("용신의 가호로 경험치가 떨어지지 않았습니다."));
|
||||
return;
|
||||
}
|
||||
|
@ -310,7 +306,7 @@ void CHARACTER::DeathPenalty(BYTE bTown)
|
|||
{
|
||||
if (FindAffect(AFFECT_NO_DEATH_PENALTY))
|
||||
{
|
||||
sys_log(0, "NO_DEATH_PENALTY_AFFECT(%s)", GetName());
|
||||
SPDLOG_DEBUG("NO_DEATH_PENALTY_AFFECT({})", GetName());
|
||||
ChatPacket(CHAT_TYPE_INFO, LC_TEXT("용신의 가호로 경험치가 떨어지지 않았습니다."));
|
||||
RemoveAffect(AFFECT_NO_DEATH_PENALTY);
|
||||
return;
|
||||
|
@ -320,7 +316,7 @@ void CHARACTER::DeathPenalty(BYTE bTown)
|
|||
{
|
||||
if (FindAffect(AFFECT_NO_DEATH_PENALTY))
|
||||
{
|
||||
sys_log(0, "NO_DEATH_PENALTY_AFFECT(%s)", GetName());
|
||||
SPDLOG_DEBUG("NO_DEATH_PENALTY_AFFECT({})", GetName());
|
||||
ChatPacket(CHAT_TYPE_INFO, LC_TEXT("용신의 가호로 경험치가 떨어지지 않았습니다."));
|
||||
RemoveAffect(AFFECT_NO_DEATH_PENALTY);
|
||||
return;
|
||||
|
@ -361,7 +357,7 @@ void CHARACTER::DeathPenalty(BYTE bTown)
|
|||
if (IsEquipUniqueItem(UNIQUE_ITEM_TEARDROP_OF_GODNESS))
|
||||
iLoss /= 2;
|
||||
|
||||
sys_log(0, "DEATH_PENALTY(%s) EXP_LOSS: %d percent %d%%", GetName(), iLoss, aiExpLossPercents[std::min(gPlayerMaxLevel, GetLevel())]);
|
||||
SPDLOG_DEBUG("DEATH_PENALTY({}) EXP_LOSS: {} percent {}%", GetName(), iLoss, aiExpLossPercents[std::min(gPlayerMaxLevel, GetLevel())]);
|
||||
|
||||
PointChange(POINT_EXP, -iLoss, true);
|
||||
}
|
||||
|
@ -381,7 +377,7 @@ EVENTFUNC(StunEvent)
|
|||
|
||||
if ( info == NULL )
|
||||
{
|
||||
sys_err( "StunEvent> <Factor> Null pointer" );
|
||||
SPDLOG_ERROR("StunEvent> <Factor> Null pointer" );
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -408,7 +404,7 @@ void CHARACTER::Stun()
|
|||
m_pkParty->SendMessage(this, PM_ATTACKED_BY, 0, 0);
|
||||
}
|
||||
|
||||
sys_log(1, "%s: Stun %p", GetName(), this);
|
||||
SPDLOG_DEBUG("{}: Stun {}", GetName(), (void*) this);
|
||||
|
||||
PointChange(POINT_HP_RECOVERY, -GetPoint(POINT_HP_RECOVERY));
|
||||
PointChange(POINT_SP_RECOVERY, -GetPoint(POINT_SP_RECOVERY));
|
||||
|
@ -452,7 +448,7 @@ EVENTFUNC(dead_event)
|
|||
|
||||
if ( info == NULL )
|
||||
{
|
||||
sys_err( "dead_event> <Factor> Null pointer" );
|
||||
SPDLOG_ERROR("dead_event> <Factor> Null pointer" );
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -469,7 +465,7 @@ EVENTFUNC(dead_event)
|
|||
|
||||
if (NULL == ch)
|
||||
{
|
||||
sys_err("DEAD_EVENT: cannot find char pointer with %s id(%d)", info->isPC ? "PC" : "MOB", info->dwID );
|
||||
SPDLOG_ERROR("DEAD_EVENT: cannot find char pointer with {} id({})", info->isPC ? "PC" : "MOB", info->dwID );
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -487,7 +483,7 @@ EVENTFUNC(dead_event)
|
|||
ch->WarpSet(pos.x, pos.y);
|
||||
else
|
||||
{
|
||||
sys_err("cannot find spawn position (name %s)", ch->GetName());
|
||||
SPDLOG_ERROR("cannot find spawn position (name {})", ch->GetName());
|
||||
ch->WarpSet(EMPIRE_START_X(ch->GetEmpire()), EMPIRE_START_Y(ch->GetEmpire()));
|
||||
}
|
||||
|
||||
|
@ -619,8 +615,7 @@ void CHARACTER::RewardGold(LPCHARACTER pkAttacker)
|
|||
for (int i = 0; i < iSplitCount; ++i)
|
||||
{
|
||||
int iGold = Random::get(GetMobTable().dwGoldMin, GetMobTable().dwGoldMax) / iSplitCount;
|
||||
if (test_server)
|
||||
sys_log(0, "iGold %d", iGold);
|
||||
SPDLOG_TRACE("iGold {}", iGold);
|
||||
iGold = iGold * CHARACTER_MANAGER::instance().GetMobGoldAmountRate(pkAttacker) / 100;
|
||||
iGold *= iGoldMultipler;
|
||||
|
||||
|
@ -629,11 +624,8 @@ void CHARACTER::RewardGold(LPCHARACTER pkAttacker)
|
|||
continue ;
|
||||
}
|
||||
|
||||
if (test_server)
|
||||
{
|
||||
sys_log(0, "Drop Moeny MobGoldAmountRate %d %d", CHARACTER_MANAGER::instance().GetMobGoldAmountRate(pkAttacker), iGoldMultipler);
|
||||
sys_log(0, "Drop Money gold %d GoldMin %d GoldMax %d", iGold, GetMobTable().dwGoldMax, GetMobTable().dwGoldMax);
|
||||
}
|
||||
SPDLOG_TRACE("Drop Moeny MobGoldAmountRate {} {}", CHARACTER_MANAGER::instance().GetMobGoldAmountRate(pkAttacker), iGoldMultipler);
|
||||
SPDLOG_TRACE("Drop Money gold {} GoldMin {} GoldMax {}", iGold, GetMobTable().dwGoldMax, GetMobTable().dwGoldMax);
|
||||
|
||||
// NOTE: 돈 폭탄은 제 3의 손 처리를 하지 않음
|
||||
if ((item = ITEM_MANAGER::instance().CreateItem(1, iGold)))
|
||||
|
@ -741,7 +733,7 @@ void CHARACTER::Reward(bool bItemDrop)
|
|||
iGold *= GetGoldMultipler();
|
||||
int iSplitCount = Random::get(25, 35);
|
||||
|
||||
sys_log(0, "WAEGU Dead gold %d split %d", iGold, iSplitCount);
|
||||
SPDLOG_TRACE("WAEGU Dead gold {} split {}", iGold, iSplitCount);
|
||||
|
||||
for (int i = 1; i <= iSplitCount; ++i)
|
||||
{
|
||||
|
@ -818,8 +810,7 @@ void CHARACTER::Reward(bool bItemDrop)
|
|||
// 돈 드롭
|
||||
//
|
||||
//PROF_UNIT pu2("r2");
|
||||
if (test_server)
|
||||
sys_log(0, "Drop money : Attacker %s", pkAttacker->GetName());
|
||||
SPDLOG_TRACE("Drop money : Attacker {}", pkAttacker->GetName());
|
||||
RewardGold(pkAttacker);
|
||||
//pu2.Pop();
|
||||
|
||||
|
@ -852,7 +843,7 @@ void CHARACTER::Reward(bool bItemDrop)
|
|||
pos.x += GetX();
|
||||
pos.y += GetY();
|
||||
|
||||
sys_log(0, "DROP_ITEM: %s %d %d from %s", item->GetName(), pos.x, pos.y, GetName());
|
||||
SPDLOG_DEBUG("DROP_ITEM: {} {} {} from {}", item->GetName(), pos.x, pos.y, GetName());
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -894,7 +885,7 @@ void CHARACTER::Reward(bool bItemDrop)
|
|||
|
||||
if (!item)
|
||||
{
|
||||
sys_err("item null in vector idx %d", iItemIdx + 1);
|
||||
SPDLOG_ERROR("item null in vector idx {}", iItemIdx + 1);
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -908,7 +899,7 @@ void CHARACTER::Reward(bool bItemDrop)
|
|||
pos.x += GetX();
|
||||
pos.y += GetY();
|
||||
|
||||
sys_log(0, "DROP_ITEM: %s %d %d by %s", item->GetName(), pos.x, pos.y, GetName());
|
||||
SPDLOG_DEBUG("DROP_ITEM: {} {} {} by {}", item->GetName(), pos.x, pos.y, GetName());
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -922,7 +913,7 @@ void CHARACTER::Reward(bool bItemDrop)
|
|||
|
||||
if (!item)
|
||||
{
|
||||
sys_err("item null in vector idx %d", iItemIdx + 1);
|
||||
SPDLOG_ERROR("item null in vector idx {}", iItemIdx + 1);
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -950,7 +941,7 @@ void CHARACTER::Reward(bool bItemDrop)
|
|||
pos.x += GetX();
|
||||
pos.y += GetY();
|
||||
|
||||
sys_log(0, "DROP_ITEM: %s %d %d by %s", item->GetName(), pos.x, pos.y, GetName());
|
||||
SPDLOG_DEBUG("DROP_ITEM: {} {} {} by {}", item->GetName(), pos.x, pos.y, GetName());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1029,7 +1020,7 @@ void CHARACTER::ItemDropPenalty(LPCHARACTER pkKiller)
|
|||
bool isDropAllEquipments = false;
|
||||
|
||||
TItemDropPenalty & r = table[iAlignIndex];
|
||||
sys_log(0, "%s align %d inven_pct %d equip_pct %d", GetName(), iAlignIndex, r.iInventoryPct, r.iEquipmentPct);
|
||||
SPDLOG_DEBUG("{} align {} inven_pct {} equip_pct {}", GetName(), iAlignIndex, r.iInventoryPct, r.iEquipmentPct);
|
||||
|
||||
bool bDropInventory = r.iInventoryPct >= Random::get(1, 1000);
|
||||
bool bDropEquipment = r.iEquipmentPct >= Random::get(1, 100);
|
||||
|
@ -1144,7 +1135,7 @@ void CHARACTER::ItemDropPenalty(LPCHARACTER pkKiller)
|
|||
item->AddToGround(GetMapIndex(), pos);
|
||||
item->StartDestroyEvent();
|
||||
|
||||
sys_log(0, "DROP_ITEM_PK: %s %d %d from %s", item->GetName(), pos.x, pos.y, GetName());
|
||||
SPDLOG_DEBUG("DROP_ITEM_PK: {} {} {} from {}", item->GetName(), pos.x, pos.y, GetName());
|
||||
LogManager::instance().ItemLog(this, item, "DEAD_DROP", (window == INVENTORY) ? "INVENTORY" : ((window == EQUIPMENT) ? "EQUIPMENT" : ""));
|
||||
|
||||
pos.x = GetX() + Random::get(-7, 7) * 20;
|
||||
|
@ -1294,14 +1285,14 @@ void CHARACTER::Dead(LPCHARACTER pkKiller, bool bImmediateDead)
|
|||
{
|
||||
if (!isForked)
|
||||
{
|
||||
sys_log(1, "DEAD: %s %p WITH PENALTY", GetName(), this);
|
||||
SPDLOG_DEBUG("DEAD: {} {} WITH PENALTY", GetName(), (void*) this);
|
||||
SET_BIT(m_pointsInstant.instant_flag, INSTANT_FLAG_DEATH_PENALTY);
|
||||
LogManager::instance().CharLog(this, pkKiller->GetRaceNum(), "DEAD_BY_NPC", pkKiller->GetName());
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
sys_log(1, "DEAD_BY_PC: %s %p KILLER %s %p", GetName(), this, pkKiller->GetName(), get_pointer(pkKiller));
|
||||
SPDLOG_DEBUG("DEAD_BY_PC: {} {} KILLER {} {}", GetName(), (void*) this, pkKiller->GetName(), (void*) get_pointer(pkKiller));
|
||||
REMOVE_BIT(m_pointsInstant.instant_flag, INSTANT_FLAG_DEATH_PENALTY);
|
||||
|
||||
if (GetEmpire() != pkKiller->GetEmpire())
|
||||
|
@ -1351,7 +1342,7 @@ void CHARACTER::Dead(LPCHARACTER pkKiller, bool bImmediateDead)
|
|||
pkKiller->UpdateAlignment(-20000);
|
||||
else
|
||||
{
|
||||
sys_log(0, "ALIGNMENT PARTY count %d amount %d", f.m_iCount, f.m_iAmount);
|
||||
SPDLOG_DEBUG("ALIGNMENT PARTY count {} amount {}", f.m_iCount, f.m_iAmount);
|
||||
|
||||
f.m_iStep = 1;
|
||||
pkKiller->GetParty()->ForEachOnlineMember(f);
|
||||
|
@ -1374,13 +1365,12 @@ void CHARACTER::Dead(LPCHARACTER pkKiller, bool bImmediateDead)
|
|||
}
|
||||
else
|
||||
{
|
||||
sys_log(1, "DEAD: %s %p", GetName(), this);
|
||||
SPDLOG_DEBUG("DEAD: {} {}", GetName(), (void*) this);
|
||||
REMOVE_BIT(m_pointsInstant.instant_flag, INSTANT_FLAG_DEATH_PENALTY);
|
||||
}
|
||||
|
||||
ClearSync();
|
||||
|
||||
//sys_log(1, "stun cancel %s[%d]", GetName(), (DWORD)GetVID());
|
||||
event_cancel(&m_pkStunEvent); // 기절 이벤트는 죽인다.
|
||||
|
||||
if (IsPC())
|
||||
|
@ -1469,7 +1459,7 @@ void CHARACTER::Dead(LPCHARACTER pkKiller, bool bImmediateDead)
|
|||
{
|
||||
if (m_pkDeadEvent)
|
||||
{
|
||||
sys_log(1, "DEAD_EVENT_CANCEL: %s %p %p", GetName(), this, get_pointer(m_pkDeadEvent));
|
||||
SPDLOG_DEBUG("DEAD_EVENT_CANCEL: {} {} {}", GetName(), (void*) this, (void*) get_pointer(m_pkDeadEvent));
|
||||
event_cancel(&m_pkDeadEvent);
|
||||
}
|
||||
|
||||
|
@ -1505,7 +1495,7 @@ void CHARACTER::Dead(LPCHARACTER pkKiller, bool bImmediateDead)
|
|||
}
|
||||
}
|
||||
|
||||
sys_log(1, "DEAD_EVENT_CREATE: %s %p %p", GetName(), this, get_pointer(m_pkDeadEvent));
|
||||
SPDLOG_DEBUG("DEAD_EVENT_CREATE: {} {} {}", GetName(), (void*) this, (void*) get_pointer(m_pkDeadEvent));
|
||||
}
|
||||
|
||||
if (m_pkExchange != NULL)
|
||||
|
@ -1530,7 +1520,7 @@ void CHARACTER::Dead(LPCHARACTER pkKiller, bool bImmediateDead)
|
|||
}
|
||||
else
|
||||
{
|
||||
sys_err("DragonLair: Dragon killed by nobody");
|
||||
SPDLOG_ERROR("DragonLair: Dragon killed by nobody");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1641,7 +1631,7 @@ bool CHARACTER::Damage(LPCHARACTER pAttacker, int dam, EDamageType type) // retu
|
|||
DWORD dwGold = 1000;
|
||||
int iSplitCount = Random::get(10, 13);
|
||||
|
||||
sys_log(0, "WAEGU DropGoldOnHit %d times", GetMaxSP());
|
||||
SPDLOG_TRACE("WAEGU DropGoldOnHit {} times", GetMaxSP());
|
||||
|
||||
for (int i = 1; i <= iSplitCount; ++i)
|
||||
{
|
||||
|
@ -2471,14 +2461,12 @@ static void GiveExp(LPCHARACTER from, LPCHARACTER to, int iExp)
|
|||
|
||||
}
|
||||
*/
|
||||
if (test_server)
|
||||
{
|
||||
sys_log(0, "Bonus Exp : Ramadan Candy: %d MallExp: %d PointExp: %d",
|
||||
|
||||
SPDLOG_TRACE("Bonus Exp : Ramadan Candy: {} MallExp: {} PointExp: {}",
|
||||
to->GetPoint(POINT_RAMADAN_CANDY_BONUS_EXP),
|
||||
to->GetPoint(POINT_MALL_EXPBONUS),
|
||||
to->GetPoint(POINT_EXP)
|
||||
);
|
||||
}
|
||||
|
||||
// 기획측 조정값 2005.04.21 현재 85%
|
||||
iExp = iExp * CHARACTER_MANAGER::instance().GetMobExpRate(to) / 100;
|
||||
|
@ -2581,7 +2569,7 @@ namespace NPartyExpDistribute
|
|||
break;
|
||||
|
||||
default:
|
||||
sys_err("Unknown party exp distribution mode %d", m_iMode);
|
||||
SPDLOG_ERROR("Unknown party exp distribution mode {}", m_iMode);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -2705,8 +2693,6 @@ LPCHARACTER CHARACTER::DistributeExp()
|
|||
di.pAttacker = pAttacker;
|
||||
di.pParty = NULL;
|
||||
|
||||
//sys_log(0, "__ pq_damage %s %d", pAttacker->GetName(), iDam);
|
||||
//pq_damage.push(di);
|
||||
damage_info_table.push_back(di);
|
||||
}
|
||||
}
|
||||
|
@ -2714,7 +2700,6 @@ LPCHARACTER CHARACTER::DistributeExp()
|
|||
for (std::map<LPPARTY, TDamageInfo>::iterator it = map_party_damage.begin(); it != map_party_damage.end(); ++it)
|
||||
{
|
||||
damage_info_table.push_back(it->second);
|
||||
//sys_log(0, "__ pq_damage_party [%u] %d", it->second.pParty->GetLeaderPID(), it->second.iDam);
|
||||
}
|
||||
|
||||
SetExp(0);
|
||||
|
@ -2725,16 +2710,13 @@ LPCHARACTER CHARACTER::DistributeExp()
|
|||
|
||||
if (m_pkChrStone) // 돌이 있을 경우 경험치의 반을 돌에게 넘긴다.
|
||||
{
|
||||
//sys_log(0, "__ Give half to Stone : %d", iExpToDistribute>>1);
|
||||
int iExp = iExpToDistribute >> 1;
|
||||
m_pkChrStone->SetExp(m_pkChrStone->GetExp() + iExp);
|
||||
iExpToDistribute -= iExp;
|
||||
}
|
||||
|
||||
sys_log(1, "%s total exp: %d, damage_info_table.size() == %d, TotalDam %d",
|
||||
SPDLOG_DEBUG("{} total exp: {}, damage_info_table.size() == {}, TotalDam {}",
|
||||
GetName(), iExpToDistribute, damage_info_table.size(), iTotalDam);
|
||||
//sys_log(1, "%s total exp: %d, pq_damage.size() == %d, TotalDam %d",
|
||||
//GetName(), iExpToDistribute, pq_damage.size(), iTotalDam);
|
||||
|
||||
if (damage_info_table.empty())
|
||||
return NULL;
|
||||
|
@ -2762,14 +2744,12 @@ LPCHARACTER CHARACTER::DistributeExp()
|
|||
|
||||
if (fPercent > 1.0f)
|
||||
{
|
||||
sys_err("DistributeExp percent over 1.0 (fPercent %f name %s)", fPercent, di->pAttacker->GetName());
|
||||
SPDLOG_ERROR("DistributeExp percent over 1.0 (fPercent {} name {})", fPercent, di->pAttacker->GetName());
|
||||
fPercent = 1.0f;
|
||||
}
|
||||
|
||||
iExp += (int) (iExpToDistribute * fPercent);
|
||||
|
||||
//sys_log(0, "%s given exp percent %.1f + 20 dam %d", GetName(), fPercent * 100.0f, di.iDam);
|
||||
|
||||
di->Distribute(this, iExp);
|
||||
|
||||
// 100% 다 먹었으면 리턴한다.
|
||||
|
@ -2791,11 +2771,10 @@ LPCHARACTER CHARACTER::DistributeExp()
|
|||
|
||||
if (fPercent > 1.0f)
|
||||
{
|
||||
sys_err("DistributeExp percent over 1.0 (fPercent %f name %s)", fPercent, di.pAttacker->GetName());
|
||||
SPDLOG_ERROR("DistributeExp percent over 1.0 (fPercent {} name {})", fPercent, di.pAttacker->GetName());
|
||||
fPercent = 1.0f;
|
||||
}
|
||||
|
||||
//sys_log(0, "%s given exp percent %.1f dam %d", GetName(), fPercent * 100.0f, di.iDam);
|
||||
di.Distribute(this, (int) (iExpToDistribute * fPercent));
|
||||
}
|
||||
}
|
||||
|
@ -2840,7 +2819,7 @@ void CHARACTER::UseArrow(LPITEM pkArrow, DWORD dwArrowCount)
|
|||
{
|
||||
LPITEM pkNewArrow = FindSpecifyItem(dwVnum);
|
||||
|
||||
sys_log(0, "UseArrow : FindSpecifyItem %u %p", dwVnum, get_pointer(pkNewArrow));
|
||||
SPDLOG_DEBUG("UseArrow : FindSpecifyItem {} {}", dwVnum, (void*) get_pointer(pkNewArrow));
|
||||
|
||||
if (pkNewArrow)
|
||||
EquipItem(pkNewArrow);
|
||||
|
@ -2926,8 +2905,6 @@ class CFuncShoot
|
|||
// 데미지 계산
|
||||
iDam = iDam * (100 - pkVictim->GetPoint(POINT_RESIST_BOW)) / 100;
|
||||
|
||||
//sys_log(0, "%s arrow %s dam %d", m_me->GetName(), pkVictim->GetName(), iDam);
|
||||
|
||||
m_me->OnMove(true);
|
||||
pkVictim->OnMove();
|
||||
|
||||
|
@ -2953,8 +2930,6 @@ class CFuncShoot
|
|||
// 데미지 계산
|
||||
iDam = iDam * (100 - pkVictim->GetPoint(POINT_RESIST_MAGIC)) / 100;
|
||||
|
||||
//sys_log(0, "%s arrow %s dam %d", m_me->GetName(), pkVictim->GetName(), iDam);
|
||||
|
||||
m_me->OnMove(true);
|
||||
pkVictim->OnMove();
|
||||
|
||||
|
@ -3007,7 +2982,7 @@ class CFuncShoot
|
|||
if (pkVictim->CanBeginFight())
|
||||
pkVictim->BeginFight(m_me);
|
||||
|
||||
sys_log(0, "%s kwankeyok %s", m_me->GetName(), pkVictim->GetName());
|
||||
SPDLOG_DEBUG("{} kwankeyok {}", m_me->GetName(), pkVictim->GetName());
|
||||
m_me->ComputeSkill(m_bType, pkVictim);
|
||||
m_me->UseArrow(pkArrow, iUseArrow);
|
||||
}
|
||||
|
@ -3025,7 +3000,7 @@ class CFuncShoot
|
|||
if (pkVictim->CanBeginFight())
|
||||
pkVictim->BeginFight(m_me);
|
||||
|
||||
sys_log(0, "%s gigung %s", m_me->GetName(), pkVictim->GetName());
|
||||
SPDLOG_DEBUG("{} gigung {}", m_me->GetName(), pkVictim->GetName());
|
||||
m_me->ComputeSkill(m_bType, pkVictim);
|
||||
m_me->UseArrow(pkArrow, iUseArrow);
|
||||
}
|
||||
|
@ -3043,7 +3018,7 @@ class CFuncShoot
|
|||
if (pkVictim->CanBeginFight())
|
||||
pkVictim->BeginFight(m_me);
|
||||
|
||||
sys_log(0, "%s hwajo %s", m_me->GetName(), pkVictim->GetName());
|
||||
SPDLOG_DEBUG("{} hwajo {}", m_me->GetName(), pkVictim->GetName());
|
||||
m_me->ComputeSkill(m_bType, pkVictim);
|
||||
m_me->UseArrow(pkArrow, iUseArrow);
|
||||
}
|
||||
|
@ -3062,7 +3037,7 @@ class CFuncShoot
|
|||
if (pkVictim->CanBeginFight())
|
||||
pkVictim->BeginFight(m_me);
|
||||
|
||||
sys_log(0, "%s horse_wildattack %s", m_me->GetName(), pkVictim->GetName());
|
||||
SPDLOG_DEBUG("{} horse_wildattack {}", m_me->GetName(), pkVictim->GetName());
|
||||
m_me->ComputeSkill(m_bType, pkVictim);
|
||||
m_me->UseArrow(pkArrow, iUseArrow);
|
||||
}
|
||||
|
@ -3087,7 +3062,7 @@ class CFuncShoot
|
|||
if (pkVictim->CanBeginFight())
|
||||
pkVictim->BeginFight(m_me);
|
||||
|
||||
sys_log(0, "%s - Skill %d -> %s", m_me->GetName(), m_bType, pkVictim->GetName());
|
||||
SPDLOG_DEBUG("{} - Skill {} -> {}", m_me->GetName(), m_bType, pkVictim->GetName());
|
||||
m_me->ComputeSkill(m_bType, pkVictim);
|
||||
}
|
||||
break;
|
||||
|
@ -3100,7 +3075,7 @@ class CFuncShoot
|
|||
if (pkVictim->CanBeginFight())
|
||||
pkVictim->BeginFight(m_me);
|
||||
|
||||
sys_log(0, "%s - Skill %d -> %s", m_me->GetName(), m_bType, pkVictim->GetName());
|
||||
SPDLOG_DEBUG("{} - Skill {} -> {}", m_me->GetName(), m_bType, pkVictim->GetName());
|
||||
m_me->ComputeSkill(m_bType, pkVictim);
|
||||
|
||||
// TODO 여러명에게 슉 슉 슉 하기
|
||||
|
@ -3128,7 +3103,7 @@ class CFuncShoot
|
|||
break;*/
|
||||
|
||||
default:
|
||||
sys_err("CFuncShoot: I don't know this type [%d] of range attack.", (int) m_bType);
|
||||
SPDLOG_ERROR("CFuncShoot: I don't know this type [{}] of range attack.", (int) m_bType);
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -3138,7 +3113,7 @@ class CFuncShoot
|
|||
|
||||
bool CHARACTER::Shoot(BYTE bType)
|
||||
{
|
||||
sys_log(1, "Shoot %s type %u flyTargets.size %zu", GetName(), bType, m_vec_dwFlyTargets.size());
|
||||
SPDLOG_DEBUG("Shoot {} type {} flyTargets.size {}", GetName(), bType, m_vec_dwFlyTargets.size());
|
||||
|
||||
if (!CanMove())
|
||||
{
|
||||
|
@ -3186,7 +3161,7 @@ void CHARACTER::FlyTarget(DWORD dwTargetVID, int x, int y, BYTE bHeader)
|
|||
pack.y = y;
|
||||
}
|
||||
|
||||
sys_log(1, "FlyTarget %s vid %d x %d y %d", GetName(), pack.dwTargetVID, pack.x, pack.y);
|
||||
SPDLOG_DEBUG("FlyTarget {} vid {} x {} y {}", GetName(), pack.dwTargetVID, pack.x, pack.y);
|
||||
PacketAround(&pack, sizeof(pack), this);
|
||||
}
|
||||
|
||||
|
@ -3326,7 +3301,7 @@ void CHARACTER::SetKillerMode(bool isOn)
|
|||
|
||||
m_iKillerModePulse = thecore_pulse();
|
||||
UpdatePacket();
|
||||
sys_log(0, "SetKillerMode Update %s[%d]", GetName(), GetPlayerID());
|
||||
SPDLOG_DEBUG("SetKillerMode Update {}[{}]", GetName(), GetPlayerID());
|
||||
}
|
||||
|
||||
bool CHARACTER::IsKillerMode() const
|
||||
|
@ -3359,7 +3334,7 @@ void CHARACTER::SetPKMode(BYTE bPKMode)
|
|||
m_bPKMode = bPKMode;
|
||||
UpdatePacket();
|
||||
|
||||
sys_log(0, "PK_MODE: %s %d", GetName(), m_bPKMode);
|
||||
SPDLOG_DEBUG("PK_MODE: {} {}", GetName(), m_bPKMode);
|
||||
}
|
||||
|
||||
BYTE CHARACTER::GetPKMode() const
|
||||
|
@ -3562,7 +3537,6 @@ void CHARACTER::UpdateAggrPointEx(LPCHARACTER pAttacker, EDamageType type, int d
|
|||
if (info.iAggro < 0)
|
||||
info.iAggro = 0;
|
||||
|
||||
//sys_log(0, "UpdateAggrPointEx for %s by %s dam %d total %d", GetName(), pAttacker->GetName(), dam, total);
|
||||
if (GetParty() && dam > 0 && type != DAMAGE_TYPE_SPECIAL)
|
||||
{
|
||||
LPPARTY pParty = GetParty();
|
||||
|
|
|
@ -125,7 +125,7 @@ bool CHARACTER::DragonSoul_RefineWindow_Open(LPENTITY pEntity)
|
|||
|
||||
if (NULL == d)
|
||||
{
|
||||
sys_err ("User(%s)'s DESC is NULL POINT.", GetName());
|
||||
SPDLOG_ERROR("User({})'s DESC is NULL POINT.", GetName());
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -62,8 +62,7 @@ bool CHARACTER::StartRiding()
|
|||
|
||||
MountVnum(dwMountVnum);
|
||||
|
||||
if(test_server)
|
||||
sys_log(0, "Ride Horse : %s ", GetName());
|
||||
SPDLOG_TRACE("Ride Horse : {} ", GetName());
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -106,7 +105,7 @@ EVENTFUNC(horse_dead_event)
|
|||
|
||||
if ( info == NULL )
|
||||
{
|
||||
sys_err( "horse_dead_event> <Factor> Null pointer" );
|
||||
SPDLOG_ERROR("horse_dead_event> <Factor> Null pointer" );
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -151,7 +150,7 @@ void CHARACTER::HorseSummon(bool bSummon, bool bFromFar, DWORD dwVnum, const cha
|
|||
if (IsRiding())
|
||||
return;
|
||||
|
||||
sys_log(0, "HorseSummon : %s lv:%d bSummon:%d fromFar:%d", GetName(), GetLevel(), bSummon, bFromFar);
|
||||
SPDLOG_DEBUG("HorseSummon : {} lv:{} bSummon:{} fromFar:{}", GetName(), GetLevel(), bSummon, bFromFar);
|
||||
|
||||
int x = GetX();
|
||||
int y = GetY();
|
||||
|
@ -210,7 +209,7 @@ void CHARACTER::HorseSummon(bool bSummon, bool bFromFar, DWORD dwVnum, const cha
|
|||
if (!m_chHorse->Show(GetMapIndex(), x, y, GetZ()))
|
||||
{
|
||||
M2_DESTROY_CHARACTER(m_chHorse);
|
||||
sys_err("cannot show monster");
|
||||
SPDLOG_ERROR("cannot show monster");
|
||||
m_chHorse = NULL;
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -34,7 +34,6 @@
|
|||
#include "castle.h"
|
||||
#include "BattleArena.h"
|
||||
#include "arena.h"
|
||||
#include "dev_log.h"
|
||||
#include "pcbang.h"
|
||||
#include "threeway_war.h"
|
||||
|
||||
|
@ -246,14 +245,14 @@ LPITEM CHARACTER::GetItem(TItemPos Cell) const
|
|||
case EQUIPMENT:
|
||||
if (wCell >= INVENTORY_AND_EQUIP_SLOT_MAX)
|
||||
{
|
||||
sys_err("CHARACTER::GetInventoryItem: invalid item cell %d", wCell);
|
||||
SPDLOG_ERROR("CHARACTER::GetInventoryItem: invalid item cell {}", wCell);
|
||||
return NULL;
|
||||
}
|
||||
return m_pointsInstant.pItems[wCell];
|
||||
case DRAGON_SOUL_INVENTORY:
|
||||
if (wCell >= DRAGON_SOUL_INVENTORY_MAX_NUM)
|
||||
{
|
||||
sys_err("CHARACTER::GetInventoryItem: invalid DS item cell %d", wCell);
|
||||
SPDLOG_ERROR("CHARACTER::GetInventoryItem: invalid DS item cell {}", wCell);
|
||||
return NULL;
|
||||
}
|
||||
return m_pointsInstant.pDSItems[wCell];
|
||||
|
@ -270,7 +269,7 @@ void CHARACTER::SetItem(TItemPos Cell, LPITEM pItem)
|
|||
BYTE window_type = Cell.window_type;
|
||||
if ((unsigned long)((CItem*)pItem) == 0xff || (unsigned long)((CItem*)pItem) == 0xffffffff)
|
||||
{
|
||||
sys_err("!!! FATAL ERROR !!! item == 0xff (char: %s cell: %u)", GetName(), wCell);
|
||||
SPDLOG_ERROR("!!! FATAL ERROR !!! item == 0xff (char: {} cell: {})", GetName(), wCell);
|
||||
core_dump();
|
||||
return;
|
||||
}
|
||||
|
@ -288,7 +287,7 @@ void CHARACTER::SetItem(TItemPos Cell, LPITEM pItem)
|
|||
{
|
||||
if (wCell >= INVENTORY_AND_EQUIP_SLOT_MAX)
|
||||
{
|
||||
sys_err("CHARACTER::SetItem: invalid item cell %d", wCell);
|
||||
SPDLOG_ERROR("CHARACTER::SetItem: invalid item cell {}", wCell);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -368,7 +367,7 @@ void CHARACTER::SetItem(TItemPos Cell, LPITEM pItem)
|
|||
{
|
||||
if (wCell >= DRAGON_SOUL_INVENTORY_MAX_NUM)
|
||||
{
|
||||
sys_err("CHARACTER::SetItem: invalid DS item cell %d", wCell);
|
||||
SPDLOG_ERROR("CHARACTER::SetItem: invalid DS item cell {}", wCell);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -394,7 +393,7 @@ void CHARACTER::SetItem(TItemPos Cell, LPITEM pItem)
|
|||
}
|
||||
break;
|
||||
default:
|
||||
sys_err ("Invalid Inventory type %d", window_type);
|
||||
SPDLOG_ERROR("Invalid Inventory type {}", window_type);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -457,7 +456,7 @@ LPITEM CHARACTER::GetWear(BYTE bCell) const
|
|||
// > WEAR_MAX_NUM : 용혼석 슬롯들.
|
||||
if (bCell >= WEAR_MAX_NUM + DRAGON_SOUL_DECK_MAX_NUM * DS_SLOT_MAX)
|
||||
{
|
||||
sys_err("CHARACTER::GetWear: invalid wear cell %d", bCell);
|
||||
SPDLOG_ERROR("CHARACTER::GetWear: invalid wear cell {}", bCell);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
@ -469,7 +468,7 @@ void CHARACTER::SetWear(BYTE bCell, LPITEM item)
|
|||
// > WEAR_MAX_NUM : 용혼석 슬롯들.
|
||||
if (bCell >= WEAR_MAX_NUM + DRAGON_SOUL_DECK_MAX_NUM * DS_SLOT_MAX)
|
||||
{
|
||||
sys_err("CHARACTER::SetItem: invalid item cell %d", bCell);
|
||||
SPDLOG_ERROR("CHARACTER::SetItem: invalid item cell {}", bCell);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -815,7 +814,7 @@ bool CHARACTER::DoRefine(LPITEM item, bool bMoneyOnly)
|
|||
{
|
||||
if (get_global_time() < quest::CQuestManager::instance().GetEventFlag("update_refine_time") + (60 * 5))
|
||||
{
|
||||
sys_log(0, "can't refine %d %s", GetPlayerID(), GetName());
|
||||
SPDLOG_DEBUG("can't refine {} {}", GetPlayerID(), GetName());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -858,7 +857,7 @@ bool CHARACTER::DoRefine(LPITEM item, bool bMoneyOnly)
|
|||
|
||||
if (!pProto)
|
||||
{
|
||||
sys_err("DoRefine NOT GET ITEM PROTO %d", item->GetRefinedVnum());
|
||||
SPDLOG_ERROR("DoRefine NOT GET ITEM PROTO {}", item->GetRefinedVnum());
|
||||
ChatPacket(CHAT_TYPE_INFO, LC_TEXT("이 아이템은 개량할 수 없습니다."));
|
||||
return false;
|
||||
}
|
||||
|
@ -937,18 +936,18 @@ bool CHARACTER::DoRefine(LPITEM item, bool bMoneyOnly)
|
|||
pkNewItem->AddToCharacter(this, TItemPos(INVENTORY, bCell));
|
||||
ITEM_MANAGER::instance().FlushDelayedSave(pkNewItem);
|
||||
|
||||
sys_log(0, "Refine Success %d", cost);
|
||||
SPDLOG_DEBUG("Refine Success {}", cost);
|
||||
pkNewItem->AttrLog();
|
||||
//PointChange(POINT_GOLD, -cost);
|
||||
sys_log(0, "PayPee %d", cost);
|
||||
SPDLOG_DEBUG("PayPee {}", cost);
|
||||
PayRefineFee(cost);
|
||||
sys_log(0, "PayPee End %d", cost);
|
||||
SPDLOG_DEBUG("PayPee End {}", cost);
|
||||
}
|
||||
else
|
||||
{
|
||||
// DETAIL_REFINE_LOG
|
||||
// 아이템 생성에 실패 -> 개량 실패로 간주
|
||||
sys_err("cannot create item %u", result_vnum);
|
||||
SPDLOG_ERROR("cannot create item {}", result_vnum);
|
||||
NotifyRefineFail(this, item, IsRefineThroughGuild() ? "GUILD" : "POWER");
|
||||
// END_OF_DETAIL_REFINE_LOG
|
||||
}
|
||||
|
@ -995,7 +994,7 @@ bool CHARACTER::DoRefineWithScroll(LPITEM item)
|
|||
{
|
||||
if (get_global_time() < quest::CQuestManager::instance().GetEventFlag("update_refine_time") + (60 * 5))
|
||||
{
|
||||
sys_log(0, "can't refine %d %s", GetPlayerID(), GetName());
|
||||
SPDLOG_DEBUG("can't refine {} {}", GetPlayerID(), GetName());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -1063,7 +1062,7 @@ bool CHARACTER::DoRefineWithScroll(LPITEM item)
|
|||
|
||||
if (!pProto)
|
||||
{
|
||||
sys_err("DoRefineWithScroll NOT GET ITEM PROTO %d", item->GetRefinedVnum());
|
||||
SPDLOG_ERROR("DoRefineWithScroll NOT GET ITEM PROTO {}", item->GetRefinedVnum());
|
||||
ChatPacket(CHAT_TYPE_INFO, LC_TEXT("이 아이템은 개량할 수 없습니다."));
|
||||
return false;
|
||||
}
|
||||
|
@ -1142,7 +1141,7 @@ bool CHARACTER::DoRefineWithScroll(LPITEM item)
|
|||
}
|
||||
else
|
||||
{
|
||||
sys_err("REFINE : Unknown refine scroll item. Value0: %d", pkItemScroll->GetValue(0));
|
||||
SPDLOG_ERROR("REFINE : Unknown refine scroll item. Value0: {}", pkItemScroll->GetValue(0));
|
||||
}
|
||||
|
||||
if (test_server)
|
||||
|
@ -1214,7 +1213,7 @@ bool CHARACTER::DoRefineWithScroll(LPITEM item)
|
|||
else
|
||||
{
|
||||
// 아이템 생성에 실패 -> 개량 실패로 간주
|
||||
sys_err("cannot create item %u", result_vnum);
|
||||
SPDLOG_ERROR("cannot create item {}", result_vnum);
|
||||
NotifyRefineFail(this, item, szRefineType);
|
||||
}
|
||||
}
|
||||
|
@ -1245,7 +1244,7 @@ bool CHARACTER::DoRefineWithScroll(LPITEM item)
|
|||
else
|
||||
{
|
||||
// 아이템 생성에 실패 -> 개량 실패로 간주
|
||||
sys_err("cannot create item %u", result_fail_vnum);
|
||||
SPDLOG_ERROR("cannot create item {}", result_fail_vnum);
|
||||
NotifyRefineFail(this, item, szRefineType);
|
||||
}
|
||||
}
|
||||
|
@ -1287,7 +1286,7 @@ bool CHARACTER::RefineInformation(BYTE bCell, BYTE bType, int iAdditionalCell)
|
|||
|
||||
if (p.result_vnum == 0)
|
||||
{
|
||||
sys_err("RefineInformation p.result_vnum == 0");
|
||||
SPDLOG_ERROR("RefineInformation p.result_vnum == 0");
|
||||
ChatPacket(CHAT_TYPE_INFO, LC_TEXT("이 아이템은 개량할 수 없습니다."));
|
||||
return false;
|
||||
}
|
||||
|
@ -1317,7 +1316,7 @@ bool CHARACTER::RefineInformation(BYTE bCell, BYTE bType, int iAdditionalCell)
|
|||
|
||||
if (!prt)
|
||||
{
|
||||
sys_err("RefineInformation NOT GET REFINE SET %d", item->GetRefineSet());
|
||||
SPDLOG_ERROR("RefineInformation NOT GET REFINE SET {}", item->GetRefineSet());
|
||||
ChatPacket(CHAT_TYPE_INFO, LC_TEXT("이 아이템은 개량할 수 없습니다."));
|
||||
return false;
|
||||
}
|
||||
|
@ -1433,7 +1432,7 @@ EVENTFUNC(kill_campfire_event)
|
|||
|
||||
if ( info == NULL )
|
||||
{
|
||||
sys_err( "kill_campfire_event> <Factor> Null pointer" );
|
||||
SPDLOG_ERROR("kill_campfire_event> <Factor> Null pointer" );
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -1550,7 +1549,7 @@ void CHARACTER::ProcessRecallItem(LPITEM item)
|
|||
}
|
||||
else
|
||||
{
|
||||
sys_log(1, "Recall: %s %d %d -> %d %d", GetName(), GetX(), GetY(), item->GetSocket(0), item->GetSocket(1));
|
||||
SPDLOG_DEBUG("Recall: {} {} {} -> {} {}", GetName(), GetX(), GetY(), item->GetSocket(0), item->GetSocket(1));
|
||||
WarpSet(item->GetSocket(0), item->GetSocket(1));
|
||||
item->SetCount(item->GetCount() - 1);
|
||||
}
|
||||
|
@ -1578,7 +1577,7 @@ void CHARACTER::SendMyShopPriceListCmd(DWORD dwItemVnum, DWORD dwItemPrice)
|
|||
char szLine[256];
|
||||
snprintf(szLine, sizeof(szLine), "MyShopPriceList %u %u", dwItemVnum, dwItemPrice);
|
||||
ChatPacket(CHAT_TYPE_COMMAND, szLine);
|
||||
sys_log(0, szLine);
|
||||
SPDLOG_DEBUG(szLine);
|
||||
}
|
||||
|
||||
//
|
||||
|
@ -1696,10 +1695,7 @@ bool CHARACTER::UseItemEx(LPITEM item, TItemPos DestCell)
|
|||
}
|
||||
}
|
||||
|
||||
if (test_server)
|
||||
{
|
||||
sys_log(0, "USE_ITEM %s, Inven %d, Cell %d, ItemType %d, SubType %d", item->GetName(), bDestInven, wDestCell, item->GetType(), item->GetSubType());
|
||||
}
|
||||
SPDLOG_TRACE("USE_ITEM {}, Inven {}, Cell {}, ItemType {}, SubType {}", item->GetName(), bDestInven, wDestCell, item->GetType(), item->GetSubType());
|
||||
|
||||
if ( CArenaManager::instance().IsLimitedItem( GetMapIndex(), item->GetVnum() ) == true )
|
||||
{
|
||||
|
@ -1854,7 +1850,7 @@ bool CHARACTER::UseItemEx(LPITEM item, TItemPos DestCell)
|
|||
{
|
||||
if (item->GetSubType() == USE_SPECIAL)
|
||||
{
|
||||
sys_log(0, "ITEM_UNIQUE: USE_SPECIAL %u", item->GetVnum());
|
||||
SPDLOG_DEBUG("ITEM_UNIQUE: USE_SPECIAL {}", item->GetVnum());
|
||||
|
||||
switch (item->GetVnum())
|
||||
{
|
||||
|
@ -2166,8 +2162,7 @@ bool CHARACTER::UseItemEx(LPITEM item, TItemPos DestCell)
|
|||
{
|
||||
if (item->GetVnum() > 50800 && item->GetVnum() <= 50820)
|
||||
{
|
||||
if (test_server)
|
||||
sys_log (0, "ADD addtional effect : vnum(%d) subtype(%d)", item->GetOriginalVnum(), item->GetSubType());
|
||||
SPDLOG_TRACE("ADD addtional effect : vnum({}) subtype({})", item->GetOriginalVnum(), item->GetSubType());
|
||||
|
||||
int affect_type = AFFECT_EXP_BONUS_EURO_FREE;
|
||||
int apply_type = aApplyInfo[item->GetValue(0)].bPointType;
|
||||
|
@ -2355,10 +2350,7 @@ bool CHARACTER::UseItemEx(LPITEM item, TItemPos DestCell)
|
|||
}
|
||||
}
|
||||
|
||||
if (test_server)
|
||||
{
|
||||
sys_log (0, "USE_ITEM %s Type %d SubType %d vnum %d", item->GetName(), item->GetType(), item->GetSubType(), item->GetOriginalVnum());
|
||||
}
|
||||
SPDLOG_TRACE("USE_ITEM {} Type {} SubType {} vnum {}", item->GetName(), item->GetType(), item->GetSubType(), item->GetOriginalVnum());
|
||||
|
||||
switch (item->GetSubType())
|
||||
{
|
||||
|
@ -3408,7 +3400,7 @@ bool CHARACTER::UseItemEx(LPITEM item, TItemPos DestCell)
|
|||
|
||||
int delta = std::min(-GetAlignment(), item->GetValue(0));
|
||||
|
||||
sys_log(0, "%s ALIGNMENT ITEM %d", GetName(), delta);
|
||||
SPDLOG_DEBUG("{} ALIGNMENT ITEM {}", GetName(), delta);
|
||||
|
||||
UpdateAlignment(delta);
|
||||
item->SetCount(item->GetCount() - 1);
|
||||
|
@ -4387,7 +4379,7 @@ bool CHARACTER::UseItemEx(LPITEM item, TItemPos DestCell)
|
|||
}
|
||||
else
|
||||
{
|
||||
sys_err("CHARACTER::UseItem : cannot find spawn position (name %s, %d x %d)", GetName(), GetX(), GetY());
|
||||
SPDLOG_ERROR("CHARACTER::UseItem : cannot find spawn position (name {}, {} x {})", GetName(), GetX(), GetY());
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -4758,7 +4750,7 @@ bool CHARACTER::UseItemEx(LPITEM item, TItemPos DestCell)
|
|||
else
|
||||
{
|
||||
// wtf ?!
|
||||
sys_err("ADD_ATTRIBUTE2 : Item has wrong AttributeCount(%d)", item2->GetAttributeCount());
|
||||
SPDLOG_ERROR("ADD_ATTRIBUTE2 : Item has wrong AttributeCount({})", item2->GetAttributeCount());
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -5081,13 +5073,13 @@ bool CHARACTER::UseItemEx(LPITEM item, TItemPos DestCell)
|
|||
|
||||
case ITEM_BLEND:
|
||||
// 새로운 약초들
|
||||
sys_log(0,"ITEM_BLEND!!");
|
||||
SPDLOG_DEBUG("ITEM_BLEND!!");
|
||||
if (Blend_Item_find(item->GetVnum()))
|
||||
{
|
||||
int affect_type = AFFECT_BLEND;
|
||||
if (item->GetSocket(0) >= _countof(aApplyInfo))
|
||||
{
|
||||
sys_err ("INVALID BLEND ITEM(id : %d, vnum : %d). APPLY TYPE IS %d.", item->GetID(), item->GetVnum(), item->GetSocket(0));
|
||||
SPDLOG_ERROR("INVALID BLEND ITEM(id : {}, vnum : {}). APPLY TYPE IS {}.", item->GetID(), item->GetVnum(), item->GetSocket(0));
|
||||
return false;
|
||||
}
|
||||
int apply_type = aApplyInfo[item->GetSocket(0)].bPointType;
|
||||
|
@ -5140,11 +5132,11 @@ bool CHARACTER::UseItemEx(LPITEM item, TItemPos DestCell)
|
|||
break;
|
||||
|
||||
case ITEM_NONE:
|
||||
sys_err("Item type NONE %s", item->GetName());
|
||||
SPDLOG_ERROR("Item type NONE {}", item->GetName());
|
||||
break;
|
||||
|
||||
default:
|
||||
sys_log(0, "UseItemEx: Unknown type %s %d", item->GetName(), item->GetType());
|
||||
SPDLOG_WARN("UseItemEx: Unknown type {} {}", item->GetName(), item->GetType());
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -5167,7 +5159,7 @@ bool CHARACTER::UseItem(TItemPos Cell, TItemPos DestCell)
|
|||
if (!IsValidItemPosition(Cell) || !(item = GetItem(Cell)))
|
||||
return false;
|
||||
|
||||
sys_log(0, "%s: USE_ITEM %s (inven %d, cell: %d)", GetName(), item->GetName(), window_type, wCell);
|
||||
SPDLOG_DEBUG("{}: USE_ITEM {} (inven {}, cell: {})", GetName(), item->GetName(), window_type, wCell);
|
||||
|
||||
if (item->IsExchanging())
|
||||
return false;
|
||||
|
@ -5391,8 +5383,7 @@ bool CHARACTER::DropItem(TItemPos Cell, BYTE bCount)
|
|||
{
|
||||
if (bCount == 0)
|
||||
{
|
||||
if (test_server)
|
||||
sys_log(0, "[DROP_ITEM] drop item count == 0");
|
||||
SPDLOG_TRACE("[DROP_ITEM] drop item count == 0");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -5594,7 +5585,7 @@ bool CHARACTER::MoveItem(TItemPos Cell, TItemPos DestCell, BYTE count)
|
|||
if (count == 0)
|
||||
count = item->GetCount();
|
||||
|
||||
sys_log(0, "%s: ITEM_STACK %s (window: %d, cell : %d) -> (window:%d, cell %d) count %d", GetName(), item->GetName(), Cell.window_type, Cell.cell,
|
||||
SPDLOG_DEBUG("{}: ITEM_STACK {} (window: {}, cell : {}) -> (window:{}, cell {}) count {}", GetName(), item->GetName(), Cell.window_type, Cell.cell,
|
||||
DestCell.window_type, DestCell.cell, count);
|
||||
|
||||
count = std::min<BYTE>(200 - item2->GetCount(), count);
|
||||
|
@ -5609,7 +5600,7 @@ bool CHARACTER::MoveItem(TItemPos Cell, TItemPos DestCell, BYTE count)
|
|||
|
||||
if (count == 0 || count >= item->GetCount() || !item->IsStackable() || IS_SET(item->GetAntiFlag(), ITEM_ANTIFLAG_STACK))
|
||||
{
|
||||
sys_log(0, "%s: ITEM_MOVE %s (window: %d, cell : %d) -> (window:%d, cell %d) count %d", GetName(), item->GetName(), Cell.window_type, Cell.cell,
|
||||
SPDLOG_DEBUG("{}: ITEM_MOVE {} (window: {}, cell : {}) -> (window:{}, cell {}) count {}", GetName(), item->GetName(), Cell.window_type, Cell.cell,
|
||||
DestCell.window_type, DestCell.cell, count);
|
||||
|
||||
item->RemoveFromCharacter();
|
||||
|
@ -5629,7 +5620,7 @@ bool CHARACTER::MoveItem(TItemPos Cell, TItemPos DestCell, BYTE count)
|
|||
// }
|
||||
//}
|
||||
|
||||
sys_log(0, "%s: ITEM_SPLIT %s (window: %d, cell : %d) -> (window:%d, cell %d) count %d", GetName(), item->GetName(), Cell.window_type, Cell.cell,
|
||||
SPDLOG_DEBUG("{}: ITEM_SPLIT {} (window: {}, cell : {}) -> (window:{}, cell {}) count {}", GetName(), item->GetName(), Cell.window_type, Cell.cell,
|
||||
DestCell.window_type, DestCell.cell, count);
|
||||
|
||||
item->SetCount(item->GetCount() - count);
|
||||
|
@ -5716,7 +5707,7 @@ void CHARACTER::GiveGold(int iAmount)
|
|||
if (iAmount <= 0)
|
||||
return;
|
||||
|
||||
sys_log(0, "GIVE_GOLD: %s %d", GetName(), iAmount);
|
||||
SPDLOG_DEBUG("GIVE_GOLD: {} {}", GetName(), iAmount);
|
||||
|
||||
if (GetParty())
|
||||
{
|
||||
|
@ -5839,7 +5830,7 @@ bool CHARACTER::PickupItem(DWORD dwVID)
|
|||
{
|
||||
if ((iEmptyCell = GetEmptyDragonSoulInventory(item)) == -1)
|
||||
{
|
||||
sys_log(0, "No empty ds inventory pid %u size %ud itemid %u", GetPlayerID(), item->GetSize(), item->GetID());
|
||||
SPDLOG_DEBUG("No empty ds inventory pid {} size {}d itemid {}", GetPlayerID(), item->GetSize(), item->GetID());
|
||||
ChatPacket(CHAT_TYPE_INFO, LC_TEXT("소지하고 있는 아이템이 너무 많습니다."));
|
||||
return false;
|
||||
}
|
||||
|
@ -5848,7 +5839,7 @@ bool CHARACTER::PickupItem(DWORD dwVID)
|
|||
{
|
||||
if ((iEmptyCell = GetEmptyInventory(item->GetSize())) == -1)
|
||||
{
|
||||
sys_log(0, "No empty inventory pid %u size %ud itemid %u", GetPlayerID(), item->GetSize(), item->GetID());
|
||||
SPDLOG_DEBUG("No empty inventory pid {} size {}d itemid {}", GetPlayerID(), item->GetSize(), item->GetID());
|
||||
ChatPacket(CHAT_TYPE_INFO, LC_TEXT("소지하고 있는 아이템이 너무 많습니다."));
|
||||
return false;
|
||||
}
|
||||
|
@ -5980,7 +5971,7 @@ bool CHARACTER::SwapItem(BYTE bCell, BYTE bDestCell)
|
|||
|
||||
if (item1 == item2)
|
||||
{
|
||||
sys_log(0, "[WARNING][WARNING][HACK USER!] : %s %d %d", m_stName.c_str(), bCell, bDestCell);
|
||||
SPDLOG_WARN("[WARNING][WARNING][HACK USER!] : {} {} {}", m_stName.c_str(), bCell, bDestCell);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -6006,7 +5997,7 @@ bool CHARACTER::SwapItem(BYTE bCell, BYTE bDestCell)
|
|||
if (item1->EquipTo(this, bEquipCell))
|
||||
item2->AddToCharacter(this, TItemPos(INVENTORY, bInvenCell));
|
||||
else
|
||||
sys_err("SwapItem cannot equip %s! item1 %s", item2->GetName(), item1->GetName());
|
||||
SPDLOG_ERROR("SwapItem cannot equip {}! item1 {}", item2->GetName(), item1->GetName());
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -6401,7 +6392,7 @@ void CHARACTER::RemoveSpecifyItem(DWORD vnum, DWORD count)
|
|||
|
||||
// 예외처리가 약하다.
|
||||
if (count)
|
||||
sys_log(0, "CHARACTER::RemoveSpecifyItem cannot remove enough item vnum %u, still remain %d", vnum, count);
|
||||
SPDLOG_WARN("CHARACTER::RemoveSpecifyItem cannot remove enough item vnum {}, still remain {}", vnum, count);
|
||||
}
|
||||
|
||||
int CHARACTER::CountSpecifyTypeItem(BYTE type) const
|
||||
|
@ -6461,12 +6452,12 @@ void CHARACTER::AutoGiveItem(LPITEM item, bool longOwnerShip)
|
|||
{
|
||||
if (NULL == item)
|
||||
{
|
||||
sys_err ("NULL point.");
|
||||
SPDLOG_ERROR("NULL point.");
|
||||
return;
|
||||
}
|
||||
if (item->GetOwner())
|
||||
{
|
||||
sys_err ("item %d 's owner exists!",item->GetID());
|
||||
SPDLOG_ERROR("item {} 's owner exists!",item->GetID());
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -6561,7 +6552,7 @@ LPITEM CHARACTER::AutoGiveItem(DWORD dwItemVnum, BYTE bCount, int iRarePct, bool
|
|||
|
||||
if (!item)
|
||||
{
|
||||
sys_err("cannot create item by vnum %u (name: %s)", dwItemVnum, GetName());
|
||||
SPDLOG_ERROR("cannot create item by vnum {} (name: {})", dwItemVnum, GetName());
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
@ -6636,8 +6627,6 @@ LPITEM CHARACTER::AutoGiveItem(DWORD dwItemVnum, BYTE bCount, int iRarePct, bool
|
|||
LogManager::instance().ItemLog(this, item, "SYSTEM_DROP", item->GetName());
|
||||
}
|
||||
|
||||
sys_log(0,
|
||||
"7: %d %d", dwItemVnum, bCount);
|
||||
return item;
|
||||
}
|
||||
|
||||
|
@ -6910,7 +6899,7 @@ void CHARACTER::ReceiveItem(LPCHARACTER from, LPITEM item)
|
|||
break;
|
||||
|
||||
default:
|
||||
sys_log(0, "TakeItem %s %d %s", from->GetName(), GetRaceNum(), item->GetName());
|
||||
SPDLOG_DEBUG("TakeItem {} {} {}", from->GetName(), GetRaceNum(), item->GetName());
|
||||
from->SetQuestNPCID(GetVID());
|
||||
quest::CQuestManager::instance().TakeItem(from->GetPlayerID(), GetRaceNum(), item);
|
||||
break;
|
||||
|
@ -6980,7 +6969,7 @@ bool CHARACTER::GiveItemFromSpecialItemGroup(DWORD dwGroupNum, std::vector<DWORD
|
|||
|
||||
if (!pGroup)
|
||||
{
|
||||
sys_err("cannot find special item group %d", dwGroupNum);
|
||||
SPDLOG_ERROR("cannot find special item group {}", dwGroupNum);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -7016,7 +7005,7 @@ bool CHARACTER::GiveItemFromSpecialItemGroup(DWORD dwGroupNum, std::vector<DWORD
|
|||
|
||||
case CSpecialItemGroup::MOB:
|
||||
{
|
||||
sys_log(0, "CSpecialItemGroup::MOB %d", dwCount);
|
||||
SPDLOG_DEBUG("CSpecialItemGroup::MOB {}", dwCount);
|
||||
int x = GetX() + Random::get(-500, 500);
|
||||
int y = GetY() + Random::get(-500, 500);
|
||||
|
||||
|
@ -7028,7 +7017,7 @@ bool CHARACTER::GiveItemFromSpecialItemGroup(DWORD dwGroupNum, std::vector<DWORD
|
|||
break;
|
||||
case CSpecialItemGroup::SLOW:
|
||||
{
|
||||
sys_log(0, "CSpecialItemGroup::SLOW %d", -(int)dwCount);
|
||||
SPDLOG_DEBUG("CSpecialItemGroup::SLOW {}", -(int)dwCount);
|
||||
AddAffect(AFFECT_SLOW, POINT_MOV_SPEED, -(int)dwCount, AFF_SLOW, 300, 0, true);
|
||||
bSuccess = true;
|
||||
}
|
||||
|
@ -7036,9 +7025,9 @@ bool CHARACTER::GiveItemFromSpecialItemGroup(DWORD dwGroupNum, std::vector<DWORD
|
|||
case CSpecialItemGroup::DRAIN_HP:
|
||||
{
|
||||
int iDropHP = GetMaxHP()*dwCount/100;
|
||||
sys_log(0, "CSpecialItemGroup::DRAIN_HP %d", -iDropHP);
|
||||
SPDLOG_DEBUG("CSpecialItemGroup::DRAIN_HP {}", -iDropHP);
|
||||
iDropHP = std::min(iDropHP, GetHP()-1);
|
||||
sys_log(0, "CSpecialItemGroup::DRAIN_HP %d", -iDropHP);
|
||||
SPDLOG_DEBUG("CSpecialItemGroup::DRAIN_HP {}", -iDropHP);
|
||||
PointChange(POINT_HP, -iDropHP);
|
||||
bSuccess = true;
|
||||
}
|
||||
|
@ -7180,7 +7169,7 @@ bool CHARACTER::ItemProcess_Polymorph(LPITEM item)
|
|||
case 71093 :
|
||||
{
|
||||
// 둔갑구 처리
|
||||
sys_log(0, "USE_POLYMORPH_BALL PID(%d) vnum(%d)", GetPlayerID(), dwVnum);
|
||||
SPDLOG_DEBUG("USE_POLYMORPH_BALL PID({}) vnum({})", GetPlayerID(), dwVnum);
|
||||
|
||||
// 레벨 제한 체크
|
||||
int iPolymorphLevelLimit = std::max(0, 20 - GetLevel() * 3 / 10);
|
||||
|
@ -7218,7 +7207,7 @@ bool CHARACTER::ItemProcess_Polymorph(LPITEM item)
|
|||
// 둔갑서 처리
|
||||
// 소켓0 소켓1 소켓2
|
||||
// 둔갑할 몬스터 번호 수련정도 둔갑서 레벨
|
||||
sys_log(0, "USE_POLYMORPH_BOOK: %s(%u) vnum(%u)", GetName(), GetPlayerID(), dwVnum);
|
||||
SPDLOG_DEBUG("USE_POLYMORPH_BOOK: {}({}) vnum({})", GetName(), GetPlayerID(), dwVnum);
|
||||
|
||||
if (CPolymorphUtils::instance().PolymorphCharacter(this, item, pMob) == true)
|
||||
{
|
||||
|
@ -7231,7 +7220,7 @@ bool CHARACTER::ItemProcess_Polymorph(LPITEM item)
|
|||
break;
|
||||
|
||||
default :
|
||||
sys_err("POLYMORPH invalid item passed PID(%d) vnum(%d)", GetPlayerID(), item->GetOriginalVnum());
|
||||
SPDLOG_ERROR("POLYMORPH invalid item passed PID({}) vnum({})", GetPlayerID(), item->GetOriginalVnum());
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -110,7 +110,7 @@ void CHARACTER_MANAGER::DestroyCharacter(LPCHARACTER ch, const char* file, size_
|
|||
// <Factor> Check whether it has been already deleted or not.
|
||||
itertype(m_map_pkChrByVID) it = m_map_pkChrByVID.find(ch->GetVID());
|
||||
if (it == m_map_pkChrByVID.end()) {
|
||||
sys_err("[CHARACTER_MANAGER::DestroyCharacter] <Factor> %d not found", (int)(ch->GetVID()));
|
||||
SPDLOG_ERROR("[CHARACTER_MANAGER::DestroyCharacter] <Factor> {} not found", (int)(ch->GetVID()));
|
||||
return; // prevent duplicated destrunction
|
||||
}
|
||||
|
||||
|
@ -178,7 +178,7 @@ LPCHARACTER CHARACTER_MANAGER::Find(DWORD dwVID)
|
|||
// <Factor> Added sanity check
|
||||
LPCHARACTER found = it->second;
|
||||
if (found != NULL && dwVID != (DWORD)found->GetVID()) {
|
||||
sys_err("[CHARACTER_MANAGER::Find] <Factor> %u != %u", dwVID, (DWORD)found->GetVID());
|
||||
SPDLOG_ERROR("[CHARACTER_MANAGER::Find] <Factor> {} != {}", dwVID, (DWORD)found->GetVID());
|
||||
return NULL;
|
||||
}
|
||||
return found;
|
||||
|
@ -204,7 +204,7 @@ LPCHARACTER CHARACTER_MANAGER::FindByPID(DWORD dwPID)
|
|||
// <Factor> Added sanity check
|
||||
LPCHARACTER found = it->second;
|
||||
if (found != NULL && dwPID != found->GetPlayerID()) {
|
||||
sys_err("[CHARACTER_MANAGER::FindByPID] <Factor> %u != %u", dwPID, found->GetPlayerID());
|
||||
SPDLOG_ERROR("[CHARACTER_MANAGER::FindByPID] <Factor> {} != {}", dwPID, found->GetPlayerID());
|
||||
return NULL;
|
||||
}
|
||||
return found;
|
||||
|
@ -222,7 +222,7 @@ LPCHARACTER CHARACTER_MANAGER::FindPC(const char * name)
|
|||
// <Factor> Added sanity check
|
||||
LPCHARACTER found = it->second;
|
||||
if (found != NULL && strncasecmp(szName, found->GetName(), CHARACTER_NAME_MAX_LEN) != 0) {
|
||||
sys_err("[CHARACTER_MANAGER::FindPC] <Factor> %s != %s", name, found->GetName());
|
||||
SPDLOG_ERROR("[CHARACTER_MANAGER::FindPC] <Factor> {} != {}", name, found->GetName());
|
||||
return NULL;
|
||||
}
|
||||
return found;
|
||||
|
@ -234,7 +234,7 @@ LPCHARACTER CHARACTER_MANAGER::SpawnMobRandomPosition(DWORD dwVnum, int lMapInde
|
|||
{
|
||||
if (dwVnum == 5001 && !quest::CQuestManager::instance().GetEventFlag("japan_regen"))
|
||||
{
|
||||
sys_log(1, "WAEGU[5001] regen disabled.");
|
||||
SPDLOG_TRACE("WAEGU[5001] regen disabled.");
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
@ -243,7 +243,7 @@ LPCHARACTER CHARACTER_MANAGER::SpawnMobRandomPosition(DWORD dwVnum, int lMapInde
|
|||
{
|
||||
if (dwVnum == 5002 && !quest::CQuestManager::instance().GetEventFlag("newyear_mob"))
|
||||
{
|
||||
sys_log(1, "HAETAE (new-year-mob) [5002] regen disabled.");
|
||||
SPDLOG_TRACE("HAETAE (new-year-mob) [5002] regen disabled.");
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
@ -252,7 +252,7 @@ LPCHARACTER CHARACTER_MANAGER::SpawnMobRandomPosition(DWORD dwVnum, int lMapInde
|
|||
{
|
||||
if (dwVnum == 5004 && !quest::CQuestManager::instance().GetEventFlag("independence_day"))
|
||||
{
|
||||
sys_log(1, "INDEPENDECE DAY [5004] regen disabled.");
|
||||
SPDLOG_TRACE("INDEPENDECE DAY [5004] regen disabled.");
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
@ -261,13 +261,13 @@ LPCHARACTER CHARACTER_MANAGER::SpawnMobRandomPosition(DWORD dwVnum, int lMapInde
|
|||
|
||||
if (!pkMob)
|
||||
{
|
||||
sys_err("no mob data for vnum %u", dwVnum);
|
||||
SPDLOG_ERROR("no mob data for vnum {}", dwVnum);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (!map_allow_find(lMapIndex))
|
||||
{
|
||||
sys_err("not allowed map %u", lMapIndex);
|
||||
SPDLOG_ERROR("not allowed map {}", lMapIndex);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
@ -301,7 +301,7 @@ LPCHARACTER CHARACTER_MANAGER::SpawnMobRandomPosition(DWORD dwVnum, int lMapInde
|
|||
|
||||
if (i == 2000)
|
||||
{
|
||||
sys_err("cannot find valid location");
|
||||
SPDLOG_ERROR("cannot find valid location");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
@ -309,7 +309,7 @@ LPCHARACTER CHARACTER_MANAGER::SpawnMobRandomPosition(DWORD dwVnum, int lMapInde
|
|||
|
||||
if (!sectree)
|
||||
{
|
||||
sys_log(0, "SpawnMobRandomPosition: cannot create monster at non-exist sectree %d x %d (map %d)", x, y, lMapIndex);
|
||||
SPDLOG_ERROR("SpawnMobRandomPosition: cannot create monster at non-exist sectree {} x {} (map {})", x, y, lMapIndex);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
@ -317,7 +317,7 @@ LPCHARACTER CHARACTER_MANAGER::SpawnMobRandomPosition(DWORD dwVnum, int lMapInde
|
|||
|
||||
if (!ch)
|
||||
{
|
||||
sys_log(0, "SpawnMobRandomPosition: cannot create new character");
|
||||
SPDLOG_ERROR("SpawnMobRandomPosition: cannot create new character");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
@ -333,7 +333,7 @@ LPCHARACTER CHARACTER_MANAGER::SpawnMobRandomPosition(DWORD dwVnum, int lMapInde
|
|||
if (!ch->Show(lMapIndex, x, y, 0, false))
|
||||
{
|
||||
M2_DESTROY_CHARACTER(ch);
|
||||
sys_err(0, "SpawnMobRandomPosition: cannot show monster");
|
||||
SPDLOG_ERROR("SpawnMobRandomPosition: cannot show monster");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
@ -345,7 +345,7 @@ LPCHARACTER CHARACTER_MANAGER::SpawnMobRandomPosition(DWORD dwVnum, int lMapInde
|
|||
if (test_server)
|
||||
SendNotice(buf);
|
||||
|
||||
sys_log(0, buf);
|
||||
SPDLOG_DEBUG(buf);
|
||||
return (ch);
|
||||
}
|
||||
|
||||
|
@ -354,7 +354,7 @@ LPCHARACTER CHARACTER_MANAGER::SpawnMob(DWORD dwVnum, int lMapIndex, int x, int
|
|||
const CMob * pkMob = CMobManager::instance().Get(dwVnum);
|
||||
if (!pkMob)
|
||||
{
|
||||
sys_err("SpawnMob: no mob data for vnum %u", dwVnum);
|
||||
SPDLOG_ERROR("SpawnMob: no mob data for vnum {}", dwVnum);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
@ -364,7 +364,7 @@ LPCHARACTER CHARACTER_MANAGER::SpawnMob(DWORD dwVnum, int lMapIndex, int x, int
|
|||
|
||||
if (!tree)
|
||||
{
|
||||
sys_log(0, "no sectree for spawn at %d %d mobvnum %d mapindex %d", x, y, dwVnum, lMapIndex);
|
||||
SPDLOG_ERROR("no sectree for spawn at {} {} mobvnum {} mapindex {}", x, y, dwVnum, lMapIndex);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
@ -391,14 +391,14 @@ LPCHARACTER CHARACTER_MANAGER::SpawnMob(DWORD dwVnum, int lMapIndex, int x, int
|
|||
}
|
||||
|
||||
if (s_isLog)
|
||||
sys_log(0, "SpawnMob: BLOCKED position for spawn %s %u at %d %d (attr %u)", pkMob->m_table.szName, dwVnum, x, y, dwAttr);
|
||||
SPDLOG_DEBUG("SpawnMob: BLOCKED position for spawn {} {} at {} {} (attr {})", pkMob->m_table.szName, dwVnum, x, y, dwAttr);
|
||||
// END_OF_SPAWN_BLOCK_LOG
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (IS_SET(dwAttr, ATTR_BANPK))
|
||||
{
|
||||
sys_log(0, "SpawnMob: BAN_PK position for mob spawn %s %u at %d %d", pkMob->m_table.szName, dwVnum, x, y);
|
||||
SPDLOG_DEBUG("SpawnMob: BAN_PK position for mob spawn {} {} at {} {}", pkMob->m_table.szName, dwVnum, x, y);
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
@ -407,7 +407,7 @@ LPCHARACTER CHARACTER_MANAGER::SpawnMob(DWORD dwVnum, int lMapIndex, int x, int
|
|||
|
||||
if (!sectree)
|
||||
{
|
||||
sys_log(0, "SpawnMob: cannot create monster at non-exist sectree %d x %d (map %d)", x, y, lMapIndex);
|
||||
SPDLOG_ERROR("SpawnMob: cannot create monster at non-exist sectree {} x {} (map {})", x, y, lMapIndex);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
@ -415,7 +415,7 @@ LPCHARACTER CHARACTER_MANAGER::SpawnMob(DWORD dwVnum, int lMapIndex, int x, int
|
|||
|
||||
if (!ch)
|
||||
{
|
||||
sys_log(0, "SpawnMob: cannot create new character");
|
||||
SPDLOG_ERROR("SpawnMob: cannot create new character");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
@ -434,7 +434,7 @@ LPCHARACTER CHARACTER_MANAGER::SpawnMob(DWORD dwVnum, int lMapIndex, int x, int
|
|||
if (bShow && !ch->Show(lMapIndex, x, y, z, bSpawnMotion))
|
||||
{
|
||||
M2_DESTROY_CHARACTER(ch);
|
||||
sys_log(0, "SpawnMob: cannot show monster");
|
||||
SPDLOG_ERROR("SpawnMob: cannot show monster");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
@ -466,7 +466,7 @@ LPCHARACTER CHARACTER_MANAGER::SpawnMobRange(DWORD dwVnum, int lMapIndex, int sx
|
|||
|
||||
if (ch)
|
||||
{
|
||||
sys_log(1, "MOB_SPAWN: %s(%d) %dx%d", ch->GetName(), (DWORD) ch->GetVID(), ch->GetX(), ch->GetY());
|
||||
SPDLOG_TRACE("MOB_SPAWN: {}({}) {}x{}", ch->GetName(), (DWORD) ch->GetVID(), ch->GetX(), ch->GetY());
|
||||
if ( bAggressive )
|
||||
ch->SetAggressive();
|
||||
return (ch);
|
||||
|
@ -487,7 +487,7 @@ bool CHARACTER_MANAGER::SpawnMoveGroup(DWORD dwVnum, int lMapIndex, int sx, int
|
|||
|
||||
if (!pkGroup)
|
||||
{
|
||||
sys_err("NOT_EXIST_GROUP_VNUM(%u) Map(%u) ", dwVnum, lMapIndex);
|
||||
SPDLOG_ERROR("NOT_EXIST_GROUP_VNUM({}) Map({}) ", dwVnum, lMapIndex);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -557,7 +557,7 @@ bool CHARACTER_MANAGER::SpawnGroupGroup(DWORD dwVnum, int lMapIndex, int sx, int
|
|||
}
|
||||
else
|
||||
{
|
||||
sys_err( "NOT_EXIST_GROUP_GROUP_VNUM(%u) MAP(%ld)", dwVnum, lMapIndex );
|
||||
SPDLOG_ERROR("NOT_EXIST_GROUP_GROUP_VNUM({}) MAP({})", dwVnum, lMapIndex );
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -568,7 +568,7 @@ LPCHARACTER CHARACTER_MANAGER::SpawnGroup(DWORD dwVnum, int lMapIndex, int sx, i
|
|||
|
||||
if (!pkGroup)
|
||||
{
|
||||
sys_err("NOT_EXIST_GROUP_VNUM(%u) Map(%u) ", dwVnum, lMapIndex);
|
||||
SPDLOG_ERROR("NOT_EXIST_GROUP_VNUM({}) Map({}) ", dwVnum, lMapIndex);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
@ -717,7 +717,7 @@ void CHARACTER_MANAGER::Update(int iPulse)
|
|||
|
||||
// 테스트 서버에서는 60초마다 캐릭터 개수를 센다
|
||||
if (test_server && 0 == (iPulse % PASSES_PER_SEC(60)))
|
||||
sys_log(0, "CHARACTER COUNT vid %zu pid %zu", m_map_pkChrByVID.size(), m_map_pkChrByPID.size());
|
||||
SPDLOG_TRACE("CHARACTER COUNT vid {} pid {}", m_map_pkChrByVID.size(), m_map_pkChrByPID.size());
|
||||
|
||||
// 지연된 DestroyCharacter 하기
|
||||
FlushPendingDestroy();
|
||||
|
@ -757,7 +757,6 @@ void CHARACTER_MANAGER::RemoveFromStateList(LPCHARACTER ch)
|
|||
|
||||
if (it != m_set_pkChrState.end())
|
||||
{
|
||||
//sys_log(0, "RemoveFromStateList %p", ch);
|
||||
m_set_pkChrState.erase(it);
|
||||
}
|
||||
}
|
||||
|
@ -838,7 +837,7 @@ void CHARACTER_MANAGER::RegisterRaceNumMap(LPCHARACTER ch)
|
|||
|
||||
if (m_set_dwRegisteredRaceNum.find(dwVnum) != m_set_dwRegisteredRaceNum.end()) // 등록된 번호 이면
|
||||
{
|
||||
sys_log(0, "RegisterRaceNumMap %s %u", ch->GetName(), dwVnum);
|
||||
SPDLOG_TRACE("RegisterRaceNumMap {} {}", ch->GetName(), dwVnum);
|
||||
m_map_pkChrByRaceNum[dwVnum].insert(ch);
|
||||
}
|
||||
}
|
||||
|
@ -1074,7 +1073,7 @@ void CHARACTER_MANAGER::FlushPendingDestroy()
|
|||
|
||||
if (!m_set_pkChrPendingDestroy.empty())
|
||||
{
|
||||
sys_log(0, "FlushPendingDestroy size %d", m_set_pkChrPendingDestroy.size());
|
||||
SPDLOG_DEBUG("FlushPendingDestroy size {}", m_set_pkChrPendingDestroy.size());
|
||||
|
||||
CHARACTER_SET::iterator it = m_set_pkChrPendingDestroy.begin(),
|
||||
end = m_set_pkChrPendingDestroy.end();
|
||||
|
|
|
@ -50,7 +50,7 @@ EVENTFUNC(poison_event)
|
|||
|
||||
if ( info == NULL )
|
||||
{
|
||||
sys_err( "poison_event> <Factor> Null pointer" );
|
||||
SPDLOG_ERROR("poison_event> <Factor> Null pointer" );
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -103,7 +103,7 @@ EVENTFUNC(fire_event)
|
|||
|
||||
if ( info == NULL )
|
||||
{
|
||||
sys_err( "fire_event> <Factor> Null pointer" );
|
||||
SPDLOG_ERROR("fire_event> <Factor> Null pointer" );
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -47,7 +47,7 @@ time_t CHARACTER::GetSkillNextReadTime(DWORD dwVnum) const
|
|||
{
|
||||
if (dwVnum >= SKILL_MAX_NUM)
|
||||
{
|
||||
sys_err("vnum overflow (vnum: %u)", dwVnum);
|
||||
SPDLOG_ERROR("vnum overflow (vnum: {})", dwVnum);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -66,24 +66,24 @@ bool TSkillUseInfo::HitOnce(DWORD dwVnum)
|
|||
if (!bUsed)
|
||||
return false;
|
||||
|
||||
sys_log(1, "__HitOnce NextUse %u current %u count %d scount %d", dwNextSkillUsableTime, get_dword_time(), iHitCount, iSplashCount);
|
||||
SPDLOG_DEBUG("__HitOnce NextUse {} current {} count {} scount {}", dwNextSkillUsableTime, get_dword_time(), iHitCount, iSplashCount);
|
||||
|
||||
if (dwNextSkillUsableTime && dwNextSkillUsableTime<get_dword_time() && dwVnum != SKILL_MUYEONG && dwVnum != SKILL_HORSE_WILDATTACK)
|
||||
{
|
||||
sys_log(1, "__HitOnce can't hit");
|
||||
SPDLOG_DEBUG("__HitOnce can't hit");
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
if (iHitCount == -1)
|
||||
{
|
||||
sys_log(1, "__HitOnce OK %d %d %d", dwNextSkillUsableTime, get_dword_time(), iHitCount);
|
||||
SPDLOG_DEBUG("__HitOnce OK {} {} {}", dwNextSkillUsableTime, get_dword_time(), iHitCount);
|
||||
return true;
|
||||
}
|
||||
|
||||
if (iHitCount)
|
||||
{
|
||||
sys_log(1, "__HitOnce OK %d %d %d", dwNextSkillUsableTime, get_dword_time(), iHitCount);
|
||||
SPDLOG_DEBUG("__HitOnce OK {} {} {}", dwNextSkillUsableTime, get_dword_time(), iHitCount);
|
||||
iHitCount--;
|
||||
return true;
|
||||
}
|
||||
|
@ -100,7 +100,7 @@ bool TSkillUseInfo::UseSkill(bool isGrandMaster, DWORD vid, DWORD dwCooltime, in
|
|||
// 아직 쿨타임이 끝나지 않았다.
|
||||
if (bUsed && dwNextSkillUsableTime > dwCur)
|
||||
{
|
||||
sys_log(0, "cooltime is not over delta %u", dwNextSkillUsableTime - dwCur);
|
||||
SPDLOG_DEBUG("cooltime is not over delta {}", dwNextSkillUsableTime - dwCur);
|
||||
iHitCount = 0;
|
||||
return false;
|
||||
}
|
||||
|
@ -115,8 +115,7 @@ bool TSkillUseInfo::UseSkill(bool isGrandMaster, DWORD vid, DWORD dwCooltime, in
|
|||
iRange = range;
|
||||
iMaxHitCount = iHitCount = hitcount;
|
||||
|
||||
if (test_server)
|
||||
sys_log(0, "UseSkill NextUse %u current %u cooltime %d hitcount %d/%d", dwNextSkillUsableTime, dwCur, dwCooltime, iHitCount, iMaxHitCount);
|
||||
SPDLOG_TRACE("UseSkill NextUse {} current {} cooltime {} hitcount {}/{}", dwNextSkillUsableTime, dwCur, dwCooltime, iHitCount, iMaxHitCount);
|
||||
|
||||
dwVID = vid;
|
||||
iSplashCount = splashcount;
|
||||
|
@ -174,7 +173,7 @@ void CHARACTER::SetSkillLevel(DWORD dwVnum, BYTE bLev)
|
|||
|
||||
if (dwVnum >= SKILL_MAX_NUM)
|
||||
{
|
||||
sys_err("vnum overflow (vnum %u)", dwVnum);
|
||||
SPDLOG_ERROR("vnum overflow (vnum {})", dwVnum);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -272,7 +271,7 @@ bool CHARACTER::LearnGrandMasterSkill(DWORD dwSkillVnum)
|
|||
return false;
|
||||
}
|
||||
|
||||
sys_log(0, "learn grand master skill[%d] cur %d, next %d", dwSkillVnum, get_global_time(), GetSkillNextReadTime(dwSkillVnum));
|
||||
SPDLOG_DEBUG("learn grand master skill[{}] cur {}, next {}", dwSkillVnum, get_global_time(), GetSkillNextReadTime(dwSkillVnum));
|
||||
|
||||
/*
|
||||
if (get_global_time() < GetSkillNextReadTime(dwSkillVnum))
|
||||
|
@ -322,7 +321,7 @@ bool CHARACTER::LearnGrandMasterSkill(DWORD dwSkillVnum)
|
|||
|
||||
int idx = std::min(9, GetSkillLevel(dwSkillVnum) - 30);
|
||||
|
||||
sys_log(0, "LearnGrandMasterSkill %s table idx %d value %d", GetName(), idx, aiGrandMasterSkillBookCountForLevelUp[idx]);
|
||||
SPDLOG_DEBUG("LearnGrandMasterSkill {} table idx {} value {}", GetName(), idx, aiGrandMasterSkillBookCountForLevelUp[idx]);
|
||||
|
||||
int iTotalReadCount = GetQuestFlag(strTrainSkill) + 1;
|
||||
SetQuestFlag(strTrainSkill, iTotalReadCount);
|
||||
|
@ -365,11 +364,11 @@ bool CHARACTER::LearnGrandMasterSkill(DWORD dwSkillVnum)
|
|||
}
|
||||
|
||||
int n = Random::get(1, iBookCount);
|
||||
sys_log(0, "Number(%d)", n);
|
||||
SPDLOG_TRACE("Number({})", n);
|
||||
|
||||
DWORD nextTime = get_global_time() + Random::get(28800, 43200);
|
||||
|
||||
sys_log(0, "GrandMaster SkillBookCount min %d cur %d max %d (next_time=%d)", iMinReadCount, iTotalReadCount, iMaxReadCount, nextTime);
|
||||
SPDLOG_DEBUG("GrandMaster SkillBookCount min {} cur {} max {} (next_time={})", iMinReadCount, iTotalReadCount, iMaxReadCount, nextTime);
|
||||
|
||||
bool bSuccess = n == 2;
|
||||
|
||||
|
@ -483,26 +482,24 @@ bool CHARACTER::LearnSkillByBook(DWORD dwSkillVnum, BYTE bProb)
|
|||
}
|
||||
// END_OF_SKILL_BOOK_BONUS
|
||||
|
||||
sys_log(0, "LearnSkillByBook Pct %u prob %d", dwSkillVnum, bProb);
|
||||
SPDLOG_DEBUG("LearnSkillByBook Pct {} prob {}", dwSkillVnum, bProb);
|
||||
|
||||
if (Random::get(1, 100) <= bProb)
|
||||
{
|
||||
if (test_server)
|
||||
sys_log(0, "LearnSkillByBook %u SUCC", dwSkillVnum);
|
||||
SPDLOG_TRACE("LearnSkillByBook {} SUCC", dwSkillVnum);
|
||||
|
||||
SkillLevelUp(dwSkillVnum, SKILL_UP_BY_BOOK);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (test_server)
|
||||
sys_log(0, "LearnSkillByBook %u FAIL", dwSkillVnum);
|
||||
SPDLOG_TRACE("LearnSkillByBook {} FAIL", dwSkillVnum);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
int idx = std::min(9, GetSkillLevel(dwSkillVnum) - 20);
|
||||
|
||||
sys_log(0, "LearnSkillByBook %s table idx %d value %d", GetName(), idx, aiSkillBookCountForLevelUp[idx]);
|
||||
SPDLOG_DEBUG("LearnSkillByBook {} table idx {} value {}", GetName(), idx, aiSkillBookCountForLevelUp[idx]);
|
||||
|
||||
if (!LC_IsYMIR())
|
||||
{
|
||||
|
@ -635,7 +632,7 @@ bool CHARACTER::SkillLevelDown(DWORD dwVnum)
|
|||
|
||||
if (!pkSk)
|
||||
{
|
||||
sys_err("There is no such skill by number %u", dwVnum);
|
||||
SPDLOG_ERROR("There is no such skill by number {}", dwVnum);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -671,7 +668,7 @@ bool CHARACTER::SkillLevelDown(DWORD dwVnum)
|
|||
idx = POINT_HORSE_SKILL;
|
||||
break;
|
||||
default:
|
||||
sys_err("Wrong skill type %d skill vnum %d", pkSk->dwType, pkSk->dwVnum);
|
||||
SPDLOG_ERROR("Wrong skill type {} skill vnum {}", pkSk->dwType, pkSk->dwVnum);
|
||||
return false;
|
||||
|
||||
}
|
||||
|
@ -679,7 +676,7 @@ bool CHARACTER::SkillLevelDown(DWORD dwVnum)
|
|||
PointChange(idx, +1);
|
||||
SetSkillLevel(pkSk->dwVnum, m_pSkillLevels[pkSk->dwVnum].bLevel - 1);
|
||||
|
||||
sys_log(0, "SkillDown: %s %u %u %u type %u", GetName(), pkSk->dwVnum, m_pSkillLevels[pkSk->dwVnum].bMasterType, m_pSkillLevels[pkSk->dwVnum].bLevel, pkSk->dwType);
|
||||
SPDLOG_DEBUG("SkillDown: {} {} {} {} type {}", GetName(), pkSk->dwVnum, m_pSkillLevels[pkSk->dwVnum].bMasterType, m_pSkillLevels[pkSk->dwVnum].bLevel, pkSk->dwType);
|
||||
Save();
|
||||
|
||||
ComputePoints();
|
||||
|
@ -711,13 +708,13 @@ void CHARACTER::SkillLevelUp(DWORD dwVnum, BYTE bMethod)
|
|||
|
||||
if (!pkSk)
|
||||
{
|
||||
sys_err("There is no such skill by number (vnum %u)", dwVnum);
|
||||
SPDLOG_ERROR("There is no such skill by number (vnum {})", dwVnum);
|
||||
return;
|
||||
}
|
||||
|
||||
if (pkSk->dwVnum >= SKILL_MAX_NUM)
|
||||
{
|
||||
sys_err("Skill Vnum overflow (vnum %u)", dwVnum);
|
||||
SPDLOG_ERROR("Skill Vnum overflow (vnum {})", dwVnum);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -789,7 +786,7 @@ void CHARACTER::SkillLevelUp(DWORD dwVnum, BYTE bMethod)
|
|||
break;
|
||||
|
||||
default:
|
||||
sys_err("Wrong skill type %d skill vnum %d", pkSk->dwType, pkSk->dwVnum);
|
||||
SPDLOG_ERROR("Wrong skill type {} skill vnum {}", pkSk->dwType, pkSk->dwVnum);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -846,7 +843,7 @@ void CHARACTER::SkillLevelUp(DWORD dwVnum, BYTE bMethod)
|
|||
snprintf(szSkillUp, sizeof(szSkillUp), "SkillUp: %s %u %d %d[Before:%d] type %u",
|
||||
GetName(), pkSk->dwVnum, m_pSkillLevels[pkSk->dwVnum].bMasterType, m_pSkillLevels[pkSk->dwVnum].bLevel, SkillPointBefore, pkSk->dwType);
|
||||
|
||||
sys_log(0, "%s", szSkillUp);
|
||||
SPDLOG_DEBUG("{}", szSkillUp);
|
||||
|
||||
LogManager::instance().CharLog(this, pkSk->dwVnum, "SKILLUP", szSkillUp);
|
||||
Save();
|
||||
|
@ -904,7 +901,7 @@ void CHARACTER::ComputePassiveSkill(DWORD dwVnum)
|
|||
pkSk->SetPointVar("k", GetSkillLevel(dwVnum));
|
||||
int iAmount = (int) pkSk->kPointPoly.Eval();
|
||||
|
||||
sys_log(2, "%s passive #%d on %d amount %d", GetName(), dwVnum, pkSk->bPointOn, iAmount);
|
||||
SPDLOG_TRACE("{} passive #{} on {} amount {}", GetName(), dwVnum, pkSk->bPointOn, iAmount);
|
||||
PointChange(pkSk->bPointOn, iAmount);
|
||||
}
|
||||
|
||||
|
@ -991,11 +988,11 @@ EVENTFUNC(ChainLightningEvent)
|
|||
|
||||
if (!pkChr || !pkChrVictim)
|
||||
{
|
||||
sys_log(1, "use chainlighting, but no character");
|
||||
SPDLOG_DEBUG("use chainlighting, but no character");
|
||||
return 0;
|
||||
}
|
||||
|
||||
sys_log(1, "chainlighting event %s", pkChr->GetName());
|
||||
SPDLOG_DEBUG("chainlighting event {}", pkChr->GetName());
|
||||
|
||||
if (pkChrVictim->GetParty()) // 파티 먼저
|
||||
{
|
||||
|
@ -1025,7 +1022,7 @@ EVENTFUNC(ChainLightningEvent)
|
|||
}
|
||||
else
|
||||
{
|
||||
sys_log(1, "%s use chainlighting, but find victim failed near %s", pkChr->GetName(), pkChrVictim->GetName());
|
||||
SPDLOG_DEBUG("{} use chainlighting, but find victim failed near {}", pkChr->GetName(), pkChrVictim->GetName());
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
@ -1075,7 +1072,6 @@ struct FuncSplashDamage
|
|||
{
|
||||
if (!ent->IsType(ENTITY_CHARACTER))
|
||||
{
|
||||
//if (m_pkSk->dwVnum == SKILL_CHAIN) sys_log(0, "CHAIN target not character %s", m_pkChr->GetName());
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -1083,15 +1079,13 @@ struct FuncSplashDamage
|
|||
|
||||
if (DISTANCE_APPROX(m_x - pkChrVictim->GetX(), m_y - pkChrVictim->GetY()) > m_pkSk->iSplashRange)
|
||||
{
|
||||
if(test_server)
|
||||
sys_log(0, "XXX target too far %s", m_pkChr->GetName());
|
||||
SPDLOG_TRACE("XXX target too far {}", m_pkChr->GetName());
|
||||
return;
|
||||
}
|
||||
|
||||
if (!battle_is_attackable(m_pkChr, pkChrVictim))
|
||||
{
|
||||
if(test_server)
|
||||
sys_log(0, "XXX target not attackable %s", m_pkChr->GetName());
|
||||
SPDLOG_TRACE("XXX target not attackable {}", m_pkChr->GetName());
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -1100,8 +1094,7 @@ struct FuncSplashDamage
|
|||
if (!(m_pkSk->dwVnum >= GUILD_SKILL_START && m_pkSk->dwVnum <= GUILD_SKILL_END))
|
||||
if (!m_bDisableCooltime && m_pInfo && !m_pInfo->HitOnce(m_pkSk->dwVnum) && m_pkSk->dwVnum != SKILL_MUYEONG)
|
||||
{
|
||||
if(test_server)
|
||||
sys_log(0, "check guild skill %s", m_pkChr->GetName());
|
||||
SPDLOG_TRACE("check guild skill {}", m_pkChr->GetName());
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -1243,7 +1236,6 @@ struct FuncSplashDamage
|
|||
iAmount = (int) (iAmount * adjust);
|
||||
}
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
//sys_log(0, "name: %s skill: %s amount %d to %s", m_pkChr->GetName(), m_pkSk->szName, iAmount, pkChrVictim->GetName());
|
||||
|
||||
iDam = CalcBattleDamage(iAmount, m_pkChr->GetLevel(), pkChrVictim->GetLevel());
|
||||
|
||||
|
@ -1317,7 +1309,7 @@ struct FuncSplashDamage
|
|||
break;
|
||||
|
||||
default:
|
||||
sys_err("Unknown skill attr type %u vnum %u", m_pkSk->bSkillAttrType, m_pkSk->dwVnum);
|
||||
SPDLOG_ERROR("Unknown skill attr type {} vnum {}", m_pkSk->bSkillAttrType, m_pkSk->dwVnum);
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -1355,7 +1347,7 @@ struct FuncSplashDamage
|
|||
pkChrVictim->BeginFight(m_pkChr);
|
||||
|
||||
if (m_pkSk->dwVnum == SKILL_CHAIN)
|
||||
sys_log(0, "%s CHAIN INDEX %d DAM %d DT %d", m_pkChr->GetName(), m_pkChr->GetChainLightningIndex() - 1, iDam, dt);
|
||||
SPDLOG_DEBUG("{} CHAIN INDEX {} DAM {} DT {}", m_pkChr->GetName(), m_pkChr->GetChainLightningIndex() - 1, iDam, (int) dt);
|
||||
|
||||
{
|
||||
BYTE AntiSkillID = 0;
|
||||
|
@ -1381,7 +1373,7 @@ struct FuncSplashDamage
|
|||
CSkillProto* pkSk = CSkillManager::instance().Get(AntiSkillID);
|
||||
if (!pkSk)
|
||||
{
|
||||
sys_err ("There is no anti skill(%d) in skill proto", AntiSkillID);
|
||||
SPDLOG_ERROR("There is no anti skill({}) in skill proto", AntiSkillID);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -1389,7 +1381,7 @@ struct FuncSplashDamage
|
|||
|
||||
double ResistAmount = pkSk->kPointPoly.Eval();
|
||||
|
||||
sys_log(0, "ANTI_SKILL: Resist(%lf) Orig(%d) Reduce(%d)", ResistAmount, iDam, int(iDam * (ResistAmount/100.0)));
|
||||
SPDLOG_DEBUG("ANTI_SKILL: Resist({}) Orig({}) Reduce({})", ResistAmount, iDam, int(iDam * (ResistAmount/100.0)));
|
||||
|
||||
iDam -= iDam * (ResistAmount/100.0);
|
||||
}
|
||||
|
@ -1478,7 +1470,7 @@ struct FuncSplashDamage
|
|||
}
|
||||
|
||||
GetDeltaByDegree(degree, fCrushSlidingLength, &fx, &fy);
|
||||
sys_log(0, "CRUSH! %s -> %s (%d %d) -> (%d %d)", m_pkChr->GetName(), pkChrVictim->GetName(), pkChrVictim->GetX(), pkChrVictim->GetY(), (int)(pkChrVictim->GetX()+fx), (int)(pkChrVictim->GetY()+fy));
|
||||
SPDLOG_TRACE("CRUSH! {} -> {} ({} {}) -> ({} {})", m_pkChr->GetName(), pkChrVictim->GetName(), pkChrVictim->GetX(), pkChrVictim->GetY(), (int)(pkChrVictim->GetX()+fx), (int)(pkChrVictim->GetY()+fy));
|
||||
int tx = (int)(pkChrVictim->GetX()+fx);
|
||||
int ty = (int)(pkChrVictim->GetY()+fy);
|
||||
|
||||
|
@ -1522,8 +1514,7 @@ struct FuncSplashDamage
|
|||
|
||||
event_create(ChainLightningEvent, info, passes_per_sec / 5);
|
||||
}
|
||||
if(test_server)
|
||||
sys_log(0, "FuncSplashDamage End :%s ", m_pkChr->GetName());
|
||||
SPDLOG_TRACE("FuncSplashDamage End :{} ", m_pkChr->GetName());
|
||||
}
|
||||
|
||||
int m_x;
|
||||
|
@ -1568,12 +1559,10 @@ struct FuncSplashAffect
|
|||
{
|
||||
LPCHARACTER pkChr = (LPCHARACTER) ent;
|
||||
|
||||
if (test_server)
|
||||
sys_log(0, "FuncSplashAffect step 1 : name:%s vnum:%d iDur:%d", pkChr->GetName(), m_dwVnum, m_iDuration);
|
||||
SPDLOG_TRACE("FuncSplashAffect step 1 : name:{} vnum:{} iDur:{}", pkChr->GetName(), m_dwVnum, m_iDuration);
|
||||
if (DISTANCE_APPROX(m_x - pkChr->GetX(), m_y - pkChr->GetY()) < m_iDist)
|
||||
{
|
||||
if (test_server)
|
||||
sys_log(0, "FuncSplashAffect step 2 : name:%s vnum:%d iDur:%d", pkChr->GetName(), m_dwVnum, m_iDuration);
|
||||
SPDLOG_TRACE("FuncSplashAffect step 2 : name:{} vnum:{} iDur:{}", pkChr->GetName(), m_dwVnum, m_iDuration);
|
||||
if (m_dwVnum == SKILL_TUSOK)
|
||||
if (pkChr->CanBeginFight())
|
||||
pkChr->BeginFight(m_pkChrAttacker);
|
||||
|
@ -1621,7 +1610,7 @@ EVENTFUNC(skill_gwihwan_event)
|
|||
|
||||
if ( info == NULL )
|
||||
{
|
||||
sys_err( "skill_gwihwan_event> <Factor> Null pointer" );
|
||||
SPDLOG_ERROR("skill_gwihwan_event> <Factor> Null pointer" );
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -1641,12 +1630,12 @@ EVENTFUNC(skill_gwihwan_event)
|
|||
// 성공
|
||||
if (SECTREE_MANAGER::instance().GetRecallPositionByEmpire(ch->GetMapIndex(), ch->GetEmpire(), pos))
|
||||
{
|
||||
sys_log(1, "Recall: %s %d %d -> %d %d", ch->GetName(), ch->GetX(), ch->GetY(), pos.x, pos.y);
|
||||
SPDLOG_DEBUG("Recall: {} {} {} -> {} {}", ch->GetName(), ch->GetX(), ch->GetY(), pos.x, pos.y);
|
||||
ch->WarpSet(pos.x, pos.y);
|
||||
}
|
||||
else
|
||||
{
|
||||
sys_err("CHARACTER::UseItem : cannot find spawn position (name %s, %d x %d)", ch->GetName(), ch->GetX(), ch->GetY());
|
||||
SPDLOG_ERROR("CHARACTER::UseItem : cannot find spawn position (name {}, {} x {})", ch->GetName(), ch->GetX(), ch->GetY());
|
||||
ch->WarpSet(EMPIRE_START_X(ch->GetEmpire()), EMPIRE_START_Y(ch->GetEmpire()));
|
||||
}
|
||||
}
|
||||
|
@ -1674,11 +1663,8 @@ int CHARACTER::ComputeSkillAtPosition(DWORD dwVnum, const PIXEL_POSITION& posTar
|
|||
if (!pkSk)
|
||||
return BATTLE_NONE;
|
||||
|
||||
if (test_server)
|
||||
{
|
||||
sys_log(0, "ComputeSkillAtPosition %s vnum %d x %d y %d level %d",
|
||||
SPDLOG_TRACE("ComputeSkillAtPosition {} vnum {} x {} y {} level {}",
|
||||
GetName(), dwVnum, posTarget.x, posTarget.y, bSkillLevel);
|
||||
}
|
||||
|
||||
// 나에게 쓰는 스킬은 내 위치를 쓴다.
|
||||
//if (IS_SET(pkSk->dwFlag, SKILL_FLAG_SELFONLY))
|
||||
|
@ -1800,20 +1786,17 @@ int CHARACTER::ComputeSkillAtPosition(DWORD dwVnum, const PIXEL_POSITION& posTar
|
|||
}
|
||||
else
|
||||
{
|
||||
//if (dwVnum == SKILL_CHAIN) sys_log(0, "CHAIN skill call FuncSplashDamage %s", GetName());
|
||||
f(this);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
//if (dwVnum == SKILL_CHAIN) sys_log(0, "CHAIN skill no damage %d %s", iAmount, GetName());
|
||||
int iDur = (int) pkSk->kDurationPoly.Eval();
|
||||
|
||||
if (IsPC())
|
||||
if (!(dwVnum >= GUILD_SKILL_START && dwVnum <= GUILD_SKILL_END)) // 길드 스킬은 쿨타임 처리를 하지 않는다.
|
||||
if (!m_bDisableCooltime && !m_SkillUseInfo[dwVnum].HitOnce(dwVnum) && dwVnum != SKILL_MUYEONG)
|
||||
{
|
||||
//if (dwVnum == SKILL_CHAIN) sys_log(0, "CHAIN skill cannot hit %s", GetName());
|
||||
return BATTLE_NONE;
|
||||
}
|
||||
|
||||
|
@ -1840,7 +1823,7 @@ int CHARACTER::ComputeSkillAtPosition(DWORD dwVnum, const PIXEL_POSITION& posTar
|
|||
{
|
||||
int iDur = (int) pkSk->kDurationPoly2.Eval();
|
||||
|
||||
sys_log(1, "try second %u %d %d", pkSk->dwVnum, pkSk->bPointOn2, iDur);
|
||||
SPDLOG_DEBUG("try second {} {} {}", pkSk->dwVnum, pkSk->bPointOn2, iDur);
|
||||
|
||||
if (iDur > 0)
|
||||
{
|
||||
|
@ -1990,16 +1973,14 @@ int CHARACTER::ComputeSkill(DWORD dwVnum, LPCHARACTER pkVictim, BYTE bSkillLevel
|
|||
|
||||
if (!pkVictim)
|
||||
{
|
||||
if (test_server)
|
||||
sys_log(0, "ComputeSkill: %s Victim == null, skill %d", GetName(), dwVnum);
|
||||
SPDLOG_TRACE("ComputeSkill: {} Victim == null, skill {}", GetName(), dwVnum);
|
||||
|
||||
return BATTLE_NONE;
|
||||
}
|
||||
|
||||
if (pkSk->dwTargetRange && DISTANCE_SQRT(GetX() - pkVictim->GetX(), GetY() - pkVictim->GetY()) >= pkSk->dwTargetRange + 50)
|
||||
{
|
||||
if (test_server)
|
||||
sys_log(0, "ComputeSkill: Victim too far, skill %d : %s to %s (distance %u limit %u)",
|
||||
SPDLOG_TRACE("ComputeSkill: Victim too far, skill {} : {} to {} (distance {} limit {})",
|
||||
dwVnum,
|
||||
GetName(),
|
||||
pkVictim->GetName(),
|
||||
|
@ -2013,8 +1994,7 @@ int CHARACTER::ComputeSkill(DWORD dwVnum, LPCHARACTER pkVictim, BYTE bSkillLevel
|
|||
{
|
||||
if ((bSkillLevel = GetSkillLevel(pkSk->dwVnum)) == 0)
|
||||
{
|
||||
if (test_server)
|
||||
sys_log(0, "ComputeSkill : name:%s vnum:%d skillLevelBySkill : %d ", GetName(), pkSk->dwVnum, bSkillLevel);
|
||||
SPDLOG_TRACE("ComputeSkill : name:{} vnum:{} skillLevelBySkill : {} ", GetName(), pkSk->dwVnum, bSkillLevel);
|
||||
return BATTLE_NONE;
|
||||
}
|
||||
}
|
||||
|
@ -2095,7 +2075,7 @@ int CHARACTER::ComputeSkill(DWORD dwVnum, LPCHARACTER pkVictim, BYTE bSkillLevel
|
|||
int iAmount3 = (int) pkSk->kPointPoly3.Eval();
|
||||
|
||||
if (test_server && IsPC())
|
||||
sys_log(0, "iAmount: %d %d %d , atk:%f skLevel:%f k:%f GetSkillPower(%d) MaxLevel:%d Per:%f",
|
||||
SPDLOG_TRACE("iAmount: {} {} {} , atk:{} skLevel:{} k:{} GetSkillPower({}) MaxLevel:{} Per:{}",
|
||||
iAmount, iAmount2, iAmount3,
|
||||
pkSk->kPointPoly.GetVar("atk"),
|
||||
pkSk->kPointPoly.GetVar("k"),
|
||||
|
@ -2117,8 +2097,6 @@ int CHARACTER::ComputeSkill(DWORD dwVnum, LPCHARACTER pkVictim, BYTE bSkillLevel
|
|||
}
|
||||
// END_OF_ADD_GRANDMASTER_SKILL
|
||||
|
||||
//sys_log(0, "XXX SKILL Calc %d Amount %d", dwVnum, iAmount);
|
||||
|
||||
// REMOVE_BAD_AFFECT_BUG_FIX
|
||||
if (IS_SET(pkSk->dwFlag, SKILL_FLAG_REMOVE_BAD_AFFECT))
|
||||
{
|
||||
|
@ -2281,8 +2259,7 @@ int CHARACTER::ComputeSkill(DWORD dwVnum, LPCHARACTER pkVictim, BYTE bSkillLevel
|
|||
|
||||
if (iDur2 > 0)
|
||||
{
|
||||
if (test_server)
|
||||
sys_log(0, "SKILL_AFFECT: %s %s Dur:%d To:%d Amount:%d",
|
||||
SPDLOG_TRACE("SKILL_AFFECT: {} {} Dur:{} To:{} Amount:{}",
|
||||
GetName(),
|
||||
pkSk->szName,
|
||||
iDur2,
|
||||
|
@ -2323,8 +2300,7 @@ int CHARACTER::ComputeSkill(DWORD dwVnum, LPCHARACTER pkVictim, BYTE bSkillLevel
|
|||
}
|
||||
else
|
||||
{
|
||||
if (test_server)
|
||||
sys_log(0, "SKILL_AFFECT: %s %s Dur:%d To:%d Amount:%d",
|
||||
SPDLOG_TRACE("SKILL_AFFECT: {} {} Dur:{} To:{} Amount:{}",
|
||||
GetName(),
|
||||
pkSk->szName,
|
||||
iDur,
|
||||
|
@ -2379,7 +2355,7 @@ int CHARACTER::ComputeSkill(DWORD dwVnum, LPCHARACTER pkVictim, BYTE bSkillLevel
|
|||
pkSk->kDurationPoly3.SetVar("k", k/*bSkillLevel*/);
|
||||
int iDur = (int) pkSk->kDurationPoly3.Eval();
|
||||
|
||||
sys_log(0, "try third %u %d %d %d 1894", pkSk->dwVnum, pkSk->bPointOn3, iDur, iAmount3);
|
||||
SPDLOG_DEBUG("try third {} {} {} {} 1894", pkSk->dwVnum, pkSk->bPointOn3, iDur, iAmount3);
|
||||
|
||||
if (iDur > 0)
|
||||
{
|
||||
|
@ -2457,7 +2433,7 @@ bool CHARACTER::UseSkill(DWORD dwVnum, LPCHARACTER pkVictim, bool bUseGrandMaste
|
|||
return false;
|
||||
|
||||
CSkillProto * pkSk = CSkillManager::instance().Get(dwVnum);
|
||||
sys_log(0, "%s: USE_SKILL: %d pkVictim %p", GetName(), dwVnum, get_pointer(pkVictim));
|
||||
SPDLOG_DEBUG("{}: USE_SKILL: {} pkVictim {}", GetName(), dwVnum, (void*) get_pointer(pkVictim));
|
||||
|
||||
if (!pkSk)
|
||||
return false;
|
||||
|
@ -2541,7 +2517,7 @@ bool CHARACTER::UseSkill(DWORD dwVnum, LPCHARACTER pkVictim, bool bUseGrandMaste
|
|||
|
||||
if (dwVnum == SKILL_TERROR && m_SkillUseInfo[dwVnum].bUsed && m_SkillUseInfo[dwVnum].dwNextSkillUsableTime > dwCur )
|
||||
{
|
||||
sys_log(0, " SKILL_TERROR's Cooltime is not delta over %u", m_SkillUseInfo[dwVnum].dwNextSkillUsableTime - dwCur );
|
||||
SPDLOG_DEBUG(" SKILL_TERROR's Cooltime is not delta over {}", m_SkillUseInfo[dwVnum].dwNextSkillUsableTime - dwCur );
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -2658,7 +2634,7 @@ int CHARACTER::GetSkillMasterType(DWORD dwVnum) const
|
|||
|
||||
if (dwVnum >= SKILL_MAX_NUM)
|
||||
{
|
||||
sys_err("%s skill vnum overflow %u", GetName(), dwVnum);
|
||||
SPDLOG_ERROR("{} skill vnum overflow {}", GetName(), dwVnum);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -2690,7 +2666,7 @@ int CHARACTER::GetSkillPower(DWORD dwVnum, BYTE bLevel) const
|
|||
|
||||
if (dwVnum >= SKILL_MAX_NUM)
|
||||
{
|
||||
sys_err("%s skill vnum overflow %u", GetName(), dwVnum);
|
||||
SPDLOG_ERROR("{} skill vnum overflow {}", GetName(), dwVnum);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -2703,8 +2679,7 @@ int CHARACTER::GetSkillLevel(DWORD dwVnum) const
|
|||
{
|
||||
if (dwVnum >= SKILL_MAX_NUM)
|
||||
{
|
||||
sys_err("%s skill vnum overflow %u", GetName(), dwVnum);
|
||||
sys_log(0, "%s skill vnum overflow %u", GetName(), dwVnum);
|
||||
SPDLOG_ERROR("{} skill vnum overflow {}", GetName(), dwVnum);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -2717,7 +2692,7 @@ EVENTFUNC(skill_muyoung_event)
|
|||
|
||||
if ( info == NULL )
|
||||
{
|
||||
sys_err( "skill_muyoung_event> <Factor> Null pointer" );
|
||||
SPDLOG_ERROR("skill_muyoung_event> <Factor> Null pointer" );
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -2896,7 +2871,7 @@ EVENTFUNC(mob_skill_hit_event)
|
|||
|
||||
if ( info == NULL )
|
||||
{
|
||||
sys_err( "mob_skill_event_info> <Factor> Null pointer" );
|
||||
SPDLOG_ERROR("mob_skill_event_info> <Factor> Null pointer" );
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -2935,11 +2910,11 @@ bool CHARACTER::UseMobSkill(unsigned int idx)
|
|||
|
||||
m_adwMobSkillCooltime[idx] = get_dword_time() + iCooltime;
|
||||
|
||||
sys_log(0, "USE_MOB_SKILL: %s idx %d vnum %u cooltime %d", GetName(), idx, dwVnum, iCooltime);
|
||||
SPDLOG_DEBUG("USE_MOB_SKILL: {} idx {} vnum {} cooltime {}", GetName(), idx, dwVnum, iCooltime);
|
||||
|
||||
if (m_pkMobData->m_mobSkillInfo[idx].vecSplashAttack.empty())
|
||||
{
|
||||
sys_err("No skill hit data for mob %s index %d", GetName(), idx);
|
||||
SPDLOG_ERROR("No skill hit data for mob {} index {}", GetName(), idx);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -2958,8 +2933,7 @@ bool CHARACTER::UseMobSkill(unsigned int idx)
|
|||
|
||||
if (rInfo.dwTiming)
|
||||
{
|
||||
if (test_server)
|
||||
sys_log(0, " timing %ums", rInfo.dwTiming);
|
||||
SPDLOG_TRACE(" timing {}ms", rInfo.dwTiming);
|
||||
|
||||
mob_skill_event_info* info = AllocEventInfo<mob_skill_event_info>();
|
||||
|
||||
|
@ -3350,7 +3324,7 @@ bool CHARACTER::IsUsableSkillMotion(DWORD dwMotionIndex) const
|
|||
|
||||
if (dwMotionIndex >= MOTION_MAX_NUM)
|
||||
{
|
||||
sys_err("OUT_OF_MOTION_VNUM: name=%s, motion=%d/%d", GetName(), dwMotionIndex, MOTION_MAX_NUM);
|
||||
SPDLOG_ERROR("OUT_OF_MOTION_VNUM: name={}, motion={}/{}", GetName(), dwMotionIndex, MOTION_MAX_NUM);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -3359,7 +3333,7 @@ bool CHARACTER::IsUsableSkillMotion(DWORD dwMotionIndex) const
|
|||
DWORD skillCount = *skillVNums++;
|
||||
if (skillCount >= SKILL_LIST_MAX_COUNT)
|
||||
{
|
||||
sys_err("OUT_OF_SKILL_LIST: name=%s, count=%d/%d", GetName(), skillCount, SKILL_LIST_MAX_COUNT);
|
||||
SPDLOG_ERROR("OUT_OF_SKILL_LIST: name={}, count={}/{}", GetName(), skillCount, SKILL_LIST_MAX_COUNT);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -3367,7 +3341,7 @@ bool CHARACTER::IsUsableSkillMotion(DWORD dwMotionIndex) const
|
|||
{
|
||||
if (skillIndex >= SKILL_MAX_NUM)
|
||||
{
|
||||
sys_err("OUT_OF_SKILL_VNUM: name=%s, skill=%d/%d", GetName(), skillIndex, SKILL_MAX_NUM);
|
||||
SPDLOG_ERROR("OUT_OF_SKILL_VNUM: name={}, skill={}/{}", GetName(), skillIndex, (int) SKILL_MAX_NUM);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -3418,7 +3392,7 @@ void CHARACTER::ClearSubSkill()
|
|||
|
||||
if (m_pSkillLevels == NULL)
|
||||
{
|
||||
sys_err("m_pSkillLevels nil (name: %s)", GetName());
|
||||
SPDLOG_ERROR("m_pSkillLevels nil (name: {})", GetName());
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -3443,13 +3417,13 @@ bool CHARACTER::ResetOneSkill(DWORD dwVnum)
|
|||
{
|
||||
if (NULL == m_pSkillLevels)
|
||||
{
|
||||
sys_err("m_pSkillLevels nil (name %s, vnum %u)", GetName(), dwVnum);
|
||||
SPDLOG_ERROR("m_pSkillLevels nil (name {}, vnum {})", GetName(), dwVnum);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (dwVnum >= SKILL_MAX_NUM)
|
||||
{
|
||||
sys_err("vnum overflow (name %s, vnum %u)", GetName(), dwVnum);
|
||||
SPDLOG_ERROR("vnum overflow (name {}, vnum {})", GetName(), dwVnum);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -3534,7 +3508,7 @@ bool CHARACTER::CheckSkillHitCount(const BYTE SkillID, const VID TargetVID)
|
|||
|
||||
if (iter == m_SkillUseInfo.end())
|
||||
{
|
||||
sys_log(0, "SkillHack: Skill(%u) is not in container", SkillID);
|
||||
SPDLOG_WARN("SkillHack: Skill({}) is not in container", SkillID);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -3542,7 +3516,7 @@ bool CHARACTER::CheckSkillHitCount(const BYTE SkillID, const VID TargetVID)
|
|||
|
||||
if (false == rSkillUseInfo.bUsed)
|
||||
{
|
||||
sys_log(0, "SkillHack: not used skill(%u)", SkillID);
|
||||
SPDLOG_WARN("SkillHack: not used skill({})", SkillID);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -3552,7 +3526,7 @@ bool CHARACTER::CheckSkillHitCount(const BYTE SkillID, const VID TargetVID)
|
|||
case SKILL_HWAYEOMPOK:
|
||||
case SKILL_DAEJINGAK:
|
||||
case SKILL_PAERYONG:
|
||||
sys_log(0, "SkillHack: cannot use attack packet for skill(%u)", SkillID);
|
||||
SPDLOG_WARN("SkillHack: cannot use attack packet for skill({})", SkillID);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -3584,7 +3558,7 @@ bool CHARACTER::CheckSkillHitCount(const BYTE SkillID, const VID TargetVID)
|
|||
|
||||
if (iterTargetMap->second >= MaxAttackCountPerTarget)
|
||||
{
|
||||
sys_log(0, "SkillHack: Too Many Hit count from SkillID(%u) count(%u)", SkillID, iterTargetMap->second);
|
||||
SPDLOG_WARN("SkillHack: Too Many Hit count from SkillID({}) count({})", SkillID, iterTargetMap->second);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -128,8 +128,8 @@ namespace
|
|||
{
|
||||
CAffect * pkAff = pkChr->FindAffect(AFFECT_WAR_FLAG);
|
||||
|
||||
sys_log(0, "FlagBase %s dist %d aff %p flag gid %d chr gid %u",
|
||||
pkChr->GetName(), iDist, pkAff, m_pkChr->GetPoint(POINT_STAT),
|
||||
SPDLOG_DEBUG("FlagBase {} dist {} aff {} flag gid {} chr gid {}",
|
||||
pkChr->GetName(), iDist, (void*) pkAff, m_pkChr->GetPoint(POINT_STAT),
|
||||
pkChr->GetGuild()->GetID());
|
||||
|
||||
if (pkAff)
|
||||
|
@ -313,7 +313,7 @@ void CHARACTER::CowardEscape()
|
|||
if (Goto(iDestX, iDestY))
|
||||
SendMovePacket(FUNC_WAIT, 0, 0, 0, 0);
|
||||
|
||||
sys_log(0, "WAEGU move to %d %d (far)", iDestX, iDestY);
|
||||
SPDLOG_TRACE("WAEGU move to {} {} (far)", iDestX, iDestY);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -877,7 +877,7 @@ void CHARACTER::StateMove()
|
|||
{
|
||||
if (IsPC())
|
||||
{
|
||||
sys_log(1, "µµÂø %s %d %d", GetName(), x, y);
|
||||
SPDLOG_DEBUG("µµÂø {} {} {}", GetName(), x, y);
|
||||
GotoState(m_stateIdle);
|
||||
StopStaminaConsume();
|
||||
}
|
||||
|
@ -910,7 +910,7 @@ void CHARACTER::StateBattle()
|
|||
{
|
||||
if (IsStone())
|
||||
{
|
||||
sys_err("Stone must not use battle state (name %s)", GetName());
|
||||
SPDLOG_ERROR("Stone must not use battle state (name {})", GetName());
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -982,7 +982,7 @@ void CHARACTER::StateBattle()
|
|||
|
||||
if (Goto((int) dx, (int) dy))
|
||||
{
|
||||
sys_log(0, "KILL_AND_GO: %s distance %.1f", GetName(), fDist);
|
||||
SPDLOG_DEBUG("KILL_AND_GO: {} distance {:.1f}", GetName(), fDist);
|
||||
SendMovePacket(FUNC_WAIT, 0, 0, 0, 0);
|
||||
}
|
||||
}
|
||||
|
@ -1101,8 +1101,7 @@ void CHARACTER::StateBattle()
|
|||
float fDuration = CMotionManager::instance().GetMotionDuration(GetRaceNum(), MAKE_MOTION_KEY(MOTION_MODE_GENERAL, MOTION_SPECIAL_1 + iSkillIdx));
|
||||
m_dwStateDuration = (DWORD) (fDuration == 0.0f ? PASSES_PER_SEC(2) : PASSES_PER_SEC(fDuration));
|
||||
|
||||
if (test_server)
|
||||
sys_log(0, "USE_MOB_SKILL: %s idx %u motion %u duration %.0f", GetName(), iSkillIdx, MOTION_SPECIAL_1 + iSkillIdx, fDuration);
|
||||
SPDLOG_TRACE("USE_MOB_SKILL: {} idx {} motion {} duration {:.0f}", GetName(), iSkillIdx, MOTION_SPECIAL_1 + iSkillIdx, fDuration);
|
||||
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -598,7 +598,7 @@ void interpreter_set_privilege(const char *cmd, int lvl)
|
|||
if (!str_cmp(cmd, cmd_info[i].command))
|
||||
{
|
||||
cmd_info[i].gm_level = lvl;
|
||||
sys_log(0, "Setting command privilege: %s -> %d", cmd, lvl);
|
||||
SPDLOG_INFO("Setting command privilege: {} -> {}", cmd, lvl);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -640,7 +640,7 @@ void interpret_command(LPCHARACTER ch, const char * argument, size_t len)
|
|||
{
|
||||
if (NULL == ch)
|
||||
{
|
||||
sys_err ("NULL CHRACTER");
|
||||
SPDLOG_ERROR("NULL CHRACTER");
|
||||
return ;
|
||||
}
|
||||
|
||||
|
@ -694,7 +694,7 @@ void interpret_command(LPCHARACTER ch, const char * argument, size_t len)
|
|||
break;
|
||||
*/
|
||||
default:
|
||||
sys_err("unknown position %d", ch->GetPosition());
|
||||
SPDLOG_ERROR("unknown position {}", ch->GetPosition());
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -714,7 +714,7 @@ void interpret_command(LPCHARACTER ch, const char * argument, size_t len)
|
|||
}
|
||||
|
||||
if (strncmp("phase", cmd_info[icmd].command, 5) != 0) // 히든 명령어 처리
|
||||
sys_log(0, "COMMAND: %s: %s", ch->GetName(), cmd_info[icmd].command);
|
||||
SPDLOG_DEBUG("COMMAND: {}: {}", ch->GetName(), cmd_info[icmd].command);
|
||||
|
||||
((*cmd_info[icmd].command_pointer) (ch, line, icmd, cmd_info[icmd].subcmd));
|
||||
|
||||
|
|
|
@ -144,7 +144,7 @@ ACMD(do_emotion)
|
|||
|
||||
if (*emotion_types[i].command == '\n')
|
||||
{
|
||||
sys_err("cannot find emotion");
|
||||
SPDLOG_ERROR("cannot find emotion");
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -260,8 +260,8 @@ ACMD(do_emotion)
|
|||
ch->PacketAround(buf.read_peek(), buf.size());
|
||||
|
||||
if (victim)
|
||||
sys_log(1, "ACTION: %s TO %s", emotion_types[i].command, victim->GetName());
|
||||
SPDLOG_DEBUG("ACTION: {} TO {}", emotion_types[i].command, victim->GetName());
|
||||
else
|
||||
sys_log(1, "ACTION: %s", emotion_types[i].command);
|
||||
SPDLOG_DEBUG("ACTION: {}", emotion_types[i].command);
|
||||
}
|
||||
|
||||
|
|
|
@ -21,7 +21,6 @@
|
|||
#include "item_manager.h"
|
||||
#include "monarch.h"
|
||||
#include "mob_manager.h"
|
||||
#include "dev_log.h"
|
||||
#include "item.h"
|
||||
#include "arena.h"
|
||||
#include "buffer_manager.h"
|
||||
|
@ -178,7 +177,7 @@ EVENTFUNC(shutdown_event)
|
|||
|
||||
if ( info == NULL )
|
||||
{
|
||||
sys_err( "shutdown_event> <Factor> Null pointer" );
|
||||
SPDLOG_ERROR("shutdown_event> <Factor> Null pointer" );
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -186,7 +185,7 @@ EVENTFUNC(shutdown_event)
|
|||
|
||||
if (*pSec < 0)
|
||||
{
|
||||
sys_log(0, "shutdown_event sec %d", *pSec);
|
||||
SPDLOG_INFO("shutdown_event sec {}", *pSec);
|
||||
|
||||
if (--*pSec == -10)
|
||||
{
|
||||
|
@ -243,7 +242,7 @@ ACMD(do_shutdown)
|
|||
{
|
||||
if (NULL == ch)
|
||||
{
|
||||
sys_err("Accept shutdown command from %s.", ch->GetName());
|
||||
SPDLOG_ERROR("Accept shutdown command from {}.", ch->GetName());
|
||||
}
|
||||
TPacketGGShutdown p;
|
||||
p.bHeader = HEADER_GG_SHUTDOWN;
|
||||
|
@ -258,7 +257,7 @@ EVENTFUNC(timed_event)
|
|||
|
||||
if ( info == NULL )
|
||||
{
|
||||
sys_err( "timed_event> <Factor> Null pointer" );
|
||||
SPDLOG_ERROR("timed_event> <Factor> Null pointer" );
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -589,7 +588,7 @@ ACMD(do_restart)
|
|||
switch (subcmd)
|
||||
{
|
||||
case SCMD_RESTART_TOWN:
|
||||
sys_log(0, "do_restart: restart town");
|
||||
SPDLOG_DEBUG("do_restart: restart town");
|
||||
PIXEL_POSITION pos;
|
||||
|
||||
if (CWarMapManager::instance().GetStartPosition(ch->GetMapIndex(), ch->GetGuild()->GetID() < dwGuildOpponent ? 0 : 1, pos))
|
||||
|
@ -603,7 +602,7 @@ ACMD(do_restart)
|
|||
break;
|
||||
|
||||
case SCMD_RESTART_HERE:
|
||||
sys_log(0, "do_restart: restart here");
|
||||
SPDLOG_DEBUG("do_restart: restart here");
|
||||
ch->RestartAtSamePos();
|
||||
//ch->Show(ch->GetMapIndex(), ch->GetX(), ch->GetY());
|
||||
ch->PointChange(POINT_HP, ch->GetMaxHP() - ch->GetHP());
|
||||
|
@ -619,7 +618,7 @@ ACMD(do_restart)
|
|||
switch (subcmd)
|
||||
{
|
||||
case SCMD_RESTART_TOWN:
|
||||
sys_log(0, "do_restart: restart town");
|
||||
SPDLOG_DEBUG("do_restart: restart town");
|
||||
PIXEL_POSITION pos;
|
||||
|
||||
if (SECTREE_MANAGER::instance().GetRecallPositionByEmpire(ch->GetMapIndex(), ch->GetEmpire(), pos))
|
||||
|
@ -632,7 +631,7 @@ ACMD(do_restart)
|
|||
break;
|
||||
|
||||
case SCMD_RESTART_HERE:
|
||||
sys_log(0, "do_restart: restart here");
|
||||
SPDLOG_DEBUG("do_restart: restart here");
|
||||
ch->RestartAtSamePos();
|
||||
//ch->Show(ch->GetMapIndex(), ch->GetX(), ch->GetY());
|
||||
ch->PointChange(POINT_HP, 50 - ch->GetHP());
|
||||
|
@ -1144,16 +1143,16 @@ ACMD(do_war)
|
|||
if (g->GetLadderPoint() == 0)
|
||||
{
|
||||
ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("<길드> 레더 점수가 모자라서 길드전을 할 수 없습니다."));
|
||||
sys_log(0, "GuildWar.StartError.NEED_LADDER_POINT");
|
||||
SPDLOG_DEBUG("GuildWar.StartError.NEED_LADDER_POINT");
|
||||
}
|
||||
else if (g->GetMemberCount() < GUILD_WAR_MIN_MEMBER_COUNT)
|
||||
{
|
||||
ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("<길드> 길드전을 하기 위해선 최소한 %d명이 있어야 합니다."), GUILD_WAR_MIN_MEMBER_COUNT);
|
||||
sys_log(0, "GuildWar.StartError.NEED_MINIMUM_MEMBER[%d]", GUILD_WAR_MIN_MEMBER_COUNT);
|
||||
SPDLOG_DEBUG("GuildWar.StartError.NEED_MINIMUM_MEMBER[{}]", (int) GUILD_WAR_MIN_MEMBER_COUNT);
|
||||
}
|
||||
else
|
||||
{
|
||||
sys_log(0, "GuildWar.StartError.UNKNOWN_ERROR");
|
||||
SPDLOG_DEBUG("GuildWar.StartError.UNKNOWN_ERROR");
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
@ -2161,7 +2160,7 @@ ACMD(do_cube)
|
|||
if (!ch->CanDoCube())
|
||||
return;
|
||||
|
||||
dev_log(LOG_DEB0, "CUBE COMMAND <%s>: %s", ch->GetName(), argument);
|
||||
SPDLOG_TRACE("CUBE COMMAND <{}>: {}", ch->GetName(), argument);
|
||||
int cube_index = 0, inven_index = 0;
|
||||
const char *line;
|
||||
|
||||
|
@ -2254,7 +2253,7 @@ ACMD(do_cube)
|
|||
if (0 != arg2[0])
|
||||
{
|
||||
while (true == Cube_make(ch))
|
||||
dev_log (LOG_DEB0, "cube make success");
|
||||
SPDLOG_TRACE("cube make success");
|
||||
}
|
||||
else
|
||||
Cube_make(ch);
|
||||
|
@ -2392,7 +2391,7 @@ ACMD(do_click_mall)
|
|||
|
||||
ACMD(do_ride)
|
||||
{
|
||||
dev_log(LOG_DEB0, "[DO_RIDE] start");
|
||||
SPDLOG_TRACE("[DO_RIDE] start");
|
||||
if (ch->IsDead() || ch->IsStun())
|
||||
return;
|
||||
|
||||
|
@ -2400,14 +2399,14 @@ ACMD(do_ride)
|
|||
{
|
||||
if (ch->IsHorseRiding())
|
||||
{
|
||||
dev_log(LOG_DEB0, "[DO_RIDE] stop riding");
|
||||
SPDLOG_TRACE("[DO_RIDE] stop riding");
|
||||
ch->StopRiding();
|
||||
return;
|
||||
}
|
||||
|
||||
if (ch->GetMountVnum())
|
||||
{
|
||||
dev_log(LOG_DEB0, "[DO_RIDE] unmount");
|
||||
SPDLOG_TRACE("[DO_RIDE] unmount");
|
||||
do_unmount(ch, NULL, 0, 0);
|
||||
return;
|
||||
}
|
||||
|
@ -2417,7 +2416,7 @@ ACMD(do_ride)
|
|||
{
|
||||
if (ch->GetHorse() != NULL)
|
||||
{
|
||||
dev_log(LOG_DEB0, "[DO_RIDE] start riding");
|
||||
SPDLOG_TRACE("[DO_RIDE] start riding");
|
||||
ch->StartRiding();
|
||||
return;
|
||||
}
|
||||
|
@ -2433,7 +2432,7 @@ ACMD(do_ride)
|
|||
{
|
||||
if (NULL==ch->GetWear(WEAR_UNIQUE1) || NULL==ch->GetWear(WEAR_UNIQUE2))
|
||||
{
|
||||
dev_log(LOG_DEB0, "[DO_RIDE] USE UNIQUE ITEM");
|
||||
SPDLOG_TRACE("[DO_RIDE] USE UNIQUE ITEM");
|
||||
//ch->EquipItem(item);
|
||||
ch->UseItem(TItemPos (INVENTORY, i));
|
||||
return;
|
||||
|
@ -2448,14 +2447,14 @@ ACMD(do_ride)
|
|||
case 71116: // 산견신이용권
|
||||
case 71118: // 투지범이용권
|
||||
case 71120: // 사자왕이용권
|
||||
dev_log(LOG_DEB0, "[DO_RIDE] USE QUEST ITEM");
|
||||
SPDLOG_TRACE("[DO_RIDE] USE QUEST ITEM");
|
||||
ch->UseItem(TItemPos (INVENTORY, i));
|
||||
return;
|
||||
}
|
||||
|
||||
// GF mantis #113524, 52001~52090 번 탈것
|
||||
if( (item->GetVnum() > 52000) && (item->GetVnum() < 52091) ) {
|
||||
dev_log(LOG_DEB0, "[DO_RIDE] USE QUEST ITEM");
|
||||
SPDLOG_TRACE("[DO_RIDE] USE QUEST ITEM");
|
||||
ch->UseItem(TItemPos (INVENTORY, i));
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -51,7 +51,7 @@ void Command_ApplyAffect(LPCHARACTER ch, const char* argument, const char* affec
|
|||
char arg1[256];
|
||||
one_argument(argument, arg1, sizeof(arg1));
|
||||
|
||||
sys_log(0, arg1);
|
||||
SPDLOG_DEBUG(arg1);
|
||||
|
||||
if (!*arg1)
|
||||
{
|
||||
|
@ -76,7 +76,7 @@ void Command_ApplyAffect(LPCHARACTER ch, const char* argument, const char* affec
|
|||
break;
|
||||
}
|
||||
|
||||
sys_log(0, "%s %s", arg1, affectName);
|
||||
SPDLOG_DEBUG("{} {}", arg1, affectName);
|
||||
|
||||
ch->ChatPacket(CHAT_TYPE_INFO, "%s %s", arg1, affectName);
|
||||
}
|
||||
|
@ -175,7 +175,7 @@ ACMD(do_transfer)
|
|||
else
|
||||
{
|
||||
ch->ChatPacket(CHAT_TYPE_INFO, "There is no character(%s) by that name", arg1);
|
||||
sys_log(0, "There is no character(%s) by that name", arg1);
|
||||
SPDLOG_DEBUG("There is no character({}) by that name", arg1);
|
||||
}
|
||||
|
||||
return;
|
||||
|
@ -240,7 +240,7 @@ void CHARACTER_AddGotoInfo(const std::string& c_st_name, BYTE empire, int mapInd
|
|||
newGotoInfo.y = y;
|
||||
gs_vec_gotoInfo.push_back(newGotoInfo);
|
||||
|
||||
sys_log(0, "AddGotoInfo(name=%s, empire=%d, mapIndex=%d, pos=(%d, %d))", c_st_name.c_str(), empire, mapIndex, x, y);
|
||||
SPDLOG_DEBUG("AddGotoInfo(name={}, empire={}, mapIndex={}, pos=({}, {}))", c_st_name.c_str(), empire, mapIndex, x, y);
|
||||
}
|
||||
|
||||
bool FindInString(const char * c_pszFind, const char * c_pszIn)
|
||||
|
@ -605,8 +605,7 @@ ACMD(do_group)
|
|||
DWORD dwVnum = 0;
|
||||
str_to_number(dwVnum, arg1);
|
||||
|
||||
if (test_server)
|
||||
sys_log(0, "COMMAND GROUP SPAWN %u at %u %u %u", dwVnum, ch->GetMapIndex(), ch->GetX(), ch->GetY());
|
||||
SPDLOG_TRACE("COMMAND GROUP SPAWN {} at {} {} {}", dwVnum, ch->GetMapIndex(), ch->GetX(), ch->GetY());
|
||||
|
||||
CHARACTER_MANAGER::instance().SpawnGroup(dwVnum, ch->GetMapIndex(), ch->GetX() - 500, ch->GetY() - 500, ch->GetX() + 500, ch->GetY() + 500);
|
||||
}
|
||||
|
@ -892,7 +891,7 @@ struct FuncPurge
|
|||
if (!m_bAll && iDist >= 1000) // 10미터 이상에 있는 것들은 purge 하지 않는다.
|
||||
return;
|
||||
|
||||
sys_log(0, "PURGE: %s %d", pkChr->GetName(), iDist);
|
||||
SPDLOG_DEBUG("PURGE: {} {}", pkChr->GetName(), iDist);
|
||||
|
||||
if (pkChr->IsNPC() && !pkChr->IsPet() && pkChr->GetRider() == NULL)
|
||||
{
|
||||
|
@ -915,7 +914,7 @@ ACMD(do_purge)
|
|||
if (sectree) // #431
|
||||
sectree->ForEachAround(func);
|
||||
else
|
||||
sys_err("PURGE_ERROR.NULL_SECTREE(mapIndex=%d, pos=(%d, %d)", ch->GetMapIndex(), ch->GetX(), ch->GetY());
|
||||
SPDLOG_ERROR("PURGE_ERROR.NULL_SECTREE(mapIndex={}, pos=({}, {})", ch->GetMapIndex(), ch->GetX(), ch->GetY());
|
||||
}
|
||||
|
||||
ACMD(do_item_purge)
|
||||
|
@ -1735,7 +1734,7 @@ ACMD(do_event_flag)
|
|||
//quest::CQuestManager::instance().SetEventFlag(arg1, atoi(arg2));
|
||||
quest::CQuestManager::instance().RequestSetEventFlag(arg1, value);
|
||||
ch->ChatPacket(CHAT_TYPE_INFO, "RequestSetEventFlag %s %d", arg1, value);
|
||||
sys_log(0, "RequestSetEventFlag %s %d", arg1, value);
|
||||
SPDLOG_DEBUG("RequestSetEventFlag {} {}", arg1, value);
|
||||
}
|
||||
|
||||
ACMD(do_get_event_flag)
|
||||
|
@ -2118,7 +2117,7 @@ ACMD(do_reload)
|
|||
case 'a':
|
||||
ch->ChatPacket(CHAT_TYPE_INFO, "Reloading Admin infomation.");
|
||||
db_clientdesc->DBPacket(HEADER_GD_RELOAD_ADMIN, 0, NULL, 0);
|
||||
sys_log(0, "Reloading admin infomation.");
|
||||
SPDLOG_INFO("Reloading admin infomation.");
|
||||
break;
|
||||
//END_RELOAD_ADMIN
|
||||
case 'c': // cube
|
||||
|
@ -2531,7 +2530,7 @@ ACMD(do_priv_empire)
|
|||
// 시간 단위로 변경
|
||||
duration = duration * (60*60);
|
||||
|
||||
sys_log(0, "_give_empire_privileage(empire=%d, type=%d, value=%d, duration=%d) by command",
|
||||
SPDLOG_DEBUG("_give_empire_privileage(empire={}, type={}, value={}, duration={}) by command",
|
||||
empire, type, value, duration);
|
||||
CPrivManager::instance().RequestGiveEmpirePriv(empire, type, value, duration);
|
||||
return;
|
||||
|
@ -2659,7 +2658,7 @@ ACMD(do_vote_block_chat)
|
|||
|
||||
const char* name = arg1;
|
||||
int lBlockDuration = 10;
|
||||
sys_log(0, "vote_block_chat %s %d", name, lBlockDuration);
|
||||
SPDLOG_DEBUG("vote_block_chat {} {}", name, lBlockDuration);
|
||||
|
||||
LPCHARACTER tch = CHARACTER_MANAGER::instance().FindPC(name);
|
||||
|
||||
|
@ -2729,7 +2728,7 @@ ACMD(do_block_chat)
|
|||
return;
|
||||
}
|
||||
|
||||
sys_log(0, "BLOCK CHAT %s %d", name, lBlockDuration);
|
||||
SPDLOG_DEBUG("BLOCK CHAT {} {}", name, lBlockDuration);
|
||||
|
||||
LPCHARACTER tch = CHARACTER_MANAGER::instance().FindPC(name);
|
||||
|
||||
|
@ -2781,7 +2780,7 @@ ACMD(do_build)
|
|||
// 메세지를 전송하지 않고 에러를 출력한다.
|
||||
if (!pkLand)
|
||||
{
|
||||
sys_err("%s trying to build on not buildable area.", ch->GetName());
|
||||
SPDLOG_ERROR("{} trying to build on not buildable area.", ch->GetName());
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -2797,14 +2796,14 @@ ACMD(do_build)
|
|||
// 플레이어가 집을 지을 때는 땅이 내껀지 확인해야 한다.
|
||||
if ((!ch->GetGuild() || ch->GetGuild()->GetID() != pkLand->GetOwner()))
|
||||
{
|
||||
sys_err("%s trying to build on not owned land.", ch->GetName());
|
||||
SPDLOG_ERROR("{} trying to build on not owned land.", ch->GetName());
|
||||
return;
|
||||
}
|
||||
|
||||
// 내가 길마인가?
|
||||
if (ch->GetGuild()->GetMasterPID() != ch->GetPlayerID())
|
||||
{
|
||||
sys_err("%s trying to build while not the guild master.", ch->GetName());
|
||||
SPDLOG_ERROR("{} trying to build while not the guild master.", ch->GetName());
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -2946,7 +2945,7 @@ ACMD(do_build)
|
|||
if (dwItemVnum == 0)
|
||||
break;
|
||||
|
||||
sys_log(0, "BUILD: material %d %u %u", i, dwItemVnum, dwItemCount);
|
||||
SPDLOG_DEBUG("BUILD: material {} {} {}", i, dwItemVnum, dwItemCount);
|
||||
ch->RemoveSpecifyItem(dwItemVnum, dwItemCount);
|
||||
}
|
||||
}
|
||||
|
@ -2981,7 +2980,7 @@ ACMD(do_build)
|
|||
|
||||
one_argument(line, arg1, sizeof(arg1));
|
||||
|
||||
sys_log(0, "guild.wall.build map[%d] direction[%s]", mapIndex, arg1);
|
||||
SPDLOG_DEBUG("guild.wall.build map[{}] direction[{}]", mapIndex, arg1);
|
||||
|
||||
switch (arg1[0])
|
||||
{
|
||||
|
@ -2999,7 +2998,7 @@ ACMD(do_build)
|
|||
break;
|
||||
default:
|
||||
ch->ChatPacket(CHAT_TYPE_INFO, "guild.wall.build unknown_direction[%s]", arg1);
|
||||
sys_err("guild.wall.build unknown_direction[%s]", arg1);
|
||||
SPDLOG_ERROR("guild.wall.build unknown_direction[{}]", arg1);
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -3030,7 +3029,7 @@ ACMD(do_build)
|
|||
|
||||
if (setID != 14105 && setID != 14115 && setID != 14125)
|
||||
{
|
||||
sys_log(0, "BUILD_WALL: wrong wall set id %d", setID);
|
||||
SPDLOG_WARN("BUILD_WALL: wrong wall set id {}", setID);
|
||||
break;
|
||||
}
|
||||
else
|
||||
|
|
|
@ -15,7 +15,6 @@
|
|||
#include "war_map.h"
|
||||
#include "locale_service.h"
|
||||
#include "config.h"
|
||||
#include "dev_log.h"
|
||||
#include "db.h"
|
||||
#include "skill_power.h"
|
||||
|
||||
|
@ -161,24 +160,24 @@ void map_allow_log()
|
|||
std::set<int>::iterator i;
|
||||
|
||||
for (i = s_set_map_allows.begin(); i != s_set_map_allows.end(); ++i)
|
||||
sys_log(0, "MAP_ALLOW: %d", *i);
|
||||
SPDLOG_INFO("MAP_ALLOW: {}", *i);
|
||||
}
|
||||
|
||||
void map_allow_add(int index)
|
||||
{
|
||||
if (map_allow_find(index) == true)
|
||||
{
|
||||
fprintf(stdout, "!!! FATAL ERROR !!! multiple MAP_ALLOW setting!!\n");
|
||||
exit(1);
|
||||
SPDLOG_CRITICAL("!!! FATAL ERROR !!! multiple MAP_ALLOW setting!!");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
if (s_set_map_allows.size() >= MAP_ALLOW_MAX_LEN)
|
||||
{
|
||||
fprintf(stdout, "Fatal error: maximum allowed maps reached!\n");
|
||||
exit(1);
|
||||
SPDLOG_CRITICAL("Fatal error: maximum allowed maps reached!");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
fprintf(stdout, "MAP ALLOW %d\n", index);
|
||||
SPDLOG_INFO("MAP ALLOW {}", index);
|
||||
s_set_map_allows.insert(index);
|
||||
}
|
||||
|
||||
|
@ -214,11 +213,11 @@ static void FN_log_adminpage()
|
|||
|
||||
while (iter != g_stAdminPageIP.end())
|
||||
{
|
||||
dev_log(LOG_DEB0, "ADMIN_PAGE_IP = %s", (*iter).c_str());
|
||||
SPDLOG_TRACE("ADMIN_PAGE_IP = {}", (*iter).c_str());
|
||||
++iter;
|
||||
}
|
||||
|
||||
dev_log(LOG_DEB0, "ADMIN_PAGE_PASSWORD = %s", g_stAdminPagePassword.c_str());
|
||||
SPDLOG_TRACE("ADMIN_PAGE_PASSWORD = {}", g_stAdminPagePassword.c_str());
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -271,13 +270,13 @@ bool GetIPInfo()
|
|||
{
|
||||
char * ip = inet_ntoa(sai->sin_addr);
|
||||
strlcpy(g_szInternalIP, ip, sizeof(g_szInternalIP));
|
||||
fprintf(stderr, "Internal IP automatically configured: %s interface %s\n", ip, ifap->ifa_name);
|
||||
SPDLOG_WARN("Internal IP automatically configured: {} interface {}", ip, ifap->ifa_name);
|
||||
}
|
||||
else if (g_szPublicIP[0] == '0')
|
||||
{
|
||||
char * ip = inet_ntoa(sai->sin_addr);
|
||||
strlcpy(g_szPublicIP, ip, sizeof(g_szPublicIP));
|
||||
fprintf(stderr, "Public IP automatically configured: %s interface %s\n", ip, ifap->ifa_name);
|
||||
SPDLOG_WARN("Public IP automatically configured: {} interface {}", ip, ifap->ifa_name);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -308,14 +307,14 @@ void config_init(const string& st_localeServiceName)
|
|||
|
||||
if (!(fp = fopen(st_configFileName.c_str(), "r")))
|
||||
{
|
||||
fprintf(stderr, "Can not open [%s]\n", st_configFileName.c_str());
|
||||
exit(1);
|
||||
SPDLOG_CRITICAL("Can not open [{}]", st_configFileName);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
if (!GetIPInfo())
|
||||
{
|
||||
fprintf(stderr, "Failure in retrieving IP address information!\n");
|
||||
exit(1);
|
||||
SPDLOG_CRITICAL("Failure in retrieving IP address information!");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
char db_host[2][64], db_user[2][64], db_pwd[2][64], db_db[2][64];
|
||||
|
@ -351,8 +350,8 @@ void config_init(const string& st_localeServiceName)
|
|||
|
||||
if (!(fpOnlyForDB = fopen(st_configFileName.c_str(), "r")))
|
||||
{
|
||||
fprintf(stderr, "Can not open [%s]\n", st_configFileName.c_str());
|
||||
exit(1);
|
||||
SPDLOG_CRITICAL("Can not open [{}]", st_configFileName);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
while (fgets(buf, 256, fpOnlyForDB))
|
||||
|
@ -396,7 +395,7 @@ void config_init(const string& st_localeServiceName)
|
|||
TOKEN("hostname")
|
||||
{
|
||||
g_stHostname = value_string;
|
||||
fprintf(stdout, "HOSTNAME: %s\n", g_stHostname.c_str());
|
||||
SPDLOG_INFO("HOSTNAME: {}", g_stHostname);
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -420,8 +419,8 @@ void config_init(const string& st_localeServiceName)
|
|||
|
||||
if (!*db_host[0] || !*db_user[0] || !*db_pwd[0] || !*db_db[0])
|
||||
{
|
||||
fprintf(stderr, "PLAYER_SQL syntax: logsql <host user password db>\n");
|
||||
exit(1);
|
||||
SPDLOG_CRITICAL("PLAYER_SQL syntax: logsql <host user password db>");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
char buf[1024];
|
||||
|
@ -444,8 +443,8 @@ void config_init(const string& st_localeServiceName)
|
|||
|
||||
if (!*db_host[1] || !*db_user[1] || !*db_pwd[1] || !*db_db[1])
|
||||
{
|
||||
fprintf(stderr, "COMMON_SQL syntax: logsql <host user password db>\n");
|
||||
exit(1);
|
||||
SPDLOG_CRITICAL("COMMON_SQL syntax: logsql <host user password db>");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
char buf[1024];
|
||||
|
@ -468,8 +467,8 @@ void config_init(const string& st_localeServiceName)
|
|||
|
||||
if (!*log_host || !*log_user || !*log_pwd || !*log_db)
|
||||
{
|
||||
fprintf(stderr, "LOG_SQL syntax: logsql <host user password db>\n");
|
||||
exit(1);
|
||||
SPDLOG_CRITICAL("LOG_SQL syntax: logsql <host user password db>");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
char buf[1024];
|
||||
|
@ -490,7 +489,7 @@ void config_init(const string& st_localeServiceName)
|
|||
puts("------------------------------------------------");
|
||||
puts("COMMON_SQL: HOST USER PASSWORD DATABASE");
|
||||
puts("");
|
||||
exit(1);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
if (!isPlayerSQL)
|
||||
|
@ -501,7 +500,7 @@ void config_init(const string& st_localeServiceName)
|
|||
puts("------------------------------------------------");
|
||||
puts("PLAYER_SQL: HOST USER PASSWORD DATABASE");
|
||||
puts("");
|
||||
exit(1);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
// Common DB 가 Locale 정보를 가지고 있기 때문에 가장 먼저 접속해야 한다.
|
||||
|
@ -509,11 +508,11 @@ void config_init(const string& st_localeServiceName)
|
|||
|
||||
if (false == AccountDB::instance().IsConnected())
|
||||
{
|
||||
fprintf(stderr, "cannot start server while no common sql connected\n");
|
||||
exit(1);
|
||||
SPDLOG_CRITICAL("cannot start server while no common sql connected");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
fprintf(stdout, "CommonSQL connected\n");
|
||||
SPDLOG_INFO("CommonSQL connected");
|
||||
|
||||
// 로케일 정보를 가져오자
|
||||
// <경고> 쿼리문에 절대 조건문(WHERE) 달지 마세요. (다른 지역에서 문제가 생길수 있습니다)
|
||||
|
@ -525,8 +524,8 @@ void config_init(const string& st_localeServiceName)
|
|||
|
||||
if (pMsg->Get()->uiNumRows == 0)
|
||||
{
|
||||
fprintf(stderr, "COMMON_SQL: DirectQuery failed : %s\n", szQuery);
|
||||
exit(1);
|
||||
SPDLOG_CRITICAL("COMMON_SQL: DirectQuery failed: {}", szQuery);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
MYSQL_ROW row;
|
||||
|
@ -538,8 +537,8 @@ void config_init(const string& st_localeServiceName)
|
|||
{
|
||||
if (LocaleService_Init(row[1]) == false)
|
||||
{
|
||||
fprintf(stderr, "COMMON_SQL: invalid locale key %s\n", row[1]);
|
||||
exit(1);
|
||||
SPDLOG_CRITICAL("COMMON_SQL: invalid locale key {}", row[1]);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -547,7 +546,7 @@ void config_init(const string& st_localeServiceName)
|
|||
|
||||
// 로케일 정보를 COMMON SQL에 세팅해준다.
|
||||
// 참고로 g_stLocale 정보는 LocaleService_Init() 내부에서 세팅된다.
|
||||
fprintf(stdout, "Setting DB to locale %s\n", g_stLocale.c_str());
|
||||
SPDLOG_INFO("Setting DB to locale {}", g_stLocale.c_str());
|
||||
|
||||
AccountDB::instance().SetLocale(g_stLocale);
|
||||
|
||||
|
@ -558,11 +557,11 @@ void config_init(const string& st_localeServiceName)
|
|||
|
||||
if (!DBManager::instance().IsConnected())
|
||||
{
|
||||
fprintf(stderr, "PlayerSQL.ConnectError\n");
|
||||
exit(1);
|
||||
SPDLOG_CRITICAL("PlayerSQL.ConnectError");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
fprintf(stdout, "PlayerSQL connected\n");
|
||||
SPDLOG_INFO("PlayerSQL connected");
|
||||
|
||||
if (false == g_bAuthServer) // 인증 서버가 아닐 경우
|
||||
{
|
||||
|
@ -571,11 +570,11 @@ void config_init(const string& st_localeServiceName)
|
|||
|
||||
if (!LogManager::instance().IsConnected())
|
||||
{
|
||||
fprintf(stderr, "LogSQL.ConnectError\n");
|
||||
exit(1);
|
||||
SPDLOG_CRITICAL("LogSQL.ConnectError");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
fprintf(stdout, "LogSQL connected\n");
|
||||
SPDLOG_INFO("LogSQL connected");
|
||||
|
||||
LogManager::instance().BootLog(g_stHostname.c_str(), g_bChannel);
|
||||
}
|
||||
|
@ -590,8 +589,8 @@ void config_init(const string& st_localeServiceName)
|
|||
|
||||
if (pMsg->Get()->uiNumRows == 0)
|
||||
{
|
||||
fprintf(stderr, "[SKILL_PERCENT] Query failed: %s", szQuery);
|
||||
exit(1);
|
||||
SPDLOG_CRITICAL("[SKILL_PERCENT] Query failed: {}", szQuery);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
MYSQL_ROW row;
|
||||
|
@ -603,22 +602,21 @@ void config_init(const string& st_localeServiceName)
|
|||
char num[128];
|
||||
int aiBaseSkillPowerByLevelTable[SKILL_MAX_LEVEL+1];
|
||||
|
||||
fprintf(stdout, "SKILL_POWER_BY_LEVEL %s\n", p);
|
||||
SPDLOG_INFO("SKILL_POWER_BY_LEVEL {}", p);
|
||||
while (*p != '\0' && cnt < (SKILL_MAX_LEVEL + 1))
|
||||
{
|
||||
p = one_argument(p, num, sizeof(num));
|
||||
aiBaseSkillPowerByLevelTable[cnt++] = atoi(num);
|
||||
|
||||
//fprintf(stdout, "%d %d\n", cnt - 1, aiBaseSkillPowerByLevelTable[cnt - 1]);
|
||||
if (*p == '\0')
|
||||
{
|
||||
if (cnt != (SKILL_MAX_LEVEL + 1))
|
||||
{
|
||||
fprintf(stderr, "[SKILL_PERCENT] locale table has not enough skill information! (count: %d query: %s)", cnt, szQuery);
|
||||
exit(1);
|
||||
SPDLOG_CRITICAL("[SKILL_PERCENT] locale table has not enough skill information! (count: {} query: {})", cnt, szQuery);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
fprintf(stdout, "SKILL_POWER_BY_LEVEL: Done! (count %d)\n", cnt);
|
||||
SPDLOG_INFO("SKILL_POWER_BY_LEVEL: Done! (count {})", cnt);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -641,22 +639,21 @@ void config_init(const string& st_localeServiceName)
|
|||
p = row[0];
|
||||
int aiSkillTable[SKILL_MAX_LEVEL + 1];
|
||||
|
||||
fprintf(stdout, "SKILL_POWER_BY_JOB %d %s\n", job, p);
|
||||
SPDLOG_INFO("SKILL_POWER_BY_JOB {} {}", job, p);
|
||||
while (*p != '\0' && cnt < (SKILL_MAX_LEVEL + 1))
|
||||
{
|
||||
p = one_argument(p, num, sizeof(num));
|
||||
aiSkillTable[cnt++] = atoi(num);
|
||||
|
||||
//fprintf(stdout, "%d %d\n", cnt - 1, aiBaseSkillPowerByLevelTable[cnt - 1]);
|
||||
if (*p == '\0')
|
||||
{
|
||||
if (cnt != (SKILL_MAX_LEVEL + 1))
|
||||
{
|
||||
fprintf(stderr, "[SKILL_PERCENT] locale table has not enough skill information! (count: %d query: %s)", cnt, szQuery);
|
||||
exit(1);
|
||||
SPDLOG_CRITICAL("[SKILL_PERCENT] locale table has not enough skill information! (count: {} query: {})", cnt, szQuery);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
fprintf(stdout, "SKILL_POWER_BY_JOB: Done! (job: %d count: %d)\n", job, cnt);
|
||||
SPDLOG_INFO("SKILL_POWER_BY_JOB: Done! (job: {} count: {})", job, cnt);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -666,10 +663,6 @@ void config_init(const string& st_localeServiceName)
|
|||
}
|
||||
// END_SKILL_POWER_BY_LEVEL
|
||||
|
||||
// LOG_KEEP_DAYS_EXTEND
|
||||
log_set_expiration_days(2);
|
||||
// END_OF_LOG_KEEP_DAYS_EXTEND
|
||||
|
||||
while (fgets(buf, 256, fp))
|
||||
{
|
||||
parse_token(buf, token_string, value_string);
|
||||
|
@ -695,11 +688,11 @@ void config_init(const string& st_localeServiceName)
|
|||
continue;
|
||||
}
|
||||
|
||||
TOKEN("log_keep_days")
|
||||
TOKEN("log_level")
|
||||
{
|
||||
int i = 0;
|
||||
str_to_number(i, value_string);
|
||||
log_set_expiration_days(std::clamp(i, 1, 90));
|
||||
log_set_level(std::clamp(i, SPDLOG_LEVEL_TRACE, SPDLOG_LEVEL_OFF));
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -902,20 +895,20 @@ void config_init(const string& st_localeServiceName)
|
|||
|
||||
if (!*szIP || (!*szPort && strcasecmp(szIP, "master")))
|
||||
{
|
||||
fprintf(stderr, "AUTH_SERVER: syntax error: <ip|master> <port>\n");
|
||||
exit(1);
|
||||
SPDLOG_CRITICAL("AUTH_SERVER: syntax error: <ip|master> <port>");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
g_bAuthServer = true;
|
||||
|
||||
if (!strcasecmp(szIP, "master"))
|
||||
fprintf(stdout, "AUTH_SERVER: I am the master\n");
|
||||
SPDLOG_INFO("AUTH_SERVER: I am the master");
|
||||
else
|
||||
{
|
||||
g_stAuthMasterIP = szIP;
|
||||
str_to_number(g_wAuthMasterPort, szPort);
|
||||
|
||||
fprintf(stdout, "AUTH_SERVER: master %s %u\n", g_stAuthMasterIP.c_str(), g_wAuthMasterPort);
|
||||
SPDLOG_INFO("AUTH_SERVER: master {} {}", g_stAuthMasterIP.c_str(), g_wAuthMasterPort);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
@ -927,7 +920,7 @@ void config_init(const string& st_localeServiceName)
|
|||
|
||||
TOKEN("quest_dir")
|
||||
{
|
||||
sys_log(0, "QUEST_DIR SETTING : %s", value_string);
|
||||
SPDLOG_INFO("QUEST_DIR SETTING : {}", value_string);
|
||||
g_stQuestDir = value_string;
|
||||
}
|
||||
|
||||
|
@ -935,7 +928,7 @@ void config_init(const string& st_localeServiceName)
|
|||
{
|
||||
//g_stQuestObjectDir = value_string;
|
||||
std::istringstream is(value_string);
|
||||
sys_log(0, "QUEST_OBJECT_DIR SETTING : %s", value_string);
|
||||
SPDLOG_INFO("QUEST_OBJECT_DIR SETTING : {}", value_string);
|
||||
string dir;
|
||||
while (!is.eof())
|
||||
{
|
||||
|
@ -943,7 +936,7 @@ void config_init(const string& st_localeServiceName)
|
|||
if (is.fail())
|
||||
break;
|
||||
g_setQuestObjectDir.insert(dir);
|
||||
sys_log(0, "QUEST_OBJECT_DIR INSERT : %s", dir .c_str());
|
||||
SPDLOG_INFO("QUEST_OBJECT_DIR INSERT : {}", dir .c_str());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1033,7 +1026,7 @@ void config_init(const string& st_localeServiceName)
|
|||
TOKEN("pk_protect_level")
|
||||
{
|
||||
str_to_number(PK_PROTECT_LEVEL, value_string);
|
||||
fprintf(stderr, "PK_PROTECT_LEVEL: %d", PK_PROTECT_LEVEL);
|
||||
SPDLOG_INFO("PK_PROTECT_LEVEL: {}", PK_PROTECT_LEVEL);
|
||||
}
|
||||
|
||||
TOKEN("max_level")
|
||||
|
@ -1042,7 +1035,7 @@ void config_init(const string& st_localeServiceName)
|
|||
|
||||
gPlayerMaxLevel = std::clamp<int>(gPlayerMaxLevel, 1, PLAYER_MAX_LEVEL_CONST);
|
||||
|
||||
fprintf(stderr, "PLAYER_MAX_LEVEL: %d\n", gPlayerMaxLevel);
|
||||
SPDLOG_INFO("PLAYER_MAX_LEVEL: {}", gPlayerMaxLevel);
|
||||
}
|
||||
|
||||
TOKEN("block_char_creation")
|
||||
|
@ -1065,20 +1058,20 @@ void config_init(const string& st_localeServiceName)
|
|||
|
||||
if (0 == db_port)
|
||||
{
|
||||
fprintf(stderr, "DB_PORT not configured\n");
|
||||
exit(1);
|
||||
SPDLOG_CRITICAL("DB_PORT not configured");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
if (0 == g_bChannel)
|
||||
{
|
||||
fprintf(stderr, "CHANNEL not configured\n");
|
||||
exit(1);
|
||||
SPDLOG_CRITICAL("CHANNEL not configured");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
if (g_stHostname.empty())
|
||||
{
|
||||
fprintf(stderr, "HOSTNAME must be configured.\n");
|
||||
exit(1);
|
||||
SPDLOG_CRITICAL("HOSTNAME must be configured.");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
// LOCALE_SERVICE
|
||||
|
@ -1100,8 +1093,8 @@ void config_init(const string& st_localeServiceName)
|
|||
|
||||
if (!*cmd || !*levelname)
|
||||
{
|
||||
fprintf(stderr, "CMD syntax error: <cmd> <DISABLE | LOW_WIZARD | WIZARD | HIGH_WIZARD | GOD>\n");
|
||||
exit(1);
|
||||
SPDLOG_CRITICAL("CMD syntax error: <cmd> <DISABLE | LOW_WIZARD | WIZARD | HIGH_WIZARD | GOD>");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
if (!strcasecmp(levelname, "LOW_WIZARD"))
|
||||
|
@ -1118,8 +1111,8 @@ void config_init(const string& st_localeServiceName)
|
|||
level = GM_IMPLEMENTOR + 1;
|
||||
else
|
||||
{
|
||||
fprintf(stderr, "CMD syntax error: <cmd> <DISABLE | LOW_WIZARD | WIZARD | HIGH_WIZARD | GOD>\n");
|
||||
exit(1);
|
||||
SPDLOG_CRITICAL("CMD syntax error: <cmd> <DISABLE | LOW_WIZARD | WIZARD | HIGH_WIZARD | GOD>");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
interpreter_set_privilege(cmd, level);
|
||||
|
@ -1164,7 +1157,7 @@ void LoadValidCRCList()
|
|||
s_set_dwProcessCRC.insert(dwValidClientProcessCRC);
|
||||
s_set_dwFileCRC.insert(dwValidClientFileCRC);
|
||||
|
||||
fprintf(stderr, "CLIENT_CRC: %u %u\n", dwValidClientProcessCRC, dwValidClientFileCRC);
|
||||
SPDLOG_INFO("CLIENT_CRC: {} {}", dwValidClientProcessCRC, dwValidClientFileCRC);
|
||||
}
|
||||
|
||||
fclose(fp);
|
||||
|
@ -1184,7 +1177,7 @@ bool LoadClientVersion()
|
|||
char * p = strchr(buf, '\n');
|
||||
if (p) *p = '\0';
|
||||
|
||||
fprintf(stderr, "VERSION: \"%s\"\n", buf);
|
||||
SPDLOG_INFO("VERSION: \"{}\"", buf);
|
||||
|
||||
g_stClientVersion = buf;
|
||||
fclose(fp);
|
||||
|
|
|
@ -12,7 +12,6 @@
|
|||
#include "utils.h"
|
||||
#include "log.h"
|
||||
#include "char.h"
|
||||
#include "dev_log.h"
|
||||
#include "locale_service.h"
|
||||
#include "item.h"
|
||||
#include "item_manager.h"
|
||||
|
@ -297,17 +296,13 @@ void Cube_open (LPCHARACTER ch)
|
|||
npc = ch->GetQuestNPC();
|
||||
if (NULL==npc)
|
||||
{
|
||||
if (test_server)
|
||||
dev_log(LOG_DEB0, "cube_npc is NULL");
|
||||
SPDLOG_TRACE("cube_npc is NULL");
|
||||
return;
|
||||
}
|
||||
|
||||
if ( FN_check_valid_npc(npc->GetRaceNum()) == false )
|
||||
{
|
||||
if ( test_server == true )
|
||||
{
|
||||
dev_log(LOG_DEB0, "cube not valid NPC");
|
||||
}
|
||||
SPDLOG_TRACE("cube not valid NPC");
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -326,7 +321,7 @@ void Cube_open (LPCHARACTER ch)
|
|||
|
||||
if (distance >= CUBE_MAX_DISTANCE)
|
||||
{
|
||||
sys_log(1, "CUBE: TOO_FAR: %s distance %d", ch->GetName(), distance);
|
||||
SPDLOG_DEBUG("CUBE: TOO_FAR: {} distance {}", ch->GetName(), distance);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -343,7 +338,7 @@ void Cube_close (LPCHARACTER ch)
|
|||
Cube_clean_item(ch);
|
||||
ch->SetCubeNpc(NULL);
|
||||
ch->ChatPacket(CHAT_TYPE_COMMAND, "cube close");
|
||||
dev_log(LOG_DEB0, "<CUBE> close (%s)", ch->GetName());
|
||||
SPDLOG_TRACE("<CUBE> close ({})", ch->GetName());
|
||||
}
|
||||
|
||||
void Cube_init()
|
||||
|
@ -354,7 +349,7 @@ void Cube_init()
|
|||
char file_name[256+1];
|
||||
snprintf(file_name, sizeof(file_name), "%s/cube.txt", LocaleService_GetBasePath().c_str());
|
||||
|
||||
sys_log(0, "Cube_Init %s", file_name);
|
||||
SPDLOG_INFO("Cube_Init {}", file_name);
|
||||
|
||||
for (iter = s_cube_proto.begin(); iter!=s_cube_proto.end(); iter++)
|
||||
{
|
||||
|
@ -365,7 +360,7 @@ void Cube_init()
|
|||
s_cube_proto.clear();
|
||||
|
||||
if (false == Cube_load(file_name))
|
||||
sys_err("Cube_Init failed");
|
||||
SPDLOG_ERROR("Cube_Init failed");
|
||||
}
|
||||
|
||||
bool Cube_load (const char *file)
|
||||
|
@ -439,7 +434,7 @@ bool Cube_load (const char *file)
|
|||
// TODO : check cube data
|
||||
if (false == FN_check_cube_data(cube_data))
|
||||
{
|
||||
dev_log(LOG_DEB0, "something wrong");
|
||||
SPDLOG_TRACE("something wrong");
|
||||
M2_DELETE(cube_data);
|
||||
continue;
|
||||
}
|
||||
|
@ -454,23 +449,23 @@ bool Cube_load (const char *file)
|
|||
static void FN_cube_print (CUBE_DATA *data, DWORD index)
|
||||
{
|
||||
DWORD i;
|
||||
dev_log(LOG_DEB0, "--------------------------------");
|
||||
dev_log(LOG_DEB0, "CUBE_DATA[%d]", index);
|
||||
SPDLOG_TRACE("--------------------------------");
|
||||
SPDLOG_TRACE("CUBE_DATA[{}]", index);
|
||||
|
||||
for (i=0; i<data->npc_vnum.size(); ++i)
|
||||
{
|
||||
dev_log(LOG_DEB0, "\tNPC_VNUM[%d] = %d", i, data->npc_vnum[i]);
|
||||
SPDLOG_TRACE("\tNPC_VNUM[{}] = {}", i, data->npc_vnum[i]);
|
||||
}
|
||||
for (i=0; i<data->item.size(); ++i)
|
||||
{
|
||||
dev_log(LOG_DEB0, "\tITEM[%d] = (%d, %d)", i, data->item[i].vnum, data->item[i].count);
|
||||
SPDLOG_TRACE("\tITEM[{}] = ({}, {})", i, data->item[i].vnum, data->item[i].count);
|
||||
}
|
||||
for (i=0; i<data->reward.size(); ++i)
|
||||
{
|
||||
dev_log(LOG_DEB0, "\tREWARD[%d] = (%d, %d)", i, data->reward[i].vnum, data->reward[i].count);
|
||||
SPDLOG_TRACE("\tREWARD[{}] = ({}, {})", i, data->reward[i].vnum, data->reward[i].count);
|
||||
}
|
||||
dev_log(LOG_DEB0, "\tPERCENT = %d", data->percent);
|
||||
dev_log(LOG_DEB0, "--------------------------------");
|
||||
SPDLOG_TRACE("\tPERCENT = {}", data->percent);
|
||||
SPDLOG_TRACE("--------------------------------");
|
||||
}
|
||||
|
||||
void Cube_print ()
|
||||
|
@ -772,8 +767,6 @@ void Cube_MakeCubeInformationText()
|
|||
sprintf(temp, "%d", materialInfo.gold);
|
||||
infoText += std::string("/") + temp;
|
||||
}
|
||||
|
||||
//sys_err("\t\tNPC: %d, Reward: %d(%s)\n\t\t\tInfo: %s", npcVNUM, materialInfo.reward.vnum, ITEM_MANAGER::Instance().GetTable(materialInfo.reward.vnum)->szName, materialInfo.infoText.c_str());
|
||||
} // for resultList
|
||||
} // for npc
|
||||
}
|
||||
|
@ -789,12 +782,12 @@ bool Cube_InformationInitialize()
|
|||
// 하드코딩 ㅈㅅ
|
||||
if (1 != rewards.size())
|
||||
{
|
||||
sys_err("[CubeInfo] WARNING! Does not support multiple rewards (count: %d)", rewards.size());
|
||||
SPDLOG_ERROR("[CubeInfo] WARNING! Does not support multiple rewards (count: {})", rewards.size());
|
||||
continue;
|
||||
}
|
||||
//if (1 != cubeData->npc_vnum.size())
|
||||
//{
|
||||
// sys_err("[CubeInfo] WARNING! Does not support multiple NPC (count: %d)", cubeData->npc_vnum.size());
|
||||
// SPDLOG_ERROR("[CubeInfo] WARNING! Does not support multiple NPC (count: {})", cubeData->npc_vnum.size());
|
||||
// continue;
|
||||
//}
|
||||
|
||||
|
@ -828,7 +821,7 @@ bool Cube_InformationInitialize()
|
|||
TItemTable* existMaterialProto = ITEM_MANAGER::Instance().GetTable(existMaterialIter->vnum);
|
||||
if (NULL == existMaterialProto)
|
||||
{
|
||||
sys_err("There is no item(%u)", existMaterialIter->vnum);
|
||||
SPDLOG_ERROR("There is no item({})", existMaterialIter->vnum);
|
||||
return false;
|
||||
}
|
||||
SItemNameAndLevel existItemInfo = SplitItemNameAndLevelFromName(existMaterialProto->szName);
|
||||
|
@ -908,7 +901,7 @@ void Cube_request_result_list(LPCHARACTER ch)
|
|||
// 채팅 패킷의 한계를 넘어가면 에러 남김... 기획자 분들 께 조정해달라고 요청하거나, 나중에 다른 방식으로 바꾸거나...
|
||||
if (resultText.size() - 20 >= CHAT_MAX_LEN)
|
||||
{
|
||||
sys_err("[CubeInfo] Too long cube result list text. (NPC: %d, length: %d)", npcVNUM, resultText.size());
|
||||
SPDLOG_ERROR("[CubeInfo] Too long cube result list text. (NPC: {}, length: {})", npcVNUM, resultText.size());
|
||||
resultText.clear();
|
||||
resultCount = 0;
|
||||
}
|
||||
|
@ -958,7 +951,7 @@ void Cube_request_material_info(LPCHARACTER ch, int requestStartIndex, int reque
|
|||
|
||||
if (false == bCatchInfo)
|
||||
{
|
||||
sys_err("[CubeInfo] Can't find matched material info (NPC: %d, index: %d, request count: %d)", npcVNUM, requestStartIndex, requestCount);
|
||||
SPDLOG_ERROR("[CubeInfo] Can't find matched material info (NPC: {}, index: {}, request count: {})", npcVNUM, requestStartIndex, requestCount);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -968,7 +961,7 @@ void Cube_request_material_info(LPCHARACTER ch, int requestStartIndex, int reque
|
|||
// (Server -> Client) /cube m_info start_index count 125,1|126,2|127,2|123,5&555,5&555,4/120000
|
||||
if (materialInfoText.size() - 20 >= CHAT_MAX_LEN)
|
||||
{
|
||||
sys_err("[CubeInfo] Too long material info. (NPC: %d, requestStart: %d, requestCount: %d, length: %d)", npcVNUM, requestStartIndex, requestCount, materialInfoText.size());
|
||||
SPDLOG_ERROR("[CubeInfo] Too long material info. (NPC: {}, requestStart: {}, requestCount: {}, length: {})", npcVNUM, requestStartIndex, requestCount, materialInfoText.size());
|
||||
}
|
||||
|
||||
ch->ChatPacket(CHAT_TYPE_COMMAND, "cube m_info %d %d %s", requestStartIndex, requestCount, materialInfoText.c_str());
|
||||
|
|
|
@ -36,7 +36,7 @@ bool DBManager::Connect(const char * host, const int port, const char * user, co
|
|||
m_bIsConnect = true;
|
||||
|
||||
if (!m_sql_direct.Setup(host, user, pwd, db, g_stLocale.c_str(), true, port))
|
||||
sys_err("cannot open direct sql connection to host %s", host);
|
||||
SPDLOG_ERROR("cannot open direct sql connection to host {}", host);
|
||||
|
||||
if (m_bIsConnect && !g_bAuthServer)
|
||||
{
|
||||
|
@ -77,7 +77,6 @@ bool DBManager::IsConnected()
|
|||
|
||||
void DBManager::ReturnQuery(int iType, DWORD dwIdent, void * pvData, const char * c_pszFormat, ...)
|
||||
{
|
||||
//sys_log(0, "ReturnQuery %s", c_pszQuery);
|
||||
char szQuery[4096];
|
||||
va_list args;
|
||||
|
||||
|
@ -163,7 +162,7 @@ void DBManager::DeleteLoginData(CLoginData * pkLD)
|
|||
if (it == m_map_pkLoginData.end())
|
||||
return;
|
||||
|
||||
sys_log(0, "DeleteLoginData %s %p", pkLD->GetLogin(), pkLD);
|
||||
SPDLOG_DEBUG("DeleteLoginData {} {}", pkLD->GetLogin(), (void*) pkLD);
|
||||
|
||||
mapLDBilling.erase(pkLD->GetLogin());
|
||||
|
||||
|
@ -177,7 +176,7 @@ void DBManager::SetBilling(DWORD dwKey, bool bOn, bool bSkipPush)
|
|||
|
||||
if (it == m_map_pkLoginData.end())
|
||||
{
|
||||
sys_err("cannot find login key %u", dwKey);
|
||||
SPDLOG_ERROR("cannot find login key {}", dwKey);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -214,7 +213,7 @@ void DBManager::PushBilling(CLoginData * pkLD)
|
|||
t.dwLoginKey = pkLD->GetKey();
|
||||
t.bBillType = pkLD->GetBillType();
|
||||
|
||||
sys_log(0, "BILLING: PUSH %s %u type %u", pkLD->GetLogin(), t.dwUseSec, t.bBillType);
|
||||
SPDLOG_DEBUG("BILLING: PUSH {} {} type {}", pkLD->GetLogin(), t.dwUseSec, t.bBillType);
|
||||
|
||||
if (t.bBillType == BILLING_IP_FREE || t.bBillType == BILLING_IP_TIME || t.bBillType == BILLING_IP_DAY)
|
||||
snprintf(t.szLogin, sizeof(t.szLogin), "%u", pkLD->GetBillID());
|
||||
|
@ -335,7 +334,7 @@ void DBManager::FlushBilling(bool bForce)
|
|||
else
|
||||
m_vec_kUseTime.clear();
|
||||
|
||||
sys_log(0, "FLUSH_USE_TIME: count %u", dwCount);
|
||||
SPDLOG_DEBUG("FLUSH_USE_TIME: count {}", dwCount);
|
||||
}
|
||||
|
||||
if (m_vec_kUseTime.size() < 10240)
|
||||
|
@ -374,7 +373,7 @@ void DBManager::FlushBilling(bool bForce)
|
|||
|
||||
if (dwSecsConnected >= 60) // 60 second cycle
|
||||
{
|
||||
sys_log(0, "BILLING 1 %s remain %d connected secs %u",
|
||||
SPDLOG_DEBUG("BILLING 1 {} remain {} connected secs {}",
|
||||
pkLD->GetLogin(), pkLD->GetRemainSecs(), dwSecsConnected);
|
||||
PushBilling(pkLD);
|
||||
}
|
||||
|
@ -385,7 +384,7 @@ void DBManager::FlushBilling(bool bForce)
|
|||
|
||||
if (dwSecsConnected > (DWORD) (pkLD->GetRemainSecs() - 600) || dwSecsConnected >= 600)
|
||||
{
|
||||
sys_log(0, "BILLING 2 %s remain %d connected secs %u",
|
||||
SPDLOG_DEBUG("BILLING 2 {} remain {} connected secs {}",
|
||||
pkLD->GetLogin(), pkLD->GetRemainSecs(), dwSecsConnected);
|
||||
PushBilling(pkLD);
|
||||
}
|
||||
|
@ -402,8 +401,6 @@ void DBManager::CheckBilling()
|
|||
std::vector<DWORD> vec;
|
||||
vec.push_back(0); // 카운트를 위해 미리 비워둔다.
|
||||
|
||||
//sys_log(0, "CheckBilling: map size %d", m_map_pkLoginData.size());
|
||||
|
||||
itertype(m_map_pkLoginData) it = m_map_pkLoginData.begin();
|
||||
|
||||
while (it != m_map_pkLoginData.end())
|
||||
|
@ -412,7 +409,7 @@ void DBManager::CheckBilling()
|
|||
|
||||
if (pkLD->IsBilling())
|
||||
{
|
||||
sys_log(0, "BILLING: CHECK %u", pkLD->GetKey());
|
||||
SPDLOG_DEBUG("BILLING: CHECK {}", pkLD->GetKey());
|
||||
vec.push_back(pkLD->GetKey());
|
||||
}
|
||||
}
|
||||
|
@ -460,7 +457,7 @@ void DBManager::SendAuthLogin(LPDESC d)
|
|||
memcpy(&ptod.adwClientKey, pkLD->GetClientKey(), sizeof(DWORD) * 4);
|
||||
|
||||
db_clientdesc->DBPacket(HEADER_GD_AUTH_LOGIN, d->GetHandle(), &ptod, sizeof(TPacketGDAuthLogin));
|
||||
sys_log(0, "SendAuthLogin %s key %u", ptod.szLogin, ptod.dwID);
|
||||
SPDLOG_DEBUG("SendAuthLogin {} key {}", ptod.szLogin, ptod.dwID);
|
||||
|
||||
SendLoginPing(r.login);
|
||||
}
|
||||
|
@ -499,7 +496,7 @@ void DBManager::LoginPrepare(BYTE bBillType, DWORD dwBillID, int lRemainSecs, LP
|
|||
|
||||
d->Packet(&pm, sizeof(TPacketGCMatrixCard));
|
||||
|
||||
sys_log(0, "MATRIX_QUERY: %s %c%d %c%d %c%d %c%d %s",
|
||||
SPDLOG_DEBUG("MATRIX_QUERY: {} {}{} {}{} {}{} {}{} {}",
|
||||
r.login,
|
||||
MATRIX_CARD_ROW(rows, 0) + 'A',
|
||||
MATRIX_CARD_COL(cols, 0) + 1,
|
||||
|
@ -581,7 +578,7 @@ bool GetGameTime(MYSQL_RES * pRes, BYTE & bBillType, int & seconds)
|
|||
return true;
|
||||
|
||||
MYSQL_ROW row = mysql_fetch_row(pRes);
|
||||
sys_log(1, "GetGameTime %p %p %p", row[0], row[1], row[2]);
|
||||
SPDLOG_DEBUG("GetGameTime {} {} {}", row[0], row[1], row[2]);
|
||||
|
||||
int type = 0;
|
||||
str_to_number(type, row[0]);
|
||||
|
@ -616,7 +613,7 @@ void SendBillingExpire(const char * c_pszLogin, BYTE bBillType, int iSecs, CLogi
|
|||
ptod.bBillType = bBillType;
|
||||
ptod.dwRemainSeconds = std::max(0, iSecs);
|
||||
db_clientdesc->DBPacket(HEADER_GD_BILLING_EXPIRE, 0, &ptod, sizeof(TPacketBillingExpire));
|
||||
sys_log(0, "BILLING: EXPIRE %s type %d sec %d ptr %p", c_pszLogin, bBillType, iSecs, pkLD);
|
||||
SPDLOG_DEBUG("BILLING: EXPIRE {} type {} sec {} ptr {}", c_pszLogin, bBillType, iSecs, (void*) pkLD);
|
||||
}
|
||||
|
||||
void DBManager::AnalyzeReturnQuery(SQLMsg * pMsg)
|
||||
|
@ -638,11 +635,11 @@ void DBManager::AnalyzeReturnQuery(SQLMsg * pMsg)
|
|||
//위치 변경 - By SeMinZ
|
||||
d->SetLogin(pinfo->login);
|
||||
|
||||
sys_log(0, "QID_AUTH_LOGIN: START %u %p", qi->dwIdent, get_pointer(d));
|
||||
SPDLOG_DEBUG("QID_AUTH_LOGIN: START {} {}", qi->dwIdent, (void*) get_pointer(d));
|
||||
|
||||
if (pMsg->Get()->uiNumRows == 0)
|
||||
{
|
||||
sys_log(0, " NOID");
|
||||
SPDLOG_DEBUG(" NOID");
|
||||
LoginFailure(d, "NOID");
|
||||
M2_DELETE(pinfo);
|
||||
}
|
||||
|
@ -661,7 +658,7 @@ void DBManager::AnalyzeReturnQuery(SQLMsg * pMsg)
|
|||
|
||||
if (!row[col])
|
||||
{
|
||||
sys_err("error column %d", col);
|
||||
SPDLOG_ERROR("error column {}", col);
|
||||
M2_DELETE(pinfo);
|
||||
break;
|
||||
}
|
||||
|
@ -670,7 +667,7 @@ void DBManager::AnalyzeReturnQuery(SQLMsg * pMsg)
|
|||
|
||||
if (!row[col])
|
||||
{
|
||||
sys_err("error column %d", col);
|
||||
SPDLOG_ERROR("error column {}", col);
|
||||
M2_DELETE(pinfo);
|
||||
break;
|
||||
}
|
||||
|
@ -689,7 +686,7 @@ void DBManager::AnalyzeReturnQuery(SQLMsg * pMsg)
|
|||
|
||||
if (!row[col])
|
||||
{
|
||||
sys_err("error column %d", col);
|
||||
SPDLOG_ERROR("error column {}", col);
|
||||
M2_DELETE(pinfo);
|
||||
break;
|
||||
}
|
||||
|
@ -698,7 +695,7 @@ void DBManager::AnalyzeReturnQuery(SQLMsg * pMsg)
|
|||
|
||||
if (!row[col])
|
||||
{
|
||||
sys_err("error column %d", col);
|
||||
SPDLOG_ERROR("error column {}", col);
|
||||
M2_DELETE(pinfo);
|
||||
break;
|
||||
}
|
||||
|
@ -707,7 +704,7 @@ void DBManager::AnalyzeReturnQuery(SQLMsg * pMsg)
|
|||
|
||||
if (!row[col])
|
||||
{
|
||||
sys_err("error column %d", col);
|
||||
SPDLOG_ERROR("error column {}", col);
|
||||
M2_DELETE(pinfo);
|
||||
break;
|
||||
}
|
||||
|
@ -752,8 +749,8 @@ void DBManager::AnalyzeReturnQuery(SQLMsg * pMsg)
|
|||
tm1 = localtime(&create_time);
|
||||
strftime(szCreateDate, 255, "%Y%m%d", tm1);
|
||||
|
||||
sys_log(0, "Create_Time %d %s", retValue, szCreateDate);
|
||||
sys_log(0, "Block Time %d ", strncmp(szCreateDate, g_stBlockDate.c_str(), 8));
|
||||
SPDLOG_DEBUG("Create_Time {} {}", retValue, szCreateDate);
|
||||
SPDLOG_DEBUG("Block Time {} ", strncmp(szCreateDate, g_stBlockDate.c_str(), 8));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -767,25 +764,25 @@ void DBManager::AnalyzeReturnQuery(SQLMsg * pMsg)
|
|||
if (nPasswordDiff)
|
||||
{
|
||||
LoginFailure(d, "WRONGPWD");
|
||||
sys_log(0, " WRONGPWD");
|
||||
SPDLOG_DEBUG(" WRONGPWD");
|
||||
M2_DELETE(pinfo);
|
||||
}
|
||||
else if (bNotAvail)
|
||||
{
|
||||
LoginFailure(d, "NOTAVAIL");
|
||||
sys_log(0, " NOTAVAIL");
|
||||
SPDLOG_DEBUG(" NOTAVAIL");
|
||||
M2_DELETE(pinfo);
|
||||
}
|
||||
else if (DESC_MANAGER::instance().FindByLoginName(pinfo->login))
|
||||
{
|
||||
LoginFailure(d, "ALREADY");
|
||||
sys_log(0, " ALREADY");
|
||||
SPDLOG_DEBUG(" ALREADY");
|
||||
M2_DELETE(pinfo);
|
||||
}
|
||||
else if (strcmp(szStatus, "OK"))
|
||||
{
|
||||
LoginFailure(d, szStatus);
|
||||
sys_log(0, " STATUS: %s", szStatus);
|
||||
SPDLOG_DEBUG(" STATUS: {}", szStatus);
|
||||
M2_DELETE(pinfo);
|
||||
}
|
||||
else
|
||||
|
@ -796,7 +793,7 @@ void DBManager::AnalyzeReturnQuery(SQLMsg * pMsg)
|
|||
if (strncmp(szCreateDate, g_stBlockDate.c_str(), 8) >= 0)
|
||||
{
|
||||
LoginFailure(d, "BLKLOGIN");
|
||||
sys_log(0, " BLKLOGIN");
|
||||
SPDLOG_DEBUG(" BLKLOGIN");
|
||||
M2_DELETE(pinfo);
|
||||
break;
|
||||
}
|
||||
|
@ -824,7 +821,7 @@ void DBManager::AnalyzeReturnQuery(SQLMsg * pMsg)
|
|||
break;
|
||||
}
|
||||
|
||||
sys_log(0, "QID_AUTH_LOGIN: SUCCESS %s", pinfo->login);
|
||||
SPDLOG_DEBUG("QID_AUTH_LOGIN: SUCCESS {}", pinfo->login);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -835,7 +832,7 @@ void DBManager::AnalyzeReturnQuery(SQLMsg * pMsg)
|
|||
TPacketCGLogin3 * pinfo = (TPacketCGLogin3 *) qi->pvData;
|
||||
LPDESC d = DESC_MANAGER::instance().FindByLoginKey(qi->dwIdent);
|
||||
|
||||
sys_log(0, "QID_BILLING_GET_TIME: START ident %u d %p", qi->dwIdent, get_pointer(d));
|
||||
SPDLOG_DEBUG("QID_BILLING_GET_TIME: START ident {} d {}", qi->dwIdent, (void*) get_pointer(d));
|
||||
|
||||
if (d)
|
||||
{
|
||||
|
@ -853,18 +850,18 @@ void DBManager::AnalyzeReturnQuery(SQLMsg * pMsg)
|
|||
|
||||
if (!GetGameTime(pMsg->Get()->pSQLResult, bBillType, seconds))
|
||||
{
|
||||
sys_log(0, "QID_BILLING_GET_TIME: BLOCK");
|
||||
SPDLOG_DEBUG("QID_BILLING_GET_TIME: BLOCK");
|
||||
LoginFailure(d, "BLOCK");
|
||||
}
|
||||
else if (bBillType == BILLING_NONE)
|
||||
{
|
||||
LoginFailure(d, "NOBILL");
|
||||
sys_log(0, "QID_BILLING_GET_TIME: NO TIME");
|
||||
SPDLOG_DEBUG("QID_BILLING_GET_TIME: NO TIME");
|
||||
}
|
||||
else
|
||||
{
|
||||
LoginPrepare(bBillType, 0, seconds, d, pinfo->adwClientKey);
|
||||
sys_log(0, "QID_BILLING_GET_TIME: SUCCESS");
|
||||
SPDLOG_DEBUG("QID_BILLING_GET_TIME: SUCCESS");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -961,7 +958,7 @@ void DBManager::AnalyzeReturnQuery(SQLMsg * pMsg)
|
|||
if (row[0] && row[1])
|
||||
{
|
||||
m_map_dbstring.insert(make_pair(std::string(row[0]), std::string(row[1])));
|
||||
sys_log(0, "DBSTR '%s' '%s'", row[0], row[1]);
|
||||
SPDLOG_DEBUG("DBSTR '{}' '{}'", row[0], row[1]);
|
||||
}
|
||||
}
|
||||
if (m_map_dbstring.find("GREET") != m_map_dbstring.end())
|
||||
|
@ -986,7 +983,7 @@ void DBManager::AnalyzeReturnQuery(SQLMsg * pMsg)
|
|||
{
|
||||
if (pMsg->Get()->uiAffectedRows == 0 || pMsg->Get()->uiAffectedRows == (uint32_t)-1)
|
||||
{
|
||||
sys_log(0, "GIVE LOTTO FAIL TO pid %u", ch->GetPlayerID());
|
||||
SPDLOG_DEBUG("GIVE LOTTO FAIL TO pid {}", ch->GetPlayerID());
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -994,14 +991,14 @@ void DBManager::AnalyzeReturnQuery(SQLMsg * pMsg)
|
|||
|
||||
if (pkItem)
|
||||
{
|
||||
sys_log(0, "GIVE LOTTO SUCCESS TO %s (pid %u)", ch->GetName(), qi->dwIdent);
|
||||
SPDLOG_DEBUG("GIVE LOTTO SUCCESS TO {} (pid {})", ch->GetName(), qi->dwIdent);
|
||||
//ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("아이템 획득: %s"), pkItem->GetName());
|
||||
|
||||
pkItem->SetSocket(0, pMsg->Get()->uiInsertID);
|
||||
pkItem->SetSocket(1, pdw[2]);
|
||||
}
|
||||
else
|
||||
sys_log(0, "GIVE LOTTO FAIL2 TO pid %u", ch->GetPlayerID());
|
||||
SPDLOG_DEBUG("GIVE LOTTO FAIL2 TO pid {}", ch->GetPlayerID());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1080,8 +1077,7 @@ void DBManager::AnalyzeReturnQuery(SQLMsg * pMsg)
|
|||
const char* c_szName = row[0];
|
||||
const char* c_szUpdateTime = row[12];
|
||||
|
||||
if (test_server)
|
||||
sys_log(0, "%s:%s", c_szName, c_szUpdateTime);
|
||||
SPDLOG_TRACE("{}:{}", c_szName, c_szUpdateTime);
|
||||
|
||||
if (PCBANG_IP_TABLE_NAME == c_szName)
|
||||
{
|
||||
|
@ -1091,12 +1087,12 @@ void DBManager::AnalyzeReturnQuery(SQLMsg * pMsg)
|
|||
if (s_stLastTime != c_szUpdateTime)
|
||||
{
|
||||
s_stLastTime = c_szUpdateTime;
|
||||
sys_log(0, "'%s' mysql table is UPDATED(%s)", PCBANG_IP_TABLE_NAME.c_str(), c_szUpdateTime);
|
||||
SPDLOG_DEBUG("'{}' mysql table is UPDATED({})", PCBANG_IP_TABLE_NAME, c_szUpdateTime);
|
||||
ReturnQuery(QID_PCBANG_IP_LIST_SELECT, 0, NULL, "SELECT pcbang_id, ip FROM %s;", PCBANG_IP_TABLE_NAME.c_str());
|
||||
}
|
||||
else
|
||||
{
|
||||
sys_log(0, "'%s' mysql table is NOT updated(%s)", PCBANG_IP_TABLE_NAME.c_str(), c_szUpdateTime);
|
||||
SPDLOG_DEBUG("'{}' mysql table is NOT updated({})", PCBANG_IP_TABLE_NAME, c_szUpdateTime);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
@ -1104,12 +1100,12 @@ void DBManager::AnalyzeReturnQuery(SQLMsg * pMsg)
|
|||
|
||||
if (!isFinded)
|
||||
{
|
||||
sys_err(0, "'%s' mysql table CANNOT FIND", PCBANG_IP_TABLE_NAME.c_str());
|
||||
SPDLOG_ERROR("'{}' mysql table CANNOT FIND", PCBANG_IP_TABLE_NAME);
|
||||
}
|
||||
}
|
||||
else if (test_server)
|
||||
{
|
||||
sys_err(0, "'%s' mysql table is NOT EXIST", PCBANG_IP_TABLE_NAME.c_str());
|
||||
SPDLOG_ERROR("'{}' mysql table is NOT EXIST", PCBANG_IP_TABLE_NAME);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
@ -1125,10 +1121,8 @@ void DBManager::AnalyzeReturnQuery(SQLMsg * pMsg)
|
|||
CPCBangManager::instance().InsertIP(row[0], row[1]);
|
||||
}
|
||||
}
|
||||
else if (test_server)
|
||||
{
|
||||
sys_log(0, "PCBANG_IP_LIST is EMPTY");
|
||||
}
|
||||
else
|
||||
SPDLOG_TRACE("PCBANG_IP_LIST is EMPTY");
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -1136,7 +1130,7 @@ void DBManager::AnalyzeReturnQuery(SQLMsg * pMsg)
|
|||
// END_OF_PCBANG_IP_LIST
|
||||
|
||||
default:
|
||||
sys_err("FATAL ERROR!!! Unhandled return query id %d", qi->iType);
|
||||
SPDLOG_ERROR("FATAL ERROR!!! Unhandled return query id {}", qi->iType);
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -1193,7 +1187,7 @@ void VCardUse(LPCHARACTER CardOwner, LPCHARACTER CardTaker, LPITEM item)
|
|||
|
||||
ITEM_MANAGER::instance().RemoveItem(item);
|
||||
|
||||
sys_log(0, "VCARD_TAKE: %u %s -> %s", p.dwID, CardOwner->GetName(), CardTaker->GetName());
|
||||
SPDLOG_DEBUG("VCARD_TAKE: {} {} -> {}", p.dwID, CardOwner->GetName(), CardTaker->GetName());
|
||||
}
|
||||
|
||||
void DBManager::StopAllBilling()
|
||||
|
@ -1233,11 +1227,11 @@ bool AccountDB::IsConnected()
|
|||
|
||||
bool AccountDB::Connect(const char * host, const int port, const char * user, const char * pwd, const char * db)
|
||||
{
|
||||
m_IsConnect = m_sql_direct.Setup(host, user, pwd, db, "", true, port);
|
||||
m_IsConnect = m_sql_direct.Setup(host, user, pwd, db, nullptr, true, port);
|
||||
|
||||
if (false == m_IsConnect)
|
||||
{
|
||||
fprintf(stderr, "cannot open direct sql connection to host: %s user: %s db: %s\n", host, user, db);
|
||||
SPDLOG_ERROR("cannot open direct sql connection to host: {} user: {} db: {}", host, user, db);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -29,9 +29,6 @@ void DescReadHandler(bufferevent *bev, void *ctx) {
|
|||
{
|
||||
int size = d->ProcessInput();
|
||||
|
||||
if (size)
|
||||
sys_log(1, "DB_BYTES_READ: %d", size);
|
||||
|
||||
if (size < 0)
|
||||
{
|
||||
d->SetPhase(PHASE_CLOSE);
|
||||
|
@ -50,15 +47,11 @@ void DescWriteHandler(bufferevent *bev, void *ctx) {
|
|||
{
|
||||
evbuffer *output = bufferevent_get_output(bev);
|
||||
size_t buf_size = evbuffer_get_length(output);
|
||||
if (buf_size)
|
||||
sys_log(1, "DB_BYTES_WRITE: size %d", buf_size);
|
||||
}
|
||||
else if (g_TeenDesc==d)
|
||||
{
|
||||
evbuffer *output = bufferevent_get_output(bev);
|
||||
size_t buf_size = evbuffer_get_length(output);
|
||||
if (buf_size)
|
||||
sys_log(0, "TEEN::Send(size %d)", buf_size);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -66,10 +59,10 @@ void DescEventHandler(bufferevent *bev, short events, void *ctx) {
|
|||
auto* d = (LPDESC) ctx;
|
||||
|
||||
if (events & BEV_EVENT_ERROR)
|
||||
sys_err("DESC libevent error, handle: %d", d->GetHandle());
|
||||
SPDLOG_ERROR("DESC libevent error, handle: {}", d->GetHandle());
|
||||
|
||||
if (events & BEV_EVENT_EOF)
|
||||
sys_log(0, "DESC disconnected: handle %d", d->GetHandle());
|
||||
SPDLOG_DEBUG("DESC disconnected: handle {}", d->GetHandle());
|
||||
|
||||
// Either the socket was closed or an error occured, therefore we can disconnect this peer.
|
||||
if (events & (BEV_EVENT_EOF | BEV_EVENT_ERROR))
|
||||
|
@ -108,8 +101,6 @@ void DESC::Initialize()
|
|||
m_lpCharacter = NULL;
|
||||
memset( &m_accountTable, 0, sizeof(m_accountTable) );
|
||||
|
||||
m_pLogFile = NULL;
|
||||
|
||||
m_wP2PPort = 0;
|
||||
m_bP2PChannel = 0;
|
||||
|
||||
|
@ -154,12 +145,6 @@ void DESC::Destroy()
|
|||
if (GetAccountTable().id)
|
||||
DESC_MANAGER::instance().DisconnectAccount(GetAccountTable().login);
|
||||
|
||||
if (m_pLogFile)
|
||||
{
|
||||
fclose(m_pLogFile);
|
||||
m_pLogFile = NULL;
|
||||
}
|
||||
|
||||
if (m_lpCharacter)
|
||||
{
|
||||
m_lpCharacter->Disconnect("DESC::~DESC");
|
||||
|
@ -184,8 +169,7 @@ void DESC::Destroy()
|
|||
|
||||
if (m_bufevent != nullptr)
|
||||
{
|
||||
sys_log(0, "SYSTEM: closing socket.");
|
||||
Log("SYSTEM: closing socket.");
|
||||
SPDLOG_DEBUG("SYSTEM: closing socket.");
|
||||
|
||||
bufferevent_free(m_bufevent);
|
||||
m_bufevent = nullptr;
|
||||
|
@ -200,7 +184,7 @@ EVENTFUNC(ping_event)
|
|||
|
||||
if ( info == NULL )
|
||||
{
|
||||
sys_err( "ping_event> <Factor> Null pointer" );
|
||||
SPDLOG_ERROR("ping_event> <Factor> Null pointer" );
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -211,7 +195,7 @@ EVENTFUNC(ping_event)
|
|||
|
||||
if (!desc->IsPong())
|
||||
{
|
||||
sys_log(0, "PING_EVENT: no pong %s", desc->GetHostName());
|
||||
SPDLOG_WARN("PING_EVENT: no pong {}", desc->GetHostName());
|
||||
|
||||
desc->SetPhase(PHASE_CLOSE);
|
||||
|
||||
|
@ -244,7 +228,7 @@ bool DESC::Setup(event_base * evbase, evutil_socket_t fd, const sockaddr * c_rSo
|
|||
{
|
||||
m_bufevent = bufferevent_socket_new(evbase, fd, BEV_OPT_CLOSE_ON_FREE);
|
||||
if (m_bufevent == nullptr) {
|
||||
sys_err("DESC::Setup : Could not set up bufferevent!");
|
||||
SPDLOG_ERROR("DESC::Setup : Could not set up bufferevent!");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -270,10 +254,8 @@ bool DESC::Setup(event_base * evbase, evutil_socket_t fd, const sockaddr * c_rSo
|
|||
SetPhase(PHASE_HANDSHAKE);
|
||||
StartHandshake(_handshake);
|
||||
|
||||
sys_log(0, "SYSTEM: new connection from [%s] handshake %u, ptr %p",
|
||||
m_stHost.c_str(), m_dwHandshake, this);
|
||||
SPDLOG_DEBUG("SYSTEM: new connection from [{}] handshake {}, ptr {}", m_stHost, m_dwHandshake, (void*) this);
|
||||
|
||||
Log("SYSTEM: new connection from [%s] handshake %u ptr %p", m_stHost.c_str(), m_dwHandshake, this);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -281,12 +263,12 @@ bool DESC::ProcessInput()
|
|||
{
|
||||
evbuffer *input = bufferevent_get_input(m_bufevent);
|
||||
if (input == nullptr) {
|
||||
sys_err("DESC::ProcessInput : nil input buffer");
|
||||
SPDLOG_ERROR("DESC::ProcessInput : nil input buffer");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!m_pInputProcessor) {
|
||||
sys_err("no input processor");
|
||||
SPDLOG_ERROR("no input processor");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -320,12 +302,12 @@ bool DESC::RawPacket(const void * c_pvData, int iSize)
|
|||
return false;
|
||||
|
||||
if (!m_bufevent) {
|
||||
sys_err("Bufferevent not ready!");
|
||||
SPDLOG_ERROR("Bufferevent not ready!");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (bufferevent_write(m_bufevent, c_pvData, iSize) != 0) {
|
||||
sys_err("Buffer write error!");
|
||||
SPDLOG_ERROR("Buffer write error!");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -373,8 +355,6 @@ void DESC::Packet(const void * c_pvData, int iSize)
|
|||
m_iPhase = PHASE_CLOSE;
|
||||
}
|
||||
}
|
||||
|
||||
//sys_log(0, "%d bytes written (first byte %d)", iSize, *(BYTE *) c_pvData);
|
||||
}
|
||||
|
||||
void DESC::SetPhase(int _phase)
|
||||
|
@ -413,7 +393,7 @@ void DESC::SetPhase(int _phase)
|
|||
|
||||
case PHASE_AUTH:
|
||||
m_pInputProcessor = &m_inputAuth;
|
||||
sys_log(0, "AUTH_PHASE %p", this);
|
||||
SPDLOG_DEBUG("AUTH_PHASE {}", (void*) this);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -425,33 +405,6 @@ void DESC::BindAccountTable(TAccountTable * pAccountTable)
|
|||
DESC_MANAGER::instance().ConnectAccount(m_accountTable.login, this);
|
||||
}
|
||||
|
||||
void DESC::Log(const char * format, ...)
|
||||
{
|
||||
if (!m_pLogFile)
|
||||
return;
|
||||
|
||||
va_list args;
|
||||
|
||||
time_t ct = get_global_time();
|
||||
struct tm tm = *localtime(&ct);
|
||||
|
||||
fprintf(m_pLogFile,
|
||||
"%02d %02d %02d:%02d:%02d | ",
|
||||
tm.tm_mon + 1,
|
||||
tm.tm_mday,
|
||||
tm.tm_hour,
|
||||
tm.tm_min,
|
||||
tm.tm_sec);
|
||||
|
||||
va_start(args, format);
|
||||
vfprintf(m_pLogFile, format, args);
|
||||
va_end(args);
|
||||
|
||||
fputs("\n", m_pLogFile);
|
||||
|
||||
fflush(m_pLogFile);
|
||||
}
|
||||
|
||||
void DESC::StartHandshake(DWORD _handshake)
|
||||
{
|
||||
// Handshake
|
||||
|
@ -483,7 +436,7 @@ bool DESC::HandshakeProcess(DWORD dwTime, LONG lDelta, bool bInfiniteRetry)
|
|||
|
||||
if (lDelta < 0)
|
||||
{
|
||||
sys_err("Desc::HandshakeProcess : value error (lDelta %d, ip %s)", lDelta, m_stHost.c_str());
|
||||
SPDLOG_ERROR("Desc::HandshakeProcess : value error (lDelta {}, ip {})", lDelta, m_stHost.c_str());
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -498,9 +451,9 @@ bool DESC::HandshakeProcess(DWORD dwTime, LONG lDelta, bool bInfiniteRetry)
|
|||
}
|
||||
|
||||
if (GetCharacter())
|
||||
sys_log(0, "Handshake: client_time %u server_time %u name: %s", m_dwClientTime, dwCurTime, GetCharacter()->GetName());
|
||||
SPDLOG_DEBUG("Handshake: client_time {} server_time {} name: {}", m_dwClientTime, dwCurTime, GetCharacter()->GetName());
|
||||
else
|
||||
sys_log(0, "Handshake: client_time %u server_time %u", m_dwClientTime, dwCurTime, lDelta);
|
||||
SPDLOG_DEBUG("Handshake: client_time {} server_time {}", m_dwClientTime, dwCurTime, lDelta);
|
||||
|
||||
m_dwClientTime = dwCurTime;
|
||||
m_bHandshaking = false;
|
||||
|
@ -511,16 +464,16 @@ bool DESC::HandshakeProcess(DWORD dwTime, LONG lDelta, bool bInfiniteRetry)
|
|||
|
||||
if (lNewDelta < 0)
|
||||
{
|
||||
sys_log(0, "Handshake: lower than zero %d", lNewDelta);
|
||||
SPDLOG_DEBUG("Handshake: lower than zero {}", lNewDelta);
|
||||
lNewDelta = (dwCurTime - m_dwHandshakeSentTime) / 2;
|
||||
}
|
||||
|
||||
sys_log(1, "Handshake: ServerTime %u dwTime %u lDelta %d SentTime %u lNewDelta %d", dwCurTime, dwTime, lDelta, m_dwHandshakeSentTime, lNewDelta);
|
||||
SPDLOG_DEBUG("Handshake: ServerTime {} dwTime {} lDelta {} SentTime {} lNewDelta {}", dwCurTime, dwTime, lDelta, m_dwHandshakeSentTime, lNewDelta);
|
||||
|
||||
if (!bInfiniteRetry)
|
||||
if (++m_iHandshakeRetry > HANDSHAKE_RETRY_LIMIT)
|
||||
{
|
||||
sys_err("handshake retry limit reached! (limit %d character %s)",
|
||||
SPDLOG_ERROR("handshake retry limit reached! (limit {} character {})",
|
||||
HANDSHAKE_RETRY_LIMIT, GetCharacter() ? GetCharacter()->GetName() : "!NO CHARACTER!");
|
||||
SetPhase(PHASE_CLOSE);
|
||||
return false;
|
||||
|
@ -556,10 +509,9 @@ void DESC::FlushOutput()
|
|||
return;
|
||||
|
||||
if (bufferevent_flush(m_bufevent, EV_WRITE, BEV_FLUSH) < 0)
|
||||
sys_log(0, "FLUSH FAIL");
|
||||
else
|
||||
sys_log(0, "FLUSH SUCCESS");
|
||||
SPDLOG_ERROR("FLUSH FAIL");
|
||||
|
||||
// TODO: investigate if necessary
|
||||
usleep(250000);
|
||||
}
|
||||
|
||||
|
@ -569,7 +521,7 @@ EVENTFUNC(disconnect_event)
|
|||
|
||||
if ( info == NULL )
|
||||
{
|
||||
sys_err( "disconnect_event> <Factor> Null pointer" );
|
||||
SPDLOG_ERROR("disconnect_event> <Factor> Null pointer" );
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -714,7 +666,7 @@ void DESC::SetLoginKey(DWORD dwKey)
|
|||
void DESC::SetLoginKey(CLoginKey * pkKey)
|
||||
{
|
||||
m_pkLoginKey = pkKey;
|
||||
sys_log(0, "SetLoginKey %u", m_pkLoginKey->m_dwKey);
|
||||
SPDLOG_DEBUG("SetLoginKey {}", m_pkLoginKey->m_dwKey);
|
||||
}
|
||||
|
||||
DWORD DESC::GetLoginKey()
|
||||
|
|
|
@ -109,8 +109,6 @@ class DESC
|
|||
|
||||
bool IsPhase(int phase) const { return m_iPhase == phase ? true : false; }
|
||||
|
||||
void Log(const char * format, ...);
|
||||
|
||||
// 핸드쉐이크 (시간 동기화)
|
||||
void StartHandshake(DWORD _dw);
|
||||
void SendHandshake(DWORD dwCurTime, LONG lNewDelta);
|
||||
|
@ -197,7 +195,6 @@ class DESC
|
|||
LPCHARACTER m_lpCharacter;
|
||||
TAccountTable m_accountTable;
|
||||
|
||||
FILE * m_pLogFile;
|
||||
std::string m_stRelayName;
|
||||
|
||||
WORD m_wP2PPort;
|
||||
|
|
|
@ -33,7 +33,7 @@ void ClientDescEventHandler(bufferevent *bev, short events, void *ptr) {
|
|||
auto * clientDesc = static_cast<LPCLIENT_DESC>(ptr);
|
||||
|
||||
if (events & BEV_EVENT_CONNECTED) {
|
||||
sys_log(0, "SYSTEM: connected to server (ptr %p)", clientDesc);
|
||||
SPDLOG_DEBUG("SYSTEM: connected to server (ptr {})", (void*) clientDesc);
|
||||
clientDesc->OnConnectSuccessful();
|
||||
|
||||
// Now that we're connected, we can set the read/write/event handlers (and therefore stop using this handler)
|
||||
|
@ -43,10 +43,10 @@ void ClientDescEventHandler(bufferevent *bev, short events, void *ptr) {
|
|||
if (events & BEV_EVENT_ERROR) {
|
||||
int err = bufferevent_socket_get_dns_error(bev);
|
||||
if (err)
|
||||
sys_err("SYSTEM: Client connection DNS error: %s", evutil_gai_strerror(err));
|
||||
SPDLOG_ERROR("SYSTEM: Client connection DNS error: {}", evutil_gai_strerror(err));
|
||||
}
|
||||
|
||||
sys_log(0, "SYSTEM: closing client connection (ptr %p)", clientDesc);
|
||||
SPDLOG_DEBUG("SYSTEM: closing client connection (ptr {})", (void*) clientDesc);
|
||||
clientDesc->SetPhase(PHASE_CLOSE);
|
||||
}
|
||||
}
|
||||
|
@ -78,7 +78,7 @@ void CLIENT_DESC::Destroy()
|
|||
DBManager::instance().StopAllBilling();
|
||||
}
|
||||
|
||||
sys_log(0, "SYSTEM: closing client socket.");
|
||||
SPDLOG_DEBUG("SYSTEM: closing client socket.");
|
||||
|
||||
bufferevent_free(m_bufevent);
|
||||
m_bufevent = nullptr;
|
||||
|
@ -105,14 +105,14 @@ bool CLIENT_DESC::Connect(int iPhaseWhenSucceed)
|
|||
if (m_bufevent != nullptr)
|
||||
return false;
|
||||
|
||||
sys_log(0, "SYSTEM: Trying to connect to %s:%d", m_stHost.c_str(), m_wPort);
|
||||
SPDLOG_DEBUG("SYSTEM: Trying to connect to {}:{}", m_stHost.c_str(), m_wPort);
|
||||
|
||||
if (m_evbase == nullptr) {
|
||||
sys_err("SYSTEM: event base not set!");
|
||||
SPDLOG_ERROR("SYSTEM: event base not set!");
|
||||
return false;
|
||||
}
|
||||
if (m_dnsBase == nullptr) {
|
||||
sys_err("SYSTEM: DNS event base not set!");
|
||||
SPDLOG_ERROR("SYSTEM: DNS event base not set!");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -126,7 +126,7 @@ bool CLIENT_DESC::Connect(int iPhaseWhenSucceed)
|
|||
}
|
||||
|
||||
void CLIENT_DESC::OnConnectSuccessful() {
|
||||
sys_log(0, "SYSTEM: connected to server (ptr %p)", this);
|
||||
SPDLOG_DEBUG("SYSTEM: connected to server (ptr {})", (void*) this);
|
||||
SetPhase(m_iPhaseWhenSucceed);
|
||||
}
|
||||
|
||||
|
@ -144,13 +144,13 @@ void CLIENT_DESC::SetPhase(int iPhase)
|
|||
switch (iPhase)
|
||||
{
|
||||
case PHASE_CLIENT_CONNECTING:
|
||||
sys_log(1, "PHASE_CLIENT_DESC::CONNECTING");
|
||||
SPDLOG_DEBUG("PHASE_CLIENT_DESC::CONNECTING");
|
||||
m_pInputProcessor = NULL;
|
||||
break;
|
||||
|
||||
case PHASE_DBCLIENT:
|
||||
{
|
||||
sys_log(1, "PHASE_DBCLIENT");
|
||||
SPDLOG_DEBUG("PHASE_DBCLIENT");
|
||||
|
||||
if (!g_bAuthServer)
|
||||
{
|
||||
|
@ -218,7 +218,7 @@ void CLIENT_DESC::SetPhase(int iPhase)
|
|||
}
|
||||
}
|
||||
|
||||
sys_log(0, "DB_SETUP current user %d size %d", p.dwLoginCount, buf.size());
|
||||
SPDLOG_DEBUG("DB_SETUP current user {} size {}", p.dwLoginCount, buf.size());
|
||||
|
||||
// ÆÄƼ¸¦ ó¸®ÇÒ ¼ö ÀÖ°Ô µÊ.
|
||||
CPartyManager::instance().EnablePCParty();
|
||||
|
@ -236,7 +236,7 @@ void CLIENT_DESC::SetPhase(int iPhase)
|
|||
break;
|
||||
|
||||
case PHASE_P2P:
|
||||
sys_log(1, "PHASE_P2P");
|
||||
SPDLOG_DEBUG("PHASE_P2P");
|
||||
m_pInputProcessor = &m_inputP2P;
|
||||
break;
|
||||
|
||||
|
@ -264,11 +264,11 @@ void CLIENT_DESC::DBPacketHeader(BYTE bHeader, DWORD dwHandle, DWORD dwSize)
|
|||
void CLIENT_DESC::DBPacket(BYTE bHeader, DWORD dwHandle, const void * c_pvData, DWORD dwSize)
|
||||
{
|
||||
if (m_bufevent == nullptr) {
|
||||
sys_log(0, "CLIENT_DESC [%s] trying DBPacket() while not connected",
|
||||
SPDLOG_INFO("CLIENT_DESC [{}] trying DBPacket() while not connected",
|
||||
GetKnownClientDescName(this));
|
||||
return;
|
||||
}
|
||||
sys_log(1, "DB_PACKET: header %d handle %d size %d", bHeader, dwHandle, dwSize);
|
||||
SPDLOG_TRACE("DB_PACKET: header {} handle {} size {}", bHeader, dwHandle, dwSize);
|
||||
DBPacketHeader(bHeader, dwHandle, dwSize);
|
||||
|
||||
if (c_pvData)
|
||||
|
@ -278,7 +278,7 @@ void CLIENT_DESC::DBPacket(BYTE bHeader, DWORD dwHandle, const void * c_pvData,
|
|||
void CLIENT_DESC::Packet(const void * c_pvData, int iSize)
|
||||
{
|
||||
if (m_bufevent == nullptr) {
|
||||
sys_log(0, "CLIENT_DESC [%s] trying Packet() while not connected",
|
||||
SPDLOG_INFO("CLIENT_DESC [{}] trying Packet() while not connected",
|
||||
GetKnownClientDescName(this));
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -10,7 +10,6 @@
|
|||
#include "protocol.h"
|
||||
#include "messenger_manager.h"
|
||||
#include "p2p.h"
|
||||
#include "dev_log.h"
|
||||
#include "ClientPackageCryptInfo.h"
|
||||
|
||||
struct valid_ip
|
||||
|
@ -151,7 +150,7 @@ LPDESC DESC_MANAGER::AcceptDesc(evconnlistener* listener, evutil_socket_t fd, so
|
|||
{
|
||||
if (m_iSocketsConnected >= MAX_ALLOW_USER)
|
||||
{
|
||||
sys_err("max connection reached. MAX_ALLOW_USER = %d", MAX_ALLOW_USER);
|
||||
SPDLOG_ERROR("max connection reached. MAX_ALLOW_USER = {}", MAX_ALLOW_USER);
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
@ -183,7 +182,7 @@ LPDESC DESC_MANAGER::AcceptP2PDesc(evconnlistener* listener, evutil_socket_t fd,
|
|||
|
||||
if (!pkDesc->Setup(base, fd, address))
|
||||
{
|
||||
sys_err("DESC_MANAGER::AcceptP2PDesc : Setup failed");
|
||||
SPDLOG_ERROR("DESC_MANAGER::AcceptP2PDesc : Setup failed");
|
||||
delete pkDesc;
|
||||
return nullptr;
|
||||
}
|
||||
|
@ -191,20 +190,20 @@ LPDESC DESC_MANAGER::AcceptP2PDesc(evconnlistener* listener, evutil_socket_t fd,
|
|||
m_set_pkDesc.insert(pkDesc);
|
||||
++m_iSocketsConnected;
|
||||
|
||||
sys_log(0, "DESC_MANAGER::AcceptP2PDesc %s:%u", GetSocketHost(address).c_str(), GetSocketPort(address));
|
||||
SPDLOG_DEBUG("DESC_MANAGER::AcceptP2PDesc {}:{}", GetSocketHost(address).c_str(), GetSocketPort(address));
|
||||
P2P_MANAGER::instance().RegisterAcceptor(pkDesc);
|
||||
return (pkDesc);
|
||||
}
|
||||
|
||||
void DESC_MANAGER::ConnectAccount(const std::string& login, LPDESC d)
|
||||
{
|
||||
dev_log(LOG_DEB0, "BBBB ConnectAccount(%s)", login.c_str());
|
||||
SPDLOG_TRACE("BBBB ConnectAccount({})", login.c_str());
|
||||
m_map_loginName.insert(DESC_LOGINNAME_MAP::value_type(login,d));
|
||||
}
|
||||
|
||||
void DESC_MANAGER::DisconnectAccount(const std::string& login)
|
||||
{
|
||||
dev_log(LOG_DEB0, "BBBB DisConnectAccount(%s)", login.c_str());
|
||||
SPDLOG_TRACE("BBBB DisConnectAccount({})", login.c_str());
|
||||
m_map_loginName.erase(login);
|
||||
}
|
||||
|
||||
|
@ -402,7 +401,7 @@ void DESC_MANAGER::GetUserCount(int & iTotal, int ** paiEmpireUserCount, int & i
|
|||
int iCount = P2P_MANAGER::instance().GetCount();
|
||||
if (iCount < 0)
|
||||
{
|
||||
sys_err("P2P_MANAGER::instance().GetCount() == -1");
|
||||
SPDLOG_ERROR("P2P_MANAGER::instance().GetCount() == -1");
|
||||
}
|
||||
iTotal = m_iLocalUserCount + iCount;
|
||||
iLocalCount = m_iLocalUserCount;
|
||||
|
|
|
@ -14,7 +14,7 @@ void DESC_P2P::Destroy()
|
|||
|
||||
P2P_MANAGER::instance().UnregisterAcceptor(this);
|
||||
|
||||
sys_log(0, "SYSTEM: closing p2p socket.");
|
||||
SPDLOG_DEBUG("SYSTEM: closing p2p socket.");
|
||||
|
||||
bufferevent_free(m_bufevent);
|
||||
m_bufevent = nullptr;
|
||||
|
@ -27,7 +27,7 @@ bool DESC_P2P::Setup(event_base * evbase, evutil_socket_t fd, const sockaddr * c
|
|||
{
|
||||
m_bufevent = bufferevent_socket_new(evbase, fd, BEV_OPT_CLOSE_ON_FREE);
|
||||
if (m_bufevent == nullptr) {
|
||||
sys_err("DESC::Setup : Could not set up bufferevent!");
|
||||
SPDLOG_ERROR("DESC::Setup : Could not set up bufferevent!");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -42,7 +42,7 @@ bool DESC_P2P::Setup(event_base * evbase, evutil_socket_t fd, const sockaddr * c
|
|||
|
||||
SetPhase(PHASE_P2P);
|
||||
|
||||
sys_log(0, "SYSTEM: new p2p connection from [%s]", m_stHost.c_str());
|
||||
SPDLOG_DEBUG("SYSTEM: new p2p connection from [{}]", m_stHost.c_str());
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -54,7 +54,7 @@ void DESC_P2P::SetPhase(int iPhase)
|
|||
switch (iPhase)
|
||||
{
|
||||
case PHASE_P2P:
|
||||
sys_log(1, "PHASE_P2P");
|
||||
SPDLOG_DEBUG("PHASE_P2P");
|
||||
m_pInputProcessor = &s_inputP2P;
|
||||
break;
|
||||
|
||||
|
@ -63,7 +63,7 @@ void DESC_P2P::SetPhase(int iPhase)
|
|||
break;
|
||||
|
||||
default:
|
||||
sys_err("DESC_P2P::SetPhase : Unknown phase");
|
||||
SPDLOG_ERROR("DESC_P2P::SetPhase : Unknown phase");
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,152 +0,0 @@
|
|||
/*********************************************************************
|
||||
* date : 2006.09.07
|
||||
* file : dev_log.cpp
|
||||
* author : mhh
|
||||
* description :
|
||||
*/
|
||||
|
||||
#define _dev_log_cpp_
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "dev_log.h"
|
||||
|
||||
#ifndef IS_SET
|
||||
# define IS_SET(flag,bit) ((flag) & (bit))
|
||||
#endif // IS_SET
|
||||
|
||||
#ifndef SET_BIT
|
||||
# define SET_BIT(var,bit) ((var) |= (bit))
|
||||
#endif // SET_BIT
|
||||
|
||||
#ifndef REMOVE_BIT
|
||||
# define REMOVE_BIT(var,bit) ((var) &= ~(bit))
|
||||
#endif // REMOVE_BIT
|
||||
|
||||
#ifndef TOGGLE_BIT
|
||||
# define TOGGLE_BIT(var,bit) ((var) = (var) ^ (bit))
|
||||
#endif // TOGGLE_BIT
|
||||
|
||||
extern int test_server;
|
||||
static int s_log_mask = 0xffffffff;
|
||||
|
||||
void dev_log(const char *file, int line, const char *function, int level, const char *fmt, ...)
|
||||
{
|
||||
// 테스트 서버에서만 남기며, 마스크가 꺼져있으면 남기지 않는다.
|
||||
if (!test_server || !IS_SET(s_log_mask, level))
|
||||
return;
|
||||
|
||||
static char buf[1024*1024]; // 1M
|
||||
int fd;
|
||||
char strtime[64+1];
|
||||
const char *strlevel;
|
||||
struct timeval tv;
|
||||
struct tm ltm;
|
||||
int mon, day, hour, min, sec, usec;
|
||||
int nlen;
|
||||
va_list args;
|
||||
|
||||
// ---------------------------------------
|
||||
// open file
|
||||
// ---------------------------------------
|
||||
#ifndef __WIN32__
|
||||
fd = ::open("DEV_LOG.log", O_WRONLY|O_APPEND|O_CREAT, 0666);
|
||||
#else
|
||||
fd = ::_open("DEV_LOG.log", _O_WRONLY|_O_APPEND|_O_CREAT, 0666);
|
||||
#endif
|
||||
|
||||
if (fd < 0)
|
||||
return;
|
||||
|
||||
// ---------------------------------------
|
||||
// set time string
|
||||
// ---------------------------------------
|
||||
gettimeofday (&tv, NULL);
|
||||
|
||||
localtime_r((time_t*) &tv.tv_sec, <m);
|
||||
|
||||
mon = ltm.tm_mon + 1;
|
||||
day = ltm.tm_mday;
|
||||
hour = ltm.tm_hour;
|
||||
min = ltm.tm_min;
|
||||
sec = ltm.tm_sec;
|
||||
usec = tv.tv_usec;
|
||||
|
||||
nlen = snprintf(strtime, sizeof(strtime), "%02d%02d %02d:%02d.%02d.%06d", mon, day, hour, min, sec, usec);
|
||||
|
||||
if (nlen < 0 || nlen >= (int) sizeof(strtime))
|
||||
nlen = sizeof(strtime) - 1;
|
||||
|
||||
strtime[nlen - 2] = '\0';
|
||||
|
||||
// ---------------------------------------
|
||||
// get level string
|
||||
// ---------------------------------------
|
||||
#define GET_LEVEL_STRING(level) case L_##level : strlevel = #level; break
|
||||
switch ( level ) {
|
||||
GET_LEVEL_STRING ( WARN );
|
||||
GET_LEVEL_STRING ( ERR );
|
||||
GET_LEVEL_STRING ( CRIT );
|
||||
GET_LEVEL_STRING ( INFO );
|
||||
|
||||
GET_LEVEL_STRING ( MIN );
|
||||
GET_LEVEL_STRING ( MAX );
|
||||
|
||||
GET_LEVEL_STRING ( LIB0 );
|
||||
GET_LEVEL_STRING ( LIB1 );
|
||||
GET_LEVEL_STRING ( LIB2 );
|
||||
GET_LEVEL_STRING ( LIB3 );
|
||||
|
||||
GET_LEVEL_STRING ( DEB0 );
|
||||
GET_LEVEL_STRING ( DEB1 );
|
||||
GET_LEVEL_STRING ( DEB2 );
|
||||
GET_LEVEL_STRING ( DEB3 );
|
||||
|
||||
GET_LEVEL_STRING ( USR0 );
|
||||
GET_LEVEL_STRING ( USR1 );
|
||||
GET_LEVEL_STRING ( USR2 );
|
||||
GET_LEVEL_STRING ( USR3 );
|
||||
|
||||
default : strlevel = "UNKNOWN"; break;
|
||||
}
|
||||
#undef GET_LEVEL_STRING
|
||||
|
||||
nlen = snprintf(buf, sizeof(buf), "%s %-4s (%-15s,%4d,%-24s) ",
|
||||
strtime, strlevel, file, line, function);
|
||||
|
||||
if (nlen < 0 || nlen >= (int) sizeof(buf))
|
||||
return;
|
||||
|
||||
// ---------------------------------------
|
||||
// write_log
|
||||
// ---------------------------------------
|
||||
va_start(args, fmt);
|
||||
int vlen = vsnprintf(buf + nlen, sizeof(buf) - (nlen + 2), fmt, args);
|
||||
va_end(args);
|
||||
|
||||
if (vlen < 0 || vlen >= (int) sizeof(buf) - (nlen + 2))
|
||||
nlen += (sizeof(buf) - (nlen + 2)) - 1;
|
||||
else
|
||||
nlen += vlen;
|
||||
|
||||
buf[nlen++] = '\n';
|
||||
buf[nlen] = 0;
|
||||
|
||||
::write(fd, buf, nlen);
|
||||
::close(fd);
|
||||
}
|
||||
|
||||
void dev_log_add_level(int level)
|
||||
{
|
||||
SET_BIT(s_log_mask, level);
|
||||
}
|
||||
|
||||
void dev_log_del_level(int level)
|
||||
{
|
||||
REMOVE_BIT(s_log_mask, level);
|
||||
}
|
||||
|
||||
void dev_log_set_level(int mask)
|
||||
{
|
||||
s_log_mask = mask;
|
||||
}
|
||||
|
|
@ -1,79 +0,0 @@
|
|||
/*********************************************************************
|
||||
* date : 2006.09.07
|
||||
* file : dev_log.h
|
||||
* author : mhh
|
||||
* description : 개발자용 로그함수 테스트 서버에서만 기록된다.
|
||||
* example)
|
||||
* dev_log(LOG_DEB0, "My Name is %s", name);
|
||||
*/
|
||||
|
||||
#ifndef _dev_log_h_
|
||||
#define _dev_log_h_
|
||||
|
||||
|
||||
// -----------------------------------------------
|
||||
// define log level
|
||||
// -----------------------------------------------
|
||||
#define L_WARN (1<<1)
|
||||
#define L_ERR (1<<2)
|
||||
#define L_CRIT (1<<3)
|
||||
#define L_INFO (1<<4)
|
||||
|
||||
#define L_MIN (1<<5)
|
||||
#define L_MAX (1<<6)
|
||||
|
||||
#define L_LIB0 (1<<7)
|
||||
#define L_LIB1 (1<<8)
|
||||
#define L_LIB2 (1<<9)
|
||||
#define L_LIB3 (1<<10)
|
||||
|
||||
#define L_DEB0 (1<<11)
|
||||
#define L_DEB1 (1<<12)
|
||||
#define L_DEB2 (1<<13)
|
||||
#define L_DEB3 (1<<14)
|
||||
|
||||
|
||||
#define L_USR0 (1<<15)
|
||||
#define L_USR1 (1<<16)
|
||||
#define L_USR2 (1<<17)
|
||||
#define L_USR3 (1<<18)
|
||||
|
||||
|
||||
// -----------------------------------------------
|
||||
// define log level
|
||||
// -----------------------------------------------
|
||||
#define LOG_WARN __FILE__,__LINE__,__FUNCTION__,L_WARN
|
||||
#define LOG_ERR __FILE__,__LINE__,__FUNCTION__,L_ERR
|
||||
#define LOG_CRIT __FILE__,__LINE__,__FUNCTION__,L_CRIT
|
||||
#define LOG_INFO __FILE__,__LINE__,__FUNCTION__,L_INFO
|
||||
|
||||
#define LOG_MIN __FILE__,__LINE__,__FUNCTION__,L_MIN
|
||||
#define LOG_MAX __FILE__,__LINE__,__FUNCTION__,L_MAX
|
||||
|
||||
#define LOG_LIB0 __FILE__,__LINE__,__FUNCTION__,L_LIB0
|
||||
#define LOG_LIB1 __FILE__,__LINE__,__FUNCTION__,L_LIB1
|
||||
#define LOG_LIB2 __FILE__,__LINE__,__FUNCTION__,L_LIB2
|
||||
#define LOG_LIB3 __FILE__,__LINE__,__FUNCTION__,L_LIB3
|
||||
|
||||
#define LOG_DEB0 __FILE__,__LINE__,__FUNCTION__,L_DEB0
|
||||
#define LOG_DEB1 __FILE__,__LINE__,__FUNCTION__,L_DEB1
|
||||
#define LOG_DEB2 __FILE__,__LINE__,__FUNCTION__,L_DEB2
|
||||
#define LOG_DEB3 __FILE__,__LINE__,__FUNCTION__,L_DEB3
|
||||
|
||||
|
||||
#define LOG_USR0 __FILE__,__LINE__,__FUNCTION__,L_USR0
|
||||
#define LOG_USR1 __FILE__,__LINE__,__FUNCTION__,L_USR1
|
||||
#define LOG_USR2 __FILE__,__LINE__,__FUNCTION__,L_USR2
|
||||
#define LOG_USR3 __FILE__,__LINE__,__FUNCTION__,L_USR3
|
||||
|
||||
|
||||
|
||||
|
||||
void dev_log(const char *file, int line, const char *function, int level, const char *fmt, ...);
|
||||
void dev_log_add_level(int level);
|
||||
void dev_log_del_level(int level);
|
||||
void dev_log_set_level(int mask);
|
||||
|
||||
|
||||
#endif /* _dev_log_h_ */
|
||||
|
|
@ -41,7 +41,7 @@ bool DragonSoulTable::ReadDragonSoulTableFile(const char * c_pszFileName)
|
|||
|
||||
if (false == loader.Load(c_pszFileName))
|
||||
{
|
||||
sys_err ("dragon_soul_table.txt load error");
|
||||
SPDLOG_ERROR("dragon_soul_table.txt load error");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -77,7 +77,7 @@ bool DragonSoulTable::ReadDragonSoulTableFile(const char * c_pszFileName)
|
|||
}
|
||||
else
|
||||
{
|
||||
sys_err ("DragonSoul table Check failed.");
|
||||
SPDLOG_ERROR("DragonSoul table Check failed.");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -92,7 +92,7 @@ bool DragonSoulTable::GetDragonSoulGroupName(BYTE bType, std::string& stGroupNam
|
|||
}
|
||||
else
|
||||
{
|
||||
sys_err ("Invalid DragonSoul Type(%d)", bType);
|
||||
SPDLOG_ERROR("Invalid DragonSoul Type({})", bType);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -106,14 +106,14 @@ bool DragonSoulTable::ReadVnumMapper()
|
|||
|
||||
if (NULL == pGroupNode)
|
||||
{
|
||||
sys_err ("dragon_soul_table.txt need VnumMapper.");
|
||||
SPDLOG_ERROR("dragon_soul_table.txt need VnumMapper.");
|
||||
return false;
|
||||
}
|
||||
{
|
||||
int n = pGroupNode->GetRowCount();
|
||||
if (0 == n)
|
||||
{
|
||||
sys_err ("Group VnumMapper is Empty.");
|
||||
SPDLOG_ERROR("Group VnumMapper is Empty.");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -128,18 +128,18 @@ bool DragonSoulTable::ReadVnumMapper()
|
|||
BYTE bType;
|
||||
if (!pRow->GetValue("dragonsoulname", stDragonSoulName))
|
||||
{
|
||||
sys_err ("In Group VnumMapper, No DragonSoulName column.");
|
||||
SPDLOG_ERROR("In Group VnumMapper, No DragonSoulName column.");
|
||||
return false;
|
||||
}
|
||||
if (!pRow->GetValue("type", bType))
|
||||
{
|
||||
sys_err ("In Group VnumMapper, %s's Vnum is invalid", stDragonSoulName.c_str());
|
||||
SPDLOG_ERROR("In Group VnumMapper, {}'s Vnum is invalid", stDragonSoulName.c_str());
|
||||
return false;
|
||||
}
|
||||
|
||||
if (setTypes.end() != setTypes.find(bType))
|
||||
{
|
||||
sys_err ("In Group VnumMapper, duplicated vnum exist.");
|
||||
SPDLOG_ERROR("In Group VnumMapper, duplicated vnum exist.");
|
||||
return false;
|
||||
}
|
||||
m_map_name_to_type.insert(TMapNameToType::value_type(stDragonSoulName, bType));
|
||||
|
@ -157,7 +157,7 @@ bool DragonSoulTable::ReadBasicApplys()
|
|||
|
||||
if (NULL == pGroupNode)
|
||||
{
|
||||
sys_err ("dragon_soul_table.txt need BasicApplys.");
|
||||
SPDLOG_ERROR("dragon_soul_table.txt need BasicApplys.");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -166,7 +166,7 @@ bool DragonSoulTable::ReadBasicApplys()
|
|||
CGroupNode* pChild;
|
||||
if (NULL == (pChild = pGroupNode->GetChildNode(m_vecDragonSoulNames[i])))
|
||||
{
|
||||
sys_err ("In Group BasicApplys, %s group is not defined.", m_vecDragonSoulNames[i].c_str());
|
||||
SPDLOG_ERROR("In Group BasicApplys, {} group is not defined.", m_vecDragonSoulNames[i].c_str());
|
||||
return false;
|
||||
}
|
||||
TVecApplys vecApplys;
|
||||
|
@ -182,7 +182,7 @@ bool DragonSoulTable::ReadBasicApplys()
|
|||
pChild->GetRow(ss.str(), &pRow);
|
||||
if (NULL == pRow)
|
||||
{
|
||||
sys_err("In Group BasicApplys, No %d row.", j);
|
||||
SPDLOG_ERROR("In Group BasicApplys, No {} row.", j);
|
||||
}
|
||||
EApplyTypes at;
|
||||
int av;
|
||||
|
@ -190,17 +190,17 @@ bool DragonSoulTable::ReadBasicApplys()
|
|||
std::string stTypeName;
|
||||
if (!pRow->GetValue("apply_type", stTypeName))
|
||||
{
|
||||
sys_err ("In Group BasicApplys, %s group's apply_type is empty.", m_vecDragonSoulNames[i].c_str());
|
||||
SPDLOG_ERROR("In Group BasicApplys, {} group's apply_type is empty.", m_vecDragonSoulNames[i].c_str());
|
||||
return false;
|
||||
}
|
||||
if (!(at = (EApplyTypes)FN_get_apply_type(stTypeName.c_str())))
|
||||
{
|
||||
sys_err ("In Group BasicApplys, %s group's apply_type %s is invalid.", m_vecDragonSoulNames[i].c_str(), stTypeName.c_str());
|
||||
SPDLOG_ERROR("In Group BasicApplys, {} group's apply_type {} is invalid.", m_vecDragonSoulNames[i].c_str(), stTypeName.c_str());
|
||||
return false;
|
||||
}
|
||||
if (!pRow->GetValue("apply_value", av))
|
||||
{
|
||||
sys_err ("In Group BasicApplys, %s group's apply_value %s is invalid.", m_vecDragonSoulNames[i].c_str(), av);
|
||||
SPDLOG_ERROR("In Group BasicApplys, {} group's apply_value {} is invalid.", m_vecDragonSoulNames[i].c_str(), av);
|
||||
return false;
|
||||
}
|
||||
vecApplys.push_back(SApply(at, av));
|
||||
|
@ -216,7 +216,7 @@ bool DragonSoulTable::ReadAdditionalApplys()
|
|||
CGroupNode* pGroupNode = m_pLoader->GetGroup("additionalapplys");
|
||||
if (NULL == pGroupNode)
|
||||
{
|
||||
sys_err ("dragon_soul_table.txt need AdditionalApplys.");
|
||||
SPDLOG_ERROR("dragon_soul_table.txt need AdditionalApplys.");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -225,7 +225,7 @@ bool DragonSoulTable::ReadAdditionalApplys()
|
|||
CGroupNode* pChild;
|
||||
if (NULL == (pChild = pGroupNode->GetChildNode(m_vecDragonSoulNames[i])))
|
||||
{
|
||||
sys_err ("In Group AdditionalApplys, %s group is not defined.", m_vecDragonSoulNames[i].c_str());
|
||||
SPDLOG_ERROR("In Group AdditionalApplys, {} group is not defined.", m_vecDragonSoulNames[i].c_str());
|
||||
return false;
|
||||
}
|
||||
TVecApplys vecApplys;
|
||||
|
@ -244,22 +244,22 @@ bool DragonSoulTable::ReadAdditionalApplys()
|
|||
std::string stTypeName;
|
||||
if (!pRow->GetValue("apply_type", stTypeName))
|
||||
{
|
||||
sys_err ("In Group AdditionalApplys, %s group's apply_type is empty.", m_vecDragonSoulNames[i].c_str());
|
||||
SPDLOG_ERROR("In Group AdditionalApplys, {} group's apply_type is empty.", m_vecDragonSoulNames[i].c_str());
|
||||
return false;
|
||||
}
|
||||
if (!(at = (EApplyTypes)FN_get_apply_type(stTypeName.c_str())))
|
||||
{
|
||||
sys_err ("In Group AdditionalApplys, %s group's apply_type %s is invalid.", m_vecDragonSoulNames[i].c_str(), stTypeName.c_str());
|
||||
SPDLOG_ERROR("In Group AdditionalApplys, {} group's apply_type {} is invalid.", m_vecDragonSoulNames[i].c_str(), stTypeName.c_str());
|
||||
return false;
|
||||
}
|
||||
if (!pRow->GetValue("apply_value", av))
|
||||
{
|
||||
sys_err ("In Group AdditionalApplys, %s group's apply_value %s is invalid.", m_vecDragonSoulNames[i].c_str(), av);
|
||||
SPDLOG_ERROR("In Group AdditionalApplys, {} group's apply_value {} is invalid.", m_vecDragonSoulNames[i].c_str(), av);
|
||||
return false;
|
||||
}
|
||||
if (!pRow->GetValue("prob", prob))
|
||||
{
|
||||
sys_err ("In Group AdditionalApplys, %s group's probability %s is invalid.", m_vecDragonSoulNames[i].c_str(), prob);
|
||||
SPDLOG_ERROR("In Group AdditionalApplys, {} group's probability {} is invalid.", m_vecDragonSoulNames[i].c_str(), prob);
|
||||
return false;
|
||||
}
|
||||
vecApplys.push_back(SApply(at, av, prob));
|
||||
|
@ -275,7 +275,7 @@ bool DragonSoulTable::CheckApplyNumSettings ()
|
|||
// Group ApplyNumSettings Reading.
|
||||
if (NULL == m_pApplyNumSettingNode)
|
||||
{
|
||||
sys_err ("dragon_soul_table.txt need ApplyNumSettings.");
|
||||
SPDLOG_ERROR("dragon_soul_table.txt need ApplyNumSettings.");
|
||||
return false;
|
||||
}
|
||||
else
|
||||
|
@ -287,7 +287,7 @@ bool DragonSoulTable::CheckApplyNumSettings ()
|
|||
int basis, add_min, add_max;
|
||||
if (!GetApplyNumSettings(m_vecDragonSoulTypes[i], j, basis, add_min, add_max))
|
||||
{
|
||||
sys_err ("In %s group of ApplyNumSettings, values in Grade(%s) row is invalid.",
|
||||
SPDLOG_ERROR("In {} group of ApplyNumSettings, values in Grade({}) row is invalid.",
|
||||
m_vecDragonSoulNames[i].c_str(), g_astGradeName[j].c_str());
|
||||
return false;
|
||||
}
|
||||
|
@ -303,7 +303,7 @@ bool DragonSoulTable::CheckWeightTables ()
|
|||
// Group WeightTables Reading.
|
||||
if (NULL == m_pWeightTableNode)
|
||||
{
|
||||
sys_err ("dragon_soul_table.txt need WeightTables.");
|
||||
SPDLOG_ERROR("dragon_soul_table.txt need WeightTables.");
|
||||
return false;
|
||||
}
|
||||
else
|
||||
|
@ -319,7 +319,7 @@ bool DragonSoulTable::CheckWeightTables ()
|
|||
float fWeight;
|
||||
if (!GetWeight(m_vecDragonSoulTypes[i], j, k, l, fWeight))
|
||||
{
|
||||
sys_err ("In %s group of WeightTables, value(Grade(%s), Step(%s), Strength(%d) is invalid.",
|
||||
SPDLOG_ERROR("In {} group of WeightTables, value(Grade({}), Step({}), Strength({}) is invalid.",
|
||||
m_vecDragonSoulNames[i].c_str(), g_astGradeName[j].c_str(), g_astStepName[k].c_str(), l);
|
||||
}
|
||||
}
|
||||
|
@ -335,7 +335,7 @@ bool DragonSoulTable::CheckRefineGradeTables()
|
|||
// Group UpgradeTables Reading.
|
||||
if (NULL == m_pRefineGradeTableNode)
|
||||
{
|
||||
sys_err ("dragon_soul_table.txt need RefineGradeTables.");
|
||||
SPDLOG_ERROR("dragon_soul_table.txt need RefineGradeTables.");
|
||||
return false;
|
||||
}
|
||||
else
|
||||
|
@ -348,32 +348,33 @@ bool DragonSoulTable::CheckRefineGradeTables()
|
|||
std::vector <float> vec_probs;
|
||||
if (!GetRefineGradeValues(m_vecDragonSoulTypes[i], j, need_count, fee, vec_probs))
|
||||
{
|
||||
sys_err ("In %s group of RefineGradeTables, values in Grade(%s) row is invalid.",
|
||||
m_vecDragonSoulNames[i].c_str(), g_astGradeName[j].c_str());
|
||||
SPDLOG_ERROR("In {} group of RefineGradeTables, values in Grade({}) row is invalid.",
|
||||
m_vecDragonSoulNames[i], g_astGradeName[j]);
|
||||
return false;
|
||||
}
|
||||
if (need_count < 1)
|
||||
{
|
||||
sys_err ("In %s group of RefineGradeTables, need_count of Grade(%s) is less than 1.",
|
||||
m_vecDragonSoulNames[i].c_str(), g_astGradeName[j].c_str());
|
||||
SPDLOG_ERROR("In {} group of RefineGradeTables, need_count of Grade({}) is less than 1.",
|
||||
m_vecDragonSoulNames[i], g_astGradeName[j]);
|
||||
return false;
|
||||
}
|
||||
if (fee < 0)
|
||||
{
|
||||
sys_err ("In %s group of RefineGradeTables, fee of Grade(%s) is less than 0.",
|
||||
m_vecDragonSoulNames[i].c_str(), g_astGradeName[j].c_str());
|
||||
SPDLOG_ERROR("In {} group of RefineGradeTables, fee of Grade({}) is less than 0.",
|
||||
m_vecDragonSoulNames[i], g_astGradeName[j]);
|
||||
return false;
|
||||
}
|
||||
if (DRAGON_SOUL_GRADE_MAX != vec_probs.size())
|
||||
{
|
||||
sys_err ("In %s group of RefineGradeTables, probability list size is not %d.", DRAGON_SOUL_GRADE_MAX);
|
||||
SPDLOG_ERROR("In {} group of RefineGradeTables, probability list size is not {}.",
|
||||
m_vecDragonSoulNames[i], (int) DRAGON_SOUL_GRADE_MAX);
|
||||
return false;
|
||||
}
|
||||
for (int k = 0; k < vec_probs.size(); k++)
|
||||
{
|
||||
if (vec_probs[k] < 0.f)
|
||||
{
|
||||
sys_err ("In %s group of RefineGradeTables, probability(index : %d) is less than 0.", k);
|
||||
SPDLOG_ERROR("In {} group of RefineGradeTables, probability(index : {}) is less than 0.", k);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -389,7 +390,7 @@ bool DragonSoulTable::CheckRefineStepTables ()
|
|||
// Group ImproveTables Reading.
|
||||
if (NULL == m_pRefineStrengthTableNode)
|
||||
{
|
||||
sys_err ("dragon_soul_table.txt need RefineStepTables.");
|
||||
SPDLOG_ERROR("dragon_soul_table.txt need RefineStepTables.");
|
||||
return false;
|
||||
}
|
||||
else
|
||||
|
@ -402,34 +403,34 @@ bool DragonSoulTable::CheckRefineStepTables ()
|
|||
std::vector <float> vec_probs;
|
||||
if (!GetRefineStepValues(m_vecDragonSoulTypes[i], j, need_count, fee, vec_probs))
|
||||
{
|
||||
sys_err ("In %s group of RefineStepTables, values in Step(%s) row is invalid.",
|
||||
m_vecDragonSoulNames[i].c_str(), g_astStepName[j].c_str());
|
||||
SPDLOG_ERROR("In {} group of RefineStepTables, values in Step({}) row is invalid.",
|
||||
m_vecDragonSoulNames[i], g_astStepName[j]);
|
||||
return false;
|
||||
}
|
||||
if (need_count < 1)
|
||||
{
|
||||
sys_err ("In %s group of RefineStepTables, need_count of Step(%s) is less than 1.",
|
||||
m_vecDragonSoulNames[i].c_str(), g_astStepName[j].c_str());
|
||||
SPDLOG_ERROR("In {} group of RefineStepTables, need_count of Step({}) is less than 1.",
|
||||
m_vecDragonSoulNames[i], g_astStepName[j]);
|
||||
return false;
|
||||
}
|
||||
if (fee < 0)
|
||||
{
|
||||
sys_err ("In %s group of RefineStepTables, fee of Step(%s) is less than 0.",
|
||||
m_vecDragonSoulNames[i].c_str(), g_astStepName[j].c_str());
|
||||
SPDLOG_ERROR("In {} group of RefineStepTables, fee of Step({}) is less than 0.",
|
||||
m_vecDragonSoulNames[i], g_astStepName[j]);
|
||||
return false;
|
||||
}
|
||||
if (DRAGON_SOUL_GRADE_MAX != vec_probs.size())
|
||||
{
|
||||
sys_err ("In %s group of RefineStepTables, probability list size is not %d.",
|
||||
m_vecDragonSoulNames[i].c_str(), DRAGON_SOUL_GRADE_MAX);
|
||||
SPDLOG_ERROR("In {} group of RefineStepTables, probability list size is not {}.",
|
||||
m_vecDragonSoulNames[i], (int) DRAGON_SOUL_GRADE_MAX);
|
||||
return false;
|
||||
}
|
||||
for (int k = 0; k < vec_probs.size(); k++)
|
||||
{
|
||||
if (vec_probs[k] < 0.f)
|
||||
{
|
||||
sys_err ("In %s group of RefineStepTables, probability(index : %d) is less than 0.",
|
||||
m_vecDragonSoulNames[i].c_str(), k);
|
||||
SPDLOG_ERROR("In {} group of RefineStepTables, probability(index : {}) is less than 0.",
|
||||
m_vecDragonSoulNames[i], k);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -447,7 +448,7 @@ bool DragonSoulTable::CheckRefineStrengthTables()
|
|||
// Group RefineTables Reading.
|
||||
if (NULL == pGroupNode)
|
||||
{
|
||||
sys_err ("dragon_soul_table.txt need RefineStrengthTables.");
|
||||
SPDLOG_ERROR("dragon_soul_table.txt need RefineStrengthTables.");
|
||||
return false;
|
||||
}
|
||||
for (int i = 0; i < m_vecDragonSoulTypes.size(); i++)
|
||||
|
@ -460,19 +461,19 @@ bool DragonSoulTable::CheckRefineStrengthTables()
|
|||
{
|
||||
if (!GetRefineStrengthValues(m_vecDragonSoulTypes[i], j, k, fee, prob))
|
||||
{
|
||||
sys_err ("In %s group of RefineStrengthTables, value(Material(%s), Strength(%d)) or fee are invalid.",
|
||||
SPDLOG_ERROR("In {} group of RefineStrengthTables, value(Material({}), Strength({})) or fee are invalid.",
|
||||
m_vecDragonSoulNames[i].c_str(), g_astMaterialName[j].c_str(), k);
|
||||
return false;
|
||||
}
|
||||
if (fee < 0)
|
||||
{
|
||||
sys_err ("In %s group of RefineStrengthTables, fee of Material(%s) is less than 0.",
|
||||
SPDLOG_ERROR("In {} group of RefineStrengthTables, fee of Material({}) is less than 0.",
|
||||
m_vecDragonSoulNames[i].c_str(), g_astMaterialName[j].c_str());
|
||||
return false;
|
||||
}
|
||||
if (prob < 0.f)
|
||||
{
|
||||
sys_err ("In %s group of RefineStrengthTables, probability(Material(%s), Strength(%d)) is less than 0.",
|
||||
SPDLOG_ERROR("In {} group of RefineStrengthTables, probability(Material({}), Strength({})) is less than 0.",
|
||||
m_vecDragonSoulNames[i].c_str(), g_astMaterialName[j].c_str(), k);
|
||||
return false;
|
||||
}
|
||||
|
@ -488,7 +489,7 @@ bool DragonSoulTable::CheckDragonHeartExtTables()
|
|||
// Group DragonHeartExtTables Reading.
|
||||
if (NULL == m_pDragonHeartExtTableNode)
|
||||
{
|
||||
sys_err ("dragon_soul_table.txt need DragonHeartExtTables.");
|
||||
SPDLOG_ERROR("dragon_soul_table.txt need DragonHeartExtTables.");
|
||||
return false;
|
||||
}
|
||||
for (int i = 0; i < m_vecDragonSoulTypes.size(); i++)
|
||||
|
@ -500,13 +501,13 @@ bool DragonSoulTable::CheckDragonHeartExtTables()
|
|||
|
||||
if (!GetDragonHeartExtValues(m_vecDragonSoulTypes[i], j, vec_chargings, vec_probs))
|
||||
{
|
||||
sys_err ("In %s group of DragonHeartExtTables, CHARGING row or Grade(%s) row are invalid.",
|
||||
SPDLOG_ERROR("In {} group of DragonHeartExtTables, CHARGING row or Grade({}) row are invalid.",
|
||||
m_vecDragonSoulNames[i].c_str(), g_astGradeName[j].c_str());
|
||||
return false;
|
||||
}
|
||||
if (vec_chargings.size() != vec_probs.size())
|
||||
{
|
||||
sys_err ("In %s group of DragonHeartExtTables, CHARGING row size(%d) are not equal Grade(%s) row size(%d).",
|
||||
SPDLOG_ERROR("In {} group of DragonHeartExtTables, CHARGING row size({}) are not equal Grade({}) row size({}).",
|
||||
m_vecDragonSoulNames[i].c_str(), vec_chargings.size(), vec_probs.size());
|
||||
return false;
|
||||
}
|
||||
|
@ -514,7 +515,7 @@ bool DragonSoulTable::CheckDragonHeartExtTables()
|
|||
{
|
||||
if (vec_chargings[k] < 0.f)
|
||||
{
|
||||
sys_err ("In %s group of DragonHeartExtTables, CHARGING value(index : %d) is less than 0",
|
||||
SPDLOG_ERROR("In {} group of DragonHeartExtTables, CHARGING value(index : {}) is less than 0",
|
||||
m_vecDragonSoulNames[i].c_str(), k);
|
||||
return false;
|
||||
}
|
||||
|
@ -523,7 +524,7 @@ bool DragonSoulTable::CheckDragonHeartExtTables()
|
|||
{
|
||||
if (vec_probs[k] < 0.f)
|
||||
{
|
||||
sys_err ("In %s group of DragonHeartExtTables, Probability(Grade : %s, index : %d) is less than 0",
|
||||
SPDLOG_ERROR("In {} group of DragonHeartExtTables, Probability(Grade : {}, index : {}) is less than 0",
|
||||
m_vecDragonSoulNames[i].c_str(), g_astGradeName[j].c_str(), k);
|
||||
return false;
|
||||
}
|
||||
|
@ -539,7 +540,7 @@ bool DragonSoulTable::CheckDragonSoulExtTables()
|
|||
// Group DragonSoulExtTables Reading.
|
||||
if (NULL == m_pDragonSoulExtTableNode)
|
||||
{
|
||||
sys_err ("dragon_soul_table.txt need DragonSoulExtTables.");
|
||||
SPDLOG_ERROR("dragon_soul_table.txt need DragonSoulExtTables.");
|
||||
return false;
|
||||
}
|
||||
for (int i = 0; i < m_vecDragonSoulTypes.size(); i++)
|
||||
|
@ -550,19 +551,19 @@ bool DragonSoulTable::CheckDragonSoulExtTables()
|
|||
DWORD by_product;
|
||||
if (!GetDragonSoulExtValues(m_vecDragonSoulTypes[i], j, prob, by_product))
|
||||
{
|
||||
sys_err ("In %s group of DragonSoulExtTables, Grade(%s) row is invalid.",
|
||||
SPDLOG_ERROR("In {} group of DragonSoulExtTables, Grade({}) row is invalid.",
|
||||
m_vecDragonSoulNames[i].c_str(), g_astGradeName[j].c_str());
|
||||
return false;
|
||||
}
|
||||
if (prob < 0.f)
|
||||
{
|
||||
sys_err ("In %s group of DragonSoulExtTables, Probability(Grade : %s) is less than 0",
|
||||
SPDLOG_ERROR("In {} group of DragonSoulExtTables, Probability(Grade : {}) is less than 0",
|
||||
m_vecDragonSoulNames[i].c_str(), g_astGradeName[j].c_str());
|
||||
return false;
|
||||
}
|
||||
if (0 != by_product && NULL == ITEM_MANAGER::instance().GetTable(by_product))
|
||||
{
|
||||
sys_err ("In %s group of DragonSoulExtTables, ByProduct(%d) of Grade %s is not exist.",
|
||||
SPDLOG_ERROR("In {} group of DragonSoulExtTables, ByProduct({}) of Grade {} is not exist.",
|
||||
m_vecDragonSoulNames[i].c_str(), by_product, g_astGradeName[j].c_str());
|
||||
return false;
|
||||
}
|
||||
|
@ -597,7 +598,7 @@ bool DragonSoulTable::GetApplyNumSettings(BYTE ds_type, BYTE grade_idx, OUT int&
|
|||
{
|
||||
if (grade_idx >= DRAGON_SOUL_GRADE_MAX)
|
||||
{
|
||||
sys_err ("Invalid dragon soul grade_idx(%d).", grade_idx);
|
||||
SPDLOG_ERROR("Invalid dragon soul grade_idx({}).", grade_idx);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -605,25 +606,25 @@ bool DragonSoulTable::GetApplyNumSettings(BYTE ds_type, BYTE grade_idx, OUT int&
|
|||
std::string stDragonSoulName;
|
||||
if (!GetDragonSoulGroupName(ds_type, stDragonSoulName))
|
||||
{
|
||||
sys_err ("Invalid dragon soul type(%d).", ds_type);
|
||||
SPDLOG_ERROR("Invalid dragon soul type({}).", ds_type);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!m_pApplyNumSettingNode->GetGroupValue(stDragonSoulName, "basis", g_astGradeName[grade_idx], basis))
|
||||
{
|
||||
sys_err ("Invalid basis value. DragonSoulGroup(%s) Grade(%s)", stDragonSoulName.c_str(), g_astGradeName[grade_idx].c_str());
|
||||
SPDLOG_ERROR("Invalid basis value. DragonSoulGroup({}) Grade({})", stDragonSoulName.c_str(), g_astGradeName[grade_idx].c_str());
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!m_pApplyNumSettingNode->GetGroupValue(stDragonSoulName, "add_min", g_astGradeName[grade_idx], add_min))
|
||||
{
|
||||
sys_err ("Invalid add_min value. DragonSoulGroup(%s) Grade(%s)", stDragonSoulName.c_str(), g_astGradeName[grade_idx].c_str());
|
||||
SPDLOG_ERROR("Invalid add_min value. DragonSoulGroup({}) Grade({})", stDragonSoulName.c_str(), g_astGradeName[grade_idx].c_str());
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!m_pApplyNumSettingNode->GetGroupValue(stDragonSoulName, "add_max", g_astGradeName[grade_idx], add_max))
|
||||
{
|
||||
sys_err ("Invalid add_max value. DragonSoulGroup(%s) Grade(%s)", stDragonSoulName.c_str(), g_astGradeName[grade_idx].c_str());
|
||||
SPDLOG_ERROR("Invalid add_max value. DragonSoulGroup({}) Grade({})", stDragonSoulName.c_str(), g_astGradeName[grade_idx].c_str());
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -634,7 +635,7 @@ bool DragonSoulTable::GetWeight(BYTE ds_type, BYTE grade_idx, BYTE step_index, B
|
|||
{
|
||||
if (grade_idx >= DRAGON_SOUL_GRADE_MAX || step_index >= DRAGON_SOUL_STEP_MAX || strength_idx >= DRAGON_SOUL_STRENGTH_MAX)
|
||||
{
|
||||
sys_err ("Invalid dragon soul grade_idx(%d) step_index(%d) strength_idx(%d).", grade_idx, step_index, strength_idx);
|
||||
SPDLOG_ERROR("Invalid dragon soul grade_idx({}) step_index({}) strength_idx({}).", grade_idx, step_index, strength_idx);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -642,7 +643,7 @@ bool DragonSoulTable::GetWeight(BYTE ds_type, BYTE grade_idx, BYTE step_index, B
|
|||
std::string stDragonSoulName;
|
||||
if (!GetDragonSoulGroupName(ds_type, stDragonSoulName))
|
||||
{
|
||||
sys_err ("Invalid dragon soul type(%d).", ds_type);
|
||||
SPDLOG_ERROR("Invalid dragon soul type({}).", ds_type);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -660,13 +661,13 @@ bool DragonSoulTable::GetWeight(BYTE ds_type, BYTE grade_idx, BYTE step_index, B
|
|||
{
|
||||
if (!pDragonSoulGroup->GetGroupValue(g_astGradeName[grade_idx], g_astStepName[step_index], strength_idx, fWeight))
|
||||
{
|
||||
sys_err ("Invalid float. DragonSoulGroup(%s) Grade(%s) Row(%s) Col(%d))", stDragonSoulName.c_str(), g_astGradeName[grade_idx].c_str(), g_astStepName[step_index].c_str(), strength_idx);
|
||||
SPDLOG_ERROR("Invalid float. DragonSoulGroup({}) Grade({}) Row({}) Col({}))", stDragonSoulName.c_str(), g_astGradeName[grade_idx].c_str(), g_astStepName[step_index].c_str(), strength_idx);
|
||||
return false;
|
||||
}
|
||||
else
|
||||
return true;
|
||||
}
|
||||
sys_err ("Invalid value. DragonSoulGroup(%s) Grade(%s) Row(%s) Col(%d))", stDragonSoulName.c_str(), g_astGradeName[grade_idx].c_str(), g_astStepName[step_index].c_str(), strength_idx);
|
||||
SPDLOG_ERROR("Invalid value. DragonSoulGroup({}) Grade({}) Row({}) Col({}))", stDragonSoulName.c_str(), g_astGradeName[grade_idx].c_str(), g_astStepName[step_index].c_str(), strength_idx);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -674,7 +675,7 @@ bool DragonSoulTable::GetRefineGradeValues(BYTE ds_type, BYTE grade_idx, OUT int
|
|||
{
|
||||
if (grade_idx >= DRAGON_SOUL_GRADE_MAX -1)
|
||||
{
|
||||
sys_err ("Invalid dragon soul grade_idx(%d).", grade_idx);
|
||||
SPDLOG_ERROR("Invalid dragon soul grade_idx({}).", grade_idx);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -682,26 +683,26 @@ bool DragonSoulTable::GetRefineGradeValues(BYTE ds_type, BYTE grade_idx, OUT int
|
|||
std::string stDragonSoulName;
|
||||
if (!GetDragonSoulGroupName(ds_type, stDragonSoulName))
|
||||
{
|
||||
sys_err ("Invalid dragon soul type(%d).", ds_type);
|
||||
SPDLOG_ERROR("Invalid dragon soul type({}).", ds_type);
|
||||
return false;
|
||||
}
|
||||
|
||||
const CGroupNode::CGroupNodeRow * pRow;
|
||||
if (!m_pRefineGradeTableNode->GetGroupRow(stDragonSoulName, g_astGradeName[grade_idx], &pRow))
|
||||
{
|
||||
sys_err ("Invalid row. DragonSoulGroup(%s) Grade(%s)", stDragonSoulName.c_str(), g_astGradeName[grade_idx].c_str());
|
||||
SPDLOG_ERROR("Invalid row. DragonSoulGroup({}) Grade({})", stDragonSoulName.c_str(), g_astGradeName[grade_idx].c_str());
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!pRow->GetValue("need_count", need_count))
|
||||
{
|
||||
sys_err ("Invalid value. DragonSoulGroup(%s) Grade(%s) Col(need_count)", stDragonSoulName.c_str(), g_astGradeName[grade_idx].c_str());
|
||||
SPDLOG_ERROR("Invalid value. DragonSoulGroup({}) Grade({}) Col(need_count)", stDragonSoulName.c_str(), g_astGradeName[grade_idx].c_str());
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!pRow->GetValue("fee", fee))
|
||||
{
|
||||
sys_err ("Invalid value. DragonSoulGroup(%s) Grade(%s) Col(fee)", stDragonSoulName.c_str(), g_astGradeName[grade_idx].c_str());
|
||||
SPDLOG_ERROR("Invalid value. DragonSoulGroup({}) Grade({}) Col(fee)", stDragonSoulName.c_str(), g_astGradeName[grade_idx].c_str());
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -710,7 +711,7 @@ bool DragonSoulTable::GetRefineGradeValues(BYTE ds_type, BYTE grade_idx, OUT int
|
|||
{
|
||||
if (!pRow->GetValue(g_astGradeName[i], vec_probs[i]))
|
||||
{
|
||||
sys_err ("Invalid value. DragonSoulGroup(%s) Grade(%s) Col(%s)", stDragonSoulName.c_str(), g_astGradeName[grade_idx].c_str(), g_astGradeName[i].c_str());
|
||||
SPDLOG_ERROR("Invalid value. DragonSoulGroup({}) Grade({}) Col({})", stDragonSoulName.c_str(), g_astGradeName[grade_idx].c_str(), g_astGradeName[i].c_str());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -722,7 +723,7 @@ bool DragonSoulTable::GetRefineStepValues(BYTE ds_type, BYTE step_idx, OUT int&
|
|||
{
|
||||
if (step_idx >= DRAGON_SOUL_STEP_MAX - 1)
|
||||
{
|
||||
sys_err ("Invalid dragon soul step_idx(%d).", step_idx);
|
||||
SPDLOG_ERROR("Invalid dragon soul step_idx({}).", step_idx);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -730,26 +731,26 @@ bool DragonSoulTable::GetRefineStepValues(BYTE ds_type, BYTE step_idx, OUT int&
|
|||
std::string stDragonSoulName;
|
||||
if (!GetDragonSoulGroupName(ds_type, stDragonSoulName))
|
||||
{
|
||||
sys_err ("Invalid dragon soul type(%d).", ds_type);
|
||||
SPDLOG_ERROR("Invalid dragon soul type({}).", ds_type);
|
||||
return false;
|
||||
}
|
||||
|
||||
const CGroupNode::CGroupNodeRow * pRow;
|
||||
if (!m_pRefineStepTableNode->GetGroupRow(stDragonSoulName, g_astStepName[step_idx], &pRow))
|
||||
{
|
||||
sys_err ("Invalid row. DragonSoulGroup(%s) Step(%s)", stDragonSoulName.c_str(), g_astStepName[step_idx].c_str());
|
||||
SPDLOG_ERROR("Invalid row. DragonSoulGroup({}) Step({})", stDragonSoulName.c_str(), g_astStepName[step_idx].c_str());
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!pRow->GetValue("need_count", need_count))
|
||||
{
|
||||
sys_err ("Invalid value. DragonSoulGroup(%s) Step(%s) Col(need_count)", stDragonSoulName.c_str(), g_astStepName[step_idx].c_str());
|
||||
SPDLOG_ERROR("Invalid value. DragonSoulGroup({}) Step({}) Col(need_count)", stDragonSoulName.c_str(), g_astStepName[step_idx].c_str());
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!pRow->GetValue("fee", fee))
|
||||
{
|
||||
sys_err ("Invalid value. DragonSoulGroup(%s) Step(%s) Col(fee)", stDragonSoulName.c_str(), g_astStepName[step_idx].c_str());
|
||||
SPDLOG_ERROR("Invalid value. DragonSoulGroup({}) Step({}) Col(fee)", stDragonSoulName.c_str(), g_astStepName[step_idx].c_str());
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -758,7 +759,7 @@ bool DragonSoulTable::GetRefineStepValues(BYTE ds_type, BYTE step_idx, OUT int&
|
|||
{
|
||||
if (!pRow->GetValue(g_astStepName[i], vec_probs[i]))
|
||||
{
|
||||
sys_err ("Invalid value. DragonSoulGroup(%s) Step(%s) Col(%s)", stDragonSoulName.c_str(), g_astStepName[step_idx].c_str(), g_astStepName[i].c_str());
|
||||
SPDLOG_ERROR("Invalid value. DragonSoulGroup({}) Step({}) Col({})", stDragonSoulName.c_str(), g_astStepName[step_idx].c_str(), g_astStepName[i].c_str());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -770,7 +771,7 @@ bool DragonSoulTable::GetRefineStrengthValues(BYTE ds_type, BYTE material_type,
|
|||
{
|
||||
if (material_type < MATERIAL_DS_REFINE_NORMAL || material_type > MATERIAL_DS_REFINE_HOLLY)
|
||||
{
|
||||
sys_err ("Invalid dragon soul material_type(%d).", material_type);
|
||||
SPDLOG_ERROR("Invalid dragon soul material_type({}).", material_type);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -778,13 +779,13 @@ bool DragonSoulTable::GetRefineStrengthValues(BYTE ds_type, BYTE material_type,
|
|||
std::string stDragonSoulName;
|
||||
if (!GetDragonSoulGroupName(ds_type, stDragonSoulName))
|
||||
{
|
||||
sys_err ("Invalid dragon soul type(%d).", ds_type);
|
||||
SPDLOG_ERROR("Invalid dragon soul type({}).", ds_type);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!m_pRefineStrengthTableNode->GetGroupValue(stDragonSoulName, g_astMaterialName[material_type], "fee", fee))
|
||||
{
|
||||
sys_err ("Invalid fee. DragonSoulGroup(%s) Material(%s)",
|
||||
SPDLOG_ERROR("Invalid fee. DragonSoulGroup({}) Material({})",
|
||||
stDragonSoulName.c_str(), g_astMaterialName[material_type].c_str());
|
||||
return false;
|
||||
}
|
||||
|
@ -792,7 +793,7 @@ bool DragonSoulTable::GetRefineStrengthValues(BYTE ds_type, BYTE material_type,
|
|||
|
||||
if (!m_pRefineStrengthTableNode->GetGroupValue(stDragonSoulName, g_astMaterialName[material_type], stStrengthIdx, prob))
|
||||
{
|
||||
sys_err ("Invalid prob. DragonSoulGroup(%s) Material(%s) Strength(%d)",
|
||||
SPDLOG_ERROR("Invalid prob. DragonSoulGroup({}) Material({}) Strength({})",
|
||||
stDragonSoulName.c_str(), g_astMaterialName[material_type].c_str(), strength_idx);
|
||||
return false;
|
||||
}
|
||||
|
@ -804,21 +805,21 @@ bool DragonSoulTable::GetDragonHeartExtValues(BYTE ds_type, BYTE grade_idx, OUT
|
|||
{
|
||||
if (grade_idx >= DRAGON_SOUL_GRADE_MAX)
|
||||
{
|
||||
sys_err ("Invalid dragon soul grade_idx(%d).", grade_idx);
|
||||
SPDLOG_ERROR("Invalid dragon soul grade_idx({}).", grade_idx);
|
||||
return false;
|
||||
}
|
||||
|
||||
std::string stDragonSoulName;
|
||||
if (!GetDragonSoulGroupName(ds_type, stDragonSoulName))
|
||||
{
|
||||
sys_err ("Invalid dragon soul type(%d).", ds_type);
|
||||
SPDLOG_ERROR("Invalid dragon soul type({}).", ds_type);
|
||||
return false;
|
||||
}
|
||||
|
||||
const CGroupNode::CGroupNodeRow * pRow;
|
||||
if (!m_pDragonHeartExtTableNode->GetGroupRow(stDragonSoulName, "charging", &pRow))
|
||||
{
|
||||
sys_err ("Invalid CHARGING row. DragonSoulGroup(%s)", stDragonSoulName.c_str());
|
||||
SPDLOG_ERROR("Invalid CHARGING row. DragonSoulGroup({})", stDragonSoulName.c_str());
|
||||
return false;
|
||||
}
|
||||
int n = pRow->GetSize();
|
||||
|
@ -827,21 +828,21 @@ bool DragonSoulTable::GetDragonHeartExtValues(BYTE ds_type, BYTE grade_idx, OUT
|
|||
{
|
||||
if (!pRow->GetValue(i, vec_chargings[i]))
|
||||
{
|
||||
sys_err ("Invalid CHARGING value. DragonSoulGroup(%s), Col(%d)", stDragonSoulName.c_str(), i);
|
||||
SPDLOG_ERROR("Invalid CHARGING value. DragonSoulGroup({}), Col({})", stDragonSoulName.c_str(), i);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (!m_pDragonHeartExtTableNode->GetGroupRow(stDragonSoulName, g_astGradeName[grade_idx], &pRow))
|
||||
{
|
||||
sys_err ("Invalid row. DragonSoulGroup(%s) Grade(%s)", stDragonSoulName.c_str(), g_astGradeName[grade_idx].c_str());
|
||||
SPDLOG_ERROR("Invalid row. DragonSoulGroup({}) Grade({})", stDragonSoulName.c_str(), g_astGradeName[grade_idx].c_str());
|
||||
return false;
|
||||
}
|
||||
|
||||
int m = pRow->GetSize();
|
||||
if (n != m)
|
||||
{
|
||||
sys_err ("Invalid row size(%d). It must be same CHARGING row size(%d). DragonSoulGroup(%s) Grade(%s)", m, n,
|
||||
SPDLOG_ERROR("Invalid row size({}). It must be same CHARGING row size({}). DragonSoulGroup({}) Grade({})", m, n,
|
||||
stDragonSoulName.c_str(), g_astGradeName[grade_idx].c_str());
|
||||
return false;
|
||||
}
|
||||
|
@ -850,7 +851,7 @@ bool DragonSoulTable::GetDragonHeartExtValues(BYTE ds_type, BYTE grade_idx, OUT
|
|||
{
|
||||
if (!pRow->GetValue(i, vec_probs[i]))
|
||||
{
|
||||
sys_err ("Invalid value. DragonSoulGroup(%s), Grade(%s) Col(%d)", stDragonSoulName.c_str(), g_astGradeName[grade_idx].c_str(), i);
|
||||
SPDLOG_ERROR("Invalid value. DragonSoulGroup({}), Grade({}) Col({})", stDragonSoulName.c_str(), g_astGradeName[grade_idx].c_str(), i);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -862,7 +863,7 @@ bool DragonSoulTable::GetDragonSoulExtValues(BYTE ds_type, BYTE grade_idx, OUT f
|
|||
{
|
||||
if (grade_idx >= DRAGON_SOUL_GRADE_MAX)
|
||||
{
|
||||
sys_err ("Invalid dragon soul grade_idx(%d).", grade_idx);
|
||||
SPDLOG_ERROR("Invalid dragon soul grade_idx({}).", grade_idx);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -870,20 +871,20 @@ bool DragonSoulTable::GetDragonSoulExtValues(BYTE ds_type, BYTE grade_idx, OUT f
|
|||
std::string stDragonSoulName;
|
||||
if (!GetDragonSoulGroupName(ds_type, stDragonSoulName))
|
||||
{
|
||||
sys_err ("Invalid dragon soul type(%d).", ds_type);
|
||||
SPDLOG_ERROR("Invalid dragon soul type({}).", ds_type);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!m_pDragonSoulExtTableNode->GetGroupValue(stDragonSoulName, g_astGradeName[grade_idx], "prob", prob))
|
||||
{
|
||||
sys_err ("Invalid Prob. DragonSoulGroup(%s) Grade(%s)",
|
||||
SPDLOG_ERROR("Invalid Prob. DragonSoulGroup({}) Grade({})",
|
||||
stDragonSoulName.c_str(), g_astGradeName[grade_idx].c_str(), g_astGradeName[grade_idx].c_str());
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!m_pDragonSoulExtTableNode->GetGroupValue(stDragonSoulName, g_astGradeName[grade_idx], "byproduct", by_product))
|
||||
{
|
||||
sys_err ("Invalid fee. DragonSoulGroup(%s) Grade(%d)",
|
||||
SPDLOG_ERROR("Invalid fee. DragonSoulGroup({}) Grade({})",
|
||||
stDragonSoulName.c_str(), g_astGradeName[grade_idx].c_str(), grade_idx);
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -21,7 +21,6 @@ CDungeon::CDungeon(IdType id, int lOriginalMapIndex, int lMapIndex)
|
|||
m_map_Area(SECTREE_MANAGER::instance().GetDungeonArea(lOriginalMapIndex))
|
||||
{
|
||||
Initialize();
|
||||
//sys_log(0,"DUNGEON create orig %d real %d", lOriginalMapIndex, lMapIndex);
|
||||
}
|
||||
|
||||
CDungeon::~CDungeon()
|
||||
|
@ -30,7 +29,6 @@ CDungeon::~CDungeon()
|
|||
{
|
||||
m_pParty->SetDungeon_for_Only_party (NULL);
|
||||
}
|
||||
//sys_log(0,"DUNGEON destroy orig %d real %d", m_lOrigMapIndex, m_lMapIndex );
|
||||
ClearRegen();
|
||||
event_cancel(&deadEvent);
|
||||
// <Factor>
|
||||
|
@ -109,7 +107,7 @@ void CDungeon::SendDestPositionToParty(LPPARTY pParty, int x, int y)
|
|||
{
|
||||
if (m_map_pkParty.find(pParty) == m_map_pkParty.end())
|
||||
{
|
||||
sys_err("PARTY %u not in DUNGEON %d", pParty->GetLeaderPID(), m_lMapIndex);
|
||||
SPDLOG_ERROR("PARTY {} not in DUNGEON {}", pParty->GetLeaderPID(), m_lMapIndex);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -143,7 +141,7 @@ struct FWarpToDungeon
|
|||
void CDungeon::Join(LPCHARACTER ch)
|
||||
{
|
||||
if (SECTREE_MANAGER::instance().GetMap(m_lMapIndex) == NULL) {
|
||||
sys_err("CDungeon: SECTREE_MAP not found for #%ld", m_lMapIndex);
|
||||
SPDLOG_ERROR("CDungeon: SECTREE_MAP not found for #{}", m_lMapIndex);
|
||||
return;
|
||||
}
|
||||
FWarpToDungeon(m_lMapIndex, this) (ch);
|
||||
|
@ -155,18 +153,16 @@ void CDungeon::JoinParty(LPPARTY pParty)
|
|||
m_map_pkParty.insert(std::make_pair(pParty,0));
|
||||
|
||||
if (SECTREE_MANAGER::instance().GetMap(m_lMapIndex) == NULL) {
|
||||
sys_err("CDungeon: SECTREE_MAP not found for #%ld", m_lMapIndex);
|
||||
SPDLOG_ERROR("CDungeon: SECTREE_MAP not found for #{}", m_lMapIndex);
|
||||
return;
|
||||
}
|
||||
FWarpToDungeon f(m_lMapIndex, this);
|
||||
pParty->ForEachOnlineMember(f);
|
||||
//sys_log(0, "DUNGEON-PARTY join %p %p", this, pParty);
|
||||
}
|
||||
|
||||
void CDungeon::QuitParty(LPPARTY pParty)
|
||||
{
|
||||
pParty->SetDungeon(NULL);
|
||||
//sys_log(0, "DUNGEON-PARTY quit %p %p", this, pParty);
|
||||
TPartyMap::iterator it = m_map_pkParty.find(pParty);
|
||||
|
||||
if (it != m_map_pkParty.end())
|
||||
|
@ -189,7 +185,7 @@ EVENTFUNC(dungeon_dead_event)
|
|||
|
||||
if ( info == NULL )
|
||||
{
|
||||
sys_err( "dungeon_dead_event> <Factor> Null pointer" );
|
||||
SPDLOG_ERROR("dungeon_dead_event> <Factor> Null pointer" );
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -234,7 +230,6 @@ void CDungeon::DecMember(LPCHARACTER ch)
|
|||
|
||||
void CDungeon::IncPartyMember(LPPARTY pParty, LPCHARACTER ch)
|
||||
{
|
||||
//sys_log(0, "DUNGEON-PARTY inc %p %p", this, pParty);
|
||||
TPartyMap::iterator it = m_map_pkParty.find(pParty);
|
||||
|
||||
if (it != m_map_pkParty.end())
|
||||
|
@ -247,11 +242,10 @@ void CDungeon::IncPartyMember(LPPARTY pParty, LPCHARACTER ch)
|
|||
|
||||
void CDungeon::DecPartyMember(LPPARTY pParty, LPCHARACTER ch)
|
||||
{
|
||||
//sys_log(0, "DUNGEON-PARTY dec %p %p", this, pParty);
|
||||
TPartyMap::iterator it = m_map_pkParty.find(pParty);
|
||||
|
||||
if (it == m_map_pkParty.end())
|
||||
sys_err("cannot find party");
|
||||
SPDLOG_ERROR("cannot find party");
|
||||
else
|
||||
{
|
||||
it->second--;
|
||||
|
@ -324,7 +318,7 @@ void CDungeon::JumpAll(int lFromMapIndex, int x, int y)
|
|||
|
||||
if (!pMap)
|
||||
{
|
||||
sys_err("cannot find map by index %d", lFromMapIndex);
|
||||
SPDLOG_ERROR("cannot find map by index {}", lFromMapIndex);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -343,7 +337,7 @@ void CDungeon::WarpAll(int lFromMapIndex, int x, int y)
|
|||
|
||||
if (!pMap)
|
||||
{
|
||||
sys_err("cannot find map by index %d", lFromMapIndex);
|
||||
SPDLOG_ERROR("cannot find map by index {}", lFromMapIndex);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -362,7 +356,7 @@ void CDungeon::JumpParty(LPPARTY pParty, int lFromMapIndex, int x, int y)
|
|||
|
||||
if (!pMap)
|
||||
{
|
||||
sys_err("cannot find map by index %d", lFromMapIndex);
|
||||
SPDLOG_ERROR("cannot find map by index {}", lFromMapIndex);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -374,7 +368,7 @@ void CDungeon::JumpParty(LPPARTY pParty, int lFromMapIndex, int x, int y)
|
|||
}
|
||||
else if (m_pParty != pParty)
|
||||
{
|
||||
sys_err ("Dungeon already has party. Another party cannot jump in dungeon : index %d", GetMapIndex());
|
||||
SPDLOG_ERROR("Dungeon already has party. Another party cannot jump in dungeon : index {}", GetMapIndex());
|
||||
return;
|
||||
}
|
||||
pParty->SetDungeon_for_Only_party (this);
|
||||
|
@ -393,7 +387,7 @@ void CDungeon::SetPartyNull()
|
|||
|
||||
void CDungeonManager::Destroy(CDungeon::IdType dungeon_id)
|
||||
{
|
||||
sys_log(0, "DUNGEON destroy : map index %u", dungeon_id);
|
||||
SPDLOG_DEBUG("DUNGEON destroy : map index {}", dungeon_id);
|
||||
LPDUNGEON pDungeon = Find(dungeon_id);
|
||||
if (pDungeon == NULL) {
|
||||
return;
|
||||
|
@ -433,7 +427,7 @@ LPDUNGEON CDungeonManager::Create(int lOriginalMapIndex)
|
|||
|
||||
if (!lMapIndex)
|
||||
{
|
||||
sys_log( 0, "Fail to Create Dungeon : OrginalMapindex %d NewMapindex %d", lOriginalMapIndex, lMapIndex );
|
||||
SPDLOG_ERROR("Fail to Create Dungeon : OrginalMapindex {} NewMapindex {}", lOriginalMapIndex, lMapIndex );
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
@ -446,7 +440,7 @@ LPDUNGEON CDungeonManager::Create(int lOriginalMapIndex)
|
|||
LPDUNGEON pDungeon = M2_NEW CDungeon(id, lOriginalMapIndex, lMapIndex);
|
||||
if (!pDungeon)
|
||||
{
|
||||
sys_err("M2_NEW CDungeon failed");
|
||||
SPDLOG_ERROR("M2_NEW CDungeon failed");
|
||||
return NULL;
|
||||
}
|
||||
m_map_pkDungeon.insert(std::make_pair(id, pDungeon));
|
||||
|
@ -469,7 +463,7 @@ void CDungeon::UniqueSetMaxHP(const std::string& key, int iMaxHP)
|
|||
TUniqueMobMap::iterator it = m_map_UniqueMob.find(key);
|
||||
if (it == m_map_UniqueMob.end())
|
||||
{
|
||||
sys_err("Unknown Key : %s", key.c_str());
|
||||
SPDLOG_ERROR("Unknown Key : {}", key.c_str());
|
||||
return;
|
||||
}
|
||||
it->second->SetMaxHP(iMaxHP);
|
||||
|
@ -480,7 +474,7 @@ void CDungeon::UniqueSetHP(const std::string& key, int iHP)
|
|||
TUniqueMobMap::iterator it = m_map_UniqueMob.find(key);
|
||||
if (it == m_map_UniqueMob.end())
|
||||
{
|
||||
sys_err("Unknown Key : %s", key.c_str());
|
||||
SPDLOG_ERROR("Unknown Key : {}", key.c_str());
|
||||
return;
|
||||
}
|
||||
it->second->SetHP(iHP);
|
||||
|
@ -491,7 +485,7 @@ void CDungeon::UniqueSetDefGrade(const std::string& key, int iGrade)
|
|||
TUniqueMobMap::iterator it = m_map_UniqueMob.find(key);
|
||||
if (it == m_map_UniqueMob.end())
|
||||
{
|
||||
sys_err("Unknown Key : %s", key.c_str());
|
||||
SPDLOG_ERROR("Unknown Key : {}", key.c_str());
|
||||
return;
|
||||
}
|
||||
it->second->PointChange(POINT_DEF_GRADE,iGrade - it->second->GetPoint(POINT_DEF_GRADE));
|
||||
|
@ -502,14 +496,14 @@ void CDungeon::SpawnMoveUnique(const char* key, DWORD vnum, const char* pos_from
|
|||
TAreaMap::iterator it_to = m_map_Area.find(pos_to);
|
||||
if (it_to == m_map_Area.end())
|
||||
{
|
||||
sys_err("Wrong position string : %s", pos_to);
|
||||
SPDLOG_ERROR("Wrong position string : {}", pos_to);
|
||||
return;
|
||||
}
|
||||
|
||||
TAreaMap::iterator it_from = m_map_Area.find(pos_from);
|
||||
if (it_from == m_map_Area.end())
|
||||
{
|
||||
sys_err("Wrong position string : %s", pos_from);
|
||||
SPDLOG_ERROR("Wrong position string : {}", pos_from);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -521,7 +515,7 @@ void CDungeon::SpawnMoveUnique(const char* key, DWORD vnum, const char* pos_from
|
|||
|
||||
LPSECTREE_MAP pkSectreeMap = SECTREE_MANAGER::instance().GetMap(m_lMapIndex);
|
||||
if (pkSectreeMap == NULL) {
|
||||
sys_err("CDungeon: SECTREE_MAP not found for #%ld", m_lMapIndex);
|
||||
SPDLOG_ERROR("CDungeon: SECTREE_MAP not found for #{}", m_lMapIndex);
|
||||
return;
|
||||
}
|
||||
for (int i=0;i<100;i++)
|
||||
|
@ -544,7 +538,7 @@ void CDungeon::SpawnMoveUnique(const char* key, DWORD vnum, const char* pos_from
|
|||
}
|
||||
else
|
||||
{
|
||||
sys_err("Cannot spawn at %d %d", pkSectreeMap->m_setting.iBaseX+((ai.sx+ai.ex)>>1), pkSectreeMap->m_setting.iBaseY+((ai.sy+ai.ey)>>1));
|
||||
SPDLOG_ERROR("Cannot spawn at {} {}", pkSectreeMap->m_setting.iBaseX+((ai.sx+ai.ex)>>1), pkSectreeMap->m_setting.iBaseY+((ai.sy+ai.ey)>>1));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -555,7 +549,7 @@ void CDungeon::SpawnUnique(const char* key, DWORD vnum, const char* pos)
|
|||
TAreaMap::iterator it = m_map_Area.find(pos);
|
||||
if (it == m_map_Area.end())
|
||||
{
|
||||
sys_err("Wrong position string : %s", pos);
|
||||
SPDLOG_ERROR("Wrong position string : {}", pos);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -566,7 +560,7 @@ void CDungeon::SpawnUnique(const char* key, DWORD vnum, const char* pos)
|
|||
|
||||
LPSECTREE_MAP pkSectreeMap = SECTREE_MANAGER::instance().GetMap(m_lMapIndex);
|
||||
if (pkSectreeMap == NULL) {
|
||||
sys_err("CDungeon: SECTREE_MAP not found for #%ld", m_lMapIndex);
|
||||
SPDLOG_ERROR("CDungeon: SECTREE_MAP not found for #{}", m_lMapIndex);
|
||||
return;
|
||||
}
|
||||
for (int i=0;i<100;i++)
|
||||
|
@ -585,7 +579,7 @@ void CDungeon::SpawnUnique(const char* key, DWORD vnum, const char* pos)
|
|||
}
|
||||
else
|
||||
{
|
||||
sys_err("Cannot spawn at %d %d", pkSectreeMap->m_setting.iBaseX+((ai.sx+ai.ex)>>1), pkSectreeMap->m_setting.iBaseY+((ai.sy+ai.ey)>>1));
|
||||
SPDLOG_ERROR("Cannot spawn at {} {}", pkSectreeMap->m_setting.iBaseX+((ai.sx+ai.ex)>>1), pkSectreeMap->m_setting.iBaseY+((ai.sy+ai.ey)>>1));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -618,7 +612,7 @@ void CDungeon::PurgeUnique(const std::string& key)
|
|||
TUniqueMobMap::iterator it = m_map_UniqueMob.find(key);
|
||||
if (it == m_map_UniqueMob.end())
|
||||
{
|
||||
sys_err("Unknown Key or Dead: %s", key.c_str());
|
||||
SPDLOG_ERROR("Unknown Key or Dead: {}", key.c_str());
|
||||
return;
|
||||
}
|
||||
LPCHARACTER ch = it->second;
|
||||
|
@ -631,7 +625,7 @@ void CDungeon::KillUnique(const std::string& key)
|
|||
TUniqueMobMap::iterator it = m_map_UniqueMob.find(key);
|
||||
if (it == m_map_UniqueMob.end())
|
||||
{
|
||||
sys_err("Unknown Key or Dead: %s", key.c_str());
|
||||
SPDLOG_ERROR("Unknown Key or Dead: {}", key.c_str());
|
||||
return;
|
||||
}
|
||||
LPCHARACTER ch = it->second;
|
||||
|
@ -644,7 +638,7 @@ DWORD CDungeon::GetUniqueVid(const std::string& key)
|
|||
TUniqueMobMap::iterator it = m_map_UniqueMob.find(key);
|
||||
if (it == m_map_UniqueMob.end())
|
||||
{
|
||||
sys_err("Unknown Key or Dead: %s", key.c_str());
|
||||
SPDLOG_ERROR("Unknown Key or Dead: {}", key.c_str());
|
||||
return 0;
|
||||
}
|
||||
LPCHARACTER ch = it->second;
|
||||
|
@ -656,7 +650,7 @@ float CDungeon::GetUniqueHpPerc(const std::string& key)
|
|||
TUniqueMobMap::iterator it = m_map_UniqueMob.find(key);
|
||||
if (it == m_map_UniqueMob.end())
|
||||
{
|
||||
sys_err("Unknown Key : %s", key.c_str());
|
||||
SPDLOG_ERROR("Unknown Key : {}", key.c_str());
|
||||
return false;
|
||||
}
|
||||
return (100.f*it->second->GetHP())/it->second->GetMaxHP();
|
||||
|
@ -671,7 +665,6 @@ void CDungeon::DeadCharacter(LPCHARACTER ch)
|
|||
{
|
||||
if (it->second == ch)
|
||||
{
|
||||
//sys_log(0,"Dead unique %s", it->first.c_str());
|
||||
m_map_UniqueMob.erase(it);
|
||||
break;
|
||||
}
|
||||
|
@ -686,7 +679,7 @@ bool CDungeon::IsUniqueDead(const std::string& key)
|
|||
|
||||
if (it == m_map_UniqueMob.end())
|
||||
{
|
||||
sys_err("Unknown Key or Dead : %s", key.c_str());
|
||||
SPDLOG_ERROR("Unknown Key or Dead : {}", key.c_str());
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -695,12 +688,11 @@ bool CDungeon::IsUniqueDead(const std::string& key)
|
|||
|
||||
void CDungeon::Spawn(DWORD vnum, const char* pos)
|
||||
{
|
||||
//sys_log(0,"DUNGEON Spawn %u %s", vnum, pos);
|
||||
TAreaMap::iterator it = m_map_Area.find(pos);
|
||||
|
||||
if (it == m_map_Area.end())
|
||||
{
|
||||
sys_err("Wrong position string : %s", pos);
|
||||
SPDLOG_ERROR("Wrong position string : {}", pos);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -712,7 +704,7 @@ void CDungeon::Spawn(DWORD vnum, const char* pos)
|
|||
LPSECTREE_MAP pkSectreeMap = SECTREE_MANAGER::instance().GetMap(m_lMapIndex);
|
||||
if (pkSectreeMap == NULL)
|
||||
{
|
||||
sys_err("cannot find map by index %d", m_lMapIndex);
|
||||
SPDLOG_ERROR("cannot find map by index {}", m_lMapIndex);
|
||||
return;
|
||||
}
|
||||
int dx = Random::get(ai.sx, ai.ex);
|
||||
|
@ -727,17 +719,17 @@ LPCHARACTER CDungeon::SpawnMob(DWORD vnum, int x, int y, int dir)
|
|||
{
|
||||
LPSECTREE_MAP pkSectreeMap = SECTREE_MANAGER::instance().GetMap(m_lMapIndex);
|
||||
if (pkSectreeMap == NULL) {
|
||||
sys_err("CDungeon: SECTREE_MAP not found for #%ld", m_lMapIndex);
|
||||
SPDLOG_ERROR("CDungeon: SECTREE_MAP not found for #{}", m_lMapIndex);
|
||||
return NULL;
|
||||
}
|
||||
sys_log(0, "CDungeon::SpawnMob %u %d %d", vnum, x, y);
|
||||
SPDLOG_DEBUG("CDungeon::SpawnMob {} {} {}", vnum, x, y);
|
||||
|
||||
LPCHARACTER ch = CHARACTER_MANAGER::instance().SpawnMob(vnum, m_lMapIndex, pkSectreeMap->m_setting.iBaseX+x*100, pkSectreeMap->m_setting.iBaseY+y*100, 0, false, dir == 0 ? -1 : (dir - 1) * 45);
|
||||
|
||||
if (ch)
|
||||
{
|
||||
ch->SetDungeon(this);
|
||||
sys_log(0, "CDungeon::SpawnMob name %s", ch->GetName());
|
||||
SPDLOG_DEBUG("CDungeon::SpawnMob name {}", ch->GetName());
|
||||
}
|
||||
|
||||
return ch;
|
||||
|
@ -747,17 +739,17 @@ LPCHARACTER CDungeon::SpawnMob_ac_dir(DWORD vnum, int x, int y, int dir)
|
|||
{
|
||||
LPSECTREE_MAP pkSectreeMap = SECTREE_MANAGER::instance().GetMap(m_lMapIndex);
|
||||
if (pkSectreeMap == NULL) {
|
||||
sys_err("CDungeon: SECTREE_MAP not found for #%ld", m_lMapIndex);
|
||||
SPDLOG_ERROR("CDungeon: SECTREE_MAP not found for #{}", m_lMapIndex);
|
||||
return NULL;
|
||||
}
|
||||
sys_log(0, "CDungeon::SpawnMob %u %d %d", vnum, x, y);
|
||||
SPDLOG_DEBUG("CDungeon::SpawnMob {} {} {}", vnum, x, y);
|
||||
|
||||
LPCHARACTER ch = CHARACTER_MANAGER::instance().SpawnMob(vnum, m_lMapIndex, pkSectreeMap->m_setting.iBaseX+x*100, pkSectreeMap->m_setting.iBaseY+y*100, 0, false, dir);
|
||||
|
||||
if (ch)
|
||||
{
|
||||
ch->SetDungeon(this);
|
||||
sys_log(0, "CDungeon::SpawnMob name %s", ch->GetName());
|
||||
SPDLOG_DEBUG("CDungeon::SpawnMob name {}", ch->GetName());
|
||||
}
|
||||
|
||||
return ch;
|
||||
|
@ -767,7 +759,7 @@ void CDungeon::SpawnNameMob(DWORD vnum, int x, int y, const char* name)
|
|||
{
|
||||
LPSECTREE_MAP pkSectreeMap = SECTREE_MANAGER::instance().GetMap(m_lMapIndex);
|
||||
if (pkSectreeMap == NULL) {
|
||||
sys_err("CDungeon: SECTREE_MAP not found for #%ld", m_lMapIndex);
|
||||
SPDLOG_ERROR("CDungeon: SECTREE_MAP not found for #{}", m_lMapIndex);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -785,11 +777,11 @@ void CDungeon::SpawnGotoMob(int lFromX, int lFromY, int lToX, int lToY)
|
|||
|
||||
LPSECTREE_MAP pkSectreeMap = SECTREE_MANAGER::instance().GetMap(m_lMapIndex);
|
||||
if (pkSectreeMap == NULL) {
|
||||
sys_err("CDungeon: SECTREE_MAP not found for #%ld", m_lMapIndex);
|
||||
SPDLOG_ERROR("CDungeon: SECTREE_MAP not found for #{}", m_lMapIndex);
|
||||
return;
|
||||
}
|
||||
|
||||
sys_log(0, "SpawnGotoMob %d %d to %d %d", lFromX, lFromY, lToX, lToY);
|
||||
SPDLOG_DEBUG("SpawnGotoMob {} {} to {} {}", lFromX, lFromY, lToX, lToY);
|
||||
|
||||
lFromX = pkSectreeMap->m_setting.iBaseX+lFromX*100;
|
||||
lFromY = pkSectreeMap->m_setting.iBaseY+lFromY*100;
|
||||
|
@ -810,7 +802,7 @@ LPCHARACTER CDungeon::SpawnGroup(DWORD vnum, int x, int y, float radius, bool bA
|
|||
{
|
||||
LPSECTREE_MAP pkSectreeMap = SECTREE_MANAGER::instance().GetMap(m_lMapIndex);
|
||||
if (pkSectreeMap == NULL) {
|
||||
sys_err("CDungeon: SECTREE_MAP not found for #%ld", m_lMapIndex);
|
||||
SPDLOG_ERROR("CDungeon: SECTREE_MAP not found for #{}", m_lMapIndex);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
@ -837,14 +829,14 @@ void CDungeon::SpawnRegen(const char* filename, bool bOnce)
|
|||
{
|
||||
if (!filename)
|
||||
{
|
||||
sys_err("CDungeon::SpawnRegen(filename=NULL, bOnce=%d) - m_lMapIndex[%d]", bOnce, m_lMapIndex);
|
||||
SPDLOG_ERROR("CDungeon::SpawnRegen(filename=NULL, bOnce={}) - m_lMapIndex[{}]", bOnce, m_lMapIndex);
|
||||
return;
|
||||
}
|
||||
|
||||
LPSECTREE_MAP pkSectreeMap = SECTREE_MANAGER::instance().GetMap(m_lMapIndex);
|
||||
if (!pkSectreeMap)
|
||||
{
|
||||
sys_err("CDungeon::SpawnRegen(filename=%s, bOnce=%d) - m_lMapIndex[%d]", filename, bOnce, m_lMapIndex);
|
||||
SPDLOG_ERROR("CDungeon::SpawnRegen(filename={}, bOnce={}) - m_lMapIndex[{}]", filename, bOnce, m_lMapIndex);
|
||||
return;
|
||||
}
|
||||
regen_do(filename, m_lMapIndex, pkSectreeMap->m_setting.iBaseX, pkSectreeMap->m_setting.iBaseY, this, bOnce);
|
||||
|
@ -883,7 +875,7 @@ void CDungeon::SpawnMoveGroup(DWORD vnum, const char* pos_from, const char* pos_
|
|||
|
||||
if (it_to == m_map_Area.end())
|
||||
{
|
||||
sys_err("Wrong position string : %s", pos_to);
|
||||
SPDLOG_ERROR("Wrong position string : {}", pos_to);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -891,7 +883,7 @@ void CDungeon::SpawnMoveGroup(DWORD vnum, const char* pos_from, const char* pos_
|
|||
|
||||
if (it_from == m_map_Area.end())
|
||||
{
|
||||
sys_err("Wrong position string : %s", pos_from);
|
||||
SPDLOG_ERROR("Wrong position string : {}", pos_from);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -904,7 +896,7 @@ void CDungeon::SpawnMoveGroup(DWORD vnum, const char* pos_from, const char* pos_
|
|||
|
||||
LPSECTREE_MAP pkSectreeMap = SECTREE_MANAGER::instance().GetMap(m_lMapIndex);
|
||||
if (pkSectreeMap == NULL) {
|
||||
sys_err("CDungeon: SECTREE_MAP not found for #%ld", m_lMapIndex);
|
||||
SPDLOG_ERROR("CDungeon: SECTREE_MAP not found for #{}", m_lMapIndex);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -952,7 +944,7 @@ namespace
|
|||
M2_DESTROY_ITEM(item);
|
||||
}
|
||||
else
|
||||
sys_err("unknown entity type %d is in dungeon", ent->GetType());
|
||||
SPDLOG_ERROR("unknown entity type {} is in dungeon", ent->GetType());
|
||||
}
|
||||
};
|
||||
}
|
||||
|
@ -962,7 +954,7 @@ void CDungeon::KillAll()
|
|||
{
|
||||
LPSECTREE_MAP pkMap = SECTREE_MANAGER::instance().GetMap(m_lMapIndex);
|
||||
if (pkMap == NULL) {
|
||||
sys_err("CDungeon: SECTREE_MAP not found for #%ld", m_lMapIndex);
|
||||
SPDLOG_ERROR("CDungeon: SECTREE_MAP not found for #{}", m_lMapIndex);
|
||||
return;
|
||||
}
|
||||
FKillSectree f;
|
||||
|
@ -974,7 +966,7 @@ void CDungeon::Purge()
|
|||
{
|
||||
LPSECTREE_MAP pkMap = SECTREE_MANAGER::instance().GetMap(m_lMapIndex);
|
||||
if (pkMap == NULL) {
|
||||
sys_err("CDungeon: SECTREE_MAP not found for #%ld", m_lMapIndex);
|
||||
SPDLOG_ERROR("CDungeon: SECTREE_MAP not found for #{}", m_lMapIndex);
|
||||
return;
|
||||
}
|
||||
FPurgeSectree f;
|
||||
|
@ -1039,7 +1031,7 @@ int CDungeon::CountRealMonster()
|
|||
|
||||
if (!pMap)
|
||||
{
|
||||
sys_err("cannot find map by index %d", m_lOrigMapIndex);
|
||||
SPDLOG_ERROR("cannot find map by index {}", m_lOrigMapIndex);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -1070,7 +1062,7 @@ void CDungeon::ExitAll()
|
|||
|
||||
if (!pMap)
|
||||
{
|
||||
sys_err("cannot find map by index %d", m_lMapIndex);
|
||||
SPDLOG_ERROR("cannot find map by index {}", m_lMapIndex);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -1104,12 +1096,12 @@ namespace
|
|||
|
||||
void CDungeon::Notice(const char* msg)
|
||||
{
|
||||
sys_log(0, "XXX Dungeon Notice %p %s", this, msg);
|
||||
SPDLOG_DEBUG("Dungeon Notice {} {}", (void*) this, msg);
|
||||
LPSECTREE_MAP pMap = SECTREE_MANAGER::instance().GetMap(m_lMapIndex);
|
||||
|
||||
if (!pMap)
|
||||
{
|
||||
sys_err("cannot find map by index %d", m_lMapIndex);
|
||||
SPDLOG_ERROR("cannot find map by index {}", m_lMapIndex);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -1146,7 +1138,7 @@ void CDungeon::ExitAllToStartPosition()
|
|||
|
||||
if (!pMap)
|
||||
{
|
||||
sys_err("cannot find map by index %d", m_lMapIndex);
|
||||
SPDLOG_ERROR("cannot find map by index {}", m_lMapIndex);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -1162,7 +1154,7 @@ EVENTFUNC(dungeon_jump_to_event)
|
|||
|
||||
if ( info == NULL )
|
||||
{
|
||||
sys_err( "dungeon_jump_to_event> <Factor> Null pointer" );
|
||||
SPDLOG_ERROR("dungeon_jump_to_event> <Factor> Null pointer" );
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -1172,7 +1164,7 @@ EVENTFUNC(dungeon_jump_to_event)
|
|||
if (pDungeon)
|
||||
pDungeon->JumpToEliminateLocation();
|
||||
else
|
||||
sys_err("cannot find dungeon with map index %u", info->dungeon_id);
|
||||
SPDLOG_ERROR("cannot find dungeon with map index {}", info->dungeon_id);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -1183,7 +1175,7 @@ EVENTFUNC(dungeon_exit_all_event)
|
|||
|
||||
if ( info == NULL )
|
||||
{
|
||||
sys_err( "dungeon_exit_all_event> <Factor> Null pointer" );
|
||||
SPDLOG_ERROR("dungeon_exit_all_event> <Factor> Null pointer" );
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -1203,7 +1195,7 @@ void CDungeon::CheckEliminated()
|
|||
|
||||
if (m_bExitAllAtEliminate)
|
||||
{
|
||||
sys_log(0, "CheckEliminated: exit");
|
||||
SPDLOG_DEBUG("CheckEliminated: exit");
|
||||
m_bExitAllAtEliminate = false;
|
||||
|
||||
if (m_iWarpDelay)
|
||||
|
@ -1221,7 +1213,7 @@ void CDungeon::CheckEliminated()
|
|||
}
|
||||
else if (m_bWarpAtEliminate)
|
||||
{
|
||||
sys_log(0, "CheckEliminated: warp");
|
||||
SPDLOG_DEBUG("CheckEliminated: warp");
|
||||
m_bWarpAtEliminate = false;
|
||||
|
||||
if (m_iWarpDelay)
|
||||
|
@ -1238,12 +1230,12 @@ void CDungeon::CheckEliminated()
|
|||
}
|
||||
}
|
||||
else
|
||||
sys_log(0, "CheckEliminated: none");
|
||||
SPDLOG_DEBUG("CheckEliminated: none");
|
||||
}
|
||||
|
||||
void CDungeon::SetExitAllAtEliminate(int time)
|
||||
{
|
||||
sys_log(0, "SetExitAllAtEliminate: time %d", time);
|
||||
SPDLOG_DEBUG("SetExitAllAtEliminate: time {}", time);
|
||||
m_bExitAllAtEliminate = true;
|
||||
m_iWarpDelay = time;
|
||||
}
|
||||
|
@ -1261,7 +1253,7 @@ void CDungeon::SetWarpAtEliminate(int time, int lMapIndex, int x, int y, const c
|
|||
else
|
||||
m_stRegenFile = regen_file;
|
||||
|
||||
sys_log(0, "SetWarpAtEliminate: time %d map %d %dx%d regenfile %s", time, lMapIndex, x, y, m_stRegenFile.c_str());
|
||||
SPDLOG_DEBUG("SetWarpAtEliminate: time {} map {} {}x{} regenfile {}", time, lMapIndex, x, y, m_stRegenFile.c_str());
|
||||
}
|
||||
|
||||
void CDungeon::JumpToEliminateLocation()
|
||||
|
@ -1285,7 +1277,7 @@ void CDungeon::JumpToEliminateLocation()
|
|||
|
||||
if (!pMap)
|
||||
{
|
||||
sys_err("no map by index %d", m_lMapIndex);
|
||||
SPDLOG_ERROR("no map by index {}", m_lMapIndex);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -1332,7 +1324,7 @@ bool CDungeon::IsAllPCNearTo(int x, int y, int dist)
|
|||
|
||||
if (!pMap)
|
||||
{
|
||||
sys_err("cannot find map by index %d", m_lMapIndex);
|
||||
SPDLOG_ERROR("cannot find map by index {}", m_lMapIndex);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -36,7 +36,7 @@ class CDungeon
|
|||
void KillAll();
|
||||
// END_OF_DUNGEON_KILL_ALL_BUG_FIX
|
||||
|
||||
void IncMonster() { m_iMonsterCount++; sys_log(0, "MonsterCount %d", m_iMonsterCount); }
|
||||
void IncMonster() { m_iMonsterCount++; SPDLOG_DEBUG("MonsterCount {}", m_iMonsterCount); }
|
||||
void DecMonster() { m_iMonsterCount--; CheckEliminated(); }
|
||||
int CountMonster() { return m_iMonsterCount; } // 데이터로 리젠한 몬스터의 수
|
||||
int CountRealMonster(); // 실제로 맵상에 있는 몬스터
|
||||
|
|
|
@ -126,7 +126,7 @@ void CEntity::UpdateSectree()
|
|||
if (IsType(ENTITY_CHARACTER))
|
||||
{
|
||||
LPCHARACTER tch = (LPCHARACTER) this;
|
||||
sys_err("null sectree name: %s %d %d", tch->GetName(), GetX(), GetY());
|
||||
SPDLOG_ERROR("null sectree name: {} {} {}", tch->GetName(), GetX(), GetY());
|
||||
}
|
||||
|
||||
return;
|
||||
|
|
|
@ -51,7 +51,7 @@ void event_cancel(LPEVENT * ppevent)
|
|||
|
||||
if (!ppevent)
|
||||
{
|
||||
sys_err("null pointer");
|
||||
SPDLOG_ERROR("null pointer");
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -136,7 +136,6 @@ int event_process(int pulse)
|
|||
}
|
||||
else
|
||||
{
|
||||
//sys_log(0, "EVENT: %s %d event %p info %p", the_event->file, the_event->line, the_event, the_event->info);
|
||||
new_time = (the_event->func) (get_pointer(the_event), processing_time);
|
||||
|
||||
if (new_time <= 0 || the_event->is_force_to_end)
|
||||
|
|
|
@ -166,13 +166,13 @@ bool CExchange::AddItem(TItemPos item_pos, BYTE display_pos)
|
|||
// 이미 교환창에 추가된 아이템인가?
|
||||
if (item->IsExchanging())
|
||||
{
|
||||
sys_log(0, "EXCHANGE under exchanging");
|
||||
SPDLOG_DEBUG("EXCHANGE under exchanging");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!m_pGrid->IsEmpty(display_pos, 1, item->GetSize()))
|
||||
{
|
||||
sys_log(0, "EXCHANGE not empty item_pos %d %d %d", display_pos, 1, item->GetSize());
|
||||
SPDLOG_DEBUG("EXCHANGE not empty item_pos {} {} {}", display_pos, 1, item->GetSize());
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -207,7 +207,7 @@ bool CExchange::AddItem(TItemPos item_pos, BYTE display_pos)
|
|||
item->GetCount(),
|
||||
item);
|
||||
|
||||
sys_log(0, "EXCHANGE AddItem success %s pos(%d, %d) %d", item->GetName(), item_pos.window_type, item_pos.cell, display_pos);
|
||||
SPDLOG_DEBUG("EXCHANGE AddItem success {} pos({}, {}) {}", item->GetName(), item_pos.window_type, item_pos.cell, display_pos);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -431,7 +431,7 @@ bool CExchange::Done()
|
|||
|
||||
if (empty_pos < 0)
|
||||
{
|
||||
sys_err("Exchange::Done : Cannot find blank position in inventory %s <-> %s item %s",
|
||||
SPDLOG_ERROR("Exchange::Done : Cannot find blank position in inventory {} <-> {} item {}",
|
||||
m_pOwner->GetName(), victim->GetName(), item->GetName());
|
||||
continue;
|
||||
}
|
||||
|
@ -548,7 +548,7 @@ bool CExchange::Accept(bool bAccept)
|
|||
|
||||
if (!db_clientdesc->IsPhase(PHASE_DBCLIENT))
|
||||
{
|
||||
sys_err("Cannot use exchange feature while DB cache connection is dead.");
|
||||
SPDLOG_ERROR("Cannot use exchange feature while DB cache connection is dead.");
|
||||
victim->ChatPacket(CHAT_TYPE_INFO, "Unknown error");
|
||||
GetOwner()->ChatPacket(CHAT_TYPE_INFO, "Unknown error");
|
||||
goto EXCHANGE_END;
|
||||
|
|
|
@ -301,7 +301,7 @@ void Initialize()
|
|||
|
||||
for (int i = 0; i < MAX_FISH; ++i)
|
||||
{
|
||||
sys_log(0, "FISH: %-24s vnum %5lu prob %4d %4d %4d %4d len %d %d %d",
|
||||
SPDLOG_TRACE("FISH: {:24} vnum {:5} prob {:4} {:4} {:4} {:4} len {} {} {}",
|
||||
fish_info[i].name,
|
||||
fish_info[i].vnum,
|
||||
fish_info[i].prob[0],
|
||||
|
@ -322,7 +322,7 @@ void Initialize()
|
|||
g_prob_accumulate[j][i] = fish_info[i].prob[j] + g_prob_accumulate[j][i - 1];
|
||||
|
||||
g_prob_sum[j] = g_prob_accumulate[j][MAX_FISH - 1];
|
||||
sys_log(0, "FISH: prob table %d %d", j, g_prob_sum[j]);
|
||||
SPDLOG_DEBUG("FISH: prob table {} {}", j, g_prob_sum[j]);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -472,7 +472,7 @@ EVENTFUNC(fishing_event)
|
|||
|
||||
if ( info == NULL )
|
||||
{
|
||||
sys_err( "fishing_event> <Factor> Null pointer" );
|
||||
SPDLOG_ERROR("fishing_event> <Factor> Null pointer" );
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -558,7 +558,7 @@ int Compute(DWORD fish_id, DWORD ms, DWORD* item, int level)
|
|||
|
||||
if (fish_id >= MAX_FISH)
|
||||
{
|
||||
sys_err("Wrong FISH ID : %d", fish_id);
|
||||
SPDLOG_ERROR("Wrong FISH ID : {}", fish_id);
|
||||
return -2;
|
||||
}
|
||||
|
||||
|
@ -857,7 +857,7 @@ int RealRefineRod(LPCHARACTER ch, LPITEM item)
|
|||
// REFINE_ROD_HACK_BUG_FIX
|
||||
if (!RefinableRod(item))
|
||||
{
|
||||
sys_err("REFINE_ROD_HACK pid(%u) item(%s:%d)", ch->GetPlayerID(), item->GetName(), item->GetID());
|
||||
SPDLOG_ERROR("REFINE_ROD_HACK pid({}) item({}:{})", ch->GetPlayerID(), item->GetName(), item->GetID());
|
||||
|
||||
LogManager::instance().RefineLog(ch->GetPlayerID(), item->GetName(), item->GetID(), -1, 1, "ROD_HACK");
|
||||
|
||||
|
|
|
@ -23,7 +23,7 @@ void gm_new_clear()
|
|||
|
||||
void gm_new_insert( const tAdminInfo &rAdminInfo )
|
||||
{
|
||||
sys_log( 0, "InsertGMList(account:%s, player:%s, contact_ip:%s, server_ip:%s, auth:%d)",
|
||||
SPDLOG_DEBUG("InsertGMList(account:{}, player:{}, contact_ip:{}, server_ip:{}, auth:{})",
|
||||
rAdminInfo.m_szAccount,
|
||||
rAdminInfo.m_szName,
|
||||
rAdminInfo.m_szContactIP,
|
||||
|
@ -35,12 +35,12 @@ void gm_new_insert( const tAdminInfo &rAdminInfo )
|
|||
if ( strlen( rAdminInfo.m_szContactIP ) == 0 )
|
||||
{
|
||||
t.pset_Host = &g_set_Host;
|
||||
sys_log(0, "GM Use ContactIP" );
|
||||
SPDLOG_DEBUG("GM Use ContactIP" );
|
||||
}
|
||||
else
|
||||
{
|
||||
t.pset_Host = NULL;
|
||||
sys_log(0, "GM Use Default Host List" );
|
||||
SPDLOG_DEBUG("GM Use Default Host List" );
|
||||
}
|
||||
|
||||
memcpy ( &t.Info, &rAdminInfo, sizeof ( rAdminInfo ) );
|
||||
|
@ -52,7 +52,7 @@ void gm_new_insert( const tAdminInfo &rAdminInfo )
|
|||
void gm_new_host_inert( const char * host )
|
||||
{
|
||||
g_set_Host.insert( host );
|
||||
sys_log( 0, "InsertGMHost(ip:%s)", host );
|
||||
SPDLOG_DEBUG("InsertGMHost(ip:{})", host );
|
||||
}
|
||||
|
||||
BYTE gm_new_get_level( const char * name, const char * host, const char* account)
|
||||
|
@ -72,11 +72,11 @@ BYTE gm_new_get_level( const char * name, const char * host, const char* account
|
|||
{
|
||||
if ( strcmp ( it->second.Info.m_szAccount, account ) != 0 )
|
||||
{
|
||||
sys_log(0, "GM_NEW_GET_LEVEL : BAD ACCOUNT [ACCOUNT:%s/%s", it->second.Info.m_szAccount, account);
|
||||
SPDLOG_DEBUG("GM_NEW_GET_LEVEL : BAD ACCOUNT [ACCOUNT:{}/{}", it->second.Info.m_szAccount, account);
|
||||
return GM_PLAYER;
|
||||
}
|
||||
}
|
||||
sys_log(0, "GM_NEW_GET_LEVEL : FIND ACCOUNT");
|
||||
SPDLOG_DEBUG("GM_NEW_GET_LEVEL : FIND ACCOUNT");
|
||||
return it->second.Info.m_Authority;
|
||||
}
|
||||
// END_OF_GERMAN_GM_NOT_CHECK_HOST
|
||||
|
@ -89,7 +89,7 @@ BYTE gm_new_get_level( const char * name, const char * host, const char* account
|
|||
{
|
||||
if ( it->second.pset_Host->end() == it->second.pset_Host->find( host ) )
|
||||
{
|
||||
sys_log(0, "GM_NEW_GET_LEVEL : BAD HOST IN HOST_LIST");
|
||||
SPDLOG_DEBUG("GM_NEW_GET_LEVEL : BAD HOST IN HOST_LIST");
|
||||
return GM_PLAYER;
|
||||
}
|
||||
}
|
||||
|
@ -97,12 +97,12 @@ BYTE gm_new_get_level( const char * name, const char * host, const char* account
|
|||
{
|
||||
if ( strcmp ( it->second.Info.m_szContactIP, host ) != 0 )
|
||||
{
|
||||
sys_log(0, "GM_NEW_GET_LEVEL : BAD HOST IN GMLIST");
|
||||
SPDLOG_DEBUG("GM_NEW_GET_LEVEL : BAD HOST IN GMLIST");
|
||||
return GM_PLAYER;
|
||||
}
|
||||
}
|
||||
}
|
||||
sys_log(0, "GM_NEW_GET_LEVEL : FIND HOST");
|
||||
SPDLOG_DEBUG("GM_NEW_GET_LEVEL : FIND HOST");
|
||||
|
||||
return it->second.Info.m_Authority;
|
||||
}
|
||||
|
|
|
@ -75,10 +75,10 @@ bool CGroupTextParseTreeLoader::LoadGroup(CGroupNode * pGroupNode)
|
|||
{
|
||||
if (2 != stTokenVector.size())
|
||||
{
|
||||
sys_err("Invalid group syntax token size: %u != 2 (DO NOT SPACE IN NAME)", stTokenVector.size());
|
||||
SPDLOG_ERROR("Invalid group syntax token size: {} != 2 (DO NOT SPACE IN NAME)", stTokenVector.size());
|
||||
for (unsigned int i = 0; i < stTokenVector.size(); ++i)
|
||||
sys_err(" %u %s", i, stTokenVector[i].c_str());
|
||||
exit(1);
|
||||
SPDLOG_ERROR(" {} {}", i, stTokenVector[i].c_str());
|
||||
exit(EXIT_FAILURE);
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -108,7 +108,7 @@ bool CGroupTextParseTreeLoader::LoadGroup(CGroupNode * pGroupNode)
|
|||
|
||||
if (1 == stTokenVector.size())
|
||||
{
|
||||
sys_err("CGroupTextParseTreeLoader::LoadGroup : must have a value (filename: %s line: %d key: %s)",
|
||||
SPDLOG_ERROR("CGroupTextParseTreeLoader::LoadGroup : must have a value (filename: {} line: {} key: {})",
|
||||
m_strFileName.c_str(),
|
||||
m_dwcurLineIndex,
|
||||
key.c_str());
|
||||
|
|
|
@ -139,7 +139,7 @@ void CGuild::RequestAddMember(LPCHARACTER ch, int grade)
|
|||
|
||||
if (m_member.find(ch->GetPlayerID()) != m_member.end())
|
||||
{
|
||||
sys_err("Already a member in guild %s[%d]", ch->GetName(), ch->GetPlayerID());
|
||||
SPDLOG_ERROR("Already a member in guild {}[{}]", ch->GetName(), ch->GetPlayerID());
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -172,8 +172,8 @@ void CGuild::AddMember(TPacketDGGuildMember * p)
|
|||
|
||||
LPCHARACTER ch = CHARACTER_MANAGER::instance().FindByPID(p->dwPID);
|
||||
|
||||
sys_log(0, "GUILD: AddMember PID %u, grade %u, job %u, level %u, offer %u, name %s ptr %p",
|
||||
p->dwPID, p->bGrade, p->bJob, p->bLevel, p->dwOffer, p->szName, get_pointer(ch));
|
||||
SPDLOG_DEBUG("GUILD: AddMember PID {}, grade {}, job {}, level {}, offer {}, name {} ptr {}",
|
||||
p->dwPID, p->bGrade, p->bJob, p->bLevel, p->dwOffer, p->szName, (void*) get_pointer(ch));
|
||||
|
||||
if (ch)
|
||||
LoginMember(ch);
|
||||
|
@ -202,7 +202,7 @@ bool CGuild::RequestRemoveMember(DWORD pid)
|
|||
|
||||
bool CGuild::RemoveMember(DWORD pid)
|
||||
{
|
||||
sys_log(0, "Receive Guild P2P RemoveMember");
|
||||
SPDLOG_DEBUG("Receive Guild P2P RemoveMember");
|
||||
TGuildMemberContainer::iterator it;
|
||||
|
||||
if ((it = m_member.find(pid)) == m_member.end())
|
||||
|
@ -240,7 +240,7 @@ void CGuild::P2PLoginMember(DWORD pid)
|
|||
{
|
||||
if (m_member.find(pid) == m_member.end())
|
||||
{
|
||||
sys_err("GUILD [%d] is not a memeber of guild.", pid);
|
||||
SPDLOG_ERROR("GUILD [{}] is not a memeber of guild.", pid);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -257,7 +257,7 @@ void CGuild::LoginMember(LPCHARACTER ch)
|
|||
{
|
||||
if (m_member.find(ch->GetPlayerID()) == m_member.end())
|
||||
{
|
||||
sys_err("GUILD %s[%d] is not a memeber of guild.", ch->GetName(), ch->GetPlayerID());
|
||||
SPDLOG_ERROR("GUILD {}[{}] is not a memeber of guild.", ch->GetName(), ch->GetPlayerID());
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -284,7 +284,7 @@ void CGuild::P2PLogoutMember(DWORD pid)
|
|||
{
|
||||
if (m_member.find(pid)==m_member.end())
|
||||
{
|
||||
sys_err("GUILD [%d] is not a memeber of guild.", pid);
|
||||
SPDLOG_ERROR("GUILD [{}] is not a memeber of guild.", pid);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -302,7 +302,7 @@ void CGuild::LogoutMember(LPCHARACTER ch)
|
|||
{
|
||||
if (m_member.find(ch->GetPlayerID())==m_member.end())
|
||||
{
|
||||
sys_err("GUILD %s[%d] is not a memeber of guild.", ch->GetName(), ch->GetPlayerID());
|
||||
SPDLOG_ERROR("GUILD {}[{}] is not a memeber of guild.", ch->GetName(), ch->GetPlayerID());
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -450,8 +450,7 @@ void CGuild::SendListPacket(LPCHARACTER ch)
|
|||
|
||||
buf.write(c, CHARACTER_NAME_MAX_LEN+1 );
|
||||
|
||||
if ( test_server )
|
||||
sys_log(0 ,"name %s job %d ", it->second.name.c_str(), it->second.job );
|
||||
SPDLOG_TRACE("name {} job {} ", it->second.name.c_str(), it->second.job );
|
||||
}
|
||||
|
||||
d->Packet(buf.read_peek(), buf.size());
|
||||
|
@ -564,7 +563,7 @@ void CGuild::LoadGuildGradeData(SQLMsg* pmsg)
|
|||
// 15개 아닐 가능성 존재
|
||||
if (pmsg->Get()->iNumRows != 15)
|
||||
{
|
||||
sys_err("Query failed: getting guild grade data. GuildID(%d)", GetID());
|
||||
SPDLOG_ERROR("Query failed: getting guild grade data. GuildID({})", GetID());
|
||||
return;
|
||||
}
|
||||
*/
|
||||
|
@ -578,7 +577,6 @@ void CGuild::LoadGuildGradeData(SQLMsg* pmsg)
|
|||
|
||||
if (grade >= 1 && grade <= 15)
|
||||
{
|
||||
//sys_log(0, "GuildGradeLoad %s", name);
|
||||
strlcpy(m_data.grade_array[grade-1].grade_name, name, sizeof(m_data.grade_array[grade-1].grade_name));
|
||||
m_data.grade_array[grade-1].auth_flag = auth;
|
||||
}
|
||||
|
@ -588,7 +586,7 @@ void CGuild::LoadGuildData(SQLMsg* pmsg)
|
|||
{
|
||||
if (pmsg->Get()->uiNumRows == 0)
|
||||
{
|
||||
sys_err("Query failed: getting guild data %s", pmsg->stQuery.c_str());
|
||||
SPDLOG_ERROR("Query failed: getting guild data {}", pmsg->stQuery.c_str());
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -628,7 +626,7 @@ void CGuild::Load(DWORD guild_id)
|
|||
DBManager::instance().FuncQuery(std::bind1st(std::mem_fun(&CGuild::LoadGuildData), this),
|
||||
"SELECT master, level, exp, name, skill_point, skill, sp, ladder_point, win, draw, loss, gold FROM guild%s WHERE id = %u", get_table_postfix(), m_data.guild_id);
|
||||
|
||||
sys_log(0, "GUILD: loading guild id %12s %u", m_data.name, guild_id);
|
||||
SPDLOG_DEBUG("GUILD: loading guild id {:>12} {}", m_data.name, guild_id);
|
||||
|
||||
DBManager::instance().FuncQuery(std::bind1st(std::mem_fun(&CGuild::LoadGuildGradeData), this),
|
||||
"SELECT grade, name, auth+0 FROM guild_grade%s WHERE guild_id = %u", get_table_postfix(), m_data.guild_id);
|
||||
|
@ -794,7 +792,7 @@ void CGuild::ChangeGradeName(BYTE grade, const char* grade_name)
|
|||
|
||||
if (grade < 1 || grade > 15)
|
||||
{
|
||||
sys_err("Wrong guild grade value %d", grade);
|
||||
SPDLOG_ERROR("Wrong guild grade value {}", grade);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -842,7 +840,7 @@ void CGuild::ChangeGradeAuth(BYTE grade, BYTE auth)
|
|||
|
||||
if (grade < 1 || grade > 15)
|
||||
{
|
||||
sys_err("Wrong guild grade value %d", grade);
|
||||
SPDLOG_ERROR("Wrong guild grade value {}", grade);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -900,8 +898,8 @@ void CGuild::SendGuildInfoPacket(LPCHARACTER ch)
|
|||
pack_sub.gold = m_data.gold;
|
||||
pack_sub.has_land = HasLand();
|
||||
|
||||
sys_log(0, "GMC guild_name %s", m_data.name);
|
||||
sys_log(0, "GMC master %d", m_data.master_pid);
|
||||
SPDLOG_DEBUG("GMC guild_name {}", m_data.name);
|
||||
SPDLOG_DEBUG("GMC master {}", m_data.master_pid);
|
||||
|
||||
d->RawPacket(&pack, sizeof(TPacketGCGuild));
|
||||
d->Packet(&pack_sub, sizeof(TPacketGCGuildInfo));
|
||||
|
@ -928,7 +926,7 @@ bool CGuild::OfferExp(LPCHARACTER ch, int amount)
|
|||
|
||||
if (ch->GetExp() - (DWORD) amount > ch->GetExp())
|
||||
{
|
||||
sys_err("Wrong guild offer amount %d by %s[%u]", amount, ch->GetName(), ch->GetPlayerID());
|
||||
SPDLOG_ERROR("Wrong guild offer amount {} by {}[{}]", amount, ch->GetName(), ch->GetPlayerID());
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -974,7 +972,7 @@ bool CGuild::OfferExp(LPCHARACTER ch, int amount)
|
|||
|
||||
void CGuild::Disband()
|
||||
{
|
||||
sys_log(0, "GUILD: Disband %s:%u", GetName(), GetID());
|
||||
SPDLOG_DEBUG("GUILD: Disband {}:{}", GetName(), GetID());
|
||||
|
||||
//building::CLand* pLand = building::CManager::instance().FindLandByGuild(GetID());
|
||||
//if (pLand)
|
||||
|
@ -1193,7 +1191,7 @@ void CGuild::SkillLevelUp(DWORD dwVnum)
|
|||
|
||||
if (!pkSk)
|
||||
{
|
||||
sys_err("There is no such guild skill by number %u", dwVnum);
|
||||
SPDLOG_ERROR("There is no such guild skill by number {}", dwVnum);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -1232,7 +1230,7 @@ void CGuild::SkillLevelUp(DWORD dwVnum)
|
|||
|
||||
for_each(m_memberOnline.begin(), m_memberOnline.end(), std::bind1st(std::mem_fun_ref(&CGuild::SendSkillInfoPacket),*this));
|
||||
|
||||
sys_log(0, "Guild SkillUp: %s %d level %d type %u", GetName(), pkSk->dwVnum, m_data.abySkill[dwRealVnum], pkSk->dwType);
|
||||
SPDLOG_DEBUG("Guild SkillUp: {} {} level {} type {}", GetName(), pkSk->dwVnum, m_data.abySkill[dwRealVnum], pkSk->dwType);
|
||||
}
|
||||
|
||||
void CGuild::UseSkill(DWORD dwVnum, LPCHARACTER ch, DWORD pid)
|
||||
|
@ -1242,7 +1240,7 @@ void CGuild::UseSkill(DWORD dwVnum, LPCHARACTER ch, DWORD pid)
|
|||
if (!GetMember(ch->GetPlayerID()) || !HasGradeAuth(GetMember(ch->GetPlayerID())->grade, GUILD_AUTH_USE_SKILL))
|
||||
return;
|
||||
|
||||
sys_log(0,"GUILD_USE_SKILL : cname(%s), skill(%d)", ch ? ch->GetName() : "", dwVnum);
|
||||
SPDLOG_DEBUG("GUILD_USE_SKILL : cname({}), skill({})", ch ? ch->GetName() : "", dwVnum);
|
||||
|
||||
DWORD dwRealVnum = dwVnum - GUILD_SKILL_START;
|
||||
|
||||
|
@ -1256,7 +1254,7 @@ void CGuild::UseSkill(DWORD dwVnum, LPCHARACTER ch, DWORD pid)
|
|||
|
||||
if (!pkSk)
|
||||
{
|
||||
sys_err("There is no such guild skill by number %u", dwVnum);
|
||||
SPDLOG_ERROR("There is no such guild skill by number {}", dwVnum);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -1748,7 +1746,7 @@ void CGuild::SkillUsableChange(DWORD dwSkillVnum, bool bUsable)
|
|||
abSkillUsable[dwRealVnum] = bUsable;
|
||||
|
||||
// GUILD_SKILL_COOLTIME_BUG_FIX
|
||||
sys_log(0, "CGuild::SkillUsableChange(guild=%s, skill=%d, usable=%d)", GetName(), dwSkillVnum, bUsable);
|
||||
SPDLOG_DEBUG("CGuild::SkillUsableChange(guild={}, skill={}, usable={})", GetName(), dwSkillVnum, bUsable);
|
||||
// END_OF_GUILD_SKILL_COOLTIME_BUG_FIX
|
||||
}
|
||||
|
||||
|
@ -1756,7 +1754,7 @@ void CGuild::SkillUsableChange(DWORD dwSkillVnum, bool bUsable)
|
|||
void CGuild::SetMemberCountBonus(int iBonus)
|
||||
{
|
||||
m_iMemberCountBonus = iBonus;
|
||||
sys_log(0, "GUILD_IS_FULL_BUG : Bonus set to %d(val:%d)", iBonus, m_iMemberCountBonus);
|
||||
SPDLOG_DEBUG("GUILD_IS_FULL_BUG : Bonus set to {}(val:{})", iBonus, m_iMemberCountBonus);
|
||||
}
|
||||
|
||||
void CGuild::BroadcastMemberCountBonus()
|
||||
|
@ -1827,7 +1825,7 @@ void CGuild::RequestDepositMoney(LPCHARACTER ch, int iGold)
|
|||
LogManager::instance().CharLog(ch, iGold, "GUILD_DEPOSIT", buf);
|
||||
|
||||
ch->UpdateDepositPulse();
|
||||
sys_log(0, "GUILD: DEPOSIT %s:%u player %s[%u] gold %d", GetName(), GetID(), ch->GetName(), ch->GetPlayerID(), iGold);
|
||||
SPDLOG_DEBUG("GUILD: DEPOSIT {}:{} player {}[{}] gold {}", GetName(), GetID(), ch->GetName(), ch->GetPlayerID(), iGold);
|
||||
}
|
||||
|
||||
void CGuild::RequestWithdrawMoney(LPCHARACTER ch, int iGold)
|
||||
|
@ -1883,7 +1881,7 @@ void CGuild::RecvWithdrawMoneyGive(int iChangeGold)
|
|||
if (ch)
|
||||
{
|
||||
ch->PointChange(POINT_GOLD, iChangeGold);
|
||||
sys_log(0, "GUILD: WITHDRAW %s:%u player %s[%u] gold %d", GetName(), GetID(), ch->GetName(), ch->GetPlayerID(), iChangeGold);
|
||||
SPDLOG_DEBUG("GUILD: WITHDRAW {}:{} player {}[{}] gold {}", GetName(), GetID(), ch->GetName(), ch->GetPlayerID(), iChangeGold);
|
||||
}
|
||||
|
||||
TPacketGDGuildMoneyWithdrawGiveReply p;
|
||||
|
@ -1922,7 +1920,7 @@ EVENTFUNC( GuildInviteEvent )
|
|||
|
||||
if ( pInfo == NULL )
|
||||
{
|
||||
sys_err( "GuildInviteEvent> <Factor> Null pointer" );
|
||||
SPDLOG_ERROR("GuildInviteEvent> <Factor> Null pointer" );
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -1930,7 +1928,7 @@ EVENTFUNC( GuildInviteEvent )
|
|||
|
||||
if ( pGuild )
|
||||
{
|
||||
sys_log( 0, "GuildInviteEvent %s", pGuild->GetName() );
|
||||
SPDLOG_DEBUG("GuildInviteEvent {}", pGuild->GetName() );
|
||||
pGuild->InviteDeny( pInfo->dwInviteePID );
|
||||
}
|
||||
|
||||
|
@ -1984,7 +1982,7 @@ void CGuild::Invite( LPCHARACTER pchInviter, LPCHARACTER pchInvitee )
|
|||
case GERR_GUILD_IS_IN_WAR : pchInviter->ChatPacket( CHAT_TYPE_INFO, LC_TEXT("<길드> 현재 길드가 전쟁 중 입니다.") ); return;
|
||||
case GERR_INVITE_LIMIT : pchInviter->ChatPacket( CHAT_TYPE_INFO, LC_TEXT("<길드> 현재 신규 가입 제한 상태 입니다.") ); return;
|
||||
|
||||
default: sys_err( "ignore guild join error(%d)", errcode ); return;
|
||||
default: SPDLOG_ERROR("ignore guild join error({})", (int) errcode ); return;
|
||||
}
|
||||
|
||||
if ( m_GuildInviteEventMap.end() != m_GuildInviteEventMap.find( pchInvitee->GetPlayerID() ) )
|
||||
|
@ -2023,7 +2021,7 @@ void CGuild::InviteAccept( LPCHARACTER pchInvitee )
|
|||
EventMap::iterator itFind = m_GuildInviteEventMap.find( pchInvitee->GetPlayerID() );
|
||||
if ( itFind == m_GuildInviteEventMap.end() )
|
||||
{
|
||||
sys_log( 0, "GuildInviteAccept from not invited character(invite guild: %s, invitee: %s)", GetName(), pchInvitee->GetName() );
|
||||
SPDLOG_DEBUG("GuildInviteAccept from not invited character(invite guild: {}, invitee: {})", GetName(), pchInvitee->GetName() );
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -2049,7 +2047,7 @@ void CGuild::InviteAccept( LPCHARACTER pchInvitee )
|
|||
case GERR_GUILD_IS_IN_WAR : pchInvitee->ChatPacket( CHAT_TYPE_INFO, LC_TEXT("<길드> 현재 길드가 전쟁 중 입니다.") ); return;
|
||||
case GERR_INVITE_LIMIT : pchInvitee->ChatPacket( CHAT_TYPE_INFO, LC_TEXT("<길드> 현재 신규 가입 제한 상태 입니다.") ); return;
|
||||
|
||||
default: sys_err( "ignore guild join error(%d)", errcode ); return;
|
||||
default: SPDLOG_ERROR("ignore guild join error({})", (int) errcode); return;
|
||||
}
|
||||
|
||||
RequestAddMember( pchInvitee, 15 );
|
||||
|
@ -2060,7 +2058,7 @@ void CGuild::InviteDeny( DWORD dwPID )
|
|||
EventMap::iterator itFind = m_GuildInviteEventMap.find( dwPID );
|
||||
if ( itFind == m_GuildInviteEventMap.end() )
|
||||
{
|
||||
sys_log( 0, "GuildInviteDeny from not invited character(invite guild: %s, invitee PID: %d)", GetName(), dwPID );
|
||||
SPDLOG_DEBUG("GuildInviteDeny from not invited character(invite guild: {}, invitee PID: {})", GetName(), dwPID );
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -2080,7 +2078,7 @@ CGuild::GuildJoinErrCode CGuild::VerifyGuildJoinableCondition( const LPCHARACTER
|
|||
return GERR_ALREADYJOIN;
|
||||
else if ( GetMemberCount() >= GetMaxMemberCount() )
|
||||
{
|
||||
sys_log(1, "GuildName = %s, GetMemberCount() = %d, GetMaxMemberCount() = %d (32 + MAX(level(%d)-10, 0) * 2 + bonus(%d)",
|
||||
SPDLOG_DEBUG("GuildName = {}, GetMemberCount() = {}, GetMaxMemberCount() = {} (32 + MAX(level({})-10, 0) * 2 + bonus({})",
|
||||
GetName(), GetMemberCount(), GetMaxMemberCount(), m_data.level, m_iMemberCountBonus);
|
||||
return GERR_GUILDISFULL;
|
||||
}
|
||||
|
|
|
@ -197,11 +197,11 @@ CGuild* CGuildManager::FindGuildByName(const std::string guild_name)
|
|||
|
||||
void CGuildManager::Initialize()
|
||||
{
|
||||
sys_log(0, "Initializing Guild");
|
||||
SPDLOG_DEBUG("Initializing Guild");
|
||||
|
||||
if (g_bAuthServer)
|
||||
{
|
||||
sys_log(0, " No need for auth server");
|
||||
SPDLOG_DEBUG(" No need for auth server");
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -469,7 +469,7 @@ void CGuildManager::GetAroundRankString(DWORD dwMyGuild, char * buffer, size_t b
|
|||
/////////////////////////////////////////////////////////////////////
|
||||
void CGuildManager::RequestCancelWar(DWORD guild_id1, DWORD guild_id2)
|
||||
{
|
||||
sys_log(0, "RequestCancelWar %d %d", guild_id1, guild_id2);
|
||||
SPDLOG_DEBUG("RequestCancelWar {} {}", guild_id1, guild_id2);
|
||||
|
||||
TPacketGuildWar p;
|
||||
p.bWar = GUILD_WAR_CANCEL;
|
||||
|
@ -480,7 +480,7 @@ void CGuildManager::RequestCancelWar(DWORD guild_id1, DWORD guild_id2)
|
|||
|
||||
void CGuildManager::RequestEndWar(DWORD guild_id1, DWORD guild_id2)
|
||||
{
|
||||
sys_log(0, "RequestEndWar %d %d", guild_id1, guild_id2);
|
||||
SPDLOG_DEBUG("RequestEndWar {} {}", guild_id1, guild_id2);
|
||||
|
||||
TPacketGuildWar p;
|
||||
p.bWar = GUILD_WAR_END;
|
||||
|
@ -496,7 +496,7 @@ void CGuildManager::RequestWarOver(DWORD dwGuild1, DWORD dwGuild2, DWORD dwGuild
|
|||
|
||||
if (g1->GetGuildWarState(g2->GetID()) != GUILD_WAR_ON_WAR)
|
||||
{
|
||||
sys_log(0, "RequestWarOver : both guild was not in war %u %u", dwGuild1, dwGuild2);
|
||||
SPDLOG_DEBUG("RequestWarOver : both guild was not in war {} {}", dwGuild1, dwGuild2);
|
||||
RequestEndWar(dwGuild1, dwGuild2);
|
||||
return;
|
||||
}
|
||||
|
@ -521,7 +521,7 @@ void CGuildManager::RequestWarOver(DWORD dwGuild1, DWORD dwGuild2, DWORD dwGuild
|
|||
}
|
||||
|
||||
db_clientdesc->DBPacket(HEADER_GD_GUILD_WAR, 0, &p, sizeof(p));
|
||||
sys_log(0, "RequestWarOver : winner %u loser %u draw %u betprice %d", p.dwGuildFrom, p.dwGuildTo, p.bType, p.lWarPrice);
|
||||
SPDLOG_DEBUG("RequestWarOver : winner {} loser {} draw {} betprice {}", p.dwGuildFrom, p.dwGuildTo, p.bType, p.lWarPrice);
|
||||
}
|
||||
|
||||
void CGuildManager::DeclareWar(DWORD guild_id1, DWORD guild_id2, BYTE bType)
|
||||
|
@ -572,7 +572,7 @@ void CGuildManager::WaitStartWar(DWORD guild_id1, DWORD guild_id2)
|
|||
|
||||
if (!g1 || !g2)
|
||||
{
|
||||
sys_log(0, "GuildWar: CGuildManager::WaitStartWar(%d,%d) - something wrong in arg. there is no guild like that.", guild_id1, guild_id2);
|
||||
SPDLOG_DEBUG("GuildWar: CGuildManager::WaitStartWar({},{}) - something wrong in arg. there is no guild like that.", guild_id1, guild_id2);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -677,7 +677,7 @@ bool CGuildManager::EndWar(DWORD guild_id1, DWORD guild_id2)
|
|||
|
||||
if (m_GuildWar.end() == it)
|
||||
{
|
||||
sys_log(0, "EndWar(%d,%d) - EndWar request but guild is not in list", guild_id1, guild_id2);
|
||||
SPDLOG_DEBUG("EndWar({},{}) - EndWar request but guild is not in list", guild_id1, guild_id2);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -760,7 +760,7 @@ void CGuildManager::CancelWar(DWORD guild_id1, DWORD guild_id2)
|
|||
|
||||
void CGuildManager::ReserveWar(DWORD dwGuild1, DWORD dwGuild2, BYTE bType) // from DB
|
||||
{
|
||||
sys_log(0, "GuildManager::ReserveWar %u %u", dwGuild1, dwGuild2);
|
||||
SPDLOG_DEBUG("GuildManager::ReserveWar {} {}", dwGuild1, dwGuild2);
|
||||
|
||||
CGuild * g1 = FindGuild(dwGuild1);
|
||||
CGuild * g2 = FindGuild(dwGuild2);
|
||||
|
@ -822,7 +822,7 @@ void SendGuildWarScore(DWORD dwGuild, DWORD dwGuildOpp, int iDelta, int iBetScor
|
|||
p.lBetScore = iBetScoreDelta;
|
||||
|
||||
db_clientdesc->DBPacket(HEADER_GD_GUILD_WAR_SCORE, 0, &p, sizeof(TPacketGuildWarScore));
|
||||
sys_log(0, "SendGuildWarScore %u %u %d", dwGuild, dwGuildOpp, iDelta);
|
||||
SPDLOG_DEBUG("SendGuildWarScore {} {} {}", dwGuild, dwGuildOpp, iDelta);
|
||||
}
|
||||
|
||||
void CGuildManager::Kill(LPCHARACTER killer, LPCHARACTER victim)
|
||||
|
@ -885,7 +885,7 @@ void CGuildManager::ReserveWarAdd(TGuildWarReserve * p)
|
|||
|
||||
memcpy(&pkReserve->data, p, sizeof(TGuildWarReserve));
|
||||
|
||||
sys_log(0, "ReserveWarAdd %u gid1 %u power %d gid2 %u power %d handicap %d",
|
||||
SPDLOG_DEBUG("ReserveWarAdd {} gid1 {} power {} gid2 {} power {} handicap {}",
|
||||
pkReserve->data.dwID, p->dwGuildFrom, p->lPowerFrom, p->dwGuildTo, p->lPowerTo, p->lHandicap);
|
||||
}
|
||||
|
||||
|
@ -911,7 +911,7 @@ bool CGuildManager::IsBet(DWORD dwID, const char * c_pszLogin)
|
|||
|
||||
void CGuildManager::ReserveWarDelete(DWORD dwID)
|
||||
{
|
||||
sys_log(0, "ReserveWarDelete %u", dwID);
|
||||
SPDLOG_DEBUG("ReserveWarDelete {}", dwID);
|
||||
itertype(m_map_kReserveWar) it = m_map_kReserveWar.find(dwID);
|
||||
|
||||
if (it == m_map_kReserveWar.end())
|
||||
|
|
|
@ -180,7 +180,7 @@ void CGuild::SetWarScoreAgainstTo(DWORD dwOppGID, int iScore)
|
|||
{
|
||||
DWORD dwSelfGID = GetID();
|
||||
|
||||
sys_log(0, "GuildWarScore Set %u from %u %d", dwSelfGID, dwOppGID, iScore);
|
||||
SPDLOG_DEBUG("GuildWarScore Set {} from {} {}", dwSelfGID, dwOppGID, iScore);
|
||||
itertype(m_EnemyGuild) it = m_EnemyGuild.find(dwOppGID);
|
||||
|
||||
if (it != m_EnemyGuild.end())
|
||||
|
@ -226,11 +226,11 @@ int CGuild::GetWarScoreAgainstTo(DWORD dwOppGID)
|
|||
|
||||
if (it != m_EnemyGuild.end())
|
||||
{
|
||||
sys_log(0, "GuildWarScore Get %u from %u %d", GetID(), dwOppGID, it->second.score);
|
||||
SPDLOG_DEBUG("GuildWarScore Get {} from {} {}", GetID(), dwOppGID, it->second.score);
|
||||
return it->second.score;
|
||||
}
|
||||
|
||||
sys_log(0, "GuildWarScore Get %u from %u No data", GetID(), dwOppGID);
|
||||
SPDLOG_DEBUG("GuildWarScore Get {} from {} No data", GetID(), dwOppGID);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -294,13 +294,13 @@ void CGuild::RequestDeclareWar(DWORD dwOppGID, BYTE type)
|
|||
{
|
||||
if (dwOppGID == GetID())
|
||||
{
|
||||
sys_log(0, "GuildWar.DeclareWar.DECLARE_WAR_SELF id(%d -> %d), type(%d)", GetID(), dwOppGID, type);
|
||||
SPDLOG_ERROR("GuildWar.DeclareWar.DECLARE_WAR_SELF id({} -> {}), type({})", GetID(), dwOppGID, type);
|
||||
return;
|
||||
}
|
||||
|
||||
if (type >= GUILD_WAR_TYPE_MAX_NUM)
|
||||
{
|
||||
sys_log(0, "GuildWar.DeclareWar.UNKNOWN_WAR_TYPE id(%d -> %d), type(%d)", GetID(), dwOppGID, type);
|
||||
SPDLOG_ERROR("GuildWar.DeclareWar.UNKNOWN_WAR_TYPE id({} -> {}), type({})", GetID(), dwOppGID, type);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -309,7 +309,7 @@ void CGuild::RequestDeclareWar(DWORD dwOppGID, BYTE type)
|
|||
{
|
||||
if (!GuildWar_IsWarMap(type))
|
||||
{
|
||||
sys_err("GuildWar.DeclareWar.NOT_EXIST_MAP id(%d -> %d), type(%d), map(%d)",
|
||||
SPDLOG_ERROR("GuildWar.DeclareWar.NOT_EXIST_MAP id({} -> {}), type({}), map({})",
|
||||
GetID(), dwOppGID, type, GuildWar_GetTypeMapIndex(type));
|
||||
|
||||
map_allow_log();
|
||||
|
@ -324,7 +324,7 @@ void CGuild::RequestDeclareWar(DWORD dwOppGID, BYTE type)
|
|||
p.dwGuildFrom = GetID();
|
||||
p.dwGuildTo = dwOppGID;
|
||||
db_clientdesc->DBPacket(HEADER_GD_GUILD_WAR, 0, &p, sizeof(p));
|
||||
sys_log(0, "GuildWar.DeclareWar id(%d -> %d), type(%d)", GetID(), dwOppGID, type);
|
||||
SPDLOG_DEBUG("GuildWar.DeclareWar id({} -> {}), type({})", GetID(), dwOppGID, type);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -343,13 +343,13 @@ void CGuild::RequestDeclareWar(DWORD dwOppGID, BYTE type)
|
|||
p.dwGuildFrom = GetID();
|
||||
p.dwGuildTo = dwOppGID;
|
||||
db_clientdesc->DBPacket(HEADER_GD_GUILD_WAR, 0, &p, sizeof(p));
|
||||
sys_log(0, "GuildWar.AcceptWar id(%d -> %d), type(%d)", GetID(), dwOppGID, saved_type);
|
||||
SPDLOG_DEBUG("GuildWar.AcceptWar id({} -> {}), type({})", GetID(), dwOppGID, saved_type);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!GuildWar_IsWarMap(saved_type))
|
||||
{
|
||||
sys_err("GuildWar.AcceptWar.NOT_EXIST_MAP id(%d -> %d), type(%d), map(%d)",
|
||||
SPDLOG_ERROR("GuildWar.AcceptWar.NOT_EXIST_MAP id({} -> {}), type({}), map({})",
|
||||
GetID(), dwOppGID, type, GuildWar_GetTypeMapIndex(type));
|
||||
|
||||
map_allow_log();
|
||||
|
@ -372,7 +372,7 @@ void CGuild::RequestDeclareWar(DWORD dwOppGID, BYTE type)
|
|||
|
||||
db_clientdesc->DBPacket(HEADER_GD_GUILD_WAR, 0, &p, sizeof(p));
|
||||
|
||||
sys_log(0, "GuildWar.WaitStartSendToDB id(%d vs %d), type(%d), bet(%d), map_index(%d)",
|
||||
SPDLOG_DEBUG("GuildWar.WaitStartSendToDB id({} vs {}), type({}), bet({}), map_index({})",
|
||||
GetID(), dwOppGID, saved_type, guildWarInfo.iWarPrice, guildWarInfo.lMapIndex);
|
||||
|
||||
}
|
||||
|
@ -383,7 +383,7 @@ void CGuild::RequestDeclareWar(DWORD dwOppGID, BYTE type)
|
|||
}
|
||||
break;
|
||||
default:
|
||||
sys_err("GuildWar.DeclareWar.UNKNOWN_STATE[%d]: id(%d vs %d), type(%d), guild(%s:%u)",
|
||||
SPDLOG_ERROR("GuildWar.DeclareWar.UNKNOWN_STATE[{}]: id({} vs {}), type({}), guild({}:{})",
|
||||
it->second.state, GetID(), dwOppGID, type, GetName(), GetID());
|
||||
break;
|
||||
}
|
||||
|
@ -444,7 +444,7 @@ bool CGuild::WaitStartWar(DWORD dwOppGID)
|
|||
//자기자신이면
|
||||
if (dwOppGID == GetID())
|
||||
{
|
||||
sys_log(0 ,"GuildWar.WaitStartWar.DECLARE_WAR_SELF id(%u -> %u)", GetID(), dwOppGID);
|
||||
SPDLOG_ERROR("GuildWar.WaitStartWar.DECLARE_WAR_SELF id({} -> {})", GetID(), dwOppGID);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -452,7 +452,7 @@ bool CGuild::WaitStartWar(DWORD dwOppGID)
|
|||
itertype(m_EnemyGuild) it = m_EnemyGuild.find(dwOppGID);
|
||||
if (it == m_EnemyGuild.end())
|
||||
{
|
||||
sys_log(0 ,"GuildWar.WaitStartWar.UNKNOWN_ENEMY id(%u -> %u)", GetID(), dwOppGID);
|
||||
SPDLOG_ERROR("GuildWar.WaitStartWar.UNKNOWN_ENEMY id({} -> {})", GetID(), dwOppGID);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -461,7 +461,7 @@ bool CGuild::WaitStartWar(DWORD dwOppGID)
|
|||
|
||||
if (gw.state == GUILD_WAR_WAIT_START)
|
||||
{
|
||||
sys_log(0 ,"GuildWar.WaitStartWar.UNKNOWN_STATE id(%u -> %u), state(%d)", GetID(), dwOppGID, gw.state);
|
||||
SPDLOG_ERROR("GuildWar.WaitStartWar.UNKNOWN_STATE id({} -> {}), state({})", GetID(), dwOppGID, gw.state);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -472,7 +472,7 @@ bool CGuild::WaitStartWar(DWORD dwOppGID)
|
|||
CGuild* g = CGuildManager::instance().FindGuild(dwOppGID);
|
||||
if (!g)
|
||||
{
|
||||
sys_log(0 ,"GuildWar.WaitStartWar.NOT_EXIST_GUILD id(%u -> %u)", GetID(), dwOppGID);
|
||||
SPDLOG_ERROR("GuildWar.WaitStartWar.NOT_EXIST_GUILD id({} -> {})", GetID(), dwOppGID);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -484,17 +484,17 @@ bool CGuild::WaitStartWar(DWORD dwOppGID)
|
|||
// 필드형이면 맵생성 안함
|
||||
if (gw.type == GUILD_WAR_TYPE_FIELD)
|
||||
{
|
||||
sys_log(0 ,"GuildWar.WaitStartWar.FIELD_TYPE id(%u -> %u)", GetID(), dwOppGID);
|
||||
SPDLOG_DEBUG("GuildWar.WaitStartWar.FIELD_TYPE id({} -> {})", GetID(), dwOppGID);
|
||||
return true;
|
||||
}
|
||||
|
||||
// 전쟁 서버 인지 확인
|
||||
sys_log(0 ,"GuildWar.WaitStartWar.CheckWarServer id(%u -> %u), type(%d), map(%d)",
|
||||
SPDLOG_DEBUG("GuildWar.WaitStartWar.CheckWarServer id({} -> {}), type({}), map({})",
|
||||
GetID(), dwOppGID, gw.type, rkGuildWarInfo.lMapIndex);
|
||||
|
||||
if (!map_allow_find(rkGuildWarInfo.lMapIndex))
|
||||
{
|
||||
sys_log(0 ,"GuildWar.WaitStartWar.SKIP_WAR_MAP id(%u -> %u)", GetID(), dwOppGID);
|
||||
SPDLOG_DEBUG("GuildWar.WaitStartWar.SKIP_WAR_MAP id({} -> {})", GetID(), dwOppGID);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -509,12 +509,12 @@ bool CGuild::WaitStartWar(DWORD dwOppGID)
|
|||
DWORD lMapIndex = CWarMapManager::instance().CreateWarMap(rkGuildWarInfo, id1, id2);
|
||||
if (!lMapIndex)
|
||||
{
|
||||
sys_err("GuildWar.WaitStartWar.CREATE_WARMAP_ERROR id(%u vs %u), type(%u), map(%d)", id1, id2, gw.type, rkGuildWarInfo.lMapIndex);
|
||||
SPDLOG_ERROR("GuildWar.WaitStartWar.CREATE_WARMAP_ERROR id({} vs {}), type({}), map({})", id1, id2, gw.type, rkGuildWarInfo.lMapIndex);
|
||||
CGuildManager::instance().RequestEndWar(GetID(), dwOppGID);
|
||||
return false;
|
||||
}
|
||||
|
||||
sys_log(0, "GuildWar.WaitStartWar.CreateMap id(%u vs %u), type(%u), map(%d) -> map_inst(%u)", id1, id2, gw.type, rkGuildWarInfo.lMapIndex, lMapIndex);
|
||||
SPDLOG_DEBUG("GuildWar.WaitStartWar.CreateMap id({} vs {}), type({}), map({}) -> map_inst({})", id1, id2, gw.type, rkGuildWarInfo.lMapIndex, lMapIndex);
|
||||
|
||||
//길드전 정보에 맵인덱스를 세팅
|
||||
gw.map_index = lMapIndex;
|
||||
|
@ -588,7 +588,7 @@ void CGuild::ReserveWar(DWORD dwOppGID, BYTE type)
|
|||
else
|
||||
it->second.state = GUILD_WAR_RESERVE;
|
||||
|
||||
sys_log(0, "Guild::ReserveWar %u", dwOppGID);
|
||||
SPDLOG_DEBUG("Guild::ReserveWar {}", dwOppGID);
|
||||
}
|
||||
|
||||
void CGuild::EndWar(DWORD dwOppGID)
|
||||
|
@ -634,7 +634,7 @@ void CGuild::SetGuildWarMapIndex(DWORD dwOppGID, int lMapIndex)
|
|||
return;
|
||||
|
||||
it->second.map_index = lMapIndex;
|
||||
sys_log(0, "GuildWar.SetGuildWarMapIndex id(%d -> %d), map(%d)", GetID(), dwOppGID, lMapIndex);
|
||||
SPDLOG_DEBUG("GuildWar.SetGuildWarMapIndex id({} -> {}), map({})", GetID(), dwOppGID, lMapIndex);
|
||||
}
|
||||
|
||||
void CGuild::GuildWarEntryAccept(DWORD dwOppGID, LPCHARACTER ch)
|
||||
|
@ -675,27 +675,27 @@ void CGuild::GuildWarEntryAsk(DWORD dwOppGID)
|
|||
itertype(m_EnemyGuild) git = m_EnemyGuild.find(dwOppGID);
|
||||
if (git == m_EnemyGuild.end())
|
||||
{
|
||||
sys_err("GuildWar.GuildWarEntryAsk.UNKNOWN_ENEMY(%d)", dwOppGID);
|
||||
SPDLOG_ERROR("GuildWar.GuildWarEntryAsk.UNKNOWN_ENEMY({})", dwOppGID);
|
||||
return;
|
||||
}
|
||||
|
||||
TGuildWar & gw(git->second);
|
||||
|
||||
sys_log(0, "GuildWar.GuildWarEntryAsk id(%d vs %d), map(%d)", GetID(), dwOppGID, gw.map_index);
|
||||
SPDLOG_DEBUG("GuildWar.GuildWarEntryAsk id({} vs {}), map({})", GetID(), dwOppGID, gw.map_index);
|
||||
if (!gw.map_index)
|
||||
{
|
||||
sys_err("GuildWar.GuildWarEntryAsk.NOT_EXIST_MAP id(%d vs %d)", GetID(), dwOppGID);
|
||||
SPDLOG_ERROR("GuildWar.GuildWarEntryAsk.NOT_EXIST_MAP id({} vs {})", GetID(), dwOppGID);
|
||||
return;
|
||||
}
|
||||
|
||||
PIXEL_POSITION pos;
|
||||
if (!CWarMapManager::instance().GetStartPosition(gw.map_index, GetID() < dwOppGID ? 0 : 1, pos))
|
||||
{
|
||||
sys_err("GuildWar.GuildWarEntryAsk.START_POSITION_ERROR id(%d vs %d), pos(%d, %d)", GetID(), dwOppGID, pos.x, pos.y);
|
||||
SPDLOG_ERROR("GuildWar.GuildWarEntryAsk.START_POSITION_ERROR id({} vs {}), pos({}, {})", GetID(), dwOppGID, pos.x, pos.y);
|
||||
return;
|
||||
}
|
||||
|
||||
sys_log(0, "GuildWar.GuildWarEntryAsk.OnlineMemberCount(%d)", m_memberOnline.size());
|
||||
SPDLOG_DEBUG("GuildWar.GuildWarEntryAsk.OnlineMemberCount({})", m_memberOnline.size());
|
||||
|
||||
itertype(m_memberOnline) it = m_memberOnline.begin();
|
||||
|
||||
|
@ -707,12 +707,12 @@ void CGuild::GuildWarEntryAsk(DWORD dwOppGID)
|
|||
unsigned int questIndex=CQuestManager::instance().GetQuestIndexByName("guild_war_join");
|
||||
if (questIndex)
|
||||
{
|
||||
sys_log(0, "GuildWar.GuildWarEntryAsk.SendLetterToMember pid(%d), qid(%d)", ch->GetPlayerID(), questIndex);
|
||||
SPDLOG_DEBUG("GuildWar.GuildWarEntryAsk.SendLetterToMember pid({}), qid({})", ch->GetPlayerID(), questIndex);
|
||||
CQuestManager::instance().Letter(ch->GetPlayerID(), questIndex, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
sys_err("GuildWar.GuildWarEntryAsk.SendLetterToMember.QUEST_ERROR pid(%d), quest_name('guild_war_join.quest')",
|
||||
SPDLOG_ERROR("GuildWar.GuildWarEntryAsk.SendLetterToMember.QUEST_ERROR pid({}), quest_name('guild_war_join.quest')",
|
||||
ch->GetPlayerID(), questIndex);
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -223,7 +223,7 @@ EVENTFUNC(horse_stamina_consume_event)
|
|||
|
||||
if ( info == NULL )
|
||||
{
|
||||
sys_err( "horse_stamina_consume_event> <Factor> Null pointer" );
|
||||
SPDLOG_ERROR("horse_stamina_consume_event> <Factor> Null pointer" );
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -247,7 +247,7 @@ EVENTFUNC(horse_stamina_consume_event)
|
|||
}
|
||||
|
||||
hr->CheckHorseHealthDropTime();
|
||||
sys_log(0, "HORSE STAMINA - %p", get_pointer(event));
|
||||
SPDLOG_DEBUG("HORSE STAMINA - {}", (void*) get_pointer(event));
|
||||
return delta;
|
||||
}
|
||||
|
||||
|
@ -257,7 +257,7 @@ EVENTFUNC(horse_stamina_regen_event)
|
|||
|
||||
if ( info == NULL )
|
||||
{
|
||||
sys_err( "horse_stamina_regen_event> <Factor> Null pointer" );
|
||||
SPDLOG_ERROR("horse_stamina_regen_event> <Factor> Null pointer" );
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -278,7 +278,7 @@ EVENTFUNC(horse_stamina_regen_event)
|
|||
}
|
||||
|
||||
hr->CheckHorseHealthDropTime();
|
||||
sys_log(0, "HORSE STAMINA + %p", get_pointer(event));
|
||||
SPDLOG_DEBUG("HORSE STAMINA + {}", (void*) get_pointer(event));
|
||||
|
||||
|
||||
return delta;
|
||||
|
@ -292,7 +292,7 @@ void CHorseRider::StartStaminaConsumeEvent()
|
|||
if (GetHorseHealth() <= 0)
|
||||
return;
|
||||
|
||||
sys_log(0,"HORSE STAMINA REGEN EVENT CANCEL %p", get_pointer(m_eventStaminaRegen));
|
||||
SPDLOG_DEBUG("HORSE STAMINA REGEN EVENT CANCEL {}", (void*) get_pointer(m_eventStaminaRegen));
|
||||
event_cancel(&m_eventStaminaRegen);
|
||||
|
||||
if (m_eventStaminaConsume)
|
||||
|
@ -302,7 +302,7 @@ void CHorseRider::StartStaminaConsumeEvent()
|
|||
|
||||
info->hr = this;
|
||||
m_eventStaminaConsume = event_create(horse_stamina_consume_event, info, PASSES_PER_SEC(HORSE_STAMINA_CONSUME_INTERVAL));
|
||||
sys_log(0,"HORSE STAMINA CONSUME EVENT CREATE %p", get_pointer(m_eventStaminaConsume));
|
||||
SPDLOG_DEBUG("HORSE STAMINA CONSUME EVENT CREATE {}", (void*) get_pointer(m_eventStaminaConsume));
|
||||
}
|
||||
|
||||
void CHorseRider::StartStaminaRegenEvent()
|
||||
|
@ -313,7 +313,7 @@ void CHorseRider::StartStaminaRegenEvent()
|
|||
if (GetHorseHealth() <= 0)
|
||||
return;
|
||||
|
||||
sys_log(0,"HORSE STAMINA CONSUME EVENT CANCEL %p", get_pointer(m_eventStaminaConsume));
|
||||
SPDLOG_DEBUG("HORSE STAMINA CONSUME EVENT CANCEL {}", (void*) get_pointer(m_eventStaminaConsume));
|
||||
event_cancel(&m_eventStaminaConsume);
|
||||
|
||||
if (m_eventStaminaRegen)
|
||||
|
@ -323,7 +323,7 @@ void CHorseRider::StartStaminaRegenEvent()
|
|||
|
||||
info->hr = this;
|
||||
m_eventStaminaRegen = event_create(horse_stamina_regen_event, info, PASSES_PER_SEC(HORSE_STAMINA_REGEN_INTERVAL));
|
||||
sys_log(0,"HORSE STAMINA REGEN EVENT CREATE %p", get_pointer(m_eventStaminaRegen));
|
||||
SPDLOG_DEBUG("HORSE STAMINA REGEN EVENT CREATE {}", (void*) get_pointer(m_eventStaminaRegen));
|
||||
}
|
||||
|
||||
// Health
|
||||
|
@ -358,7 +358,7 @@ void CHorseRider::UpdateHorseHealth(int iHealth, bool bSend)
|
|||
|
||||
void CHorseRider::HorseDie()
|
||||
{
|
||||
sys_log(0, "HORSE DIE %p %p", get_pointer(m_eventStaminaRegen), get_pointer(m_eventStaminaConsume));
|
||||
SPDLOG_DEBUG("HORSE DIE {} {}", (void*) get_pointer(m_eventStaminaRegen), (void*) get_pointer(m_eventStaminaConsume));
|
||||
UpdateHorseStamina(-m_Horse.sStamina);
|
||||
event_cancel(&m_eventStaminaRegen);
|
||||
event_cancel(&m_eventStaminaConsume);
|
||||
|
|
|
@ -32,11 +32,11 @@ void CHorseNameManager::UpdateHorseName(DWORD dwPlayerID, const char* szHorseNam
|
|||
{
|
||||
if ( szHorseName == NULL )
|
||||
{
|
||||
sys_err("HORSE_NAME: NULL NAME (%u)", dwPlayerID);
|
||||
SPDLOG_ERROR("HORSE_NAME: NULL NAME ({})", dwPlayerID);
|
||||
szHorseName = "";
|
||||
}
|
||||
|
||||
sys_log(0, "HORSENAME: update %u %s", dwPlayerID, szHorseName);
|
||||
SPDLOG_DEBUG("HORSENAME: update {} {}", dwPlayerID, szHorseName);
|
||||
|
||||
m_mapHorseNames[dwPlayerID] = szHorseName;
|
||||
|
||||
|
|
|
@ -16,7 +16,6 @@
|
|||
#include "TrafficProfiler.h"
|
||||
#include "priv_manager.h"
|
||||
#include "castle.h"
|
||||
#include "dev_log.h"
|
||||
|
||||
extern time_t get_global_time();
|
||||
|
||||
|
@ -64,7 +63,7 @@ bool CInputProcessor::Process(LPDESC lpDesc, const void * c_pvOrig, int iBytes,
|
|||
|
||||
if (!m_pPacketInfo)
|
||||
{
|
||||
sys_err("No packet info has been binded to");
|
||||
SPDLOG_ERROR("No packet info has been binded to");
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -77,7 +76,7 @@ bool CInputProcessor::Process(LPDESC lpDesc, const void * c_pvOrig, int iBytes,
|
|||
iPacketLen = 1;
|
||||
else if (!m_pPacketInfo->Get(bHeader, &iPacketLen, &c_pszName))
|
||||
{
|
||||
sys_err("UNKNOWN HEADER: %d, LAST HEADER: %d(%d), REMAIN BYTES: %d",
|
||||
SPDLOG_ERROR("UNKNOWN HEADER: {}, LAST HEADER: {}({}), REMAIN BYTES: {}",
|
||||
bHeader, bLastHeader, iLastPacketLen, m_iBufferLeft);
|
||||
//printdata((BYTE *) c_pvOrig, m_iBufferLeft);
|
||||
lpDesc->SetPhase(PHASE_CLOSE);
|
||||
|
@ -89,9 +88,6 @@ bool CInputProcessor::Process(LPDESC lpDesc, const void * c_pvOrig, int iBytes,
|
|||
|
||||
if (bHeader)
|
||||
{
|
||||
if (test_server && bHeader != HEADER_CG_MOVE)
|
||||
sys_log(0, "Packet Analyze [Header %d][bufferLeft %d] ", bHeader, m_iBufferLeft);
|
||||
|
||||
m_pPacketInfo->Start();
|
||||
|
||||
int iExtraPacketSize = Analyze(lpDesc, bHeader, c_pData);
|
||||
|
@ -100,7 +96,6 @@ bool CInputProcessor::Process(LPDESC lpDesc, const void * c_pvOrig, int iBytes,
|
|||
return true;
|
||||
|
||||
iPacketLen += iExtraPacketSize;
|
||||
lpDesc->Log("%s %d", c_pszName, iPacketLen);
|
||||
m_pPacketInfo->End();
|
||||
}
|
||||
|
||||
|
@ -110,7 +105,7 @@ bool CInputProcessor::Process(LPDESC lpDesc, const void * c_pvOrig, int iBytes,
|
|||
// END_OF_TRAFFIC_PROFILER
|
||||
|
||||
if (bHeader == HEADER_CG_PONG)
|
||||
sys_log(0, "PONG! %u %u", m_pPacketInfo->IsSequence(bHeader), *(BYTE *) (c_pData + iPacketLen - sizeof(BYTE)));
|
||||
SPDLOG_TRACE("PONG! {} {}", m_pPacketInfo->IsSequence(bHeader), *(BYTE *) (c_pData + iPacketLen - sizeof(BYTE)));
|
||||
|
||||
if (m_pPacketInfo->IsSequence(bHeader))
|
||||
{
|
||||
|
@ -119,7 +114,7 @@ bool CInputProcessor::Process(LPDESC lpDesc, const void * c_pvOrig, int iBytes,
|
|||
|
||||
if (bSeq != bSeqReceived)
|
||||
{
|
||||
sys_err("SEQUENCE %x mismatch 0x%x != 0x%x header %u", get_pointer(lpDesc), bSeq, bSeqReceived, bHeader);
|
||||
SPDLOG_ERROR("SEQUENCE {} mismatch {:#x} != {:#x} header {}", (void*) get_pointer(lpDesc), bSeq, bSeqReceived, bHeader);
|
||||
|
||||
LPCHARACTER ch = lpDesc->GetCharacter();
|
||||
|
||||
|
@ -144,7 +139,7 @@ bool CInputProcessor::Process(LPDESC lpDesc, const void * c_pvOrig, int iBytes,
|
|||
}
|
||||
|
||||
snprintf(buf + offset, sizeof(buf) - offset, "\t[%03d : 0x%x]\n", bHeader, bSeq);
|
||||
sys_err("%s", buf);
|
||||
SPDLOG_ERROR("{}", buf);
|
||||
|
||||
lpDesc->SetPhase(PHASE_CLOSE);
|
||||
return true;
|
||||
|
@ -153,7 +148,7 @@ bool CInputProcessor::Process(LPDESC lpDesc, const void * c_pvOrig, int iBytes,
|
|||
{
|
||||
lpDesc->push_seq(bHeader, bSeq);
|
||||
lpDesc->SetNextSequence();
|
||||
sys_err("SEQUENCE %x match %u next %u header %u", lpDesc, bSeq, lpDesc->GetSequence(), bHeader);
|
||||
SPDLOG_TRACE("SEQUENCE {} match {} next {} header {}", (void*) lpDesc, bSeq, lpDesc->GetSequence(), bHeader);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -182,7 +177,7 @@ void CInputProcessor::Handshake(LPDESC d, const char * c_pData)
|
|||
|
||||
if (d->GetHandshake() != p->dwHandshake)
|
||||
{
|
||||
sys_err("Invalid Handshake");
|
||||
SPDLOG_ERROR("Invalid Handshake");
|
||||
d->SetPhase(PHASE_CLOSE);
|
||||
}
|
||||
else
|
||||
|
@ -208,7 +203,7 @@ void CInputProcessor::Version(LPCHARACTER ch, const char* c_pData)
|
|||
return;
|
||||
|
||||
TPacketCGClientVersion * p = (TPacketCGClientVersion *) c_pData;
|
||||
sys_log(0, "VERSION: %s %s %s", ch->GetName(), p->timestamp, p->filename);
|
||||
SPDLOG_DEBUG("VERSION: {} {} {}", ch->GetName(), p->timestamp, p->filename);
|
||||
ch->GetDesc()->SetClientVersion(p->timestamp);
|
||||
}
|
||||
|
||||
|
@ -272,7 +267,7 @@ int CInputHandshake::Analyze(LPDESC d, BYTE bHeader, const char * c_pData)
|
|||
std::string stBuf;
|
||||
stBuf.assign(c_pData, 0, c_pSep - c_pData);
|
||||
|
||||
sys_log(0, "SOCKET_CMD: FROM(%s) CMD(%s)", d->GetHostName(), stBuf.c_str());
|
||||
SPDLOG_DEBUG("SOCKET_CMD: FROM({}) CMD({})", d->GetHostName(), stBuf.c_str());
|
||||
|
||||
if (!stBuf.compare("IS_SERVER_UP"))
|
||||
{
|
||||
|
@ -366,7 +361,6 @@ int CInputHandshake::Analyze(LPDESC d, BYTE bHeader, const char * c_pData)
|
|||
TPacketDeleteAwardID p;
|
||||
p.dwID = (DWORD)(atoi(msg.c_str()));
|
||||
snprintf(szTmp,sizeof(szTmp),"Sent to DB cache to delete ItemAward, id: %d",p.dwID);
|
||||
//sys_log(0,"%d",p.dwID);
|
||||
// strlcpy(p.login, msg.c_str(), sizeof(p.login));
|
||||
db_clientdesc->DBPacket(HEADER_GD_DELETE_AWARDID, 0, &p, sizeof(p));
|
||||
stResult += szTmp;
|
||||
|
@ -390,20 +384,20 @@ int CInputHandshake::Analyze(LPDESC d, BYTE bHeader, const char * c_pData)
|
|||
TPacketGGShutdown p;
|
||||
p.bHeader = HEADER_GG_SHUTDOWN;
|
||||
P2P_MANAGER::instance().Send(&p, sizeof(TPacketGGShutdown));
|
||||
sys_err("Accept shutdown command from %s.", d->GetHostName());
|
||||
SPDLOG_ERROR("Accept shutdown command from {}.", d->GetHostName());
|
||||
Shutdown(10);
|
||||
}
|
||||
else if (!stBuf.compare("SHUTDOWN_ONLY"))
|
||||
{
|
||||
LogManager::instance().CharLog(0, 0, 0, 2, "SHUTDOWN", "", d->GetHostName());
|
||||
sys_err("Accept shutdown only command from %s.", d->GetHostName());
|
||||
SPDLOG_ERROR("Accept shutdown only command from {}.", d->GetHostName());
|
||||
Shutdown(10);
|
||||
}
|
||||
else if (!stBuf.compare(0, 3, "DC "))
|
||||
{
|
||||
std::string msg = stBuf.substr(3, LOGIN_MAX_LEN);
|
||||
|
||||
dev_log(LOG_DEB0, "DC : '%s'", msg.c_str());
|
||||
SPDLOG_TRACE("DC : '{}'", msg.c_str());
|
||||
|
||||
TPacketGGDisconnect pgg;
|
||||
|
||||
|
@ -471,7 +465,7 @@ dev_log(LOG_DEB0, "DC : '%s'", msg.c_str());
|
|||
|
||||
case 'a':
|
||||
db_clientdesc->DBPacket(HEADER_GD_RELOAD_ADMIN, 0, NULL, 0);
|
||||
sys_log(0, "Reloading admin infomation.");
|
||||
SPDLOG_INFO("Reloading admin infomation.");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -485,7 +479,7 @@ dev_log(LOG_DEB0, "DC : '%s'", msg.c_str());
|
|||
|
||||
if (!is.fail())
|
||||
{
|
||||
sys_log(0, "EXTERNAL EVENT FLAG name %s value %d", strFlagName.c_str(), lValue);
|
||||
SPDLOG_DEBUG("EXTERNAL EVENT FLAG name {} value {}", strFlagName.c_str(), lValue);
|
||||
quest::CQuestManager::instance().RequestSetEventFlag(strFlagName, lValue);
|
||||
stResult = "EVENT FLAG CHANGE ";
|
||||
stResult += strFlagName;
|
||||
|
@ -505,7 +499,7 @@ dev_log(LOG_DEB0, "DC : '%s'", msg.c_str());
|
|||
|
||||
if (!is.fail())
|
||||
{
|
||||
sys_log(0, "EXTERNAL BLOCK_CHAT name %s duration %d", strCharName.c_str(), lDuration);
|
||||
SPDLOG_DEBUG("EXTERNAL BLOCK_CHAT name {} duration {}", strCharName.c_str(), lDuration);
|
||||
|
||||
do_block_chat(NULL, const_cast<char*>(stBuf.c_str() + 11), 0, 0);
|
||||
|
||||
|
@ -543,7 +537,7 @@ dev_log(LOG_DEB0, "DC : '%s'", msg.c_str());
|
|||
// 시간 단위로 변경
|
||||
duration = duration * (60 * 60);
|
||||
|
||||
sys_log(0, "_give_empire_privileage(empire=%d, type=%d, value=%d, duration=%d) by web",
|
||||
SPDLOG_DEBUG("_give_empire_privileage(empire={}, type={}, value={}, duration={}) by web",
|
||||
empire, type, value, duration);
|
||||
CPrivManager::instance().RequestGiveEmpirePriv(empire, type, value, duration);
|
||||
}
|
||||
|
@ -559,14 +553,14 @@ dev_log(LOG_DEB0, "DC : '%s'", msg.c_str());
|
|||
|
||||
is >> dummy_string >> cmd >> login_string;
|
||||
|
||||
sys_log(0, "block_exception %s:%d", login_string.c_str(), cmd);
|
||||
SPDLOG_DEBUG("block_exception {}:{}", login_string.c_str(), cmd);
|
||||
DBManager::instance().RequestBlockException(login_string.c_str(), cmd);
|
||||
stResult = "BLOCK_EXCEPTION_YES";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
sys_log(1, "TEXT %s RESULT %s", stBuf.c_str(), stResult.c_str());
|
||||
SPDLOG_DEBUG("TEXT {} RESULT {}", stBuf.c_str(), stResult.c_str());
|
||||
stResult += "\n";
|
||||
d->Packet(stResult.c_str(), stResult.length());
|
||||
return (c_pSep - c_pData) + 1;
|
||||
|
@ -576,13 +570,13 @@ dev_log(LOG_DEB0, "DC : '%s'", msg.c_str());
|
|||
if (!guild_mark_server)
|
||||
{
|
||||
// 끊어버려! - 마크 서버가 아닌데 마크를 요청하려고?
|
||||
sys_err("Guild Mark login requested but i'm not a mark server!");
|
||||
SPDLOG_ERROR("Guild Mark login requested but i'm not a mark server!");
|
||||
d->SetPhase(PHASE_CLOSE);
|
||||
return 0;
|
||||
}
|
||||
|
||||
// 무조건 인증 --;
|
||||
sys_log(0, "MARK_SERVER: Login");
|
||||
SPDLOG_DEBUG("MARK_SERVER: Login");
|
||||
d->SetPhase(PHASE_LOGIN);
|
||||
return 0;
|
||||
}
|
||||
|
@ -599,7 +593,7 @@ dev_log(LOG_DEB0, "DC : '%s'", msg.c_str());
|
|||
else if (bHeader == HEADER_CG_HANDSHAKE)
|
||||
Handshake(d, c_pData);
|
||||
else
|
||||
sys_err("Handshake phase does not handle packet %d", bHeader);
|
||||
SPDLOG_ERROR("Handshake phase does not handle packet {}", bHeader);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -106,7 +106,7 @@ void CInputAuth::Login(LPDESC d, const char * c_pData)
|
|||
|
||||
if (!g_bAuthServer)
|
||||
{
|
||||
sys_err ("CInputAuth class is not for game server. IP %s might be a hacker.", d->GetHostName());
|
||||
SPDLOG_ERROR("CInputAuth class is not for game server. IP {} might be a hacker.", d->GetHostName());
|
||||
d->DelayedDisconnect(5);
|
||||
return;
|
||||
}
|
||||
|
@ -118,14 +118,14 @@ void CInputAuth::Login(LPDESC d, const char * c_pData)
|
|||
char passwd[PASSWD_MAX_LEN + 1];
|
||||
strlcpy(passwd, pinfo->passwd, sizeof(passwd));
|
||||
|
||||
sys_log(0, "InputAuth::Login : %s(%d) desc %p",
|
||||
login, strlen(login), get_pointer(d));
|
||||
SPDLOG_DEBUG("InputAuth::Login : {}({}) desc {}",
|
||||
login, strlen(login), (void*) get_pointer(d));
|
||||
|
||||
// check login string
|
||||
if (false == FN_IS_VALID_LOGIN_STRING(login))
|
||||
{
|
||||
sys_log(0, "InputAuth::Login : IS_NOT_VALID_LOGIN_STRING(%s) desc %p",
|
||||
login, get_pointer(d));
|
||||
SPDLOG_DEBUG("InputAuth::Login : IS_NOT_VALID_LOGIN_STRING({}) desc {}",
|
||||
login, (void*) get_pointer(d));
|
||||
LoginFailure(d, "NOID");
|
||||
return;
|
||||
}
|
||||
|
@ -151,7 +151,7 @@ void CInputAuth::Login(LPDESC d, const char * c_pData)
|
|||
DWORD dwPanamaKey = dwKey ^ pinfo->adwClientKey[0] ^ pinfo->adwClientKey[1] ^ pinfo->adwClientKey[2] ^ pinfo->adwClientKey[3];
|
||||
d->SetPanamaKey(dwPanamaKey);
|
||||
|
||||
sys_log(0, "InputAuth::Login : key %u:0x%x login %s", dwKey, dwPanamaKey, login);
|
||||
SPDLOG_DEBUG("InputAuth::Login : key {}:{} login {}", dwKey, dwPanamaKey, login);
|
||||
|
||||
TPacketCGLogin3 * p = M2_NEW TPacketCGLogin3;
|
||||
memcpy(p, pinfo, sizeof(TPacketCGLogin3));
|
||||
|
@ -165,7 +165,7 @@ void CInputAuth::Login(LPDESC d, const char * c_pData)
|
|||
// CHANNEL_SERVICE_LOGIN
|
||||
if (Login_IsInChannelService(szLogin))
|
||||
{
|
||||
sys_log(0, "ChannelServiceLogin [%s]", szLogin);
|
||||
SPDLOG_DEBUG("ChannelServiceLogin [{}]", szLogin);
|
||||
|
||||
DBManager::instance().ReturnQuery(QID_AUTH_LOGIN, dwKey, p,
|
||||
"SELECT '%s',password,securitycode,social_id,id,status,availDt - NOW() > 0,"
|
||||
|
@ -204,15 +204,14 @@ int CInputAuth::Analyze(LPDESC d, BYTE bHeader, const char * c_pData)
|
|||
|
||||
if (!g_bAuthServer)
|
||||
{
|
||||
sys_err ("CInputAuth class is not for game server. IP %s might be a hacker.", d->GetHostName());
|
||||
SPDLOG_ERROR("CInputAuth class is not for game server. IP {} might be a hacker.", d->GetHostName());
|
||||
d->DelayedDisconnect(5);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int iExtraLen = 0;
|
||||
|
||||
if (test_server)
|
||||
sys_log(0, " InputAuth Analyze Header[%d] ", bHeader);
|
||||
SPDLOG_TRACE(" InputAuth Analyze Header[{}] ", bHeader);
|
||||
|
||||
switch (bHeader)
|
||||
{
|
||||
|
@ -228,7 +227,7 @@ int CInputAuth::Analyze(LPDESC d, BYTE bHeader, const char * c_pData)
|
|||
break;
|
||||
|
||||
default:
|
||||
sys_err("This phase does not handle this header %d (0x%x)(phase: AUTH)", bHeader, bHeader);
|
||||
SPDLOG_ERROR("This phase does not handle this header {} (0x{})(phase: AUTH)", bHeader, bHeader);
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
|
@ -35,7 +35,6 @@
|
|||
#include "block_country.h"
|
||||
#include "motion.h"
|
||||
|
||||
#include "dev_log.h"
|
||||
|
||||
#include "log.h"
|
||||
|
||||
|
@ -78,7 +77,7 @@ bool GetServerLocation(TAccountTable & rTab, BYTE bEmpire)
|
|||
rTab.players[i].lAddr,
|
||||
rTab.players[i].wPort))
|
||||
{
|
||||
sys_err("location error name %s mapindex %d %d x %d empire %d",
|
||||
SPDLOG_ERROR("location error name {} mapindex {} {} x {} empire {}",
|
||||
rTab.players[i].szName, lIndex, rTab.players[i].x, rTab.players[i].y, rTab.bEmpire);
|
||||
|
||||
rTab.players[i].x = EMPIRE_START_X(rTab.bEmpire);
|
||||
|
@ -88,7 +87,7 @@ bool GetServerLocation(TAccountTable & rTab, BYTE bEmpire)
|
|||
|
||||
if (!CMapLocation::instance().Get(rTab.players[i].x, rTab.players[i].y, lIndex, rTab.players[i].lAddr, rTab.players[i].wPort))
|
||||
{
|
||||
sys_err("cannot find server for mapindex %d %d x %d (name %s)",
|
||||
SPDLOG_ERROR("cannot find server for mapindex {} {} x {} (name {})",
|
||||
lIndex,
|
||||
rTab.players[i].x,
|
||||
rTab.players[i].y,
|
||||
|
@ -100,7 +99,7 @@ bool GetServerLocation(TAccountTable & rTab, BYTE bEmpire)
|
|||
|
||||
struct in_addr in;
|
||||
in.s_addr = rTab.players[i].lAddr;
|
||||
sys_log(0, "success to %s:%d", inet_ntoa(in), rTab.players[i].wPort);
|
||||
SPDLOG_DEBUG("success to {}:{}", inet_ntoa(in), rTab.players[i].wPort);
|
||||
}
|
||||
|
||||
return bFound;
|
||||
|
@ -111,14 +110,14 @@ extern std::map<DWORD, CLoginSim *> g_simByPID;
|
|||
|
||||
void CInputDB::LoginSuccess(DWORD dwHandle, const char *data)
|
||||
{
|
||||
sys_log(0, "LoginSuccess");
|
||||
SPDLOG_DEBUG("LoginSuccess");
|
||||
|
||||
TAccountTable * pTab = (TAccountTable *) data;
|
||||
|
||||
itertype(g_sim) it = g_sim.find(pTab->id);
|
||||
if (g_sim.end() != it)
|
||||
{
|
||||
sys_log(0, "CInputDB::LoginSuccess - already exist sim [%s]", pTab->login);
|
||||
SPDLOG_ERROR("CInputDB::LoginSuccess - already exist sim [{}]", pTab->login);
|
||||
it->second->SendLoad();
|
||||
return;
|
||||
}
|
||||
|
@ -127,7 +126,7 @@ void CInputDB::LoginSuccess(DWORD dwHandle, const char *data)
|
|||
|
||||
if (!d)
|
||||
{
|
||||
sys_log(0, "CInputDB::LoginSuccess - cannot find handle [%s]", pTab->login);
|
||||
SPDLOG_ERROR("CInputDB::LoginSuccess - cannot find handle [{}]", pTab->login);
|
||||
|
||||
TLogoutPacket pack;
|
||||
|
||||
|
@ -138,7 +137,7 @@ void CInputDB::LoginSuccess(DWORD dwHandle, const char *data)
|
|||
|
||||
if (strcmp(pTab->status, "OK")) // OK°¡ ¾Æ´Ï¸é
|
||||
{
|
||||
sys_log(0, "CInputDB::LoginSuccess - status[%s] is not OK [%s]", pTab->status, pTab->login);
|
||||
SPDLOG_DEBUG("CInputDB::LoginSuccess - status[{}] is not OK [{}]", pTab->status, pTab->login);
|
||||
|
||||
TLogoutPacket pack;
|
||||
|
||||
|
@ -152,7 +151,7 @@ void CInputDB::LoginSuccess(DWORD dwHandle, const char *data)
|
|||
for (int i = 0; i != PLAYER_PER_ACCOUNT; ++i)
|
||||
{
|
||||
TSimplePlayer& player = pTab->players[i];
|
||||
sys_log(0, "\tplayer(%s).job(%d)", player.szName, player.byJob);
|
||||
SPDLOG_DEBUG("\tplayer({}).job({})", player.szName, player.byJob);
|
||||
}
|
||||
|
||||
bool bFound = GetServerLocation(*pTab, pTab->bEmpire);
|
||||
|
@ -177,7 +176,7 @@ void CInputDB::LoginSuccess(DWORD dwHandle, const char *data)
|
|||
d->SetPhase(PHASE_SELECT);
|
||||
d->SendLoginSuccessPacket();
|
||||
|
||||
sys_log(0, "InputDB::login_success: %s", pTab->login);
|
||||
SPDLOG_DEBUG("InputDB::login_success: {}", pTab->login);
|
||||
}
|
||||
|
||||
void CInputDB::PlayerCreateFailure(LPDESC d, BYTE bType)
|
||||
|
@ -214,7 +213,7 @@ void CInputDB::PlayerCreateSuccess(LPDESC d, const char * data)
|
|||
pPacketDB->player.lAddr,
|
||||
pPacketDB->player.wPort))
|
||||
{
|
||||
sys_err("InputDB::PlayerCreateSuccess: cannot find server for mapindex %d %d x %d (name %s)",
|
||||
SPDLOG_ERROR("InputDB::PlayerCreateSuccess: cannot find server for mapindex {} {} x {} (name {})",
|
||||
lIndex,
|
||||
pPacketDB->player.x,
|
||||
pPacketDB->player.y,
|
||||
|
@ -370,7 +369,7 @@ void CInputDB::PlayerLoad(LPDESC d, const char * data)
|
|||
// by rtsummit
|
||||
if (!SECTREE_MANAGER::instance().GetValidLocation(pTab->lMapIndex, pTab->x, pTab->y, lMapIndex, pos, d->GetEmpire()))
|
||||
{
|
||||
sys_err("InputDB::PlayerLoad : cannot find valid location %d x %d (name: %s)", pTab->x, pTab->y, pTab->name);
|
||||
SPDLOG_ERROR("InputDB::PlayerLoad : cannot find valid location {} x {} (name: {})", pTab->x, pTab->y, pTab->name);
|
||||
d->SetPhase(PHASE_CLOSE);
|
||||
return;
|
||||
}
|
||||
|
@ -382,13 +381,13 @@ void CInputDB::PlayerLoad(LPDESC d, const char * data)
|
|||
if (d->GetCharacter() || d->IsPhase(PHASE_GAME))
|
||||
{
|
||||
LPCHARACTER p = d->GetCharacter();
|
||||
sys_err("login state already has main state (character %s %p)", p->GetName(), get_pointer(p));
|
||||
SPDLOG_ERROR("login state already has main state (character {} {})", p->GetName(), (void*) get_pointer(p));
|
||||
return;
|
||||
}
|
||||
|
||||
if (NULL != CHARACTER_MANAGER::Instance().FindPC(pTab->name))
|
||||
{
|
||||
sys_err("InputDB: PlayerLoad : %s already exist in game", pTab->name);
|
||||
SPDLOG_ERROR("InputDB: PlayerLoad : {} already exist in game", pTab->name);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -444,7 +443,7 @@ void CInputDB::PlayerLoad(LPDESC d, const char * data)
|
|||
//if (!map_allow_find(lMapIndex >= 10000 ? lMapIndex / 10000 : lMapIndex) || !CheckEmpire(ch, lMapIndex))
|
||||
if (!map_allow_find(lPublicMapIndex))
|
||||
{
|
||||
sys_err("InputDB::PlayerLoad : entering %d map is not allowed here (name: %s, empire %u)",
|
||||
SPDLOG_ERROR("InputDB::PlayerLoad : entering {} map is not allowed here (name: {}, empire {})",
|
||||
lMapIndex, pTab->name, d->GetEmpire());
|
||||
|
||||
ch->SetWarpLocation(EMPIRE_START_MAP(d->GetEmpire()),
|
||||
|
@ -463,7 +462,7 @@ void CInputDB::PlayerLoad(LPDESC d, const char * data)
|
|||
ch->PointsPacket();
|
||||
ch->SkillLevelPacket();
|
||||
|
||||
sys_log(0, "InputDB: player_load %s %dx%dx%d LEVEL %d MOV_SPEED %d JOB %d ATG %d DFG %d GMLv %d",
|
||||
SPDLOG_DEBUG("InputDB: player_load {} {}x{}x{} LEVEL {} MOV_SPEED {} JOB {} ATG {} DFG {} GMLv {}",
|
||||
pTab->name,
|
||||
ch->GetX(), ch->GetY(), ch->GetZ(),
|
||||
ch->GetLevel(),
|
||||
|
@ -488,27 +487,27 @@ void CInputDB::Boot(const char* data)
|
|||
BYTE bVersion = decode_byte(data);
|
||||
data += 1;
|
||||
|
||||
sys_log(0, "BOOT: PACKET: %d", dwPacketSize);
|
||||
sys_log(0, "BOOT: VERSION: %d", bVersion);
|
||||
SPDLOG_INFO("BOOT: PACKET: {}", dwPacketSize);
|
||||
SPDLOG_INFO("BOOT: VERSION: {}", bVersion);
|
||||
if (bVersion != 6)
|
||||
{
|
||||
sys_err("boot version error");
|
||||
SPDLOG_ERROR("boot version error");
|
||||
thecore_shutdown();
|
||||
}
|
||||
|
||||
sys_log(0, "sizeof(TMobTable) = %d", sizeof(TMobTable));
|
||||
sys_log(0, "sizeof(TItemTable) = %d", sizeof(TItemTable));
|
||||
sys_log(0, "sizeof(TShopTable) = %d", sizeof(TShopTable));
|
||||
sys_log(0, "sizeof(TSkillTable) = %d", sizeof(TSkillTable));
|
||||
sys_log(0, "sizeof(TRefineTable) = %d", sizeof(TRefineTable));
|
||||
sys_log(0, "sizeof(TItemAttrTable) = %d", sizeof(TItemAttrTable));
|
||||
sys_log(0, "sizeof(TItemRareTable) = %d", sizeof(TItemAttrTable));
|
||||
sys_log(0, "sizeof(TBanwordTable) = %d", sizeof(TBanwordTable));
|
||||
sys_log(0, "sizeof(TLand) = %d", sizeof(building::TLand));
|
||||
sys_log(0, "sizeof(TObjectProto) = %d", sizeof(building::TObjectProto));
|
||||
sys_log(0, "sizeof(TObject) = %d", sizeof(building::TObject));
|
||||
SPDLOG_DEBUG("sizeof(TMobTable) = {}", sizeof(TMobTable));
|
||||
SPDLOG_DEBUG("sizeof(TItemTable) = {}", sizeof(TItemTable));
|
||||
SPDLOG_DEBUG("sizeof(TShopTable) = {}", sizeof(TShopTable));
|
||||
SPDLOG_DEBUG("sizeof(TSkillTable) = {}", sizeof(TSkillTable));
|
||||
SPDLOG_DEBUG("sizeof(TRefineTable) = {}", sizeof(TRefineTable));
|
||||
SPDLOG_DEBUG("sizeof(TItemAttrTable) = {}", sizeof(TItemAttrTable));
|
||||
SPDLOG_DEBUG("sizeof(TItemRareTable) = {}", sizeof(TItemAttrTable));
|
||||
SPDLOG_DEBUG("sizeof(TBanwordTable) = {}", sizeof(TBanwordTable));
|
||||
SPDLOG_DEBUG("sizeof(TLand) = {}", sizeof(building::TLand));
|
||||
SPDLOG_DEBUG("sizeof(TObjectProto) = {}", sizeof(building::TObjectProto));
|
||||
SPDLOG_DEBUG("sizeof(TObject) = {}", sizeof(building::TObject));
|
||||
//ADMIN_MANAGER
|
||||
sys_log(0, "sizeof(TAdminManager) = %d", sizeof (TAdminInfo) );
|
||||
SPDLOG_DEBUG("sizeof(TAdminManager) = {}", sizeof (TAdminInfo) );
|
||||
//END_ADMIN_MANAGER
|
||||
|
||||
WORD size;
|
||||
|
@ -519,7 +518,7 @@ void CInputDB::Boot(const char* data)
|
|||
|
||||
if (decode_2bytes(data)!=sizeof(TMobTable))
|
||||
{
|
||||
sys_err("mob table size error");
|
||||
SPDLOG_ERROR("mob table size error");
|
||||
thecore_shutdown();
|
||||
return;
|
||||
}
|
||||
|
@ -527,7 +526,7 @@ void CInputDB::Boot(const char* data)
|
|||
|
||||
size = decode_2bytes(data);
|
||||
data += 2;
|
||||
sys_log(0, "BOOT: MOB: %d", size);
|
||||
SPDLOG_DEBUG("BOOT: MOB: {}", size);
|
||||
|
||||
if (size)
|
||||
{
|
||||
|
@ -541,7 +540,7 @@ void CInputDB::Boot(const char* data)
|
|||
|
||||
if (decode_2bytes(data) != sizeof(TItemTable))
|
||||
{
|
||||
sys_err("item table size error");
|
||||
SPDLOG_ERROR("item table size error");
|
||||
thecore_shutdown();
|
||||
return;
|
||||
}
|
||||
|
@ -549,7 +548,7 @@ void CInputDB::Boot(const char* data)
|
|||
|
||||
size = decode_2bytes(data);
|
||||
data += 2;
|
||||
sys_log(0, "BOOT: ITEM: %d", size);
|
||||
SPDLOG_DEBUG("BOOT: ITEM: {}", size);
|
||||
|
||||
|
||||
if (size)
|
||||
|
@ -564,7 +563,7 @@ void CInputDB::Boot(const char* data)
|
|||
|
||||
if (decode_2bytes(data) != sizeof(TShopTable))
|
||||
{
|
||||
sys_err("shop table size error");
|
||||
SPDLOG_ERROR("shop table size error");
|
||||
thecore_shutdown();
|
||||
return;
|
||||
}
|
||||
|
@ -572,14 +571,14 @@ void CInputDB::Boot(const char* data)
|
|||
|
||||
size = decode_2bytes(data);
|
||||
data += 2;
|
||||
sys_log(0, "BOOT: SHOP: %d", size);
|
||||
SPDLOG_DEBUG("BOOT: SHOP: {}", size);
|
||||
|
||||
|
||||
if (size)
|
||||
{
|
||||
if (!CShopManager::instance().Initialize((TShopTable *) data, size))
|
||||
{
|
||||
sys_err("shop table Initialize error");
|
||||
SPDLOG_ERROR("shop table Initialize error");
|
||||
thecore_shutdown();
|
||||
return;
|
||||
}
|
||||
|
@ -592,7 +591,7 @@ void CInputDB::Boot(const char* data)
|
|||
|
||||
if (decode_2bytes(data) != sizeof(TSkillTable))
|
||||
{
|
||||
sys_err("skill table size error");
|
||||
SPDLOG_ERROR("skill table size error");
|
||||
thecore_shutdown();
|
||||
return;
|
||||
}
|
||||
|
@ -600,13 +599,13 @@ void CInputDB::Boot(const char* data)
|
|||
|
||||
size = decode_2bytes(data);
|
||||
data += 2;
|
||||
sys_log(0, "BOOT: SKILL: %d", size);
|
||||
SPDLOG_DEBUG("BOOT: SKILL: {}", size);
|
||||
|
||||
if (size)
|
||||
{
|
||||
if (!CSkillManager::instance().Initialize((TSkillTable *) data, size))
|
||||
{
|
||||
sys_err("cannot initialize skill table");
|
||||
SPDLOG_ERROR("cannot initialize skill table");
|
||||
thecore_shutdown();
|
||||
return;
|
||||
}
|
||||
|
@ -618,7 +617,7 @@ void CInputDB::Boot(const char* data)
|
|||
*/
|
||||
if (decode_2bytes(data) != sizeof(TRefineTable))
|
||||
{
|
||||
sys_err("refine table size error");
|
||||
SPDLOG_ERROR("refine table size error");
|
||||
thecore_shutdown();
|
||||
return;
|
||||
}
|
||||
|
@ -626,7 +625,7 @@ void CInputDB::Boot(const char* data)
|
|||
|
||||
size = decode_2bytes(data);
|
||||
data += 2;
|
||||
sys_log(0, "BOOT: REFINE: %d", size);
|
||||
SPDLOG_DEBUG("BOOT: REFINE: {}", size);
|
||||
|
||||
if (size)
|
||||
{
|
||||
|
@ -639,7 +638,7 @@ void CInputDB::Boot(const char* data)
|
|||
*/
|
||||
if (decode_2bytes(data) != sizeof(TItemAttrTable))
|
||||
{
|
||||
sys_err("item attr table size error");
|
||||
SPDLOG_ERROR("item attr table size error");
|
||||
thecore_shutdown();
|
||||
return;
|
||||
}
|
||||
|
@ -647,7 +646,7 @@ void CInputDB::Boot(const char* data)
|
|||
|
||||
size = decode_2bytes(data);
|
||||
data += 2;
|
||||
sys_log(0, "BOOT: ITEM_ATTR: %d", size);
|
||||
SPDLOG_DEBUG("BOOT: ITEM_ATTR: {}", size);
|
||||
|
||||
if (size)
|
||||
{
|
||||
|
@ -659,7 +658,7 @@ void CInputDB::Boot(const char* data)
|
|||
continue;
|
||||
|
||||
g_map_itemAttr[p->dwApplyIndex] = *p;
|
||||
sys_log(0, "ITEM_ATTR[%d]: %s %u", p->dwApplyIndex, p->szApply, p->dwProb);
|
||||
SPDLOG_DEBUG("ITEM_ATTR[{}]: {} {}", p->dwApplyIndex, p->szApply, p->dwProb);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -671,7 +670,7 @@ void CInputDB::Boot(const char* data)
|
|||
*/
|
||||
if (decode_2bytes(data) != sizeof(TItemAttrTable))
|
||||
{
|
||||
sys_err("item rare table size error");
|
||||
SPDLOG_ERROR("item rare table size error");
|
||||
thecore_shutdown();
|
||||
return;
|
||||
}
|
||||
|
@ -679,7 +678,7 @@ void CInputDB::Boot(const char* data)
|
|||
|
||||
size = decode_2bytes(data);
|
||||
data += 2;
|
||||
sys_log(0, "BOOT: ITEM_RARE: %d", size);
|
||||
SPDLOG_DEBUG("BOOT: ITEM_RARE: {}", size);
|
||||
|
||||
if (size)
|
||||
{
|
||||
|
@ -691,7 +690,7 @@ void CInputDB::Boot(const char* data)
|
|||
continue;
|
||||
|
||||
g_map_itemRare[p->dwApplyIndex] = *p;
|
||||
sys_log(0, "ITEM_RARE[%d]: %s %u", p->dwApplyIndex, p->szApply, p->dwProb);
|
||||
SPDLOG_DEBUG("ITEM_RARE[{}]: {} {}", p->dwApplyIndex, p->szApply, p->dwProb);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -704,7 +703,7 @@ void CInputDB::Boot(const char* data)
|
|||
|
||||
if (decode_2bytes(data) != sizeof(TBanwordTable))
|
||||
{
|
||||
sys_err("ban word table size error");
|
||||
SPDLOG_ERROR("ban word table size error");
|
||||
thecore_shutdown();
|
||||
return;
|
||||
}
|
||||
|
@ -725,7 +724,7 @@ void CInputDB::Boot(const char* data)
|
|||
|
||||
if (decode_2bytes(data) != sizeof(TLand))
|
||||
{
|
||||
sys_err("land table size error");
|
||||
SPDLOG_ERROR("land table size error");
|
||||
thecore_shutdown();
|
||||
return;
|
||||
}
|
||||
|
@ -746,7 +745,7 @@ void CInputDB::Boot(const char* data)
|
|||
|
||||
if (decode_2bytes(data) != sizeof(TObjectProto))
|
||||
{
|
||||
sys_err("object proto table size error");
|
||||
SPDLOG_ERROR("object proto table size error");
|
||||
thecore_shutdown();
|
||||
return;
|
||||
}
|
||||
|
@ -763,7 +762,7 @@ void CInputDB::Boot(const char* data)
|
|||
*/
|
||||
if (decode_2bytes(data) != sizeof(TObject))
|
||||
{
|
||||
sys_err("object table size error");
|
||||
SPDLOG_ERROR("object table size error");
|
||||
thecore_shutdown();
|
||||
return;
|
||||
}
|
||||
|
@ -787,7 +786,7 @@ void CInputDB::Boot(const char* data)
|
|||
|
||||
if (decode_2bytes(data) != sizeof(TItemIDRangeTable) )
|
||||
{
|
||||
sys_err("ITEM ID RANGE size error");
|
||||
SPDLOG_ERROR("ITEM ID RANGE size error");
|
||||
thecore_shutdown();
|
||||
return;
|
||||
}
|
||||
|
@ -808,11 +807,11 @@ void CInputDB::Boot(const char* data)
|
|||
data += 2;
|
||||
int HostSize = decode_2bytes(data );
|
||||
data += 2;
|
||||
sys_log(0, "GM Value Count %d %d", HostSize, ChunkSize );
|
||||
SPDLOG_INFO("GM Value Count {} {}", HostSize, ChunkSize );
|
||||
for (int n = 0; n < HostSize; ++n )
|
||||
{
|
||||
gm_new_host_inert(data );
|
||||
sys_log(0, "GM HOST : IP[%s] ", data );
|
||||
SPDLOG_INFO("GM HOST : IP[{}] ", data );
|
||||
data += ChunkSize;
|
||||
}
|
||||
|
||||
|
@ -844,7 +843,7 @@ void CInputDB::Boot(const char* data)
|
|||
for (int n = 1; n < 4; ++n)
|
||||
{
|
||||
if (p.name[n] && *p.name[n])
|
||||
sys_log(0, "[MONARCH] Empire %d Pid %d Money %d %s", n, p.pid[n], p.money[n], p.name[n]);
|
||||
SPDLOG_DEBUG("[MONARCH] Empire {} Pid {} Money {} {}", n, p.pid[n], p.money[n], p.name[n]);
|
||||
}
|
||||
|
||||
int CandidacySize = decode_2bytes(data);
|
||||
|
@ -853,8 +852,7 @@ void CInputDB::Boot(const char* data)
|
|||
int CandidacyCount = decode_2bytes(data);
|
||||
data += 2;
|
||||
|
||||
if (test_server)
|
||||
sys_log (0, "[MONARCH] Size %d Count %d", CandidacySize, CandidacyCount);
|
||||
SPDLOG_TRACE("[MONARCH] Size {} Count {}", CandidacySize, CandidacyCount);
|
||||
|
||||
data += CandidacySize * CandidacyCount;
|
||||
|
||||
|
@ -864,24 +862,24 @@ void CInputDB::Boot(const char* data)
|
|||
WORD endCheck=decode_2bytes(data);
|
||||
if (endCheck != 0xffff)
|
||||
{
|
||||
sys_err("boot packet end check error [%x]!=0xffff", endCheck);
|
||||
SPDLOG_CRITICAL("boot packet end check error [{}]!=0xffff", endCheck);
|
||||
thecore_shutdown();
|
||||
return;
|
||||
}
|
||||
else
|
||||
sys_log(0, "boot packet end check ok [%x]==0xffff", endCheck );
|
||||
SPDLOG_DEBUG("boot packet end check ok [{}]==0xffff", endCheck );
|
||||
data +=2;
|
||||
|
||||
if (!ITEM_MANAGER::instance().SetMaxItemID(*range))
|
||||
{
|
||||
sys_err("not enough item id contact your administrator!");
|
||||
SPDLOG_CRITICAL("not enough item id contact your administrator!");
|
||||
thecore_shutdown();
|
||||
return;
|
||||
}
|
||||
|
||||
if (!ITEM_MANAGER::instance().SetMaxSpareItemID(*rangespare))
|
||||
{
|
||||
sys_err("not enough item id for spare contact your administrator!");
|
||||
SPDLOG_CRITICAL("not enough item id for spare contact your administrator!");
|
||||
thecore_shutdown();
|
||||
return;
|
||||
}
|
||||
|
@ -916,72 +914,72 @@ void CInputDB::Boot(const char* data)
|
|||
snprintf(szDragonSoulTableFileName, sizeof(szDragonSoulTableFileName),
|
||||
"%s/dragon_soul_table.txt", LocaleService_GetBasePath().c_str());
|
||||
|
||||
sys_log(0, "Initializing Informations of Cube System");
|
||||
SPDLOG_DEBUG("Initializing Informations of Cube System");
|
||||
if (!Cube_InformationInitialize())
|
||||
{
|
||||
sys_err("cannot init cube infomation.");
|
||||
SPDLOG_ERROR("cannot init cube infomation.");
|
||||
thecore_shutdown();
|
||||
return;
|
||||
}
|
||||
|
||||
sys_log(0, "LoadLocaleFile: CommonDropItem: %s", szCommonDropItemFileName);
|
||||
SPDLOG_DEBUG("LoadLocaleFile: CommonDropItem: {}", szCommonDropItemFileName);
|
||||
if (!ITEM_MANAGER::instance().ReadCommonDropItemFile(szCommonDropItemFileName))
|
||||
{
|
||||
sys_err("cannot load CommonDropItem: %s", szCommonDropItemFileName);
|
||||
SPDLOG_ERROR("cannot load CommonDropItem: {}", szCommonDropItemFileName);
|
||||
thecore_shutdown();
|
||||
return;
|
||||
}
|
||||
|
||||
sys_log(0, "LoadLocaleFile: ETCDropItem: %s", szETCDropItemFileName);
|
||||
SPDLOG_DEBUG("LoadLocaleFile: ETCDropItem: {}", szETCDropItemFileName);
|
||||
if (!ITEM_MANAGER::instance().ReadEtcDropItemFile(szETCDropItemFileName))
|
||||
{
|
||||
sys_err("cannot load ETCDropItem: %s", szETCDropItemFileName);
|
||||
SPDLOG_ERROR("cannot load ETCDropItem: {}", szETCDropItemFileName);
|
||||
thecore_shutdown();
|
||||
return;
|
||||
}
|
||||
|
||||
sys_log(0, "LoadLocaleFile: DropItemGroup: %s", szDropItemGroupFileName);
|
||||
SPDLOG_DEBUG("LoadLocaleFile: DropItemGroup: {}", szDropItemGroupFileName);
|
||||
if (!ITEM_MANAGER::instance().ReadDropItemGroup(szDropItemGroupFileName))
|
||||
{
|
||||
sys_err("cannot load DropItemGroup: %s", szDropItemGroupFileName);
|
||||
SPDLOG_ERROR("cannot load DropItemGroup: {}", szDropItemGroupFileName);
|
||||
thecore_shutdown();
|
||||
return;
|
||||
}
|
||||
|
||||
sys_log(0, "LoadLocaleFile: SpecialItemGroup: %s", szSpecialItemGroupFileName);
|
||||
SPDLOG_DEBUG("LoadLocaleFile: SpecialItemGroup: {}", szSpecialItemGroupFileName);
|
||||
if (!ITEM_MANAGER::instance().ReadSpecialDropItemFile(szSpecialItemGroupFileName))
|
||||
{
|
||||
sys_err("cannot load SpecialItemGroup: %s", szSpecialItemGroupFileName);
|
||||
SPDLOG_ERROR("cannot load SpecialItemGroup: {}", szSpecialItemGroupFileName);
|
||||
thecore_shutdown();
|
||||
return;
|
||||
}
|
||||
|
||||
sys_log(0, "LoadLocaleFile: ItemVnumMaskTable : %s", szItemVnumMaskTableFileName);
|
||||
SPDLOG_DEBUG("LoadLocaleFile: ItemVnumMaskTable : {}", szItemVnumMaskTableFileName);
|
||||
if (!ITEM_MANAGER::instance().ReadItemVnumMaskTable(szItemVnumMaskTableFileName))
|
||||
{
|
||||
sys_log(0, "Could not open MaskItemTable");
|
||||
SPDLOG_ERROR("Could not open MaskItemTable");
|
||||
}
|
||||
|
||||
sys_log(0, "LoadLocaleFile: MOBDropItemFile: %s", szMOBDropItemFileName);
|
||||
SPDLOG_DEBUG("LoadLocaleFile: MOBDropItemFile: {}", szMOBDropItemFileName);
|
||||
if (!ITEM_MANAGER::instance().ReadMonsterDropItemGroup(szMOBDropItemFileName))
|
||||
{
|
||||
sys_err("cannot load MOBDropItemFile: %s", szMOBDropItemFileName);
|
||||
SPDLOG_ERROR("cannot load MOBDropItemFile: {}", szMOBDropItemFileName);
|
||||
thecore_shutdown();
|
||||
return;
|
||||
}
|
||||
|
||||
sys_log(0, "LoadLocaleFile: MapIndex: %s", szMapIndexFileName);
|
||||
SPDLOG_DEBUG("LoadLocaleFile: MapIndex: {}", szMapIndexFileName);
|
||||
if (!SECTREE_MANAGER::instance().Build(szMapIndexFileName, LocaleService_GetMapPath().c_str()))
|
||||
{
|
||||
sys_err("cannot load MapIndex: %s", szMapIndexFileName);
|
||||
SPDLOG_ERROR("cannot load MapIndex: {}", szMapIndexFileName);
|
||||
thecore_shutdown();
|
||||
return;
|
||||
}
|
||||
|
||||
sys_log(0, "LoadLocaleFile: DragonSoulTable: %s", szDragonSoulTableFileName);
|
||||
SPDLOG_DEBUG("LoadLocaleFile: DragonSoulTable: {}", szDragonSoulTableFileName);
|
||||
if (!DSManager::instance().ReadDragonSoulTableFile(szDragonSoulTableFileName))
|
||||
{
|
||||
sys_err("cannot load DragonSoulTable: %s", szDragonSoulTableFileName);
|
||||
SPDLOG_ERROR("cannot load DragonSoulTable: {}", szDragonSoulTableFileName);
|
||||
//thecore_shutdown();
|
||||
//return;
|
||||
}
|
||||
|
@ -1008,7 +1006,7 @@ void CInputDB::Boot(const char* data)
|
|||
// request blocked_country_ip
|
||||
{
|
||||
db_clientdesc->DBPacket(HEADER_GD_BLOCK_COUNTRY_IP, 0, NULL, 0);
|
||||
dev_log(LOG_DEB0, "<sent HEADER_GD_BLOCK_COUNTRY_IP>");
|
||||
SPDLOG_TRACE("<sent HEADER_GD_BLOCK_COUNTRY_IP>");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1028,7 +1026,7 @@ EVENTFUNC(quest_login_event)
|
|||
|
||||
if ( info == NULL )
|
||||
{
|
||||
sys_err( "quest_login_event> <Factor> Null pointer" );
|
||||
SPDLOG_ERROR("quest_login_event> <Factor> Null pointer" );
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -1058,13 +1056,13 @@ EVENTFUNC(quest_login_event)
|
|||
}
|
||||
else if (d->IsPhase(PHASE_GAME))
|
||||
{
|
||||
sys_log(0, "QUEST_LOAD: Login pc %d by event", ch->GetPlayerID());
|
||||
SPDLOG_DEBUG("QUEST_LOAD: Login pc {} by event", ch->GetPlayerID());
|
||||
quest::CQuestManager::instance().Login(ch->GetPlayerID());
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
sys_err(0, "input_db.cpp:quest_login_event INVALID PHASE pid %d", ch->GetPlayerID());
|
||||
SPDLOG_ERROR("input_db.cpp:quest_login_event INVALID PHASE pid {}", ch->GetPlayerID());
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
@ -1089,18 +1087,18 @@ void CInputDB::QuestLoad(LPDESC d, const char * c_pData)
|
|||
{
|
||||
if (ch->GetPlayerID() != pQuestTable[0].dwPID)
|
||||
{
|
||||
sys_err("PID differs %u %u", ch->GetPlayerID(), pQuestTable[0].dwPID);
|
||||
SPDLOG_ERROR("PID differs {} {}", ch->GetPlayerID(), pQuestTable[0].dwPID);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
sys_log(0, "QUEST_LOAD: count %d", dwCount);
|
||||
SPDLOG_DEBUG("QUEST_LOAD: count {}", dwCount);
|
||||
|
||||
quest::PC * pkPC = quest::CQuestManager::instance().GetPCForce(ch->GetPlayerID());
|
||||
|
||||
if (!pkPC)
|
||||
{
|
||||
sys_err("null quest::PC with id %u", pQuestTable[0].dwPID);
|
||||
SPDLOG_ERROR("null quest::PC with id {}", pQuestTable[0].dwPID);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -1114,7 +1112,7 @@ void CInputDB::QuestLoad(LPDESC d, const char * c_pData)
|
|||
st += ".";
|
||||
st += pQuestTable[i].szState;
|
||||
|
||||
sys_log(0, " %s %d", st.c_str(), pQuestTable[i].lValue);
|
||||
SPDLOG_DEBUG(" {} {}", st.c_str(), pQuestTable[i].lValue);
|
||||
pkPC->SetFlag(st.c_str(), pQuestTable[i].lValue, false);
|
||||
}
|
||||
|
||||
|
@ -1123,7 +1121,7 @@ void CInputDB::QuestLoad(LPDESC d, const char * c_pData)
|
|||
|
||||
if (ch->GetDesc()->IsPhase(PHASE_GAME))
|
||||
{
|
||||
sys_log(0, "QUEST_LOAD: Login pc %d", pQuestTable[0].dwPID);
|
||||
SPDLOG_DEBUG("QUEST_LOAD: Login pc {}", pQuestTable[0].dwPID);
|
||||
quest::CQuestManager::instance().Login(pQuestTable[0].dwPID);
|
||||
}
|
||||
else
|
||||
|
@ -1145,7 +1143,7 @@ void CInputDB::SafeboxLoad(LPDESC d, const char * c_pData)
|
|||
|
||||
if (d->GetAccountTable().id != p->dwID)
|
||||
{
|
||||
sys_err("SafeboxLoad: safebox has different id %u != %u", d->GetAccountTable().id, p->dwID);
|
||||
SPDLOG_ERROR("SafeboxLoad: safebox has different id {} != {}", d->GetAccountTable().id, p->dwID);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -1237,7 +1235,7 @@ void CInputDB::MallLoad(LPDESC d, const char * c_pData)
|
|||
|
||||
if (d->GetAccountTable().id != p->dwID)
|
||||
{
|
||||
sys_err("safebox has different id %u != %u", d->GetAccountTable().id, p->dwID);
|
||||
SPDLOG_ERROR("safebox has different id {} != {}", d->GetAccountTable().id, p->dwID);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -1277,7 +1275,7 @@ void CInputDB::LoginAlready(LPDESC d, const char * c_pData)
|
|||
|
||||
void CInputDB::EmpireSelect(LPDESC d, const char * c_pData)
|
||||
{
|
||||
sys_log(0, "EmpireSelect %p", get_pointer(d));
|
||||
SPDLOG_DEBUG("EmpireSelect {}", (void*) get_pointer(d));
|
||||
|
||||
if (!d)
|
||||
return;
|
||||
|
@ -1306,7 +1304,7 @@ void CInputDB::MapLocations(const char * c_pData)
|
|||
{
|
||||
BYTE bCount = *(BYTE *) (c_pData++);
|
||||
|
||||
sys_log(0, "InputDB::MapLocations %d", bCount);
|
||||
SPDLOG_DEBUG("InputDB::MapLocations {}", bCount);
|
||||
|
||||
TMapLocation * pLoc = (TMapLocation *) c_pData;
|
||||
|
||||
|
@ -1336,7 +1334,7 @@ void CInputDB::P2P(const char * c_pData)
|
|||
if (false == DESC_MANAGER::instance().IsP2PDescExist(p->szHost, p->wPort))
|
||||
{
|
||||
LPCLIENT_DESC pkDesc = NULL;
|
||||
sys_log(0, "InputDB:P2P %s:%u", p->szHost, p->wPort);
|
||||
SPDLOG_DEBUG("InputDB:P2P {}:{}", p->szHost, p->wPort);
|
||||
pkDesc = DESC_MANAGER::instance().CreateConnectionDesc(ev_base, dns_base, p->szHost, p->wPort, PHASE_P2P, false);
|
||||
mgr.RegisterConnector(pkDesc);
|
||||
pkDesc->SetP2P(p->wPort, p->bChannel);
|
||||
|
@ -1365,7 +1363,7 @@ void CInputDB::GuildWar(const char* c_pData)
|
|||
{
|
||||
TPacketGuildWar * p = (TPacketGuildWar*) c_pData;
|
||||
|
||||
sys_log(0, "InputDB::GuildWar %u %u state %d", p->dwGuildFrom, p->dwGuildTo, p->bWar);
|
||||
SPDLOG_DEBUG("InputDB::GuildWar {} {} state {}", p->dwGuildFrom, p->dwGuildTo, p->bWar);
|
||||
|
||||
switch (p->bWar)
|
||||
{
|
||||
|
@ -1403,7 +1401,7 @@ void CInputDB::GuildWar(const char* c_pData)
|
|||
break;
|
||||
|
||||
default:
|
||||
sys_err("Unknown guild war state");
|
||||
SPDLOG_ERROR("Unknown guild war state");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -1423,7 +1421,7 @@ void CInputDB::GuildSkillRecharge()
|
|||
void CInputDB::GuildExpUpdate(const char* c_pData)
|
||||
{
|
||||
TPacketGuildSkillUpdate * p = (TPacketGuildSkillUpdate *) c_pData;
|
||||
sys_log(1, "GuildExpUpdate %d", p->amount);
|
||||
SPDLOG_DEBUG("GuildExpUpdate {}", p->amount);
|
||||
|
||||
CGuild * g = CGuildManager::instance().TouchGuild(p->guild_id);
|
||||
|
||||
|
@ -1460,7 +1458,7 @@ void CInputDB::GuildChangeGrade(const char* c_pData)
|
|||
|
||||
void CInputDB::GuildChangeMemberData(const char* c_pData)
|
||||
{
|
||||
sys_log(0, "Recv GuildChangeMemberData");
|
||||
SPDLOG_DEBUG("Recv GuildChangeMemberData");
|
||||
TPacketGuildChangeMemberData * p = (TPacketGuildChangeMemberData *) c_pData;
|
||||
CGuild * g = CGuildManager::instance().TouchGuild(p->guild_id);
|
||||
|
||||
|
@ -1477,7 +1475,7 @@ void CInputDB::GuildDisband(const char* c_pData)
|
|||
void CInputDB::GuildLadder(const char* c_pData)
|
||||
{
|
||||
TPacketGuildLadder* p = (TPacketGuildLadder*) c_pData;
|
||||
sys_log(0, "Recv GuildLadder %u %d / w %d d %d l %d", p->dwGuild, p->lLadderPoint, p->lWin, p->lDraw, p->lLoss);
|
||||
SPDLOG_DEBUG("Recv GuildLadder {} {} / w {} d {} l {}", p->dwGuild, p->lLadderPoint, p->lWin, p->lDraw, p->lLoss);
|
||||
CGuild * g = CGuildManager::instance().TouchGuild(p->dwGuild);
|
||||
|
||||
g->SetLadderPoint(p->lLadderPoint);
|
||||
|
@ -1497,7 +1495,7 @@ void CInputDB::ItemLoad(LPDESC d, const char * c_pData)
|
|||
DWORD dwCount = decode_4bytes(c_pData);
|
||||
c_pData += sizeof(DWORD);
|
||||
|
||||
sys_log(0, "ITEM_LOAD: COUNT %s %u", ch->GetName(), dwCount);
|
||||
SPDLOG_INFO("ITEM_LOAD: COUNT {} {}", ch->GetName(), dwCount);
|
||||
|
||||
std::vector<LPITEM> v;
|
||||
|
||||
|
@ -1509,7 +1507,7 @@ void CInputDB::ItemLoad(LPDESC d, const char * c_pData)
|
|||
|
||||
if (!item)
|
||||
{
|
||||
sys_err("cannot create item by vnum %u (name %s id %u)", p->vnum, ch->GetName(), p->id);
|
||||
SPDLOG_ERROR("cannot create item by vnum {} (name {} id {})", p->vnum, ch->GetName(), p->id);
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -1520,7 +1518,7 @@ void CInputDB::ItemLoad(LPDESC d, const char * c_pData)
|
|||
if ((p->window == INVENTORY && ch->GetInventoryItem(p->pos)) ||
|
||||
(p->window == EQUIPMENT && ch->GetWear(p->pos)))
|
||||
{
|
||||
sys_log(0, "ITEM_RESTORE: %s %s", ch->GetName(), item->GetName());
|
||||
SPDLOG_INFO("ITEM_RESTORE: {} {}", ch->GetName(), item->GetName());
|
||||
v.push_back(item);
|
||||
}
|
||||
else
|
||||
|
@ -1549,7 +1547,7 @@ void CInputDB::ItemLoad(LPDESC d, const char * c_pData)
|
|||
}
|
||||
|
||||
if (false == item->OnAfterCreatedItem())
|
||||
sys_err("Failed to call ITEM::OnAfterCreatedItem (vnum: %d, id: %d)", item->GetVnum(), item->GetID());
|
||||
SPDLOG_ERROR("Failed to call ITEM::OnAfterCreatedItem (vnum: {}, id: {})", item->GetVnum(), item->GetID());
|
||||
|
||||
item->SetSkipSave(false);
|
||||
}
|
||||
|
@ -1684,7 +1682,7 @@ void CInputDB::ReloadProto(const char * c_pData)
|
|||
*/
|
||||
wSize = decode_2bytes(c_pData);
|
||||
c_pData += 2;
|
||||
sys_log(0, "RELOAD: ITEM: %d", wSize);
|
||||
SPDLOG_INFO("RELOAD: ITEM: {}", wSize);
|
||||
|
||||
if (wSize)
|
||||
{
|
||||
|
@ -1697,7 +1695,7 @@ void CInputDB::ReloadProto(const char * c_pData)
|
|||
*/
|
||||
wSize = decode_2bytes(c_pData);
|
||||
c_pData += 2;
|
||||
sys_log(0, "RELOAD: MOB: %d", wSize);
|
||||
SPDLOG_INFO("RELOAD: MOB: {}", wSize);
|
||||
|
||||
if (wSize)
|
||||
{
|
||||
|
@ -1751,7 +1749,7 @@ void CInputDB::AuthLogin(LPDESC d, const char * c_pData)
|
|||
ptoc.bResult = bResult;
|
||||
|
||||
d->Packet(&ptoc, sizeof(TPacketGCAuthSuccess));
|
||||
sys_log(0, "AuthLogin result %u key %u", bResult, d->GetLoginKey());
|
||||
SPDLOG_INFO("AuthLogin result {} key {}", bResult, d->GetLoginKey());
|
||||
}
|
||||
|
||||
void CInputDB::ChangeEmpirePriv(const char* c_pData)
|
||||
|
@ -1858,7 +1856,7 @@ void CInputDB::BillingRepair(const char * c_pData)
|
|||
pkLD->SetLogin(p->szLogin);
|
||||
pkLD->SetIP(p->szHost);
|
||||
|
||||
sys_log(0, "BILLING: REPAIR %s host %s", p->szLogin, p->szHost);
|
||||
SPDLOG_INFO("BILLING: REPAIR {} host {}", p->szLogin, p->szHost);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1876,7 +1874,7 @@ void CInputDB::BillingExpire(const char * c_pData)
|
|||
if (p->dwRemainSeconds <= 60)
|
||||
{
|
||||
int i = std::max<int>(5, p->dwRemainSeconds);
|
||||
sys_log(0, "BILLING_EXPIRE: %s %u", p->szLogin, p->dwRemainSeconds);
|
||||
SPDLOG_INFO("BILLING_EXPIRE: {} {}", p->szLogin, p->dwRemainSeconds);
|
||||
d->DelayedDisconnect(i);
|
||||
}
|
||||
else
|
||||
|
@ -1919,7 +1917,7 @@ void CInputDB::BillingCheck(const char * c_pData)
|
|||
DWORD dwKey = *(DWORD *) c_pData;
|
||||
c_pData += sizeof(DWORD);
|
||||
|
||||
sys_log(0, "BILLING: NOT_LOGIN %u", dwKey);
|
||||
SPDLOG_INFO("BILLING: NOT_LOGIN {}", dwKey);
|
||||
DBManager::instance().SetBilling(dwKey, 0, true);
|
||||
}
|
||||
}
|
||||
|
@ -1931,7 +1929,7 @@ void CInputDB::Notice(const char * c_pData)
|
|||
char szBuf[256+1];
|
||||
strlcpy(szBuf, c_pData, sizeof(szBuf));
|
||||
|
||||
sys_log(0, "InputDB:: Notice: %s", szBuf);
|
||||
SPDLOG_INFO("InputDB:: Notice: {}", szBuf);
|
||||
|
||||
//SendNotice(LC_TEXT(szBuf));
|
||||
SendNotice(szBuf);
|
||||
|
@ -1941,12 +1939,12 @@ void CInputDB::VCard(const char * c_pData)
|
|||
{
|
||||
TPacketGDVCard * p = (TPacketGDVCard *) c_pData;
|
||||
|
||||
sys_log(0, "VCARD: %u %s %s %s %s", p->dwID, p->szSellCharacter, p->szSellAccount, p->szBuyCharacter, p->szBuyAccount);
|
||||
SPDLOG_DEBUG("VCARD: {} {} {} {} {}", p->dwID, p->szSellCharacter, p->szSellAccount, p->szBuyCharacter, p->szBuyAccount);
|
||||
|
||||
std::unique_ptr<SQLMsg> pmsg(DBManager::instance().DirectQuery("SELECT sell_account, buy_account, time FROM vcard WHERE id=%u", p->dwID));
|
||||
if (pmsg->Get()->uiNumRows != 1)
|
||||
{
|
||||
sys_log(0, "VCARD_FAIL: no data");
|
||||
SPDLOG_ERROR("VCARD_FAIL: no data");
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -1954,13 +1952,13 @@ void CInputDB::VCard(const char * c_pData)
|
|||
|
||||
if (strcmp(row[0], p->szSellAccount))
|
||||
{
|
||||
sys_log(0, "VCARD_FAIL: sell account differ %s", row[0]);
|
||||
SPDLOG_ERROR("VCARD_FAIL: sell account differ {}", row[0]);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!row[1] || *row[1])
|
||||
{
|
||||
sys_log(0, "VCARD_FAIL: buy account already exist");
|
||||
SPDLOG_ERROR("VCARD_FAIL: buy account already exist");
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -1969,7 +1967,7 @@ void CInputDB::VCard(const char * c_pData)
|
|||
|
||||
if (!row[2] || time < 0)
|
||||
{
|
||||
sys_log(0, "VCARD_FAIL: time null");
|
||||
SPDLOG_ERROR("VCARD_FAIL: time null");
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -1977,7 +1975,7 @@ void CInputDB::VCard(const char * c_pData)
|
|||
|
||||
if (pmsg1->Get()->uiAffectedRows == 0 || pmsg1->Get()->uiAffectedRows == (uint32_t)-1)
|
||||
{
|
||||
sys_log(0, "VCARD_FAIL: cannot modify GameTime table");
|
||||
SPDLOG_ERROR("VCARD_FAIL: cannot modify GameTime table");
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -1985,11 +1983,11 @@ void CInputDB::VCard(const char * c_pData)
|
|||
|
||||
if (pmsg2->Get()->uiAffectedRows == 0 || pmsg2->Get()->uiAffectedRows == (uint32_t)-1)
|
||||
{
|
||||
sys_log(0, "VCARD_FAIL: cannot modify vcard table");
|
||||
SPDLOG_ERROR("VCARD_FAIL: cannot modify vcard table");
|
||||
return;
|
||||
}
|
||||
|
||||
sys_log(0, "VCARD_SUCCESS: %s %s", p->szBuyAccount, p->szBuyCharacter);
|
||||
SPDLOG_DEBUG("VCARD_SUCCESS: {} {}", p->szBuyAccount, p->szBuyCharacter);
|
||||
}
|
||||
|
||||
void CInputDB::GuildWarReserveAdd(TGuildWarReserve * p)
|
||||
|
@ -2009,19 +2007,19 @@ void CInputDB::GuildWarBet(TPacketGDGuildWarBet * p)
|
|||
|
||||
void CInputDB::MarriageAdd(TPacketMarriageAdd * p)
|
||||
{
|
||||
sys_log(0, "MarriageAdd %u %u %u %s %s", p->dwPID1, p->dwPID2, (DWORD)p->tMarryTime, p->szName1, p->szName2);
|
||||
SPDLOG_DEBUG("MarriageAdd {} {} {} {} {}", p->dwPID1, p->dwPID2, (DWORD)p->tMarryTime, p->szName1, p->szName2);
|
||||
marriage::CManager::instance().Add(p->dwPID1, p->dwPID2, p->tMarryTime, p->szName1, p->szName2);
|
||||
}
|
||||
|
||||
void CInputDB::MarriageUpdate(TPacketMarriageUpdate * p)
|
||||
{
|
||||
sys_log(0, "MarriageUpdate %u %u %d %d", p->dwPID1, p->dwPID2, p->iLovePoint, p->byMarried);
|
||||
SPDLOG_DEBUG("MarriageUpdate {} {} {} {}", p->dwPID1, p->dwPID2, p->iLovePoint, p->byMarried);
|
||||
marriage::CManager::instance().Update(p->dwPID1, p->dwPID2, p->iLovePoint, p->byMarried);
|
||||
}
|
||||
|
||||
void CInputDB::MarriageRemove(TPacketMarriageRemove * p)
|
||||
{
|
||||
sys_log(0, "MarriageRemove %u %u", p->dwPID1, p->dwPID2);
|
||||
SPDLOG_DEBUG("MarriageRemove {} {}", p->dwPID1, p->dwPID2);
|
||||
marriage::CManager::instance().Remove(p->dwPID1, p->dwPID2);
|
||||
}
|
||||
|
||||
|
@ -2032,19 +2030,19 @@ void CInputDB::WeddingRequest(TPacketWeddingRequest* p)
|
|||
|
||||
void CInputDB::WeddingReady(TPacketWeddingReady* p)
|
||||
{
|
||||
sys_log(0, "WeddingReady %u %u %u", p->dwPID1, p->dwPID2, p->dwMapIndex);
|
||||
SPDLOG_DEBUG("WeddingReady {} {} {}", p->dwPID1, p->dwPID2, p->dwMapIndex);
|
||||
marriage::CManager::instance().WeddingReady(p->dwPID1, p->dwPID2, p->dwMapIndex);
|
||||
}
|
||||
|
||||
void CInputDB::WeddingStart(TPacketWeddingStart* p)
|
||||
{
|
||||
sys_log(0, "WeddingStart %u %u", p->dwPID1, p->dwPID2);
|
||||
SPDLOG_DEBUG("WeddingStart {} {}", p->dwPID1, p->dwPID2);
|
||||
marriage::CManager::instance().WeddingStart(p->dwPID1, p->dwPID2);
|
||||
}
|
||||
|
||||
void CInputDB::WeddingEnd(TPacketWeddingEnd* p)
|
||||
{
|
||||
sys_log(0, "WeddingEnd %u %u", p->dwPID1, p->dwPID2);
|
||||
SPDLOG_DEBUG("WeddingEnd {} {}", p->dwPID1, p->dwPID2);
|
||||
marriage::CManager::instance().WeddingEnd(p->dwPID1, p->dwPID2);
|
||||
}
|
||||
|
||||
|
@ -2056,8 +2054,8 @@ void CInputDB::MyshopPricelistRes(LPDESC d, const TPacketMyshopPricelistHeader*
|
|||
if (!d || !(ch = d->GetCharacter()) )
|
||||
return;
|
||||
|
||||
sys_log(0, "RecvMyshopPricelistRes name[%s]", ch->GetName());
|
||||
ch->UseSilkBotaryReal(p );
|
||||
SPDLOG_DEBUG("RecvMyshopPricelistRes name[{}]", ch->GetName());
|
||||
ch->UseSilkBotaryReal(p);
|
||||
|
||||
}
|
||||
// END_OF_MYSHOP_PRICE_LIST
|
||||
|
@ -2150,11 +2148,9 @@ int CInputDB::Analyze(LPDESC d, BYTE bHeader, const char * c_pData)
|
|||
break;
|
||||
|
||||
case HEADER_DG_PLAYER_LOAD_FAILED:
|
||||
//sys_log(0, "PLAYER_LOAD_FAILED");
|
||||
break;
|
||||
|
||||
case HEADER_DG_PLAYER_DELETE_FAILED:
|
||||
//sys_log(0, "PLAYER_DELETE_FAILED");
|
||||
PlayerDeleteFail(DESC_MANAGER::instance().FindByHandle(m_dwHandle));
|
||||
break;
|
||||
|
||||
|
@ -2490,7 +2486,7 @@ bool CInputDB::Process(LPDESC d, const void * orig, int bytes, int & r_iBytesPro
|
|||
m_dwHandle = *((DWORD *) (c_pData + 1)); // 4
|
||||
iSize = *((DWORD *) (c_pData + 5)); // 4
|
||||
|
||||
sys_log(1, "DBCLIENT: header %d handle %d size %d bytes %d", bHeader, m_dwHandle, iSize, bytes);
|
||||
SPDLOG_TRACE("DBCLIENT: header {} handle {} size {} bytes {}", bHeader, m_dwHandle, iSize, bytes);
|
||||
|
||||
if (m_iBufferLeft - 9 < iSize)
|
||||
return true;
|
||||
|
@ -2499,7 +2495,7 @@ bool CInputDB::Process(LPDESC d, const void * orig, int bytes, int & r_iBytesPro
|
|||
|
||||
if (Analyze(d, bHeader, pRealData) < 0)
|
||||
{
|
||||
sys_err("in InputDB: UNKNOWN HEADER: %d, LAST HEADER: %d(%d), REMAIN BYTES: %d",
|
||||
SPDLOG_ERROR("in InputDB: UNKNOWN HEADER: {}, LAST HEADER: {}({}), REMAIN BYTES: {}",
|
||||
bHeader, bLastHeader, iLastPacketLen, m_iBufferLeft);
|
||||
|
||||
//printdata((BYTE*) orig, bytes);
|
||||
|
@ -2589,7 +2585,7 @@ void CInputDB::ChangeMonarchLord(TPacketChangeMonarchLordACK* info)
|
|||
void CInputDB::UpdateMonarchInfo(TMonarchInfo* info)
|
||||
{
|
||||
CMonarch::instance().SetMonarchInfo(info);
|
||||
sys_log(0, "MONARCH INFO UPDATED");
|
||||
SPDLOG_INFO("MONARCH INFO UPDATED");
|
||||
}
|
||||
|
||||
void CInputDB::AddBlockCountryIp(TPacketBlockCountryIp * data)
|
||||
|
|
|
@ -26,7 +26,6 @@
|
|||
#include "OXEvent.h"
|
||||
#include "priv_manager.h"
|
||||
#include "block_country.h"
|
||||
#include "dev_log.h"
|
||||
#include "log.h"
|
||||
#include "horsename_manager.h"
|
||||
#include "MarkManager.h"
|
||||
|
@ -89,7 +88,7 @@ void CInputLogin::Login(LPDESC d, const char * data)
|
|||
char login[LOGIN_MAX_LEN + 1];
|
||||
trim_and_lower(pinfo->login, login, sizeof(login));
|
||||
|
||||
sys_log(0, "InputLogin::Login : %s", login);
|
||||
SPDLOG_DEBUG("InputLogin::Login : {}", login);
|
||||
|
||||
TPacketGCLoginFailure failurePacket;
|
||||
|
||||
|
@ -143,16 +142,16 @@ void CInputLogin::LoginByKey(LPDESC d, const char * data)
|
|||
|
||||
// is blocked ip?
|
||||
{
|
||||
dev_log(LOG_DEB0, "check_blocked_country_start");
|
||||
SPDLOG_TRACE("check_blocked_country_start");
|
||||
|
||||
if (!is_block_exception(login) && is_blocked_country_ip(d->GetHostName()))
|
||||
{
|
||||
sys_log(0, "BLOCK_COUNTRY_IP (%s)", d->GetHostName());
|
||||
SPDLOG_DEBUG("BLOCK_COUNTRY_IP ({})", d->GetHostName());
|
||||
d->SetPhase(PHASE_CLOSE);
|
||||
return;
|
||||
}
|
||||
|
||||
dev_log(LOG_DEB0, "check_blocked_country_end");
|
||||
SPDLOG_TRACE("check_blocked_country_end");
|
||||
}
|
||||
|
||||
if (g_bNoMoreClient)
|
||||
|
@ -185,7 +184,7 @@ void CInputLogin::LoginByKey(LPDESC d, const char * data)
|
|||
}
|
||||
}
|
||||
|
||||
sys_log(0, "LOGIN_BY_KEY: %s key %u", login, pinfo->dwLoginKey);
|
||||
SPDLOG_DEBUG("LOGIN_BY_KEY: {} key {}", login, pinfo->dwLoginKey);
|
||||
|
||||
d->SetLoginKey(pinfo->dwLoginKey);
|
||||
|
||||
|
@ -206,7 +205,7 @@ void CInputLogin::ChangeName(LPDESC d, const char * data)
|
|||
|
||||
if (!c_r.id)
|
||||
{
|
||||
sys_err("no account table");
|
||||
SPDLOG_ERROR("no account table");
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -234,23 +233,23 @@ void CInputLogin::CharacterSelect(LPDESC d, const char * data)
|
|||
struct command_player_select * pinfo = (struct command_player_select *) data;
|
||||
const TAccountTable & c_r = d->GetAccountTable();
|
||||
|
||||
sys_log(0, "player_select: login: %s index: %d", c_r.login, pinfo->index);
|
||||
SPDLOG_DEBUG("player_select: login: {} index: {}", c_r.login, pinfo->index);
|
||||
|
||||
if (!c_r.id)
|
||||
{
|
||||
sys_err("no account table");
|
||||
SPDLOG_ERROR("no account table");
|
||||
return;
|
||||
}
|
||||
|
||||
if (pinfo->index >= PLAYER_PER_ACCOUNT)
|
||||
{
|
||||
sys_err("index overflow %d, login: %s", pinfo->index, c_r.login);
|
||||
SPDLOG_ERROR("index overflow {}, login: {}", pinfo->index, c_r.login);
|
||||
return;
|
||||
}
|
||||
|
||||
if (c_r.players[pinfo->index].bChangeName)
|
||||
{
|
||||
sys_err("name must be changed idx %d, login %s, name %s",
|
||||
SPDLOG_ERROR("name must be changed idx {}, login {}, name {}",
|
||||
pinfo->index, c_r.login, c_r.players[pinfo->index].szName);
|
||||
return;
|
||||
}
|
||||
|
@ -379,7 +378,7 @@ bool NewPlayerTable2(TPlayerTable * table, const char * name, BYTE race, BYTE sh
|
|||
{
|
||||
if (race >= MAIN_RACE_MAX_NUM)
|
||||
{
|
||||
sys_err("NewPlayerTable2.OUT_OF_RACE_RANGE(%d >= max(%d))\n", race, MAIN_RACE_MAX_NUM);
|
||||
SPDLOG_ERROR("NewPlayerTable2.OUT_OF_RACE_RANGE({} >= max({}))", race, (int) MAIN_RACE_MAX_NUM);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -387,11 +386,11 @@ bool NewPlayerTable2(TPlayerTable * table, const char * name, BYTE race, BYTE sh
|
|||
|
||||
if (!RaceToJob(race, &job))
|
||||
{
|
||||
sys_err("NewPlayerTable2.RACE_TO_JOB_ERROR(%d)\n", race);
|
||||
SPDLOG_ERROR("NewPlayerTable2.RACE_TO_JOB_ERROR({})", race);
|
||||
return false;
|
||||
}
|
||||
|
||||
sys_log(0, "NewPlayerTable2(name=%s, race=%d, job=%d)", name, race, job);
|
||||
SPDLOG_DEBUG("NewPlayerTable2(name={}, race={}, job={})", name, race, job);
|
||||
|
||||
memset(table, 0, sizeof(TPlayerTable));
|
||||
|
||||
|
@ -428,7 +427,7 @@ void CInputLogin::CharacterCreate(LPDESC d, const char * data)
|
|||
struct command_player_create * pinfo = (struct command_player_create *) data;
|
||||
TPlayerCreatePacket player_create_packet;
|
||||
|
||||
sys_log(0, "PlayerCreate: name %s pos %d job %d shape %d",
|
||||
SPDLOG_DEBUG("PlayerCreate: name {} pos {} job {} shape {}",
|
||||
pinfo->name,
|
||||
pinfo->index,
|
||||
pinfo->job,
|
||||
|
@ -480,7 +479,7 @@ void CInputLogin::CharacterCreate(LPDESC d, const char * data)
|
|||
|
||||
if (!NewPlayerTable2(&player_create_packet.player_table, pinfo->name, pinfo->job, pinfo->shape, d->GetEmpire()))
|
||||
{
|
||||
sys_err("player_prototype error: job %d face %d ", pinfo->job);
|
||||
SPDLOG_ERROR("player_prototype error: job {} face {} ", pinfo->job);
|
||||
d->Packet(&packFailure, sizeof(packFailure));
|
||||
return;
|
||||
}
|
||||
|
@ -493,7 +492,7 @@ void CInputLogin::CharacterCreate(LPDESC d, const char * data)
|
|||
player_create_packet.account_id = c_rAccountTable.id;
|
||||
player_create_packet.account_index = pinfo->index;
|
||||
|
||||
sys_log(0, "PlayerCreate: name %s account_id %d, TPlayerCreatePacketSize(%d), Packet->Gold %d",
|
||||
SPDLOG_DEBUG("PlayerCreate: name {} account_id {}, TPlayerCreatePacketSize({}), Packet->Gold {}",
|
||||
pinfo->name,
|
||||
pinfo->index,
|
||||
sizeof(TPlayerCreatePacket),
|
||||
|
@ -509,21 +508,21 @@ void CInputLogin::CharacterDelete(LPDESC d, const char * data)
|
|||
|
||||
if (!c_rAccountTable.id)
|
||||
{
|
||||
sys_err("PlayerDelete: no login data");
|
||||
SPDLOG_ERROR("PlayerDelete: no login data");
|
||||
return;
|
||||
}
|
||||
|
||||
sys_log(0, "PlayerDelete: login: %s index: %d, social_id %s", c_rAccountTable.login, pinfo->index, pinfo->private_code);
|
||||
SPDLOG_DEBUG("PlayerDelete: login: {} index: {}, social_id {}", c_rAccountTable.login, pinfo->index, pinfo->private_code);
|
||||
|
||||
if (pinfo->index >= PLAYER_PER_ACCOUNT)
|
||||
{
|
||||
sys_err("PlayerDelete: index overflow %d, login: %s", pinfo->index, c_rAccountTable.login);
|
||||
SPDLOG_ERROR("PlayerDelete: index overflow {}, login: {}", pinfo->index, c_rAccountTable.login);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!c_rAccountTable.players[pinfo->index].dwID)
|
||||
{
|
||||
sys_err("PlayerDelete: Wrong Social ID index %d, login: %s", pinfo->index, c_rAccountTable.login);
|
||||
SPDLOG_ERROR("PlayerDelete: Wrong Social ID index {}, login: {}", pinfo->index, c_rAccountTable.login);
|
||||
d->Packet(encode_byte(HEADER_GC_CHARACTER_DELETE_WRONG_SOCIAL_ID), 1);
|
||||
return;
|
||||
}
|
||||
|
@ -564,7 +563,7 @@ void CInputLogin::Entergame(LPDESC d, const char * data)
|
|||
PIXEL_POSITION pos2;
|
||||
SECTREE_MANAGER::instance().GetRecallPositionByEmpire(ch->GetMapIndex(), ch->GetEmpire(), pos2);
|
||||
|
||||
sys_err("!GetMovablePosition (name %s %dx%d map %d changed to %dx%d)",
|
||||
SPDLOG_ERROR("!GetMovablePosition (name {} {}x{} map {} changed to {}x{})",
|
||||
ch->GetName(),
|
||||
pos.x, pos.y,
|
||||
ch->GetMapIndex(),
|
||||
|
@ -585,7 +584,7 @@ void CInputLogin::Entergame(LPDESC d, const char * data)
|
|||
if(ch->GetItemAward_cmd()) //게임페이즈 들어가면
|
||||
quest::CQuestManager::instance().ItemInformer(ch->GetPlayerID(),ch->GetItemAward_vnum()); //questmanager 호출
|
||||
|
||||
sys_log(0, "ENTERGAME: %s %dx%dx%d %s map_index %d",
|
||||
SPDLOG_DEBUG("ENTERGAME: {} {}x{}x{} {} map_index {}",
|
||||
ch->GetName(), ch->GetX(), ch->GetY(), ch->GetZ(), d->GetHostName(), ch->GetMapIndex());
|
||||
|
||||
if (ch->GetHorseLevel() > 0)
|
||||
|
@ -635,7 +634,7 @@ void CInputLogin::Entergame(LPDESC d, const char * data)
|
|||
continue;
|
||||
|
||||
ch->AddAffect(AFFECT_PREMIUM_START + i, POINT_NONE, 0, 0, remain, 0, true);
|
||||
sys_log(0, "PREMIUM: %s type %d %dmin", ch->GetName(), i, remain);
|
||||
SPDLOG_DEBUG("PREMIUM: {} type {} {}min", ch->GetName(), i, remain);
|
||||
}
|
||||
|
||||
if (LC_IsEurope())
|
||||
|
@ -645,7 +644,7 @@ void CInputLogin::Entergame(LPDESC d, const char * data)
|
|||
int version = atoi(g_stClientVersion.c_str());
|
||||
int date = atoi(d->GetClientVersion());
|
||||
|
||||
sys_log(0, "VERSION CHECK %d %d %s %s", version, date, g_stClientVersion.c_str(), d->GetClientVersion());
|
||||
SPDLOG_DEBUG("VERSION CHECK {} {} {} {}", version, date, g_stClientVersion.c_str(), d->GetClientVersion());
|
||||
|
||||
if (!d->GetClientVersion())
|
||||
{
|
||||
|
@ -660,7 +659,7 @@ void CInputLogin::Entergame(LPDESC d, const char * data)
|
|||
d->DelayedDisconnect(10);
|
||||
LogManager::instance().HackLog("VERSION_CONFLICT", ch);
|
||||
|
||||
sys_log(0, "VERSION : WRONG VERSION USER : account:%s name:%s hostName:%s server_version:%s client_version:%s",
|
||||
SPDLOG_WARN("VERSION : WRONG VERSION USER : account:{} name:{} hostName:{} server_version:{} client_version:{}",
|
||||
d->GetAccountTable().login,
|
||||
ch->GetName(),
|
||||
d->GetHostName(),
|
||||
|
@ -671,12 +670,12 @@ void CInputLogin::Entergame(LPDESC d, const char * data)
|
|||
}
|
||||
else
|
||||
{
|
||||
sys_log(0, "VERSION : NO CHECK");
|
||||
SPDLOG_WARN("VERSION : NO CHECK");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
sys_log(0, "VERSION : NO LOGIN");
|
||||
SPDLOG_WARN("VERSION : NO LOGIN");
|
||||
}
|
||||
|
||||
if (LC_IsEurope() == true)
|
||||
|
@ -704,7 +703,7 @@ void CInputLogin::Entergame(LPDESC d, const char * data)
|
|||
ch->SetArenaObserverMode(true);
|
||||
if (CArenaManager::instance().RegisterObserverPtr(ch, ch->GetMapIndex(), ch->GetX()/100, ch->GetY()/100))
|
||||
{
|
||||
sys_log(0, "ARENA : Observer add failed");
|
||||
SPDLOG_ERROR("ARENA : Observer add failed");
|
||||
}
|
||||
|
||||
if (ch->IsHorseRiding() == true)
|
||||
|
@ -780,7 +779,7 @@ void CInputLogin::Entergame(LPDESC d, const char * data)
|
|||
p.id = d->GetAccountTable().id;
|
||||
|
||||
g_TeenDesc->Packet(&p, sizeof(p));
|
||||
sys_log(0, "TEEN_SEND: (%u, %s)", d->GetAccountTable().id, ch->GetName());
|
||||
SPDLOG_DEBUG("TEEN_SEND: ({}, {})", d->GetAccountTable().id, ch->GetName());
|
||||
}
|
||||
|
||||
if (ch->GetHorseLevel() > 0)
|
||||
|
@ -821,7 +820,7 @@ void CInputLogin::Empire(LPDESC d, const char * c_pData)
|
|||
{
|
||||
if (0 != r.players[i].dwID)
|
||||
{
|
||||
sys_err("EmpireSelectFailed %d", r.players[i].dwID);
|
||||
SPDLOG_ERROR("EmpireSelectFailed {}", r.players[i].dwID);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -840,7 +839,7 @@ int CInputLogin::GuildSymbolUpload(LPDESC d, const char* c_pData, size_t uiBytes
|
|||
if (uiBytes < sizeof(TPacketCGGuildSymbolUpload))
|
||||
return -1;
|
||||
|
||||
sys_log(0, "GuildSymbolUpload uiBytes %u", uiBytes);
|
||||
SPDLOG_DEBUG("GuildSymbolUpload uiBytes {}", uiBytes);
|
||||
|
||||
TPacketCGGuildSymbolUpload* p = (TPacketCGGuildSymbolUpload*) c_pData;
|
||||
|
||||
|
@ -865,7 +864,7 @@ int CInputLogin::GuildSymbolUpload(LPDESC d, const char* c_pData, size_t uiBytes
|
|||
return 0;
|
||||
}
|
||||
|
||||
sys_log(0, "GuildSymbolUpload Do Upload %02X%02X%02X%02X %d", c_pData[7], c_pData[8], c_pData[9], c_pData[10], sizeof(*p));
|
||||
SPDLOG_DEBUG("GuildSymbolUpload Do Upload {:02X}{:02X}{:02X}{:02X} {}", c_pData[7], c_pData[8], c_pData[9], c_pData[10], sizeof(*p));
|
||||
|
||||
CGuildMarkManager::instance().UploadSymbol(p->guild_id, iSymbolSize, (const BYTE*)(c_pData + sizeof(*p)));
|
||||
CGuildMarkManager::instance().SaveSymbol(GUILD_SYMBOL_FILENAME);
|
||||
|
@ -876,14 +875,14 @@ void CInputLogin::GuildSymbolCRC(LPDESC d, const char* c_pData)
|
|||
{
|
||||
const TPacketCGSymbolCRC & CGPacket = *((TPacketCGSymbolCRC *) c_pData);
|
||||
|
||||
sys_log(0, "GuildSymbolCRC %u %u %u", CGPacket.guild_id, CGPacket.crc, CGPacket.size);
|
||||
SPDLOG_DEBUG("GuildSymbolCRC {} {} {}", CGPacket.guild_id, CGPacket.crc, CGPacket.size);
|
||||
|
||||
const CGuildMarkManager::TGuildSymbol * pkGS = CGuildMarkManager::instance().GetGuildSymbol(CGPacket.guild_id);
|
||||
|
||||
if (!pkGS)
|
||||
return;
|
||||
|
||||
sys_log(0, " Server %u %u", pkGS->crc, pkGS->raw.size());
|
||||
SPDLOG_DEBUG(" Server {} {}", pkGS->crc, pkGS->raw.size());
|
||||
|
||||
if (pkGS->raw.size() != CGPacket.size || pkGS->crc != CGPacket.crc)
|
||||
{
|
||||
|
@ -896,7 +895,7 @@ void CInputLogin::GuildSymbolCRC(LPDESC d, const char* c_pData)
|
|||
d->RawPacket(&GCPacket, sizeof(GCPacket));
|
||||
d->Packet(&pkGS->raw[0], pkGS->raw.size());
|
||||
|
||||
sys_log(0, "SendGuildSymbolHead %02X%02X%02X%02X Size %d",
|
||||
SPDLOG_DEBUG("SendGuildSymbolHead {:02X}{:02X}{:02X}{:02X} Size {}",
|
||||
pkGS->raw[0], pkGS->raw[1], pkGS->raw[2], pkGS->raw[3], pkGS->raw.size());
|
||||
}
|
||||
}
|
||||
|
@ -909,19 +908,19 @@ void CInputLogin::GuildMarkUpload(LPDESC d, const char* c_pData)
|
|||
|
||||
if (!(pkGuild = rkGuildMgr.FindGuild(p->gid)))
|
||||
{
|
||||
sys_err("MARK_SERVER: GuildMarkUpload: no guild. gid %u", p->gid);
|
||||
SPDLOG_ERROR("MARK_SERVER: GuildMarkUpload: no guild. gid {}", p->gid);
|
||||
return;
|
||||
}
|
||||
|
||||
if (pkGuild->GetLevel() < guild_mark_min_level)
|
||||
{
|
||||
sys_log(0, "MARK_SERVER: GuildMarkUpload: level < %u (%u)", guild_mark_min_level, pkGuild->GetLevel());
|
||||
SPDLOG_DEBUG("MARK_SERVER: GuildMarkUpload: level < {} ({})", guild_mark_min_level, pkGuild->GetLevel());
|
||||
return;
|
||||
}
|
||||
|
||||
CGuildMarkManager & rkMarkMgr = CGuildMarkManager::instance();
|
||||
|
||||
sys_log(0, "MARK_SERVER: GuildMarkUpload: gid %u", p->gid);
|
||||
SPDLOG_DEBUG("MARK_SERVER: GuildMarkUpload: gid {}", p->gid);
|
||||
|
||||
bool isEmpty = true;
|
||||
|
||||
|
@ -962,7 +961,7 @@ void CInputLogin::GuildMarkIDXList(LPDESC d, const char* c_pData)
|
|||
else
|
||||
d->Packet(&p, sizeof(p));
|
||||
|
||||
sys_log(0, "MARK_SERVER: GuildMarkIDXList %d bytes sent.", p.bufSize);
|
||||
SPDLOG_DEBUG("MARK_SERVER: GuildMarkIDXList {} bytes sent.", p.bufSize);
|
||||
}
|
||||
|
||||
void CInputLogin::GuildMarkCRCList(LPDESC d, const char* c_pData)
|
||||
|
@ -994,7 +993,7 @@ void CInputLogin::GuildMarkCRCList(LPDESC d, const char* c_pData)
|
|||
pGC.bufSize = buf.size() + sizeof(TPacketGCMarkBlock);
|
||||
pGC.count = blockCount;
|
||||
|
||||
sys_log(0, "MARK_SERVER: Sending blocks. (imgIdx %u diff %u size %u)", pCG->imgIdx, mapDiffBlocks.size(), pGC.bufSize);
|
||||
SPDLOG_DEBUG("MARK_SERVER: Sending blocks. (imgIdx {} diff {} size {})", pCG->imgIdx, mapDiffBlocks.size(), pGC.bufSize);
|
||||
|
||||
if (buf.size() > 0)
|
||||
{
|
||||
|
@ -1091,7 +1090,7 @@ int CInputLogin::Analyze(LPDESC d, BYTE bHeader, const char * c_pData)
|
|||
break;
|
||||
|
||||
default:
|
||||
sys_err("login phase does not handle this packet! header %d", bHeader);
|
||||
SPDLOG_ERROR("login phase does not handle this packet! header {}", bHeader);
|
||||
//d->SetPhase(PHASE_CLOSE);
|
||||
return (0);
|
||||
}
|
||||
|
|
|
@ -95,7 +95,7 @@ EVENTFUNC(block_chat_by_ip_event)
|
|||
|
||||
if ( info == NULL )
|
||||
{
|
||||
sys_err( "block_chat_by_ip_event> <Factor> Null pointer" );
|
||||
SPDLOG_ERROR("block_chat_by_ip_event> <Factor> Null pointer" );
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -138,7 +138,7 @@ bool SpamBlockCheck(LPCHARACTER ch, const char* const buf, const size_t buflen)
|
|||
it->second.first += score;
|
||||
|
||||
if (word)
|
||||
sys_log(0, "SPAM_SCORE: %s text: %s score: %u total: %u word: %s", ch->GetName(), buf, score, it->second.first, word);
|
||||
SPDLOG_DEBUG("SPAM_SCORE: {} text: {} score: {} total: {} word: {}", ch->GetName(), buf, score, it->second.first, word);
|
||||
|
||||
extern unsigned int g_uiSpamBlockScore;
|
||||
extern unsigned int g_uiSpamBlockDuration;
|
||||
|
@ -149,7 +149,7 @@ bool SpamBlockCheck(LPCHARACTER ch, const char* const buf, const size_t buflen)
|
|||
strlcpy(info->host, ch->GetDesc()->GetHostName(), sizeof(info->host));
|
||||
|
||||
it->second.second = event_create(block_chat_by_ip_event, info, PASSES_PER_SEC(g_uiSpamBlockDuration));
|
||||
sys_log(0, "SPAM_IP: %s for %u seconds", info->host, g_uiSpamBlockDuration);
|
||||
SPDLOG_DEBUG("SPAM_IP: {} for {} seconds", info->host, g_uiSpamBlockDuration);
|
||||
|
||||
LogManager::instance().CharLog(ch, 0, "SPAM", word);
|
||||
|
||||
|
@ -288,7 +288,7 @@ int CInputMain::Whisper(LPCHARACTER ch, const char * data, size_t uiBytes)
|
|||
|
||||
if (iExtraLen < 0)
|
||||
{
|
||||
sys_err("invalid packet length (len %d size %u buffer %u)", iExtraLen, pinfo->wSize, uiBytes);
|
||||
SPDLOG_ERROR("invalid packet length (len {} size {} buffer {})", iExtraLen, pinfo->wSize, uiBytes);
|
||||
ch->GetDesc()->SetPhase(PHASE_CLOSE);
|
||||
return -1;
|
||||
}
|
||||
|
@ -311,9 +311,9 @@ int CInputMain::Whisper(LPCHARACTER ch, const char * data, size_t uiBytes)
|
|||
if (test_server)
|
||||
{
|
||||
if (!pkChr)
|
||||
sys_log(0, "Whisper to %s(%s) from %s", "Null", pinfo->szNameTo, ch->GetName());
|
||||
SPDLOG_DEBUG("Whisper to {}({}) from {}", "Null", pinfo->szNameTo, ch->GetName());
|
||||
else
|
||||
sys_log(0, "Whisper to %s(%s) from %s", pkChr->GetName(), pinfo->szNameTo, ch->GetName());
|
||||
SPDLOG_DEBUG("Whisper to {}({}) from {}", pkChr->GetName(), pinfo->szNameTo, ch->GetName());
|
||||
}
|
||||
|
||||
if (ch->IsBlockMode(BLOCK_WHISPER))
|
||||
|
@ -340,8 +340,7 @@ int CInputMain::Whisper(LPCHARACTER ch, const char * data, size_t uiBytes)
|
|||
pkDesc->SetRelay(pinfo->szNameTo);
|
||||
bOpponentEmpire = pkCCI->bEmpire;
|
||||
|
||||
if (test_server)
|
||||
sys_log(0, "Whisper to %s from %s (Channel %d Mapindex %d)", "Null", ch->GetName(), pkCCI->bChannel, pkCCI->lMapIndex);
|
||||
SPDLOG_TRACE("Whisper to {} from {} (Channel {} Mapindex {})", "Null", ch->GetName(), pkCCI->bChannel, pkCCI->lMapIndex);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -361,7 +360,7 @@ int CInputMain::Whisper(LPCHARACTER ch, const char * data, size_t uiBytes)
|
|||
pack.wSize = sizeof(TPacketGCWhisper);
|
||||
strlcpy(pack.szNameFrom, pinfo->szNameTo, sizeof(pack.szNameFrom));
|
||||
ch->GetDesc()->Packet(&pack, sizeof(TPacketGCWhisper));
|
||||
sys_log(0, "WHISPER: no player");
|
||||
SPDLOG_DEBUG("WHISPER: no player");
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -467,7 +466,7 @@ int CInputMain::Whisper(LPCHARACTER ch, const char * data, size_t uiBytes)
|
|||
ch->GetDesc()->RawPacket(&pack, sizeof(pack));
|
||||
ch->GetDesc()->Packet(buf, len);
|
||||
|
||||
sys_log(0, "WHISPER: not enough %s: char: %s", pTable->szLocaleName, ch->GetName());
|
||||
SPDLOG_DEBUG("WHISPER: not enough {}: char: {}", pTable->szLocaleName, ch->GetName());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -499,7 +498,7 @@ int CInputMain::Whisper(LPCHARACTER ch, const char * data, size_t uiBytes)
|
|||
|
||||
if (LC_IsEurope() != true)
|
||||
{
|
||||
sys_log(0, "WHISPER: %s -> %s : %s", ch->GetName(), pinfo->szNameTo, buf);
|
||||
SPDLOG_DEBUG("WHISPER: {} -> {} : {}", ch->GetName(), pinfo->szNameTo, buf);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -648,7 +647,7 @@ int CInputMain::Chat(LPCHARACTER ch, const char * data, size_t uiBytes)
|
|||
|
||||
if (iExtraLen < 0)
|
||||
{
|
||||
sys_err("invalid packet length (len %d size %u buffer %u)", iExtraLen, pinfo->size, uiBytes);
|
||||
SPDLOG_ERROR("invalid packet length (len {} size {} buffer {})", iExtraLen, pinfo->size, uiBytes);
|
||||
ch->GetDesc()->SetPhase(PHASE_CLOSE);
|
||||
return -1;
|
||||
}
|
||||
|
@ -667,7 +666,7 @@ int CInputMain::Chat(LPCHARACTER ch, const char * data, size_t uiBytes)
|
|||
{
|
||||
if (ch->GetChatCounter() == 10)
|
||||
{
|
||||
sys_log(0, "CHAT_HACK: %s", ch->GetName());
|
||||
SPDLOG_WARN("CHAT_HACK: {}", ch->GetName());
|
||||
ch->GetDesc()->DelayedDisconnect(5);
|
||||
}
|
||||
|
||||
|
@ -814,7 +813,7 @@ int CInputMain::Chat(LPCHARACTER ch, const char * data, size_t uiBytes)
|
|||
break;
|
||||
|
||||
default:
|
||||
sys_err("Unknown chat type %d", pinfo->type);
|
||||
SPDLOG_ERROR("Unknown chat type {}", pinfo->type);
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -1003,7 +1002,7 @@ int CInputMain::Messenger(LPCHARACTER ch, const char* c_pData, size_t uiBytes)
|
|||
return CHARACTER_NAME_MAX_LEN;
|
||||
|
||||
default:
|
||||
sys_err("CInputMain::Messenger : Unknown subheader %d : %s", p->subheader, ch->GetName());
|
||||
SPDLOG_ERROR("CInputMain::Messenger : Unknown subheader {} : {}", p->subheader, ch->GetName());
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -1017,8 +1016,7 @@ int CInputMain::Shop(LPCHARACTER ch, const char * data, size_t uiBytes)
|
|||
if (uiBytes < sizeof(TPacketCGShop))
|
||||
return -1;
|
||||
|
||||
if (test_server)
|
||||
sys_log(0, "CInputMain::Shop() ==> SubHeader %d", p->subheader);
|
||||
SPDLOG_TRACE("CInputMain::Shop() ==> SubHeader {}", p->subheader);
|
||||
|
||||
const char * c_pData = data + sizeof(TPacketCGShop);
|
||||
uiBytes -= sizeof(TPacketCGShop);
|
||||
|
@ -1026,7 +1024,7 @@ int CInputMain::Shop(LPCHARACTER ch, const char * data, size_t uiBytes)
|
|||
switch (p->subheader)
|
||||
{
|
||||
case SHOP_SUBHEADER_CG_END:
|
||||
sys_log(1, "INPUT: %s SHOP: END", ch->GetName());
|
||||
SPDLOG_DEBUG("INPUT: {} SHOP: END", ch->GetName());
|
||||
CShopManager::instance().StopShopping(ch);
|
||||
return 0;
|
||||
|
||||
|
@ -1036,7 +1034,7 @@ int CInputMain::Shop(LPCHARACTER ch, const char * data, size_t uiBytes)
|
|||
return -1;
|
||||
|
||||
BYTE bPos = *(c_pData + 1);
|
||||
sys_log(1, "INPUT: %s SHOP: BUY %d", ch->GetName(), bPos);
|
||||
SPDLOG_DEBUG("INPUT: {} SHOP: BUY {}", ch->GetName(), bPos);
|
||||
CShopManager::instance().Buy(ch, bPos);
|
||||
return (sizeof(BYTE) + sizeof(BYTE));
|
||||
}
|
||||
|
@ -1048,7 +1046,7 @@ int CInputMain::Shop(LPCHARACTER ch, const char * data, size_t uiBytes)
|
|||
|
||||
BYTE pos = *c_pData;
|
||||
|
||||
sys_log(0, "INPUT: %s SHOP: SELL", ch->GetName());
|
||||
SPDLOG_DEBUG("INPUT: {} SHOP: SELL", ch->GetName());
|
||||
CShopManager::instance().Sell(ch, pos);
|
||||
return sizeof(BYTE);
|
||||
}
|
||||
|
@ -1061,13 +1059,13 @@ int CInputMain::Shop(LPCHARACTER ch, const char * data, size_t uiBytes)
|
|||
BYTE pos = *(c_pData++);
|
||||
BYTE count = *(c_pData);
|
||||
|
||||
sys_log(0, "INPUT: %s SHOP: SELL2", ch->GetName());
|
||||
SPDLOG_DEBUG("INPUT: {} SHOP: SELL2", ch->GetName());
|
||||
CShopManager::instance().Sell(ch, pos, count);
|
||||
return sizeof(BYTE) + sizeof(BYTE);
|
||||
}
|
||||
|
||||
default:
|
||||
sys_err("CInputMain::Shop : Unknown subheader %d : %s", p->subheader, ch->GetName());
|
||||
SPDLOG_ERROR("CInputMain::Shop : Unknown subheader {} : {}", p->subheader, ch->GetName());
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -1081,10 +1079,8 @@ void CInputMain::OnClick(LPCHARACTER ch, const char * data)
|
|||
|
||||
if ((victim = CHARACTER_MANAGER::instance().Find(pinfo->vid)))
|
||||
victim->OnClick(ch);
|
||||
else if (test_server)
|
||||
{
|
||||
sys_err("CInputMain::OnClick %s.Click.NOT_EXIST_VID[%d]", ch->GetName(), pinfo->vid);
|
||||
}
|
||||
else
|
||||
SPDLOG_TRACE("CInputMain::OnClick {}.Click.NOT_EXIST_VID[{}]", ch->GetName(), pinfo->vid);
|
||||
}
|
||||
|
||||
void CInputMain::Exchange(LPCHARACTER ch, const char * data)
|
||||
|
@ -1111,7 +1107,7 @@ void CInputMain::Exchange(LPCHARACTER ch, const char * data)
|
|||
}
|
||||
}
|
||||
|
||||
sys_log(0, "CInputMain()::Exchange() SubHeader %d ", pinfo->sub_header);
|
||||
SPDLOG_DEBUG("CInputMain()::Exchange() SubHeader {} ", pinfo->sub_header);
|
||||
|
||||
if (iPulse - ch->GetSafeboxLoadTime() < PASSES_PER_SEC(g_nPortalLimitTime))
|
||||
{
|
||||
|
@ -1159,7 +1155,7 @@ void CInputMain::Exchange(LPCHARACTER ch, const char * data)
|
|||
{
|
||||
ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("액수가 20억 냥을 초과하여 거래를 할수가 없습니다.."));
|
||||
|
||||
sys_err("[OVERFLOG_GOLD] START (%u) id %u name %s ", ch->GetGold(), ch->GetPlayerID(), ch->GetName());
|
||||
SPDLOG_ERROR("[OVERFLOG_GOLD] START ({}) id {} name {} ", ch->GetGold(), ch->GetPlayerID(), ch->GetName());
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -1167,7 +1163,7 @@ void CInputMain::Exchange(LPCHARACTER ch, const char * data)
|
|||
{
|
||||
if (quest::CQuestManager::instance().GiveItemToPC(ch->GetPlayerID(), to_ch))
|
||||
{
|
||||
sys_log(0, "Exchange canceled by quest %s %s", ch->GetName(), to_ch->GetName());
|
||||
SPDLOG_DEBUG("Exchange canceled by quest {} {}", ch->GetName(), to_ch->GetName());
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -1209,7 +1205,7 @@ void CInputMain::Exchange(LPCHARACTER ch, const char * data)
|
|||
{
|
||||
ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("상대방의 총금액이 20억 냥을 초과하여 거래를 할수가 없습니다.."));
|
||||
|
||||
sys_err("[OVERFLOW_GOLD] ELK_ADD (%u) id %u name %s ",
|
||||
SPDLOG_ERROR("[OVERFLOW_GOLD] ELK_ADD ({}) id {} name {} ",
|
||||
ch->GetExchange()->GetCompany()->GetOwner()->GetGold(),
|
||||
ch->GetExchange()->GetCompany()->GetOwner()->GetPlayerID(),
|
||||
ch->GetExchange()->GetCompany()->GetOwner()->GetName());
|
||||
|
@ -1225,7 +1221,7 @@ void CInputMain::Exchange(LPCHARACTER ch, const char * data)
|
|||
case EXCHANGE_SUBHEADER_CG_ACCEPT: // arg1 == not used
|
||||
if (ch->GetExchange())
|
||||
{
|
||||
sys_log(0, "CInputMain()::Exchange() ==> ACCEPT ");
|
||||
SPDLOG_DEBUG("CInputMain()::Exchange() ==> ACCEPT ");
|
||||
ch->GetExchange()->Accept(true);
|
||||
}
|
||||
|
||||
|
@ -1276,7 +1272,7 @@ DWORD ClacValidComboInterval( LPCHARACTER ch, BYTE bArg )
|
|||
|
||||
if( !ch )
|
||||
{
|
||||
sys_err( "ClacValidComboInterval() ch is NULL");
|
||||
SPDLOG_ERROR("ClacValidComboInterval() ch is NULL");
|
||||
return nInterval;
|
||||
}
|
||||
|
||||
|
@ -1295,7 +1291,7 @@ DWORD ClacValidComboInterval( LPCHARACTER ch, BYTE bArg )
|
|||
}
|
||||
else
|
||||
{
|
||||
sys_err( "ClacValidComboInterval() Invalid bArg(%d) ch(%s)", bArg, ch->GetName() );
|
||||
SPDLOG_ERROR("ClacValidComboInterval() Invalid bArg({}) ch({})", bArg, ch->GetName() );
|
||||
}
|
||||
|
||||
return nInterval;
|
||||
|
@ -1316,7 +1312,7 @@ bool CheckComboHack(LPCHARACTER ch, BYTE bArg, DWORD dwTime, bool CheckSpeedHack
|
|||
int HackScalar = 0; // 기본 스칼라 단위 1
|
||||
|
||||
// [2013 09 11 CYH] debugging log
|
||||
/*sys_log(0, "COMBO_TEST_LOG: %s arg:%u interval:%d valid:%u atkspd:%u riding:%s",
|
||||
/*SPDLOG_DEBUG("COMBO_TEST_LOG: {} arg:{} interval:{} valid:{} atkspd:{} riding:{}",
|
||||
ch->GetName(),
|
||||
bArg,
|
||||
ComboInterval,
|
||||
|
@ -1325,7 +1321,7 @@ bool CheckComboHack(LPCHARACTER ch, BYTE bArg, DWORD dwTime, bool CheckSpeedHack
|
|||
ch->IsRiding() ? "yes" : "no");*/
|
||||
|
||||
#if 0
|
||||
sys_log(0, "COMBO: %s arg:%u seq:%u delta:%d checkspeedhack:%d",
|
||||
SPDLOG_DEBUG("COMBO: {} arg:{} seq:{} delta:{} checkspeedhack:{}",
|
||||
ch->GetName(), bArg, ch->GetComboSequence(), ComboInterval - ch->GetValidComboInterval(), CheckSpeedHack);
|
||||
#endif
|
||||
// bArg 14 ~ 21번 까지 총 8콤보 가능
|
||||
|
@ -1342,7 +1338,7 @@ bool CheckComboHack(LPCHARACTER ch, BYTE bArg, DWORD dwTime, bool CheckSpeedHack
|
|||
// 이로 인해 콤보핵으로 튕기는 경우가 있어 다음 코드 비 활성화.
|
||||
//HackScalar = 1 + (ch->GetValidComboInterval() - ComboInterval) / 300;
|
||||
|
||||
//sys_log(0, "COMBO_HACK: 2 %s arg:%u interval:%d valid:%u atkspd:%u riding:%s",
|
||||
//SPDLOG_WARN("COMBO_HACK: 2 {} arg:{} interval:{} valid:{} atkspd:{} riding:{}",
|
||||
// ch->GetName(),
|
||||
// bArg,
|
||||
// ComboInterval,
|
||||
|
@ -1365,7 +1361,7 @@ bool CheckComboHack(LPCHARACTER ch, BYTE bArg, DWORD dwTime, bool CheckSpeedHack
|
|||
{
|
||||
HackScalar = 1;
|
||||
ch->SetValidComboInterval(300);
|
||||
sys_log(0, "COMBO_HACK: 5 %s combo_seq:%d", ch->GetName(), ch->GetComboSequence());
|
||||
SPDLOG_WARN("COMBO_HACK: 5 {} combo_seq:{}", ch->GetName(), ch->GetComboSequence());
|
||||
}
|
||||
// 자객 쌍수 콤보 예외처리
|
||||
else if (bArg == 21 &&
|
||||
|
@ -1380,7 +1376,7 @@ bool CheckComboHack(LPCHARACTER ch, BYTE bArg, DWORD dwTime, bool CheckSpeedHack
|
|||
HackScalar = 1;
|
||||
ch->SetValidComboInterval(300);
|
||||
|
||||
sys_log(0, "COMBO_HACK: 3 %s arg:%u valid:%u combo_idx:%d combo_seq:%d",
|
||||
SPDLOG_WARN("COMBO_HACK: 3 {} arg:{} valid:{} combo_idx:{} combo_seq:{}",
|
||||
ch->GetName(),
|
||||
bArg,
|
||||
ComboSequenceBySkillLevel[idx][ch->GetComboSequence()],
|
||||
|
@ -1393,7 +1389,7 @@ bool CheckComboHack(LPCHARACTER ch, BYTE bArg, DWORD dwTime, bool CheckSpeedHack
|
|||
{
|
||||
HackScalar = 1 + (ch->GetValidComboInterval() - ComboInterval) / 100;
|
||||
|
||||
sys_log(0, "COMBO_HACK: 2 %s arg:%u interval:%d valid:%u atkspd:%u riding:%s",
|
||||
SPDLOG_WARN("COMBO_HACK: 2 {} arg:{} interval:{} valid:{} atkspd:{} riding:{}",
|
||||
ch->GetName(),
|
||||
bArg,
|
||||
ComboInterval,
|
||||
|
@ -1424,7 +1420,7 @@ bool CheckComboHack(LPCHARACTER ch, BYTE bArg, DWORD dwTime, bool CheckSpeedHack
|
|||
// 이로 인해 콤보핵으로 튕기는 경우가 있어 다음 코드 비 활성화.
|
||||
//HackScalar = 1 + (ch->GetValidComboInterval() - ComboInterval) / 100;
|
||||
|
||||
//sys_log(0, "COMBO_HACK: 6 %s arg:%u interval:%d valid:%u atkspd:%u",
|
||||
//SPDLOG_WARN("COMBO_HACK: 6 {} arg:{} interval:{} valid:{} atkspd:{}",
|
||||
// ch->GetName(),
|
||||
// bArg,
|
||||
// ComboInterval,
|
||||
|
@ -1441,7 +1437,7 @@ bool CheckComboHack(LPCHARACTER ch, BYTE bArg, DWORD dwTime, bool CheckSpeedHack
|
|||
const CMotion * pkMotion = CMotionManager::instance().GetMotion(ch->GetRaceNum(), MAKE_MOTION_KEY(MOTION_MODE_GENERAL, MOTION_NORMAL_ATTACK));
|
||||
|
||||
if (!pkMotion)
|
||||
sys_err("cannot find motion by race %u", ch->GetRaceNum());
|
||||
SPDLOG_ERROR("cannot find motion by race {}", ch->GetRaceNum());
|
||||
else
|
||||
{
|
||||
// 정상적 계산이라면 1000.f를 곱해야 하지만 클라이언트가 애니메이션 속도의 90%에서
|
||||
|
@ -1466,7 +1462,7 @@ bool CheckComboHack(LPCHARACTER ch, BYTE bArg, DWORD dwTime, bool CheckSpeedHack
|
|||
//if (ch->GetDesc()->DelayedDisconnect(Random::get(2, 9)))
|
||||
//{
|
||||
// LogManager::instance().HackLog("Hacker", ch);
|
||||
// sys_log(0, "HACKER: %s arg %u", ch->GetName(), bArg);
|
||||
// SPDLOG_WARN("HACKER: {} arg {}", ch->GetName(), bArg);
|
||||
//}
|
||||
|
||||
// 위 코드로 인해, 폴리모프를 푸는 중에 공격 하면,
|
||||
|
@ -1491,7 +1487,7 @@ bool CheckComboHack(LPCHARACTER ch, BYTE bArg, DWORD dwTime, bool CheckSpeedHack
|
|||
if (ch->GetDesc()->DelayedDisconnect(Random::get(2, 9)))
|
||||
{
|
||||
LogManager::instance().HackLog("Hacker", ch);
|
||||
sys_log(0, "HACKER: %s arg %u", ch->GetName(), bArg);
|
||||
SPDLOG_WARN("HACKER: {} arg {}", ch->GetName(), bArg);
|
||||
}
|
||||
|
||||
HackScalar = 10;
|
||||
|
@ -1519,7 +1515,7 @@ void CInputMain::Move(LPCHARACTER ch, const char * data)
|
|||
|
||||
if (pinfo->bFunc >= FUNC_MAX_NUM && !(pinfo->bFunc & 0x80))
|
||||
{
|
||||
sys_err("invalid move type: %s", ch->GetName());
|
||||
SPDLOG_ERROR("invalid move type: {}", ch->GetName());
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -1551,7 +1547,7 @@ void CInputMain::Move(LPCHARACTER ch, const char * data)
|
|||
LogManager::instance().HackLog("Teleport", ch); // 부정확할 수 있음
|
||||
}
|
||||
|
||||
sys_log(0, "MOVE: %s trying to move too far (dist: %.1fm) Riding(%d)", ch->GetName(), fDist, ch->IsRiding());
|
||||
SPDLOG_WARN("MOVE: {} trying to move too far (dist: {:.1f}m) Riding({})", ch->GetName(), fDist, ch->IsRiding());
|
||||
|
||||
ch->Show(ch->GetMapIndex(), ch->GetX(), ch->GetY(), ch->GetZ());
|
||||
ch->Stop();
|
||||
|
@ -1575,13 +1571,13 @@ void CInputMain::Move(LPCHARACTER ch, const char * data)
|
|||
// 시간이 늦게간다. 일단 로그만 해둔다. 진짜 이런 사람들이 많은지 체크해야함. TODO
|
||||
if (iDelta >= 30000)
|
||||
{
|
||||
sys_log(0, "SPEEDHACK: slow timer name %s delta %d", ch->GetName(), iDelta);
|
||||
SPDLOG_WARN("SPEEDHACK: slow timer name {} delta {}", ch->GetName(), iDelta);
|
||||
ch->GetDesc()->DelayedDisconnect(3);
|
||||
}
|
||||
// 1초에 20msec 빨리 가는거 까지는 이해한다.
|
||||
else if (iDelta < -(iServerDelta / 50))
|
||||
{
|
||||
sys_log(0, "SPEEDHACK: DETECTED! %s (delta %d %d)", ch->GetName(), iDelta, iServerDelta);
|
||||
SPDLOG_WARN("SPEEDHACK: DETECTED! {} (delta {} {})", ch->GetName(), iDelta, iServerDelta);
|
||||
ch->GetDesc()->DelayedDisconnect(3);
|
||||
}
|
||||
}
|
||||
|
@ -1623,7 +1619,7 @@ void CInputMain::Move(LPCHARACTER ch, const char * data)
|
|||
char szBuf[256];
|
||||
snprintf(szBuf, sizeof(szBuf), "SKILL_HACK: name=%s, job=%d, group=%d, motion=%d", name, job, group, motion);
|
||||
LogManager::instance().HackLog(szBuf, ch->GetDesc()->GetAccountTable().login, ch->GetName(), ch->GetDesc()->GetHostName());
|
||||
sys_log(0, "%s", szBuf);
|
||||
SPDLOG_WARN("{}", szBuf);
|
||||
|
||||
if (test_server)
|
||||
{
|
||||
|
@ -1674,8 +1670,8 @@ void CInputMain::Move(LPCHARACTER ch, const char * data)
|
|||
}
|
||||
*/
|
||||
/*
|
||||
sys_log(0,
|
||||
"MOVE: %s Func:%u Arg:%u Pos:%dx%d Time:%u Dist:%.1f",
|
||||
SPDLOG_TRACE(
|
||||
"MOVE: {} Func:{} Arg:{} Pos:{}x{} Time:{} Dist:{:.1f}",
|
||||
ch->GetName(),
|
||||
pinfo->bFunc,
|
||||
pinfo->bArg,
|
||||
|
@ -1789,14 +1785,14 @@ int CInputMain::SyncPosition(LPCHARACTER ch, const char * c_pcData, size_t uiByt
|
|||
|
||||
if (iExtraLen < 0)
|
||||
{
|
||||
sys_err("invalid packet length (len %d size %u buffer %u)", iExtraLen, pinfo->wSize, uiBytes);
|
||||
SPDLOG_ERROR("invalid packet length (len {} size {} buffer {})", iExtraLen, pinfo->wSize, uiBytes);
|
||||
ch->GetDesc()->SetPhase(PHASE_CLOSE);
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (0 != (iExtraLen % sizeof(TPacketCGSyncPositionElement)))
|
||||
{
|
||||
sys_err("invalid packet length %d (name: %s)", pinfo->wSize, ch->GetName());
|
||||
SPDLOG_ERROR("invalid packet length {} (name: {})", pinfo->wSize, ch->GetName());
|
||||
return iExtraLen;
|
||||
}
|
||||
|
||||
|
@ -1810,7 +1806,7 @@ int CInputMain::SyncPosition(LPCHARACTER ch, const char * c_pcData, size_t uiByt
|
|||
if( iCount > nCountLimit )
|
||||
{
|
||||
//LogManager::instance().HackLog( "SYNC_POSITION_HACK", ch );
|
||||
sys_err( "Too many SyncPosition Count(%d) from Name(%s)", iCount, ch->GetName() );
|
||||
SPDLOG_ERROR("Too many SyncPosition Count({}) from Name({})", iCount, ch->GetName() );
|
||||
//ch->GetDesc()->SetPhase(PHASE_CLOSE);
|
||||
//return -1;
|
||||
iCount = nCountLimit;
|
||||
|
@ -1866,7 +1862,7 @@ int CInputMain::SyncPosition(LPCHARACTER ch, const char * c_pcData, size_t uiByt
|
|||
{
|
||||
LogManager::instance().HackLog( "SYNC_POSITION_HACK", ch );
|
||||
|
||||
sys_err( "Too far SyncPosition DistanceWithSyncOwner(%f)(%s) from Name(%s) CH(%d,%d) VICTIM(%d,%d) SYNC(%d,%d)",
|
||||
SPDLOG_ERROR("Too far SyncPosition DistanceWithSyncOwner({})({}) from Name({}) CH({},{}) VICTIM({},{}) SYNC({},{})",
|
||||
fDistWithSyncOwner, victim->GetName(), ch->GetName(), ch->GetX(), ch->GetY(), victim->GetX(), victim->GetY(),
|
||||
e->lX, e->lY );
|
||||
|
||||
|
@ -1895,7 +1891,7 @@ int CInputMain::SyncPosition(LPCHARACTER ch, const char * c_pcData, size_t uiByt
|
|||
{
|
||||
LogManager::instance().HackLog( "SYNC_POSITION_HACK", ch );
|
||||
|
||||
sys_err( "Too often SyncPosition Interval(%ldms)(%s) from Name(%s) VICTIM(%d,%d) SYNC(%d,%d)",
|
||||
SPDLOG_ERROR("Too often SyncPosition Interval({}ms)({}) from Name({}) VICTIM({},{}) SYNC({},{})",
|
||||
tvDiff->tv_sec * 1000 + tvDiff->tv_usec / 1000, victim->GetName(), ch->GetName(), victim->GetX(), victim->GetY(),
|
||||
e->lX, e->lY );
|
||||
|
||||
|
@ -1908,7 +1904,7 @@ int CInputMain::SyncPosition(LPCHARACTER ch, const char * c_pcData, size_t uiByt
|
|||
{
|
||||
LogManager::instance().HackLog( "SYNC_POSITION_HACK", ch );
|
||||
|
||||
sys_err( "Too far SyncPosition Distance(%f)(%s) from Name(%s) CH(%d,%d) VICTIM(%d,%d) SYNC(%d,%d)",
|
||||
SPDLOG_ERROR("Too far SyncPosition Distance({})({}) from Name({}) CH({},{}) VICTIM({},{}) SYNC({},{})",
|
||||
fDist, victim->GetName(), ch->GetName(), ch->GetX(), ch->GetY(), victim->GetX(), victim->GetY(),
|
||||
e->lX, e->lY );
|
||||
|
||||
|
@ -1950,7 +1946,7 @@ void CInputMain::UseSkill(LPCHARACTER ch, const char * pcData)
|
|||
void CInputMain::ScriptButton(LPCHARACTER ch, const void* c_pData)
|
||||
{
|
||||
TPacketCGScriptButton * p = (TPacketCGScriptButton *) c_pData;
|
||||
sys_log(0, "QUEST ScriptButton pid %d idx %u", ch->GetPlayerID(), p->idx);
|
||||
SPDLOG_DEBUG("QUEST ScriptButton pid {} idx {}", ch->GetPlayerID(), p->idx);
|
||||
|
||||
quest::PC* pc = quest::CQuestManager::instance().GetPCForce(ch->GetPlayerID());
|
||||
if (pc && pc->IsConfirmWait())
|
||||
|
@ -1970,7 +1966,7 @@ void CInputMain::ScriptButton(LPCHARACTER ch, const void* c_pData)
|
|||
void CInputMain::ScriptAnswer(LPCHARACTER ch, const void* c_pData)
|
||||
{
|
||||
TPacketCGScriptAnswer * p = (TPacketCGScriptAnswer *) c_pData;
|
||||
sys_log(0, "QUEST ScriptAnswer pid %d answer %d", ch->GetPlayerID(), p->answer);
|
||||
SPDLOG_DEBUG("QUEST ScriptAnswer pid {} answer {}", ch->GetPlayerID(), p->answer);
|
||||
|
||||
if (p->answer > 250) // 다음 버튼에 대한 응답으로 온 패킷인 경우
|
||||
{
|
||||
|
@ -1987,7 +1983,7 @@ void CInputMain::ScriptAnswer(LPCHARACTER ch, const void* c_pData)
|
|||
void CInputMain::ScriptSelectItem(LPCHARACTER ch, const void* c_pData)
|
||||
{
|
||||
TPacketCGScriptSelectItem* p = (TPacketCGScriptSelectItem*) c_pData;
|
||||
sys_log(0, "QUEST ScriptSelectItem pid %d answer %d", ch->GetPlayerID(), p->selection);
|
||||
SPDLOG_DEBUG("QUEST ScriptSelectItem pid {} answer {}", ch->GetPlayerID(), p->selection);
|
||||
quest::CQuestManager::Instance().SelectItem(ch->GetPlayerID(), p->selection);
|
||||
}
|
||||
// END_OF_SCRIPT_SELECT_ITEM
|
||||
|
@ -1998,7 +1994,7 @@ void CInputMain::QuestInputString(LPCHARACTER ch, const void* c_pData)
|
|||
|
||||
char msg[65];
|
||||
strlcpy(msg, p->msg, sizeof(msg));
|
||||
sys_log(0, "QUEST InputString pid %u msg %s", ch->GetPlayerID(), msg);
|
||||
SPDLOG_DEBUG("QUEST InputString pid {} msg {}", ch->GetPlayerID(), msg);
|
||||
|
||||
quest::CQuestManager::Instance().Input(ch->GetPlayerID(), msg);
|
||||
}
|
||||
|
@ -2009,7 +2005,7 @@ void CInputMain::QuestConfirm(LPCHARACTER ch, const void* c_pData)
|
|||
LPCHARACTER ch_wait = CHARACTER_MANAGER::instance().FindByPID(p->requestPID);
|
||||
if (p->answer)
|
||||
p->answer = quest::CONFIRM_YES;
|
||||
sys_log(0, "QuestConfirm from %s pid %u name %s answer %d", ch->GetName(), p->requestPID, (ch_wait)?ch_wait->GetName():"", p->answer);
|
||||
SPDLOG_DEBUG("QuestConfirm from {} pid {} name {} answer {}", ch->GetName(), p->requestPID, (ch_wait)?ch_wait->GetName():"", p->answer);
|
||||
if (ch_wait)
|
||||
{
|
||||
quest::CQuestManager::Instance().Confirm(ch_wait->GetPlayerID(), (quest::EQuestConfirmType) p->answer, ch->GetPlayerID());
|
||||
|
@ -2164,7 +2160,7 @@ void CInputMain::SafeboxCheckout(LPCHARACTER ch, const char * c_pData, bool bMal
|
|||
{
|
||||
if (NULL == pkItem->GetProto())
|
||||
{
|
||||
sys_err ("pkItem->GetProto() == NULL (id : %d)",pkItem->GetID());
|
||||
SPDLOG_ERROR("pkItem->GetProto() == NULL (id : {})",pkItem->GetID());
|
||||
return ;
|
||||
}
|
||||
// 100% 확률로 속성이 붙어야 하는데 안 붙어있다면 새로 붙힌다. ...............
|
||||
|
@ -2217,7 +2213,7 @@ void CInputMain::PartyInvite(LPCHARACTER ch, const char * c_pData)
|
|||
|
||||
if (!pInvitee || !ch->GetDesc() || !pInvitee->GetDesc())
|
||||
{
|
||||
sys_err("PARTY Cannot find invited character");
|
||||
SPDLOG_ERROR("PARTY Cannot find invited character");
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -2273,7 +2269,7 @@ void CInputMain::PartySetState(LPCHARACTER ch, const char* c_pData)
|
|||
}
|
||||
|
||||
DWORD pid = p->pid;
|
||||
sys_log(0, "PARTY SetRole pid %d to role %d state %s", pid, p->byRole, p->flag ? "on" : "off");
|
||||
SPDLOG_DEBUG("PARTY SetRole pid {} to role {} state {}", pid, p->byRole, p->flag ? "on" : "off");
|
||||
|
||||
switch (p->byRole)
|
||||
{
|
||||
|
@ -2300,7 +2296,7 @@ void CInputMain::PartySetState(LPCHARACTER ch, const char* c_pData)
|
|||
break;
|
||||
|
||||
default:
|
||||
sys_err("wrong byRole in PartySetState Packet name %s state %d", ch->GetName(), p->byRole);
|
||||
SPDLOG_ERROR("wrong byRole in PartySetState Packet name {} state {}", ch->GetName(), p->byRole);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -2778,7 +2774,7 @@ int CInputMain::Guild(LPCHARACTER ch, const char * data, size_t uiBytes)
|
|||
if (length > GUILD_COMMENT_MAX_LEN)
|
||||
{
|
||||
// 잘못된 길이.. 끊어주자.
|
||||
sys_err("POST_COMMENT: %s comment too long (length: %u)", ch->GetName(), length);
|
||||
SPDLOG_ERROR("POST_COMMENT: {} comment too long (length: {})", ch->GetName(), length);
|
||||
ch->GetDesc()->SetPhase(PHASE_CLOSE);
|
||||
return -1;
|
||||
}
|
||||
|
@ -2919,7 +2915,7 @@ int CInputMain::MyShop(LPCHARACTER ch, const char * c_pData, size_t uiBytes)
|
|||
if (ch->GetGold() >= GOLD_MAX)
|
||||
{
|
||||
ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("소유 돈이 20억냥을 넘어 거래를 핼수가 없습니다."));
|
||||
sys_log(0, "MyShop ==> OverFlow Gold id %u name %s ", ch->GetPlayerID(), ch->GetName());
|
||||
SPDLOG_DEBUG("MyShop ==> OverFlow Gold id {} name {} ", ch->GetPlayerID(), ch->GetName());
|
||||
return (iExtraLen);
|
||||
}
|
||||
|
||||
|
@ -2932,7 +2928,7 @@ int CInputMain::MyShop(LPCHARACTER ch, const char * c_pData, size_t uiBytes)
|
|||
return (iExtraLen);
|
||||
}
|
||||
|
||||
sys_log(0, "MyShop count %d", p->bCount);
|
||||
SPDLOG_DEBUG("MyShop count {}", p->bCount);
|
||||
ch->OpenMyShop(p->szSign, (TShopItemTable *) (c_pData + sizeof(TPacketCGMyShop)), p->bCount);
|
||||
return (iExtraLen);
|
||||
}
|
||||
|
@ -2973,12 +2969,12 @@ void CInputMain::Refine(LPCHARACTER ch, const char* c_pData)
|
|||
|
||||
if (p->type == REFINE_TYPE_NORMAL)
|
||||
{
|
||||
sys_log (0, "refine_type_noraml");
|
||||
SPDLOG_DEBUG("refine_type_noraml");
|
||||
ch->DoRefine(item);
|
||||
}
|
||||
else if (p->type == REFINE_TYPE_SCROLL || p->type == REFINE_TYPE_HYUNIRON || p->type == REFINE_TYPE_MUSIN || p->type == REFINE_TYPE_BDRAGON)
|
||||
{
|
||||
sys_log (0, "refine_type_scroll, ...");
|
||||
SPDLOG_DEBUG("refine_type_scroll, ...");
|
||||
ch->DoRefineWithScroll(item);
|
||||
}
|
||||
else if (p->type == REFINE_TYPE_MONEY_ONLY)
|
||||
|
@ -3015,7 +3011,7 @@ int CInputMain::Analyze(LPDESC d, BYTE bHeader, const char * c_pData)
|
|||
|
||||
if (!(ch = d->GetCharacter()))
|
||||
{
|
||||
sys_err("no character on desc");
|
||||
SPDLOG_ERROR("no character on desc");
|
||||
d->SetPhase(PHASE_CLOSE);
|
||||
return (0);
|
||||
}
|
||||
|
@ -3023,7 +3019,7 @@ int CInputMain::Analyze(LPDESC d, BYTE bHeader, const char * c_pData)
|
|||
int iExtraLen = 0;
|
||||
|
||||
if (test_server && bHeader != HEADER_CG_MOVE)
|
||||
sys_log(0, "CInputMain::Analyze() ==> Header [%d] ", bHeader);
|
||||
SPDLOG_TRACE("CInputMain::Analyze() ==> Header [{}] ", bHeader);
|
||||
|
||||
switch (bHeader)
|
||||
{
|
||||
|
@ -3039,7 +3035,7 @@ int CInputMain::Analyze(LPDESC d, BYTE bHeader, const char * c_pData)
|
|||
if (test_server)
|
||||
{
|
||||
char* pBuf = (char*)c_pData;
|
||||
sys_log(0, "%s", pBuf + sizeof(TPacketCGChat));
|
||||
SPDLOG_DEBUG("{}", pBuf + sizeof(TPacketCGChat));
|
||||
}
|
||||
|
||||
if ((iExtraLen = Chat(ch, c_pData, m_iBufferLeft)) < 0)
|
||||
|
@ -3074,7 +3070,7 @@ int CInputMain::Analyze(LPDESC d, BYTE bHeader, const char * c_pData)
|
|||
{
|
||||
if (!*d->GetClientVersion())
|
||||
{
|
||||
sys_err("Version not recieved name %s", ch->GetName());
|
||||
SPDLOG_ERROR("Version not recieved name {}", ch->GetName());
|
||||
d->SetPhase(PHASE_CLOSE);
|
||||
}
|
||||
}
|
||||
|
@ -3308,7 +3304,7 @@ int CInputDead::Analyze(LPDESC d, BYTE bHeader, const char * c_pData)
|
|||
|
||||
if (!(ch = d->GetCharacter()))
|
||||
{
|
||||
sys_err("no character on desc");
|
||||
SPDLOG_ERROR("no character on desc");
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -15,7 +15,6 @@
|
|||
#include "xmas_event.h"
|
||||
#include "affect.h"
|
||||
#include "castle.h"
|
||||
#include "dev_log.h"
|
||||
#include "locale_service.h"
|
||||
#include "questmanager.h"
|
||||
#include "pcbang.h"
|
||||
|
@ -50,12 +49,12 @@ int CInputP2P::Relay(LPDESC d, const char * c_pData, size_t uiBytes)
|
|||
|
||||
if (p->lSize < 0)
|
||||
{
|
||||
sys_err("invalid packet length %d", p->lSize);
|
||||
SPDLOG_ERROR("invalid packet length {}", p->lSize);
|
||||
d->SetPhase(PHASE_CLOSE);
|
||||
return -1;
|
||||
}
|
||||
|
||||
sys_log(0, "InputP2P::Relay : %s size %d", p->szName, p->lSize);
|
||||
SPDLOG_INFO("InputP2P::Relay : {} size {}", p->szName, p->lSize);
|
||||
|
||||
LPCHARACTER pkChr = CHARACTER_MANAGER::instance().FindPC(p->szName);
|
||||
|
||||
|
@ -111,7 +110,7 @@ int CInputP2P::Notice(LPDESC d, const char * c_pData, size_t uiBytes)
|
|||
|
||||
if (p->lSize < 0)
|
||||
{
|
||||
sys_err("invalid packet length %d", p->lSize);
|
||||
SPDLOG_ERROR("invalid packet length {}", p->lSize);
|
||||
d->SetPhase(PHASE_CLOSE);
|
||||
return -1;
|
||||
}
|
||||
|
@ -131,7 +130,7 @@ int CInputP2P::MonarchNotice(LPDESC d, const char * c_pData, size_t uiBytes)
|
|||
|
||||
if (p->lSize < 0)
|
||||
{
|
||||
sys_err("invalid packet length %d", p->lSize);
|
||||
SPDLOG_ERROR("invalid packet length {}", p->lSize);
|
||||
d->SetPhase(PHASE_CLOSE);
|
||||
return -1;
|
||||
}
|
||||
|
@ -199,7 +198,7 @@ int CInputP2P::Guild(LPDESC d, const char* c_pData, size_t uiBytes)
|
|||
return sizeof(int);
|
||||
}
|
||||
default:
|
||||
sys_err ("UNKNOWN GUILD SUB PACKET");
|
||||
SPDLOG_ERROR("UNKNOWN GUILD SUB PACKET");
|
||||
break;
|
||||
}
|
||||
return 0;
|
||||
|
@ -256,21 +255,21 @@ void CInputP2P::Disconnect(const char * c_pData)
|
|||
void CInputP2P::Setup(LPDESC d, const char * c_pData)
|
||||
{
|
||||
TPacketGGSetup * p = (TPacketGGSetup *) c_pData;
|
||||
sys_log(0, "P2P: Setup %s:%d", d->GetHostName(), p->wPort);
|
||||
SPDLOG_INFO("P2P: Setup {}:{}", d->GetHostName(), p->wPort);
|
||||
d->SetP2P(p->wPort, p->bChannel);
|
||||
}
|
||||
|
||||
void CInputP2P::MessengerAdd(const char * c_pData)
|
||||
{
|
||||
TPacketGGMessenger * p = (TPacketGGMessenger *) c_pData;
|
||||
sys_log(0, "P2P: Messenger Add %s %s", p->szAccount, p->szCompanion);
|
||||
SPDLOG_INFO("P2P: Messenger Add {} {}", p->szAccount, p->szCompanion);
|
||||
MessengerManager::instance().__AddToList(p->szAccount, p->szCompanion);
|
||||
}
|
||||
|
||||
void CInputP2P::MessengerRemove(const char * c_pData)
|
||||
{
|
||||
TPacketGGMessenger * p = (TPacketGGMessenger *) c_pData;
|
||||
sys_log(0, "P2P: Messenger Remove %s %s", p->szAccount, p->szCompanion);
|
||||
SPDLOG_INFO("P2P: Messenger Remove {} {}", p->szAccount, p->szCompanion);
|
||||
MessengerManager::instance().__RemoveFromList(p->szAccount, p->szCompanion);
|
||||
}
|
||||
|
||||
|
@ -304,7 +303,7 @@ void CInputP2P::GuildWarZoneMapIndex(const char* c_pData)
|
|||
TPacketGGGuildWarMapIndex * p = (TPacketGGGuildWarMapIndex*) c_pData;
|
||||
CGuildManager & gm = CGuildManager::instance();
|
||||
|
||||
sys_log(0, "P2P: GuildWarZoneMapIndex g1(%u) vs g2(%u), mapIndex(%d)", p->dwGuildID1, p->dwGuildID2, p->lMapIndex);
|
||||
SPDLOG_DEBUG("P2P: GuildWarZoneMapIndex g1({}) vs g2({}), mapIndex({})", p->dwGuildID1, p->dwGuildID2, p->lMapIndex);
|
||||
|
||||
CGuild * g1 = gm.FindGuild(p->dwGuildID1);
|
||||
CGuild * g2 = gm.FindGuild(p->dwGuildID2);
|
||||
|
@ -386,12 +385,12 @@ void CInputP2P::BlockChat(const char * c_pData)
|
|||
|
||||
if (ch)
|
||||
{
|
||||
sys_log(0, "BLOCK CHAT apply name %s dur %d", p->szName, p->lBlockDuration);
|
||||
SPDLOG_DEBUG("BLOCK CHAT apply name {} dur {}", p->szName, p->lBlockDuration);
|
||||
ch->AddAffect(AFFECT_BLOCK_CHAT, POINT_NONE, 0, AFF_NONE, p->lBlockDuration, 0, true);
|
||||
}
|
||||
else
|
||||
{
|
||||
sys_log(0, "BLOCK CHAT fail name %s dur %d", p->szName, p->lBlockDuration);
|
||||
SPDLOG_DEBUG("BLOCK CHAT fail name {} dur {}", p->szName, p->lBlockDuration);
|
||||
}
|
||||
}
|
||||
// END_OF_BLOCK_CHAT
|
||||
|
@ -408,13 +407,12 @@ void CInputP2P::IamAwake(LPDESC d, const char * c_pData)
|
|||
{
|
||||
std::string hostNames;
|
||||
P2P_MANAGER::instance().GetP2PHostNames(hostNames);
|
||||
sys_log(0, "P2P Awakeness check from %s. My P2P connection number is %d. and details...\n%s", d->GetHostName(), P2P_MANAGER::instance().GetDescCount(), hostNames.c_str());
|
||||
SPDLOG_INFO("P2P Awakeness check from {}. My P2P connection number is {}. and details...\n{}", d->GetHostName(), P2P_MANAGER::instance().GetDescCount(), hostNames.c_str());
|
||||
}
|
||||
|
||||
int CInputP2P::Analyze(LPDESC d, BYTE bHeader, const char * c_pData)
|
||||
{
|
||||
if (test_server)
|
||||
sys_log(0, "CInputP2P::Anlayze[Header %d]", bHeader);
|
||||
SPDLOG_TRACE("CInputP2P::Anlayze[Header {}]", bHeader);
|
||||
|
||||
int iExtraLen = 0;
|
||||
|
||||
|
@ -443,7 +441,7 @@ int CInputP2P::Analyze(LPDESC d, BYTE bHeader, const char * c_pData)
|
|||
break;
|
||||
|
||||
case HEADER_GG_SHUTDOWN:
|
||||
sys_err("Accept shutdown p2p command from %s.", d->GetHostName());
|
||||
SPDLOG_ERROR("Accept shutdown p2p command from {}.", d->GetHostName());
|
||||
Shutdown(10);
|
||||
break;
|
||||
|
||||
|
|
|
@ -16,7 +16,6 @@
|
|||
#include "db.h"
|
||||
#include "protocol.h"
|
||||
#include "char.h"
|
||||
#include "dev_log.h"
|
||||
|
||||
#define HANDSHAKE_XOR 0x6AB3D224
|
||||
|
||||
|
|
|
@ -12,7 +12,6 @@
|
|||
#include "profiler.h"
|
||||
#include "marriage.h"
|
||||
#include "item_addon.h"
|
||||
#include "dev_log.h"
|
||||
#include "locale_service.h"
|
||||
#include "item.h"
|
||||
#include "item_manager.h"
|
||||
|
@ -86,14 +85,14 @@ EVENTFUNC(item_destroy_event)
|
|||
|
||||
if ( info == NULL )
|
||||
{
|
||||
sys_err( "item_destroy_event> <Factor> Null pointer" );
|
||||
SPDLOG_ERROR("item_destroy_event> <Factor> Null pointer" );
|
||||
return 0;
|
||||
}
|
||||
|
||||
LPITEM pkItem = info->item;
|
||||
|
||||
if (pkItem->GetOwner())
|
||||
sys_err("item_destroy_event: Owner exist. (item %s owner %s)", pkItem->GetName(), pkItem->GetOwner()->GetName());
|
||||
SPDLOG_ERROR("item_destroy_event: Owner exist. (item {} owner {})", pkItem->GetName(), pkItem->GetOwner()->GetName());
|
||||
|
||||
pkItem->SetDestroyEvent(NULL);
|
||||
M2_DESTROY_ITEM(pkItem);
|
||||
|
@ -143,7 +142,7 @@ void CItem::EncodeInsertPacket(LPENTITY ent)
|
|||
|
||||
if ( info == NULL )
|
||||
{
|
||||
sys_err( "CItem::EncodeInsertPacket> <Factor> Null pointer" );
|
||||
SPDLOG_ERROR("CItem::EncodeInsertPacket> <Factor> Null pointer" );
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -170,7 +169,7 @@ void CItem::EncodeRemovePacket(LPENTITY ent)
|
|||
pack.dwVID = m_dwVID;
|
||||
|
||||
d->Packet(&pack, sizeof(pack));
|
||||
sys_log(2, "Item::EncodeRemovePacket %s to %s", GetName(), ((LPCHARACTER) ent)->GetName());
|
||||
SPDLOG_TRACE("Item::EncodeRemovePacket {} to {}", GetName(), ((LPCHARACTER) ent)->GetName());
|
||||
}
|
||||
|
||||
void CItem::SetProto(const TItemTable * table)
|
||||
|
@ -218,7 +217,7 @@ void CItem::UpdatePacket()
|
|||
|
||||
memcpy(pack.aAttr, GetAttributes(), sizeof(pack.aAttr));
|
||||
|
||||
sys_log(2, "UpdatePacket %s -> %s", GetName(), m_pOwner->GetName());
|
||||
SPDLOG_TRACE("UpdatePacket {} -> {}", GetName(), m_pOwner->GetName());
|
||||
m_pOwner->GetDesc()->Packet(&pack, sizeof(pack));
|
||||
}
|
||||
|
||||
|
@ -289,7 +288,7 @@ LPITEM CItem::RemoveFromCharacter()
|
|||
{
|
||||
if (!m_pOwner)
|
||||
{
|
||||
sys_err("Item::RemoveFromCharacter owner null");
|
||||
SPDLOG_ERROR("Item::RemoveFromCharacter owner null");
|
||||
return (this);
|
||||
}
|
||||
|
||||
|
@ -311,7 +310,7 @@ LPITEM CItem::RemoveFromCharacter()
|
|||
if (IsDragonSoul())
|
||||
{
|
||||
if (m_wCell >= DRAGON_SOUL_INVENTORY_MAX_NUM)
|
||||
sys_err("CItem::RemoveFromCharacter: pos >= DRAGON_SOUL_INVENTORY_MAX_NUM");
|
||||
SPDLOG_ERROR("CItem::RemoveFromCharacter: pos >= DRAGON_SOUL_INVENTORY_MAX_NUM");
|
||||
else
|
||||
pOwner->SetItem(TItemPos(m_bWindow, m_wCell), NULL);
|
||||
}
|
||||
|
@ -320,7 +319,7 @@ LPITEM CItem::RemoveFromCharacter()
|
|||
TItemPos cell(INVENTORY, m_wCell);
|
||||
|
||||
if (false == cell.IsDefaultInventoryPosition() && false == cell.IsBeltInventoryPosition()) // ¾Æ´Ï¸é ¼ÒÁöÇ°¿¡?
|
||||
sys_err("CItem::RemoveFromCharacter: Invalid Item Position");
|
||||
SPDLOG_ERROR("CItem::RemoveFromCharacter: Invalid Item Position");
|
||||
else
|
||||
{
|
||||
pOwner->SetItem(cell, NULL);
|
||||
|
@ -348,7 +347,7 @@ bool CItem::AddToCharacter(LPCHARACTER ch, TItemPos Cell)
|
|||
{
|
||||
if (m_wCell >= INVENTORY_MAX_NUM && BELT_INVENTORY_SLOT_START > m_wCell)
|
||||
{
|
||||
sys_err("CItem::AddToCharacter: cell overflow: %s to %s cell %d", m_pProto->szName, ch->GetName(), m_wCell);
|
||||
SPDLOG_ERROR("CItem::AddToCharacter: cell overflow: {} to {} cell {}", m_pProto->szName, ch->GetName(), m_wCell);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -356,7 +355,7 @@ bool CItem::AddToCharacter(LPCHARACTER ch, TItemPos Cell)
|
|||
{
|
||||
if (m_wCell >= DRAGON_SOUL_INVENTORY_MAX_NUM)
|
||||
{
|
||||
sys_err("CItem::AddToCharacter: cell overflow: %s to %s cell %d", m_pProto->szName, ch->GetName(), m_wCell);
|
||||
SPDLOG_ERROR("CItem::AddToCharacter: cell overflow: {} to {} cell {}", m_pProto->szName, ch->GetName(), m_wCell);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -393,19 +392,19 @@ bool CItem::AddToGround(int lMapIndex, const PIXEL_POSITION & pos, bool skipOwne
|
|||
{
|
||||
if (0 == lMapIndex)
|
||||
{
|
||||
sys_err("wrong map index argument: %d", lMapIndex);
|
||||
SPDLOG_ERROR("wrong map index argument: {}", lMapIndex);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (GetSectree())
|
||||
{
|
||||
sys_err("sectree already assigned");
|
||||
SPDLOG_ERROR("sectree already assigned");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!skipOwnerCheck && m_pOwner)
|
||||
{
|
||||
sys_err("owner pointer not null");
|
||||
SPDLOG_ERROR("owner pointer not null");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -413,7 +412,7 @@ bool CItem::AddToGround(int lMapIndex, const PIXEL_POSITION & pos, bool skipOwne
|
|||
|
||||
if (!tree)
|
||||
{
|
||||
sys_err("cannot find sectree by %dx%d", pos.x, pos.y);
|
||||
SPDLOG_ERROR("cannot find sectree by {}x{}", pos.x, pos.y);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -605,7 +604,7 @@ void CItem::ModifyPoints(bool bAdd)
|
|||
|
||||
if (!p)
|
||||
{
|
||||
sys_err("cannot find table by vnum %u", dwVnum);
|
||||
SPDLOG_ERROR("cannot find table by vnum {}", dwVnum);
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -817,7 +816,7 @@ bool CItem::EquipTo(LPCHARACTER ch, BYTE bWearCell)
|
|||
{
|
||||
if (!ch)
|
||||
{
|
||||
sys_err("EquipTo: nil character");
|
||||
SPDLOG_ERROR("EquipTo: nil character");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -826,7 +825,7 @@ bool CItem::EquipTo(LPCHARACTER ch, BYTE bWearCell)
|
|||
{
|
||||
if (bWearCell < WEAR_MAX_NUM || bWearCell >= WEAR_MAX_NUM + DRAGON_SOUL_DECK_MAX_NUM * DS_SLOT_MAX)
|
||||
{
|
||||
sys_err("EquipTo: invalid dragon soul cell (this: #%d %s wearflag: %d cell: %d)", GetOriginalVnum(), GetName(), GetSubType(), bWearCell - WEAR_MAX_NUM);
|
||||
SPDLOG_ERROR("EquipTo: invalid dragon soul cell (this: #{} {} wearflag: {} cell: {})", GetOriginalVnum(), GetName(), GetSubType(), bWearCell - WEAR_MAX_NUM);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -834,14 +833,14 @@ bool CItem::EquipTo(LPCHARACTER ch, BYTE bWearCell)
|
|||
{
|
||||
if (bWearCell >= WEAR_MAX_NUM)
|
||||
{
|
||||
sys_err("EquipTo: invalid wear cell (this: #%d %s wearflag: %d cell: %d)", GetOriginalVnum(), GetName(), GetWearFlag(), bWearCell);
|
||||
SPDLOG_ERROR("EquipTo: invalid wear cell (this: #{} {} wearflag: {} cell: {})", GetOriginalVnum(), GetName(), GetWearFlag(), bWearCell);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (ch->GetWear(bWearCell))
|
||||
{
|
||||
sys_err("EquipTo: item already exist (this: #%d %s cell: %d %s)", GetOriginalVnum(), GetName(), bWearCell, ch->GetWear(bWearCell)->GetName());
|
||||
SPDLOG_ERROR("EquipTo: item already exist (this: #{} {} cell: {} {})", GetOriginalVnum(), GetName(), bWearCell, ch->GetWear(bWearCell)->GetName());
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -894,15 +893,15 @@ bool CItem::Unequip()
|
|||
if (!m_pOwner || GetCell() < INVENTORY_MAX_NUM)
|
||||
{
|
||||
// ITEM_OWNER_INVALID_PTR_BUG
|
||||
sys_err("%s %u m_pOwner %p, GetCell %d",
|
||||
GetName(), GetID(), get_pointer(m_pOwner), GetCell());
|
||||
SPDLOG_ERROR("{} {} m_pOwner {}, GetCell {}",
|
||||
GetName(), GetID(), (void*) get_pointer(m_pOwner), GetCell());
|
||||
// END_OF_ITEM_OWNER_INVALID_PTR_BUG
|
||||
return false;
|
||||
}
|
||||
|
||||
if (this != m_pOwner->GetWear(GetCell() - INVENTORY_MAX_NUM))
|
||||
{
|
||||
sys_err("m_pOwner->GetWear() != this");
|
||||
SPDLOG_ERROR("m_pOwner->GetWear() != this");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -977,7 +976,7 @@ bool CItem::CreateSocket(BYTE bSlot, BYTE bGold)
|
|||
|
||||
if (m_alSockets[bSlot] != 0)
|
||||
{
|
||||
sys_err("Item::CreateSocket : socket already exist %s %d", GetName(), bSlot);
|
||||
SPDLOG_ERROR("Item::CreateSocket : socket already exist {} {}", GetName(), bSlot);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -1040,7 +1039,7 @@ EVENTFUNC(ownership_event)
|
|||
|
||||
if ( info == NULL )
|
||||
{
|
||||
sys_err( "ownership_event> <Factor> Null pointer" );
|
||||
SPDLOG_ERROR("ownership_event> <Factor> Null pointer" );
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -1132,7 +1131,7 @@ void CItem::AlterToSocketItem(int iSocketCount)
|
|||
{
|
||||
if (iSocketCount >= ITEM_SOCKET_MAX_NUM)
|
||||
{
|
||||
sys_log(0, "Invalid Socket Count %d, set to maximum", ITEM_SOCKET_MAX_NUM);
|
||||
SPDLOG_ERROR("Invalid Socket Count {}, set to maximum", (int) ITEM_SOCKET_MAX_NUM);
|
||||
iSocketCount = ITEM_SOCKET_MAX_NUM;
|
||||
}
|
||||
|
||||
|
@ -1245,7 +1244,7 @@ int CItem::GetRefineLevel()
|
|||
str_to_number(locale_rtn, p+1);
|
||||
if (locale_rtn != rtn)
|
||||
{
|
||||
sys_err("refine_level_based_on_NAME(%d) is not equal to refine_level_based_on_LOCALE_NAME(%d).", rtn, locale_rtn);
|
||||
SPDLOG_ERROR("refine_level_based_on_NAME({}) is not equal to refine_level_based_on_LOCALE_NAME({}).", rtn, locale_rtn);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1263,7 +1262,7 @@ EVENTFUNC(unique_expire_event)
|
|||
|
||||
if ( info == NULL )
|
||||
{
|
||||
sys_err( "unique_expire_event> <Factor> Null pointer" );
|
||||
SPDLOG_ERROR("unique_expire_event> <Factor> Null pointer" );
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -1273,7 +1272,7 @@ EVENTFUNC(unique_expire_event)
|
|||
{
|
||||
if (pkItem->GetSocket(ITEM_SOCKET_UNIQUE_REMAIN_TIME) <= 1)
|
||||
{
|
||||
sys_log(0, "UNIQUE_ITEM: expire %s %u", pkItem->GetName(), pkItem->GetID());
|
||||
SPDLOG_DEBUG("UNIQUE_ITEM: expire {} {}", pkItem->GetName(), pkItem->GetID());
|
||||
pkItem->SetUniqueExpireEvent(NULL);
|
||||
ITEM_MANAGER::instance().RemoveItem(pkItem, "UNIQUE_EXPIRE");
|
||||
return 0;
|
||||
|
@ -1316,7 +1315,7 @@ EVENTFUNC(timer_based_on_wear_expire_event)
|
|||
|
||||
if ( info == NULL )
|
||||
{
|
||||
sys_err( "expire_event <Factor> Null pointer" );
|
||||
SPDLOG_ERROR("expire_event <Factor> Null pointer" );
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -1324,7 +1323,7 @@ EVENTFUNC(timer_based_on_wear_expire_event)
|
|||
int remain_time = pkItem->GetSocket(ITEM_SOCKET_REMAIN_SEC) - processing_time/passes_per_sec;
|
||||
if (remain_time <= 0)
|
||||
{
|
||||
sys_log(0, "ITEM EXPIRED : expired %s %u", pkItem->GetName(), pkItem->GetID());
|
||||
SPDLOG_DEBUG("ITEM EXPIRED : expired {} {}", pkItem->GetName(), pkItem->GetID());
|
||||
pkItem->SetTimerBasedOnWearExpireEvent(NULL);
|
||||
pkItem->SetSocket(ITEM_SOCKET_REMAIN_SEC, 0);
|
||||
|
||||
|
@ -1393,7 +1392,7 @@ void CItem::StartRealTimeExpireEvent()
|
|||
|
||||
m_pkRealTimeExpireEvent = event_create( real_time_expire_event, info, PASSES_PER_SEC(1));
|
||||
|
||||
sys_log(0, "REAL_TIME_EXPIRE: StartRealTimeExpireEvent");
|
||||
SPDLOG_DEBUG("REAL_TIME_EXPIRE: StartRealTimeExpireEvent");
|
||||
|
||||
return;
|
||||
}
|
||||
|
@ -1554,7 +1553,7 @@ EVENTFUNC(accessory_socket_expire_event)
|
|||
|
||||
if ( info == NULL )
|
||||
{
|
||||
sys_err( "accessory_socket_expire_event> <Factor> Null pointer" );
|
||||
SPDLOG_ERROR("accessory_socket_expire_event> <Factor> Null pointer" );
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -1957,13 +1956,13 @@ bool CItem::MoveToAuction()
|
|||
LPCHARACTER owner = GetOwner();
|
||||
if (owner == NULL)
|
||||
{
|
||||
sys_err ("Item those owner is not exist cannot regist in auction");
|
||||
SPDLOG_ERROR("Item those owner is not exist cannot regist in auction");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (GetWindow() == AUCTION)
|
||||
{
|
||||
sys_err ("Item is already in auction.");
|
||||
SPDLOG_ERROR("Item is already in auction.");
|
||||
}
|
||||
|
||||
SetWindow(AUCTION);
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue