lib files are building

This commit is contained in:
d1str4ught
2025-08-18 02:05:07 +02:00
parent 4e679320a3
commit 0ec3511104
93 changed files with 418 additions and 759 deletions

View File

@@ -9,6 +9,9 @@ target_link_libraries(game
libsql
libthecore
liblua
# external
mariadbclient
)
if (WIN32)

View File

@@ -2,7 +2,7 @@
#include "ClientPackageCryptInfo.h"
#include "../../common/stl.h"
#ifndef __FreeBSD__
#ifndef OS_FREEBSD
#include "../../libthecore/include/xdirent.h"
#endif

View File

@@ -2,7 +2,7 @@
#include "HackShield_Impl.h"
#ifdef __FreeBSD__
#ifdef OS_FREEBSD
#include "char.h"
#include "packet.h"

View File

@@ -4,7 +4,7 @@
#include <unordered_map>
#ifdef __FreeBSD__
#ifdef OS_FREEBSD
// Live build only
#define UNIX
#include <AntiCpXSvr.h>
@@ -16,7 +16,7 @@
typedef struct SPacketGCHSCheck
{
BYTE bHeader;
#ifdef __FreeBSD__
#ifdef OS_FREEBSD
AHNHS_TRANS_BUFFER Req;
#endif
} TPacketGCHSCheck;
@@ -36,7 +36,7 @@ class CHackShieldImpl
bool VerifyAck (LPCHARACTER ch, TPacketGCHSCheck* buf);
private:
#ifdef __FreeBSD__
#ifdef OS_FREEBSD
AHNHS_SERVER_HANDLE handle_;
typedef std::unordered_map<DWORD, AHNHS_CLIENT_HANDLE> ClientHandleContainer;

View File

@@ -1,7 +1,7 @@
#include "stdafx.h"
#include "MarkManager.h"
#ifdef __WIN32__
#ifdef OS_WINDOWS
#include <direct.h>
#endif
@@ -31,14 +31,14 @@ static Pixel * LoadOldGuildMarkImageFile()
bool GuildMarkConvert(const std::vector<DWORD> & vecGuildID)
{
// 폴더 생성
#ifndef __WIN32__
#ifndef OS_WINDOWS
mkdir("mark", S_IRWXU);
#else
_mkdir("mark");
#endif
// 인덱스 파일이 있나?
#ifndef __WIN32__
#ifndef OS_WINDOWS
if (0 != access(OLD_MARK_INDEX_FILENAME, F_OK))
#else
if (0 != _access(OLD_MARK_INDEX_FILENAME, 0))
@@ -120,7 +120,7 @@ bool GuildMarkConvert(const std::vector<DWORD> & vecGuildID)
fclose(fp);
// 컨버트는 한번만 하면되므로 파일을 옮겨준다.
#ifndef __WIN32__
#ifndef OS_WINDOWS
system("mv -f guild_mark.idx guild_mark.idx.removable");
system("mv -f guild_mark.tga guild_mark.tga.removable");
#else

View File

@@ -55,7 +55,7 @@ CXTrapManager::CXTrapManager()
CXTrapManager::~CXTrapManager()
{
#ifdef __FreeBSD__
#ifdef OS_FREEBSD
if (m_pImpl->hXTrap4Server)
{
dlclose(m_pImpl->hXTrap4Server);
@@ -65,7 +65,7 @@ CXTrapManager::~CXTrapManager()
M2_DELETE(m_pImpl);
}
#ifdef __FreeBSD__
#ifdef OS_FREEBSD
void CXTrapManager::MapReloadSignalHandler( int signal )
{
for(int i=0; i<CSFILE_NUM; ++i )
@@ -85,7 +85,7 @@ void CXTrapManager::NotifyMapFileChanged( const std::string& fileName, eFileUpda
bool CXTrapManager::LoadXTrapModule()
{
#ifdef __FreeBSD__
#ifdef OS_FREEBSD
//first load client mapfile
bool bClientMapFileLoaded = false;
for(int i=0; i<CSFILE_NUM; ++i )
@@ -154,7 +154,7 @@ bool CXTrapManager::LoadXTrapModule()
bool CXTrapManager::LoadClientMapFile( unsigned int iMapIndex )
{
#ifdef __FreeBSD__
#ifdef OS_FREEBSD
//index check
if( iMapIndex >= CSFILE_NUM )
{

View File

@@ -33,7 +33,7 @@ public:
bool Verify_CSStep1( LPCHARACTER lpCharSession, BYTE* pOutBufData );
void Verify_CSStep3( LPCHARACTER lpCharSession, BYTE* pBufData );
#ifdef __FreeBSD__
#ifdef OS_FREEBSD
static void MapReloadSignalHandler( int signal );
static void NotifyMapFileChanged( const std::string& fileName, eFileUpdatedOptions eUpdateOption );

View File

@@ -7,13 +7,13 @@
*/
#include "stdafx.h"
#ifndef __WIN32__
#ifndef OS_WINDOWS
#include <unistd.h>
#include <stdint.h>
#endif
#include <stdio.h>
#include <string.h>
#ifdef __FreeBSD__
#ifdef OS_FREEBSD
#include <md5.h>
#else
#include "../../libthecore/include/xmd5.h"
@@ -109,7 +109,7 @@ int auth_brazil(const char *login, const char *pwd)
char request[512];
int len = FN_make_request(login, pwd, request, sizeof(request));
#ifndef __WIN32__
#ifndef OS_WINDOWS
if (write(fd, request, len) < 0)
#else
if (_write(fd, request, len) < 0)

View File

@@ -110,7 +110,7 @@ bool is_blocked_country_ip(const char *user_ip)
DWORD ip_number;
struct in_addr st_addr;
#ifndef __WIN32__
#ifndef OS_WINDOWS
if (0 == inet_aton(user_ip, &st_addr))
#else
unsigned long in_address;

View File

@@ -1,5 +1,5 @@
#include "stdafx.h"
#ifdef __FreeBSD__
#ifdef OS_FREEBSD
#include <md5.h>
#else
#include "../../libthecore/include/xmd5.h"
@@ -2367,7 +2367,7 @@ ACMD(do_in_game_mall)
MD5Init(&ctx);
MD5Update(&ctx, (const unsigned char *) buf, strlen(buf));
#ifdef __FreeBSD__
#ifdef OS_FREEBSD
MD5End(&ctx, sas);
#else
static const char hex[] = "0123456789abcdef";

View File

@@ -1,6 +1,6 @@
#include "stdafx.h"
#include <sstream>
#ifndef __WIN32__
#ifndef OS_WINDOWS
#include <ifaddrs.h>
#endif
@@ -233,7 +233,7 @@ static void FN_log_adminpage()
bool GetIPInfo()
{
#ifndef __WIN32__
#ifndef OS_WINDOWS
struct ifaddrs* ifaddrp = NULL;
if (0 != getifaddrs(&ifaddrp))
@@ -273,7 +273,7 @@ bool GetIPInfo()
if (!strncmp(netip, "192.168", 7)) // ignore if address is starting with 192
{
strlcpy(g_szInternalIP, netip, sizeof(g_szInternalIP));
#ifndef __WIN32__
#ifndef OS_WINDOWS
fprintf(stderr, "INTERNAL_IP: %s interface %s\n", netip, ifap->ifa_name);
#else
fprintf(stderr, "INTERNAL_IP: %s\n", netip);
@@ -282,7 +282,7 @@ bool GetIPInfo()
else if (!strncmp(netip, "10.", 3))
{
strlcpy(g_szInternalIP, netip, sizeof(g_szInternalIP));
#ifndef __WIN32__
#ifndef OS_WINDOWS
fprintf(stderr, "INTERNAL_IP: %s interface %s\n", netip, ifap->ifa_name);
#else
fprintf(stderr, "INTERNAL_IP: %s\n", netip);
@@ -291,7 +291,7 @@ bool GetIPInfo()
else if (g_szPublicIP[0] == '0')
{
strlcpy(g_szPublicIP, netip, sizeof(g_szPublicIP));
#ifndef __WIN32__
#ifndef OS_WINDOWS
fprintf(stderr, "PUBLIC_IP: %s interface %s\n", netip, ifap->ifa_name);
#else
fprintf(stderr, "PUBLIC_IP: %s\n", netip);
@@ -299,7 +299,7 @@ bool GetIPInfo()
}
}
#ifndef __WIN32__
#ifndef OS_WINDOWS
freeifaddrs( ifaddrp );
#else
WSACleanup();

View File

@@ -516,7 +516,7 @@ bool DESC_MANAGER::LoadClientPackageCryptInfo(const char* pDirName)
{
return m_pPackageCrypt->LoadPackageCryptInfo(pDirName);
}
#ifdef __FreeBSD__
#ifdef OS_FREEBSD
void DESC_MANAGER::NotifyClientPackageFileChanged( const std::string& dirName, eFileUpdatedOptions eUpdateOption )
{
Instance().LoadClientPackageCryptInfo(dirName.c_str());

View File

@@ -69,7 +69,7 @@ class DESC_MANAGER : public singleton<DESC_MANAGER>
bool LoadClientPackageCryptInfo(const char* pDirName);
void SendClientPackageCryptKey( LPDESC desc );
void SendClientPackageSDBToLoadMap( LPDESC desc, const char* pMapName );
#ifdef __FreeBSD__
#ifdef OS_FREEBSD
static void NotifyClientPackageFileChanged( const std::string& fileName, eFileUpdatedOptions eUpdateOption );
#endif

View File

@@ -48,7 +48,7 @@ void dev_log(const char *file, int line, const char *function, int level, const
// ---------------------------------------
// open file
// ---------------------------------------
#ifndef __WIN32__
#ifndef OS_WINDOWS
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);

View File

@@ -19,7 +19,7 @@
#include "dev_log.h"
// #include "HackShield_Impl.h"
#ifndef __WIN32__
#ifndef OS_WINDOWS
#include "limit_time.h"
#endif

View File

@@ -11,7 +11,7 @@
#include "auth_brazil.h"
#include "db.h"
#ifndef __WIN32__
#ifndef OS_WINDOWS
#include "limit_time.h"
#endif
@@ -431,7 +431,7 @@ int CInputAuth::auth_OpenID(const char *authKey, const char *ipAddr, char *rID)
//"/kyw/gameauth.php", authKey, ipAddr);
openid_uri, authKey, ipAddr, openid_host);
//#ifndef __WIN32__
//#ifndef OS_WINDOWS
// if (write(fd, request, len) < 0)
//#else
if (socket_write(fd, request, len) < 0)
@@ -446,7 +446,7 @@ int CInputAuth::auth_OpenID(const char *authKey, const char *ipAddr, char *rID)
// read reply
char reply[1024] = {0};
int len;
//#ifndef __WIN32__
//#ifndef OS_WINDOWS
// len = read(fd, reply, sizeof(reply));
//#else
len = socket_read(fd, reply, sizeof(reply));

View File

@@ -318,7 +318,7 @@ void LogManager::DragonSlayLog(DWORD dwGuildID, DWORD dwDragonVnum, DWORD dwStar
// {
// struct in_addr st_addr;
// #ifndef __WIN32__
// #ifndef OS_WINDOWS
// if (0 == inet_aton(ch->GetDesc()->GetHostName(), &st_addr))
// #else
// unsigned long in_address;

View File

@@ -64,13 +64,13 @@
// #include "XTrapManager.h"
#include "DragonSoul.h"
#include <boost/bind.hpp>
#ifndef __WIN32__
#ifndef OS_WINDOWS
#include "limit_time.h"
#endif
//#define __FILEMONITOR__
#if defined (__FreeBSD__) && defined(__FILEMONITOR__)
#if defined (OS_FREEBSD) && defined(__FILEMONITOR__)
#include "FileMonitor_FreeBSD.h"
#endif
@@ -78,7 +78,7 @@
#include "auction_manager.h"
#endif
// #ifndef __WIN32__
// #ifndef OS_WINDOWS
// #include <gtest/gtest.h>
// #endif
@@ -94,7 +94,7 @@
extern void WriteVersion();
//extern const char * _malloc_options;
#if defined(__FreeBSD__) && defined(DEBUG_ALLOC)
#if defined(OS_FREEBSD) && defined(DEBUG_ALLOC)
extern void (*_malloc_message)(const char* p1, const char* p2, const char* p3, const char* p4);
// FreeBSD _malloc_message replacement
void WriteMallocMessage(const char* p1, const char* p2, const char* p3, const char* p4) {
@@ -317,7 +317,7 @@ void heartbeat(LPHEART ht, int pulse)
CHARACTER_MANAGER::instance().ProcessDelayedSave();
//4초 마다
#if defined (__FreeBSD__) && defined(__FILEMONITOR__)
#if defined (OS_FREEBSD) && defined(__FILEMONITOR__)
if (!(pulse % (passes_per_sec * 5)))
{
FileMonitorFreeBSD::Instance().Update(pulse);
@@ -448,7 +448,7 @@ int main(int argc, char **argv)
DebugAllocator::StaticSetUp();
#endif
// #ifndef __WIN32__
// #ifndef OS_WINDOWS
// // <Factor> start unit tests if option is set
// if ( argc > 1 )
// {
@@ -579,7 +579,7 @@ int main(int argc, char **argv)
// CleanUpForEarlyExit();
// return 0;
// }
// #if defined (__FreeBSD__) && defined(__FILEMONITOR__)
// #if defined (OS_FREEBSD) && defined(__FILEMONITOR__)
// // PFN_FileChangeListener pNotifyFunc = boost::bind( &CXTrapManager::NotifyMapFileChanged, CXTrapManager::instance(), _1 );
// PFN_FileChangeListener pNotifyFunc = &(CXTrapManager::NotifyMapFileChanged);
@@ -601,7 +601,7 @@ int main(int argc, char **argv)
sys_err("Failed to Load ClientPackageCryptInfo File(%s)", strPackageCryptInfoDir.c_str());
}
#if defined (__FreeBSD__) && defined(__FILEMONITOR__)
#if defined (OS_FREEBSD) && defined(__FILEMONITOR__)
PFN_FileChangeListener pPackageNotifyFunc = &(DESC_MANAGER::NotifyClientPackageFileChanged);
//FileMonitorFreeBSD::Instance().AddWatch( strPackageCryptInfoName, pPackageNotifyFunc );
#endif
@@ -705,7 +705,7 @@ int start(int argc, char **argv)
char ch;
//_malloc_options = "A";
#if defined(__FreeBSD__) && defined(DEBUG_ALLOC)
#if defined(OS_FREEBSD) && defined(DEBUG_ALLOC)
_malloc_message = WriteMallocMessage;
#endif
#ifdef ENABLE_LIMIT_TIME
@@ -788,7 +788,7 @@ int start(int argc, char **argv)
config_init(st_localeServiceName);
// END_OF_LOCALE_SERVICE
#ifdef __WIN32__
#ifdef OS_WINDOWS
// In Windows dev mode, "verbose" option is [on] by default.
bVerbose = true;
#endif
@@ -983,7 +983,7 @@ int idle()
}
#endif
#ifdef __WIN32__
#ifdef OS_WINDOWS
if (_kbhit()) {
int c = _getch();
switch (c) {

View File

@@ -20,7 +20,7 @@
#include "sectree_manager.h"
#undef sys_err
#ifndef __WIN32__
#ifndef OS_WINDOWS
#define sys_err(fmt, args...) quest::CQuestManager::instance().QuestError(__FUNCTION__, __LINE__, fmt, ##args)
#else
#define sys_err(fmt, ...) quest::CQuestManager::instance().QuestError(__FUNCTION__, __LINE__, fmt, __VA_ARGS__)

View File

@@ -5,7 +5,7 @@
#include "char.h"
#undef sys_err
#ifndef __WIN32__
#ifndef OS_WINDOWS
#define sys_err(fmt, args...) quest::CQuestManager::instance().QuestError(__FUNCTION__, __LINE__, fmt, ##args)
#else
#define sys_err(fmt, ...) quest::CQuestManager::instance().QuestError(__FUNCTION__, __LINE__, fmt, __VA_ARGS__)

View File

@@ -13,7 +13,7 @@
#undef sys_err
#ifndef __WIN32__
#ifndef OS_WINDOWS
#define sys_err(fmt, args...) quest::CQuestManager::instance().QuestError(__FUNCTION__, __LINE__, fmt, ##args)
#else
#define sys_err(fmt, ...) quest::CQuestManager::instance().QuestError(__FUNCTION__, __LINE__, fmt, __VA_ARGS__)

View File

@@ -9,7 +9,7 @@
#include "packet.h"
#undef sys_err
#ifndef __WIN32__
#ifndef OS_WINDOWS
#define sys_err(fmt, args...) quest::CQuestManager::instance().QuestError(__FUNCTION__, __LINE__, fmt, ##args)
#else
#define sys_err(fmt, ...) quest::CQuestManager::instance().QuestError(__FUNCTION__, __LINE__, fmt, __VA_ARGS__)

View File

@@ -25,7 +25,7 @@
#include "sectree_manager.h"
#undef sys_err
#ifndef __WIN32__
#ifndef OS_WINDOWS
#define sys_err(fmt, args...) quest::CQuestManager::instance().QuestError(__FUNCTION__, __LINE__, fmt, ##args)
#else
#define sys_err(fmt, ...) quest::CQuestManager::instance().QuestError(__FUNCTION__, __LINE__, fmt, __VA_ARGS__)

View File

@@ -10,7 +10,7 @@
#include "guild_manager.h"
#undef sys_err
#ifndef __WIN32__
#ifndef OS_WINDOWS
#define sys_err(fmt, args...) quest::CQuestManager::instance().QuestError(__FUNCTION__, __LINE__, fmt, ##args)
#else
#define sys_err(fmt, ...) quest::CQuestManager::instance().QuestError(__FUNCTION__, __LINE__, fmt, __VA_ARGS__)

View File

@@ -9,7 +9,7 @@
#include "utils.h"
#undef sys_err
#ifndef __WIN32__
#ifndef OS_WINDOWS
#define sys_err(fmt, args...) quest::CQuestManager::instance().QuestError(__FUNCTION__, __LINE__, fmt, ##args)
#else
#define sys_err(fmt, ...) quest::CQuestManager::instance().QuestError(__FUNCTION__, __LINE__, fmt, __VA_ARGS__)

View File

@@ -7,7 +7,7 @@
#include "log.h"
#undef sys_err
#ifndef __WIN32__
#ifndef OS_WINDOWS
#define sys_err(fmt, args...) quest::CQuestManager::instance().QuestError(__FUNCTION__, __LINE__, fmt, ##args)
#else
#define sys_err(fmt, ...) quest::CQuestManager::instance().QuestError(__FUNCTION__, __LINE__, fmt, __VA_ARGS__)

View File

@@ -7,7 +7,7 @@
#include "config.h"
#undef sys_err
#ifndef __WIN32__
#ifndef OS_WINDOWS
#define sys_err(fmt, args...) quest::CQuestManager::instance().QuestError(__FUNCTION__, __LINE__, fmt, ##args)
#else
#define sys_err(fmt, ...) quest::CQuestManager::instance().QuestError(__FUNCTION__, __LINE__, fmt, __VA_ARGS__)

View File

@@ -17,7 +17,7 @@
#include "sectree_manager.h"
#undef sys_err
#ifndef __WIN32__
#ifndef OS_WINDOWS
#define sys_err(fmt, args...) quest::CQuestManager::instance().QuestError(__FUNCTION__, __LINE__, fmt, ##args)
#else
#define sys_err(fmt, ...) quest::CQuestManager::instance().QuestError(__FUNCTION__, __LINE__, fmt, __VA_ARGS__)

View File

@@ -9,7 +9,7 @@
#include "packet.h"
#undef sys_err
#ifndef __WIN32__
#ifndef OS_WINDOWS
#define sys_err(fmt, args...) quest::CQuestManager::instance().QuestError(__FUNCTION__, __LINE__, fmt, ##args)
#else
#define sys_err(fmt, ...) quest::CQuestManager::instance().QuestError(__FUNCTION__, __LINE__, fmt, __VA_ARGS__)

View File

@@ -25,7 +25,7 @@
#include <cctype>
#undef sys_err
#ifndef __WIN32__
#ifndef OS_WINDOWS
#define sys_err(fmt, args...) quest::CQuestManager::instance().QuestError(__FUNCTION__, __LINE__, fmt, ##args)
#else
#define sys_err(fmt, ...) quest::CQuestManager::instance().QuestError(__FUNCTION__, __LINE__, fmt, __VA_ARGS__)

View File

@@ -11,7 +11,7 @@
#include "PetSystem.h"
#undef sys_err
#ifndef __WIN32__
#ifndef OS_WINDOWS
#define sys_err(fmt, args...) quest::CQuestManager::instance().QuestError(__FUNCTION__, __LINE__, fmt, ##args)
#else
#define sys_err(fmt, ...) quest::CQuestManager::instance().QuestError(__FUNCTION__, __LINE__, fmt, __VA_ARGS__)

View File

@@ -4,7 +4,7 @@
#include "questmanager.h"
#undef sys_err
#ifndef __WIN32__
#ifndef OS_WINDOWS
#define sys_err(fmt, args...) quest::CQuestManager::instance().QuestError(__FUNCTION__, __LINE__, fmt, ##args)
#else
#define sys_err(fmt, ...) quest::CQuestManager::instance().QuestError(__FUNCTION__, __LINE__, fmt, __VA_ARGS__)

View File

@@ -1657,7 +1657,7 @@ namespace quest
GetCurrentCharacterPtr()->ChatPacket(CHAT_TYPE_PARTY, "LUA_ERROR: quest %s.%s %s", GetCurrentQuestName().c_str(), state_name, event_index_name.c_str() );
}
#ifndef __WIN32__
#ifndef OS_WINDOWS
void CQuestManager::QuestError(const char* func, int line, const char* fmt, ...)
{
char szMsg[4096];

View File

@@ -167,7 +167,7 @@ namespace quest
void ClearError() { m_bError = false; }
bool IsError() { return m_bError; }
void WriteRunningStateToSyserr();
#ifndef __WIN32__
#ifndef OS_WINDOWS
void QuestError(const char* func, int line, const char* fmt, ...);
#else
//void QuestError(const char* fmt, ...);

View File

@@ -40,7 +40,7 @@ inline int DISTANCE_APPROX(int dx, int dy)
( min << 7 ) - ( min << 5 ) + ( min << 3 ) - ( min << 1 )) >> 8 );
}
#ifndef __WIN32__
#ifndef OS_WINDOWS
inline WORD MAKEWORD(BYTE a, BYTE b)
{
return static_cast<WORD>(a) | (static_cast<WORD>(b) << 8);

View File

@@ -2,7 +2,7 @@
void WriteVersion()
{
#ifndef __WIN32__
#ifndef OS_WINDOWS
FILE* fp = fopen("version.txt", "w");
if (fp)