Commit 6f6cc61b authored by nanahira's avatar nanahira

support mdpro3 build

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