Commit aa6eddab authored by nanahira's avatar nanahira

Merge branch 'server' of git.mycard.moe:mycard/ygopro into server

parents 833c3e69 71a8c155
...@@ -10,7 +10,11 @@ token=$(echo $loginInfo | jq '.token' | sed 's/"//g') ...@@ -10,7 +10,11 @@ token=$(echo $loginInfo | jq '.token' | sed 's/"//g')
header="Authorization: $token" header="Authorization: $token"
echo "Login succeeded." echo "Login succeeded."
<<<<<<< HEAD
appName="koishipro" appName="koishipro"
=======
appName="ygopro"
>>>>>>> 71a8c15521cc6fe09e774c7fa2a62aeb20a0e017
handleErrorMessage() { handleErrorMessage() {
rawJsonInput="$1" rawJsonInput="$1"
......
...@@ -49,13 +49,13 @@ mat_linux: ...@@ -49,13 +49,13 @@ mat_linux:
- linux - linux
script: script:
- apt update; apt -y install git wget tar - apt update; apt -y install git wget tar
#- git clone --depth=1 https://code.mycard.moe/mycard/irrlicht-new irrlicht - git clone --depth=1 https://code.mycard.moe/mycard/irrlicht-new irrlicht
- wget -O - https://cdn01.moecube.com/ygopro-build-materials/premake-5.0.0-beta2-linux.tar.gz | tar zfx - - wget -O - https://cdn01.moecube.com/ygopro-build-materials/premake-5.0.0-beta2-linux.tar.gz | tar zfx -
- env PROCESSOR_COUNT=$(nproc) ./.ci/libevent-prebuild.sh - env PROCESSOR_COUNT=$(nproc) ./.ci/libevent-prebuild.sh
artifacts: artifacts:
paths: paths:
- premake5 - premake5
#- irrlicht - irrlicht
- libevent-stable - libevent-stable
mat_windows: mat_windows:
...@@ -71,11 +71,12 @@ mat_windows: ...@@ -71,11 +71,12 @@ mat_windows:
- wget -O - https://cdn01.moecube.com/ygopro-build-materials/libevent-2.0.22-stable.tar.gz | tar zfx - - wget -O - https://cdn01.moecube.com/ygopro-build-materials/libevent-2.0.22-stable.tar.gz | tar zfx -
- mv libevent-2.0.22-stable event - mv libevent-2.0.22-stable event
# irrlicht # irrlicht
#- git clone --depth=1 https://code.mycard.moe/mycard/irrlicht-new irrlicht - git clone --depth=1 https://code.mycard.moe/mycard/irrlicht-new irrlicht
artifacts: artifacts:
paths: paths:
- premake5.exe - premake5.exe
- event - event
- irrlicht
._exec_build: ._exec_build:
stage: build stage: build
...@@ -114,7 +115,7 @@ exec_linux: ...@@ -114,7 +115,7 @@ exec_linux:
- mat_submodules - mat_submodules
script: script:
- apt update; apt -y install git build-essential - apt update; apt -y install git build-essential
- ./premake5 gmake --build-sqlite - ./premake5 gmake --build-sqlite --server-zip-support
- cd build - cd build
- make config=release -j$(nproc) - make config=release -j$(nproc)
- cd .. - cd ..
......
version: '{build}' version: '{build}'
image: Visual Studio 2019 image: Visual Studio 2019
environment:
matrix:
- SERVER_MODE: true
- SERVER_PRO2_SUPPORT: true
skip_tags: true skip_tags: true
...@@ -22,11 +26,9 @@ install: ...@@ -22,11 +26,9 @@ install:
- bash -c "curl --retry 5 --connect-timeout 30 --location --remote-header-name --remote-name https://www.sqlite.org/2022/sqlite-amalgamation-3390300.zip ; exit 0" - bash -c "curl --retry 5 --connect-timeout 30 --location --remote-header-name --remote-name https://www.sqlite.org/2022/sqlite-amalgamation-3390300.zip ; exit 0"
- 7z x -y sqlite-amalgamation-3390300.zip - 7z x -y sqlite-amalgamation-3390300.zip
- move sqlite-amalgamation-3390300 sqlite3 - move sqlite-amalgamation-3390300 sqlite3
# let premake happy before_build:
- xcopy /E premake\* . - xcopy /E premake\* .
# premake
- premake5 vs2019 - premake5 vs2019
configuration: Release configuration: Release
...@@ -91,5 +93,6 @@ deploy: ...@@ -91,5 +93,6 @@ deploy:
cache: cache:
- premake-5.0.0-beta2-windows.zip - premake-5.0.0-beta2-windows.zip
- libevent-2.0.22-stable.tar.gz - libevent-2.0.22-stable.tar.gz
- irrlicht-1.8.5.zip
- lua-5.4.4.tar.gz - lua-5.4.4.tar.gz
- sqlite-amalgamation-3390300.zip - sqlite-amalgamation-3390300.zip
...@@ -91,6 +91,12 @@ using namespace io; ...@@ -91,6 +91,12 @@ using namespace io;
using namespace gui; using namespace gui;
#endif //YGOPRO_SERVER_MODE #endif //YGOPRO_SERVER_MODE
#ifdef SERVER_ZIP_SUPPORT
#include <irrlicht.h>
using namespace irr;
using namespace io;
#endif
extern unsigned short PRO_VERSION; extern unsigned short PRO_VERSION;
extern int enable_log; extern int enable_log;
extern bool exit_on_return; extern bool exit_on_return;
......
...@@ -6,7 +6,7 @@ namespace ygo { ...@@ -6,7 +6,7 @@ namespace ygo {
const wchar_t* DataManager::unknown_string = L"???"; const wchar_t* DataManager::unknown_string = L"???";
byte DataManager::scriptBuffer[0x20000]; byte DataManager::scriptBuffer[0x20000];
#ifndef YGOPRO_SERVER_MODE #if !defined(YGOPRO_SERVER_MODE) || defined(SERVER_ZIP_SUPPORT)
IFileSystem* DataManager::FileSystem; IFileSystem* DataManager::FileSystem;
#endif #endif
DataManager dataManager; DataManager dataManager;
...@@ -14,7 +14,7 @@ DataManager dataManager; ...@@ -14,7 +14,7 @@ DataManager dataManager;
bool DataManager::LoadDB(const wchar_t* wfile) { bool DataManager::LoadDB(const wchar_t* wfile) {
char file[256]; char file[256];
BufferIO::EncodeUTF8(wfile, file); BufferIO::EncodeUTF8(wfile, file);
#ifdef YGOPRO_SERVER_MODE #if defined(YGOPRO_SERVER_MODE) && !defined(SERVER_ZIP_SUPPORT)
sqlite3* pDB; sqlite3* pDB;
if(sqlite3_open_v2(file, &pDB, SQLITE_OPEN_READONLY, 0) != SQLITE_OK) if(sqlite3_open_v2(file, &pDB, SQLITE_OPEN_READONLY, 0) != SQLITE_OK)
return Error(pDB); return Error(pDB);
...@@ -45,19 +45,21 @@ bool DataManager::LoadDB(const wchar_t* wfile) { ...@@ -45,19 +45,21 @@ bool DataManager::LoadDB(const wchar_t* wfile) {
const char* sql = "select * from datas,texts where datas.id=texts.id"; const char* sql = "select * from datas,texts where datas.id=texts.id";
#endif #endif
if(sqlite3_prepare_v2(pDB, sql, -1, &pStmt, 0) != SQLITE_OK) if(sqlite3_prepare_v2(pDB, sql, -1, &pStmt, 0) != SQLITE_OK)
#ifdef YGOPRO_SERVER_MODE #if defined(YGOPRO_SERVER_MODE) && !defined(SERVER_ZIP_SUPPORT)
return Error(pDB); return Error(pDB);
#else #else
return Error(&db); return Error(&db);
#endif #endif
CardDataC cd; CardDataC cd;
CardString cs; CardString cs;
#ifndef YGOPRO_SERVER_MODE
wchar_t strBuffer[4096]; wchar_t strBuffer[4096];
#endif
int step = 0; int step = 0;
do { do {
step = sqlite3_step(pStmt); step = sqlite3_step(pStmt);
if(step == SQLITE_BUSY || step == SQLITE_ERROR || step == SQLITE_MISUSE) if(step == SQLITE_BUSY || step == SQLITE_ERROR || step == SQLITE_MISUSE)
#ifdef YGOPRO_SERVER_MODE #if defined(YGOPRO_SERVER_MODE) && !defined(SERVER_ZIP_SUPPORT)
return Error(pDB, pStmt); return Error(pDB, pStmt);
#else #else
return Error(&db, pStmt); return Error(&db, pStmt);
...@@ -166,7 +168,7 @@ void DataManager::ReadStringConfLine(const char* linebuf) { ...@@ -166,7 +168,7 @@ void DataManager::ReadStringConfLine(const char* linebuf) {
_setnameStrings[value] = strBuffer; _setnameStrings[value] = strBuffer;
} }
} }
#ifdef YGOPRO_SERVER_MODE #if defined(YGOPRO_SERVER_MODE) && !defined(SERVER_ZIP_SUPPORT)
bool DataManager::Error(sqlite3* pDB, sqlite3_stmt* pStmt) { bool DataManager::Error(sqlite3* pDB, sqlite3_stmt* pStmt) {
wchar_t strBuffer[4096]; wchar_t strBuffer[4096];
BufferIO::DecodeUTF8(sqlite3_errmsg(pDB), strBuffer); BufferIO::DecodeUTF8(sqlite3_errmsg(pDB), strBuffer);
...@@ -417,7 +419,7 @@ byte* DataManager::ScriptReaderExSingle(const char* path, const char* script_nam ...@@ -417,7 +419,7 @@ byte* DataManager::ScriptReaderExSingle(const char* path, const char* script_nam
return ScriptReader(sname, slen); return ScriptReader(sname, slen);
} }
byte* DataManager::ScriptReader(const char* script_name, int* slen) { byte* DataManager::ScriptReader(const char* script_name, int* slen) {
#ifdef YGOPRO_SERVER_MODE #if defined(YGOPRO_SERVER_MODE) && !defined(SERVER_ZIP_SUPPORT)
FILE* fp = fopen(script_name, "rb"); FILE* fp = fopen(script_name, "rb");
if(!fp) if(!fp)
return 0; return 0;
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
#include "config.h" #include "config.h"
#include "sqlite3.h" #include "sqlite3.h"
#ifndef YGOPRO_SERVER_MODE #if !defined(YGOPRO_SERVER_MODE) || defined(SERVER_ZIP_SUPPORT)
#include "spmemvfs/spmemvfs.h" #include "spmemvfs/spmemvfs.h"
#endif #endif
#include "client_card.h" #include "client_card.h"
...@@ -18,10 +18,11 @@ public: ...@@ -18,10 +18,11 @@ public:
bool LoadStrings(const char* file); bool LoadStrings(const char* file);
#ifndef YGOPRO_SERVER_MODE #ifndef YGOPRO_SERVER_MODE
bool LoadStrings(IReadFile* reader); bool LoadStrings(IReadFile* reader);
#endif
void ReadStringConfLine(const char* linebuf); void ReadStringConfLine(const char* linebuf);
#if !defined(YGOPRO_SERVER_MODE) || defined(SERVER_ZIP_SUPPORT)
bool Error(spmemvfs_db_t* pDB, sqlite3_stmt* pStmt = 0); bool Error(spmemvfs_db_t* pDB, sqlite3_stmt* pStmt = 0);
#else #else
void ReadStringConfLine(const char* linebuf);
bool Error(sqlite3* pDB, sqlite3_stmt* pStmt = 0); bool Error(sqlite3* pDB, sqlite3_stmt* pStmt = 0);
#endif //YGOPRO_SERVER_MODE #endif //YGOPRO_SERVER_MODE
bool GetData(int code, CardData* pData); bool GetData(int code, CardData* pData);
...@@ -64,7 +65,7 @@ public: ...@@ -64,7 +65,7 @@ public:
static byte* ScriptReaderEx(const char* script_name, int* slen); static byte* ScriptReaderEx(const char* script_name, int* slen);
static byte* ScriptReaderExSingle(const char* path, const char* script_name, int* slen, int pre_len = 2); static byte* ScriptReaderExSingle(const char* path, const char* script_name, int* slen, int pre_len = 2);
static byte* ScriptReader(const char* script_name, int* slen); static byte* ScriptReader(const char* script_name, int* slen);
#ifndef YGOPRO_SERVER_MODE #if !defined(YGOPRO_SERVER_MODE) || defined(SERVER_ZIP_SUPPORT)
static IFileSystem* FileSystem; static IFileSystem* FileSystem;
#endif #endif
}; };
......
...@@ -52,6 +52,9 @@ void DeckManager::LoadLFListSingle(const char* path) { ...@@ -52,6 +52,9 @@ void DeckManager::LoadLFListSingle(const char* path) {
} }
} }
void DeckManager::LoadLFList() { void DeckManager::LoadLFList() {
#ifdef SERVER_PRO2_SUPPORT
LoadLFListSingle("config/lflist.conf");
#endif
LoadLFListSingle("expansions/lflist.conf"); LoadLFListSingle("expansions/lflist.conf");
LoadLFListSingle("lflist.conf"); LoadLFListSingle("lflist.conf");
LFList nolimit; LFList nolimit;
......
...@@ -4,6 +4,15 @@ ...@@ -4,6 +4,15 @@
#include "data_manager.h" #include "data_manager.h"
#include "deck_manager.h" #include "deck_manager.h"
#include "replay.h" #include "replay.h"
#ifdef SERVER_ZIP_SUPPORT
#include "CFileSystem.h"
namespace irr {
namespace core {
// taken from Irrlicht.cpp beacuse that file is not included
irr::core::stringc LOCALE_DECIMAL_POINTS(".");
}
}
#endif
#else #else
#include "image_manager.h" #include "image_manager.h"
#include "data_manager.h" #include "data_manager.h"
...@@ -31,6 +40,12 @@ unsigned int pre_seed[3]; ...@@ -31,6 +40,12 @@ unsigned int pre_seed[3];
HostInfo game_info; HostInfo game_info;
void Game::MainServerLoop() { void Game::MainServerLoop() {
#ifdef SERVER_ZIP_SUPPORT
dataManager.FileSystem = new irr::io::CFileSystem();
#endif
#ifdef SERVER_PRO2_SUPPORT
dataManager.FileSystem->addFileArchive("data/script.zip");
#endif
initUtils(); initUtils();
deckManager.LoadLFList(); deckManager.LoadLFList();
dataManager.LoadDB(L"cards.cdb"); dataManager.LoadDB(L"cards.cdb");
...@@ -1206,20 +1221,29 @@ std::wstring Game::SetStaticText(irr::gui::IGUIStaticText* pControl, u32 cWidth, ...@@ -1206,20 +1221,29 @@ std::wstring Game::SetStaticText(irr::gui::IGUIStaticText* pControl, u32 cWidth,
} }
#endif //YGOPRO_SERVER_MODE #endif //YGOPRO_SERVER_MODE
void Game::LoadExpansions() { void Game::LoadExpansions() {
#ifdef SERVER_PRO2_SUPPORT
FileSystem::TraversalDir(L"./cdb", [](const wchar_t* name, bool isdir) {
wchar_t fpath[1024];
myswprintf(fpath, L"./cdb/%ls", name);
if(!isdir && wcsrchr(name, '.') && !mywcsncasecmp(wcsrchr(name, '.'), L".cdb", 4)) {
dataManager.LoadDB(fpath);
}
});
#endif // SERVER_PRO2_SUPPORT
FileSystem::TraversalDir(L"./expansions", [](const wchar_t* name, bool isdir) { FileSystem::TraversalDir(L"./expansions", [](const wchar_t* name, bool isdir) {
wchar_t fpath[1024]; wchar_t fpath[1024];
myswprintf(fpath, L"./expansions/%ls", name); myswprintf(fpath, L"./expansions/%ls", name);
if(!isdir && wcsrchr(name, '.') && !mywcsncasecmp(wcsrchr(name, '.'), L".cdb", 4)) { if(!isdir && wcsrchr(name, '.') && !mywcsncasecmp(wcsrchr(name, '.'), L".cdb", 4)) {
dataManager.LoadDB(fpath); dataManager.LoadDB(fpath);
} }
#ifdef YGOPRO_SERVER_MODE #ifndef YGOPRO_SERVER_MODE
});
#else
if(!isdir && wcsrchr(name, '.') && !mywcsncasecmp(wcsrchr(name, '.'), L".conf", 5)) { if(!isdir && wcsrchr(name, '.') && !mywcsncasecmp(wcsrchr(name, '.'), L".conf", 5)) {
char upath[1024]; char upath[1024];
BufferIO::EncodeUTF8(fpath, upath); BufferIO::EncodeUTF8(fpath, upath);
dataManager.LoadStrings(upath); dataManager.LoadStrings(upath);
} }
#endif // YGOPRO_SERVER_MODE
#if defined(SERVER_ZIP_SUPPORT) || !defined(YGOPRO_SERVER_MODE)
if(!isdir && wcsrchr(name, '.') && (!mywcsncasecmp(wcsrchr(name, '.'), L".zip", 4) || !mywcsncasecmp(wcsrchr(name, '.'), L".ypk", 4))) { if(!isdir && wcsrchr(name, '.') && (!mywcsncasecmp(wcsrchr(name, '.'), L".zip", 4) || !mywcsncasecmp(wcsrchr(name, '.'), L".ypk", 4))) {
#ifdef _WIN32 #ifdef _WIN32
dataManager.FileSystem->addFileArchive(fpath, true, false, EFAT_ZIP); dataManager.FileSystem->addFileArchive(fpath, true, false, EFAT_ZIP);
...@@ -1229,7 +1253,9 @@ void Game::LoadExpansions() { ...@@ -1229,7 +1253,9 @@ void Game::LoadExpansions() {
dataManager.FileSystem->addFileArchive(upath, true, false, EFAT_ZIP); dataManager.FileSystem->addFileArchive(upath, true, false, EFAT_ZIP);
#endif #endif
} }
#endif //SERVER_ZIP_SUPPORT
}); });
#if defined(SERVER_ZIP_SUPPORT) || !defined(YGOPRO_SERVER_MODE)
for(u32 i = 0; i < DataManager::FileSystem->getFileArchiveCount(); ++i) { for(u32 i = 0; i < DataManager::FileSystem->getFileArchiveCount(); ++i) {
const IFileList* archive = DataManager::FileSystem->getFileArchive(i)->getFileList(); const IFileList* archive = DataManager::FileSystem->getFileArchive(i)->getFileList();
for(u32 j = 0; j < archive->getFileCount(); ++j) { for(u32 j = 0; j < archive->getFileCount(); ++j) {
...@@ -1242,6 +1268,7 @@ void Game::LoadExpansions() { ...@@ -1242,6 +1268,7 @@ void Game::LoadExpansions() {
#endif #endif
if(wcsrchr(fname, '.') && !mywcsncasecmp(wcsrchr(fname, '.'), L".cdb", 4)) if(wcsrchr(fname, '.') && !mywcsncasecmp(wcsrchr(fname, '.'), L".cdb", 4))
dataManager.LoadDB(fname); dataManager.LoadDB(fname);
#ifndef YGOPRO_SERVER_MODE
if(wcsrchr(fname, '.') && !mywcsncasecmp(wcsrchr(fname, '.'), L".conf", 5)) { if(wcsrchr(fname, '.') && !mywcsncasecmp(wcsrchr(fname, '.'), L".conf", 5)) {
#ifdef _WIN32 #ifdef _WIN32
IReadFile* reader = DataManager::FileSystem->createAndOpenFile(fname); IReadFile* reader = DataManager::FileSystem->createAndOpenFile(fname);
...@@ -1253,9 +1280,10 @@ void Game::LoadExpansions() { ...@@ -1253,9 +1280,10 @@ void Game::LoadExpansions() {
if(wcsrchr(fname, '.') && !mywcsncasecmp(wcsrchr(fname, '.'), L".ydk", 4)) { if(wcsrchr(fname, '.') && !mywcsncasecmp(wcsrchr(fname, '.'), L".ydk", 4)) {
deckBuilder.expansionPacks.push_back(fname); deckBuilder.expansionPacks.push_back(fname);
} }
#endif // YGOPRO_SERVER_MODE
} }
} }
#endif //YGOPRO_SERVER_MODE #endif //SERVER_ZIP_SUPPORT
} }
#ifndef YGOPRO_SERVER_MODE #ifndef YGOPRO_SERVER_MODE
void Game::RefreshCategoryDeck(irr::gui::IGUIComboBox* cbCategory, irr::gui::IGUIComboBox* cbDeck, bool selectlastused) { void Game::RefreshCategoryDeck(irr::gui::IGUIComboBox* cbCategory, irr::gui::IGUIComboBox* cbDeck, bool selectlastused) {
......
...@@ -93,7 +93,11 @@ bool NetServer::StartServer(unsigned short port) { ...@@ -93,7 +93,11 @@ bool NetServer::StartServer(unsigned short port) {
memset(&sin, 0, sizeof(sin)); memset(&sin, 0, sizeof(sin));
server_port = port; server_port = port;
sin.sin_family = AF_INET; sin.sin_family = AF_INET;
#ifdef SERVER_PRO2_SUPPORT
sin.sin_addr.s_addr = htonl(INADDR_LOOPBACK);
#else
sin.sin_addr.s_addr = htonl(INADDR_ANY); sin.sin_addr.s_addr = htonl(INADDR_ANY);
#endif
sin.sin_port = htons(port); sin.sin_port = htons(port);
listener = evconnlistener_new_bind(net_evbase, ServerAccept, NULL, listener = evconnlistener_new_bind(net_evbase, ServerAccept, NULL,
LEV_OPT_CLOSE_ON_FREE | LEV_OPT_REUSEABLE, -1, (sockaddr*)&sin, sizeof(sin)); LEV_OPT_CLOSE_ON_FREE | LEV_OPT_REUSEABLE, -1, (sockaddr*)&sin, sizeof(sin));
......
include "lzma/." include "lzma/."
if not SERVER_MODE then if (SERVER_ZIP_SUPPORT or not SERVER_MODE) then
include "spmemvfs/." include "spmemvfs/."
end end
...@@ -19,6 +19,16 @@ if SERVER_MODE then ...@@ -19,6 +19,16 @@ if SERVER_MODE then
"tag_duel.cpp", "tag_duel.h" } "tag_duel.cpp", "tag_duel.h" }
includedirs { "../ocgcore" } includedirs { "../ocgcore" }
links { "ocgcore", "clzma", LUA_LIB_NAME, "sqlite3", "event" } links { "ocgcore", "clzma", LUA_LIB_NAME, "sqlite3", "event" }
if SERVER_ZIP_SUPPORT then
defines { "SERVER_ZIP_SUPPORT" }
links { "irrlicht", "cspmemvfs" }
if BUILD_IRRLICHT then
includedirs { "../irrlicht/source/Irrlicht" }
end
end
if SERVER_PRO2_SUPPORT then
defines { "SERVER_PRO2_SUPPORT" }
end
else else
kind "WindowedApp" kind "WindowedApp"
...@@ -75,6 +85,9 @@ end ...@@ -75,6 +85,9 @@ end
files "ygopro.rc" files "ygopro.rc"
if not SERVER_MODE then if not SERVER_MODE then
libdirs { "$(DXSDK_DIR)Lib/x86" } libdirs { "$(DXSDK_DIR)Lib/x86" }
end
if SERVER_PRO2_SUPPORT then
targetname ("AI.Server")
end end
if USE_IRRKLANG then if USE_IRRKLANG then
links { "irrKlang" } links { "irrKlang" }
......
project "irrlicht"
kind "StaticLib"
includedirs { "include", "source/Irrlicht", "source/Irrlicht/zlib" }
defines {
"_IRR_STATIC_LIB_",
"NO_IRR_COMPILE_WITH_ZIP_ENCRYPTION_",
"NO_IRR_COMPILE_WITH_BZIP2_",
"NO__IRR_COMPILE_WITH_MOUNT_ARCHIVE_LOADER_",
"NO__IRR_COMPILE_WITH_PAK_ARCHIVE_LOADER_",
"NO__IRR_COMPILE_WITH_NPK_ARCHIVE_LOADER_",
"NO__IRR_COMPILE_WITH_TAR_ARCHIVE_LOADER_",
"NO__IRR_COMPILE_WITH_WAD_ARCHIVE_LOADER_"
}
exceptionhandling "Off"
rtti "Off"
files {
"source/Irrlicht/os.cpp",
"source/Irrlicht/zlib/adler32.c",
"source/Irrlicht/zlib/crc32.c",
"source/Irrlicht/zlib/inffast.c",
"source/Irrlicht/zlib/inflate.c",
"source/Irrlicht/zlib/inftrees.c",
"source/Irrlicht/zlib/zutil.c",
"source/Irrlicht/CAttributes.cpp",
"source/Irrlicht/CFileList.cpp",
"source/Irrlicht/CFileSystem.cpp",
"source/Irrlicht/CLimitReadFile.cpp",
"source/Irrlicht/CMemoryFile.cpp",
"source/Irrlicht/CReadFile.cpp",
"source/Irrlicht/CWriteFile.cpp",
"source/Irrlicht/CXMLReader.cpp",
"source/Irrlicht/CXMLWriter.cpp",
"source/Irrlicht/CZipReader.cpp"
}
filter { "system:windows" }
defines { "_IRR_WCHAR_FILESYSTEM" }
...@@ -10,6 +10,8 @@ IRRKLANG_PRO = false ...@@ -10,6 +10,8 @@ IRRKLANG_PRO = false
LUA_LIB_NAME = "lua" LUA_LIB_NAME = "lua"
SERVER_MODE = true SERVER_MODE = true
SERVER_ZIP_SUPPORT = false
SERVER_PRO2_SUPPORT = false
USE_IRRKLANG = false USE_IRRKLANG = false
-- read settings from command line or environment variables -- read settings from command line or environment variables
...@@ -54,7 +56,10 @@ newoption { trigger = 'build-ikpmp3', category = "YGOPro - irrklang - ikpmp3", d ...@@ -54,7 +56,10 @@ newoption { trigger = 'build-ikpmp3', category = "YGOPro - irrklang - ikpmp3", d
newoption { trigger = "winxp-support", category = "YGOPro", description = "" } newoption { trigger = "winxp-support", category = "YGOPro", description = "" }
newoption { trigger = "mac-arm", category = "YGOPro", description = "M1" } newoption { trigger = "mac-arm", category = "YGOPro", description = "M1" }
newoption { trigger = "server-mode", category = "YGOPro", description = "" }
newoption { trigger = "server-mode", category = "YGOPro - server", description = "" }
newoption { trigger = "server-zip-support", category = "YGOPro - server", description = "" }
newoption { trigger = "server-pro2-support", category = "YGOPro - server", description = "" }
-- koishipro specific -- koishipro specific
...@@ -208,6 +213,14 @@ if os.istarget("macosx") then ...@@ -208,6 +213,14 @@ if os.istarget("macosx") then
end end
if GetParam("server-mode") then if GetParam("server-mode") then
SERVER_MODE = true SERVER_MODE = true
SERVER_ZIP_SUPPORT = false
end
if GetParam("server-zip-support") then
SERVER_ZIP_SUPPORT = true
end
if GetParam("server-pro2-support") then
SERVER_PRO2_SUPPORT = true
SERVER_ZIP_SUPPORT = true
end end
if SERVER_MODE then if SERVER_MODE then
...@@ -235,9 +248,7 @@ workspace "YGOPro" ...@@ -235,9 +248,7 @@ workspace "YGOPro"
filter "system:windows" filter "system:windows"
defines { "WIN32", "_WIN32" } defines { "WIN32", "_WIN32" }
if not SERVER_MODE then
entrypoint "mainCRTStartup" entrypoint "mainCRTStartup"
end
systemversion "latest" systemversion "latest"
startproject "YGOPro" startproject "YGOPro"
if WINXP_SUPPORT then if WINXP_SUPPORT then
...@@ -308,6 +319,9 @@ end ...@@ -308,6 +319,9 @@ end
if BUILD_IRRLICHT and not SERVER_MODE then if BUILD_IRRLICHT and not SERVER_MODE then
include "irrlicht" include "irrlicht"
end end
if BUILD_IRRLICHT and SERVER_MODE and SERVER_ZIP_SUPPORT then
include "irrlicht/premake5-only-zipreader.lua"
end
if BUILD_SQLITE then if BUILD_SQLITE then
include "sqlite3" include "sqlite3"
end end
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment