Commit 6f6cc61b authored by nanahira's avatar nanahira

support mdpro3 build

parent f4c7452d
......@@ -5,8 +5,8 @@ set -o errexit
wget -O - https://cdn01.moecube.com/ygopro-build-materials/libevent-2.0.22-stable.tar.gz | tar zfx -
cd libevent-2.0.22-stable
./configure --prefix=$PWD/libevent-stable --disable-openssl --enable-static=yes --enable-shared=no
make -j$PROCESSOR_COUNT
./configure --prefix=$PWD/libevent-stable --disable-openssl --enable-static=yes --enable-shared=no "$@"
make -j$(nproc)
make install
cd ..
mv libevent-2.0.22-stable/libevent-stable .
......
......@@ -69,7 +69,7 @@ mat_windows:
- 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
# irrlicht
# - git clone --depth=1 -b develop https://code.mycard.moe/mycard/irrlicht-new irrlicht
- git clone --depth=1 -b develop https://code.mycard.moe/mycard/irrlicht-new irrlicht
artifacts:
paths:
- premake5.exe
......
......@@ -48,6 +48,9 @@ void DeckManager::LoadLFListSingle(const char* path) {
void DeckManager::LoadLFList() {
#ifdef SERVER_PRO2_SUPPORT
LoadLFListSingle("config/lflist.conf");
#endif
#ifdef SERVER_PRO3_SUPPORT
LoadLFListSingle("Data/lflist.conf");
#endif
LoadLFListSingle("expansions/lflist.conf");
LoadLFListSingle("lflist.conf");
......
......@@ -114,8 +114,8 @@ void Game::MainServerLoop() {
deckManager.LoadLFList();
dataManager.LoadDB(L"cards.cdb");
LoadExpansions();
#ifdef SERVER_PRO2_SUPPORT
DataManager::FileSystem->addFileArchive("data/script.zip", true, false, EFAT_ZIP);
#if defined SERVER_PRO2_SUPPORT || defined SERVER_PRO3_SUPPORT
DataManager::FileSystem->addFileArchive("data/script.zip", true, false, irr::io::EFAT_ZIP);
#endif
server_port = NetServer::StartServer(server_port);
......@@ -1306,6 +1306,15 @@ void Game::LoadExpansions() {
}
});
#endif // SERVER_PRO2_SUPPORT
#ifdef SERVER_PRO3_SUPPORT
FileSystem::TraversalDir(L"./Data/locales/zh-CN", [](const wchar_t* name, bool isdir) {
wchar_t fpath[1024];
myswprintf(fpath, L"./Data/locales/zh-CN/%ls", name);
if(!isdir && IsExtension(name, L".cdb")) {
dataManager.LoadDB(fpath);
}
});
#endif // SERVER_PRO3_SUPPORT
FileSystem::TraversalDir(L"./expansions", [](const wchar_t* name, bool isdir) {
wchar_t fpath[1024];
myswprintf(fpath, L"./expansions/%ls", name);
......
......@@ -6,9 +6,15 @@ if USE_AUDIO then
include "miniaudio/."
end
project "ygopro"
if SERVER_PRO3_SUPPORT then
project "ygoserver"
kind "SharedLib"
end
if SERVER_MODE then
if not SERVER_PRO3_SUPPORT then
project "ygopro"
kind "ConsoleApp"
end
defines { "YGOPRO_SERVER_MODE" }
......@@ -20,6 +26,10 @@ if SERVER_MODE then
"netserver.cpp", "netserver.h",
"single_duel.cpp", "single_duel.h",
"tag_duel.cpp", "tag_duel.h" }
if SERVER_PRO3_SUPPORT then
files { "gframe.h", "serverapi.cpp", "serverapi.h" }
defines { "SERVER_PRO3_SUPPORT" }
end
includedirs { "../ocgcore" }
links { "ocgcore", "clzma", LUA_LIB_NAME, "sqlite3", "event" }
if SERVER_ZIP_SUPPORT then
......@@ -36,6 +46,7 @@ if SERVER_MODE then
defines { "SERVER_TAG_SURRENDER_CONFIRM" }
end
else
project "ygopro"
kind "WindowedApp"
cppdialect "C++14"
rtti "Off"
......@@ -104,7 +115,7 @@ end
linkoptions { "-arch arm64" }
end
filter "system:linux"
linkoptions { "-static-libstdc++", "-static-libgcc" }
linkoptions { "-static-libstdc++", "-static-libgcc" }
if not SERVER_MODE then
links { "GL", "X11", "Xxf86vm" }
end
Subproject commit 5669c08b3a6674f25fd924633b2275eaed3fffad
Subproject commit 236a414e34db17905ac4ac1eb0669d441adbebc3
......@@ -10,6 +10,7 @@ LUA_LIB_NAME = "lua"
SERVER_MODE = true
SERVER_ZIP_SUPPORT = false
SERVER_PRO2_SUPPORT = false
SERVER_PRO3_SUPPORT = false
SERVER_TAG_SURRENDER_CONFIRM = false
USE_IRRKLANG = false
......@@ -48,6 +49,7 @@ newoption { trigger = "mac-arm", category = "YGOPro", description = "Cross compi
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 = "" }
newoption { trigger = "server-pro3-support", category = "YGOPro - server", description = "" }
newoption { trigger = "server-tag-surrender-confirm", category = "YGOPro - server", description = "" }
boolOptions = {
......@@ -173,6 +175,12 @@ end
if GetParam("server-pro2-support") then
SERVER_PRO2_SUPPORT = true
SERVER_ZIP_SUPPORT = true
SERVER_TAG_SURRENDER_CONFIRM = true
end
if GetParam("server-pro3-support") then
SERVER_PRO3_SUPPORT = true
SERVER_ZIP_SUPPORT = true
SERVER_TAG_SURRENDER_CONFIRM = true
end
if GetParam("server-tag-surrender-confirm") then
SERVER_TAG_SURRENDER_CONFIRM = true
......@@ -265,6 +273,11 @@ end
filter "not action:vs*"
buildoptions { "-fno-strict-aliasing", "-Wno-multichar", "-Wno-format-security" }
if SERVER_PRO3_SUPPORT then
filter "not action:vs*"
pic "On"
end
filter {}
include "ocgcore"
......
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