Commit 47e70cc1 authored by nanahira's avatar nanahira

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

parents 4b133226 57ec4313
......@@ -14,14 +14,11 @@ mat_common:
- linux
script:
# lua
- wget -O - https://cdn01.moecube.com/ygopro-build-materials/lua-5.3.5.tar.gz | tar zfx -
- mv lua-5.3.5/src lua
- wget -O - https://cdn01.moecube.com/ygopro-build-materials/lua-5.3.6.tar.gz | tar zfx -
- mv lua-5.3.6/src lua
# sqlite3
- wget -O - https://cdn01.moecube.com/ygopro-build-materials/sqlite-autoconf-3360000.tar.gz | tar zfx -
- mv sqlite-autoconf-3360000 sqlite3
# freetype
#- wget -O - https://cdn01.moecube.com/ygopro-build-materials/freetype-2.10.4.tar.gz | tar zfx -
#- mv freetype-2.10.4 freetype
# premake
- cp -rf premake/* .;
artifacts:
......@@ -36,9 +33,8 @@ mat_linux:
- linux
script:
- apt update; apt -y install git wget tar
# - 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-alpha14-linux.tar.gz | tar zfx -
- env PROCESSOR_COUNT=$(nproc) ./.ci/libevent-prebuild.sh
#- git clone --depth=1 https://code.mycard.moe/mycard/irrlicht irrlicht_linux
- wget -O - https://cdn01.moecube.com/ygopro-build-materials/premake-5.0.0-beta1-linux.tar.gz | tar zfx -
artifacts:
paths:
- premake5
......@@ -52,11 +48,15 @@ mat_windows:
script:
- apt update; apt -y install wget tar patch p7zip-full
# premake5.exe
- wget https://cdn01.moecube.com/ygopro-build-materials/premake-5.0.0-alpha14-windows.zip
- 7z x -y premake-5.0.0-alpha14-windows.zip
- wget https://cdn01.moecube.com/ygopro-build-materials/premake-5.0.0-beta1-windows.zip
- 7z x -y premake-5.0.0-beta1-windows.zip
# event
- 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 ; cp -rf event/WIN32-Code/* event/include
- mv libevent-2.0.22-stable event
# sqlite3
- wget https://cdn01.moecube.com/ygopro-build-materials/sqlite-amalgamation-3310100.zip
- 7z x -y sqlite-amalgamation-3310100.zip
- mv sqlite-amalgamation-3310100 sqlite3
artifacts:
paths:
- premake5.exe
......@@ -84,7 +84,7 @@ exec_windows:
- git submodule update --init
- bash -c 'cp -rf premake/* .'
- '.\premake5.exe vs2019'
- cmd /c '"C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\msbuild.exe" build\ygo.sln /m /p:Configuration=Release'
- cmd /c '"C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\msbuild.exe" build\YGOPro.sln /m /p:Configuration=Release'
- copy bin\release\ygopro.exe .
artifacts:
paths:
......@@ -100,9 +100,10 @@ exec_linux:
dependencies:
- mat_common
#- mat_irrklang
- mat_lua
- mat_linux
script:
- apt update; apt -y install git build-essential
- apt update; apt -y install git build-essential libevent-dev libsqlite3-dev
- git submodule update --init
- env YGOPRO_LIBEVENT_STATIC_PATH=$PWD/libevent-stable ./premake5 gmake
- cd build
......
......@@ -22,8 +22,8 @@ before_install:
#- sudo ln -s /usr/bin/gcc-6 /usr/local/bin/gcc
#- sudo ln -s /usr/bin/g++-6 /usr/local/bin/g++
#- g++ --version
- wget -O - https://github.com/premake/premake-core/releases/download/v5.0.0-alpha14/premake-5.0.0-alpha14-linux.tar.gz | tar zfx -
#- wget -O - https://www.lua.org/ftp/lua-5.3.5.tar.gz | tar zfx -; cd lua-5.3.5; sudo make linux install; cd ..
- wget -O - https://github.com/premake/premake-core/releases/download/v5.0.0-beta1/premake-5.0.0-beta1-linux.tar.gz | tar zfx -
#- wget -O - https://www.lua.org/ftp/lua-5.3.6.tar.gz | tar zfx -; cd lua-5.3.6; sudo make linux install; cd ..
script:
- ./premake5 gmake
- cd build
......
......@@ -24,6 +24,20 @@
* sqlite3
* 可参考本项目 [appveyor.yml](https://github.com/mycard/ygopro/blob/server/appveyor.yml) 中的脚本
### MacOS下编译
* 需要以下组件或工具
* clang
* premake5
* libevent
* lua5.3
* sqlite3
* 参考步骤
* 安装libevent sqlite3
* 编译premake5
* wget https://www.lua.org/ftp/lua-5.4.3.tar.gz && tar xf lua-5.4.3.tar.gz && mv lua-5.4.3 lua && cp premake/lua/* lua/
* ./premake5 gmake --cc=clang
* cd build && make config=release
### 运行
* 使用[ygopro-server](https://github.com/mycard/ygopro-server)运行
* 手动运行的参数是
......
......@@ -7,17 +7,22 @@ install:
- git submodule update --init --recursive
# environment and system dependency
<<<<<<< HEAD
- bash -c "curl --retry 5 --connect-timeout 30 --location --remote-header-name --remote-name https://github.com/premake/premake-core/releases/download/v5.0.0-alpha14/premake-5.0.0-alpha14-windows.zip ; exit 0"
- 7z x -y premake-5.0.0-alpha14-windows.zip
=======
- bash -c "curl --retry 5 --connect-timeout 30 --location --remote-header-name --remote-name https://github.com/premake/premake-core/releases/download/v5.0.0-beta1/premake-5.0.0-beta1-windows.zip ; exit 0"
- 7z x premake-5.0.0-beta1-windows.zip
>>>>>>> 57ec431355b6eada0eeb74f1a54f0c1e83fa1ba5
- bash -c "curl --retry 5 --connect-timeout 30 --location --remote-header-name --remote-name https://github.com/libevent/libevent/releases/download/release-2.0.22-stable/libevent-2.0.22-stable.tar.gz ; exit 0"
- tar xf libevent-2.0.22-stable.tar.gz
- move libevent-2.0.22-stable event
- xcopy /E event\WIN32-Code event\include
- bash -c "curl --retry 5 --connect-timeout 30 --location --remote-header-name --remote-name https://www.lua.org/ftp/lua-5.3.5.tar.gz ; exit 0"
- tar xf lua-5.3.5.tar.gz
- move lua-5.3.5\src lua
- bash -c "curl --retry 5 --connect-timeout 30 --location --remote-header-name --remote-name https://www.lua.org/ftp/lua-5.3.6.tar.gz ; exit 0"
- tar xf lua-5.3.6.tar.gz
- move lua-5.3.6\src lua
- bash -c "curl --retry 5 --connect-timeout 30 --location --remote-header-name --remote-name https://www.sqlite.org/2020/sqlite-amalgamation-3310100.zip ; exit 0"
- 7z x -y sqlite-amalgamation-3310100.zip
......@@ -89,9 +94,13 @@ deploy:
branch: server
cache:
- premake-5.0.0-alpha14-windows.zip
- premake-5.0.0-beta1-windows.zip
- libevent-2.0.22-stable.tar.gz
<<<<<<< HEAD
- freetype-2.10.1.tar.gz
- lua-5.3.5.tar.gz
- irrlicht-1.8.4.zip
=======
- lua-5.3.6.tar.gz
>>>>>>> 57ec431355b6eada0eeb74f1a54f0c1e83fa1ba5
- sqlite-amalgamation-3310100.zip
......@@ -1743,7 +1743,6 @@ void Game::ShowCardInfo(int code, bool resize) {
if(!dataManager.GetData(code, &cd))
memset(&cd, 0, sizeof(CardData));
imgCard->setImage(imageManager.GetTexture(code, true));
imgCard->setScaleImage(true);
if(cd.alias != 0 && (cd.alias - code < CARD_ARTWORK_VERSIONS_OFFSET || code - cd.alias < CARD_ARTWORK_VERSIONS_OFFSET))
myswprintf(formatBuffer, L"%ls[%08d]", dataManager.GetName(cd.alias), cd.alias);
else myswprintf(formatBuffer, L"%ls[%08d]", dataManager.GetName(code), code);
......@@ -1976,9 +1975,7 @@ void Game::initUtils() {
#ifndef YGOPRO_SERVER_MODE
void Game::ClearTextures() {
matManager.mCard.setTexture(0, 0);
imgCard->setImage(imageManager.tCover[0]);
scrCardText->setVisible(false);
imgCard->setScaleImage(true);
ClearCardInfo(0);
btnPSAU->setImage();
btnPSDU->setImage();
for(int i=0; i<=4; ++i) {
......
......@@ -28,7 +28,7 @@ int main(int argc, char* argv[]) {
#ifndef _WIN32
setlocale(LC_CTYPE, "UTF-8");
#endif
#ifdef __APPLE__
#if defined __APPLE__ && !defined YGOPRO_SERVER_MODE
CFURLRef bundle_url = CFBundleCopyBundleURL(CFBundleGetMainBundle());
CFURLRef bundle_base_url = CFURLCreateCopyDeletingLastPathComponent(NULL, bundle_url);
CFRelease(bundle_url);
......
project "clzma"
kind "StaticLib"
files { "**.c", "**.h" }
files { "*.c", "*.h" }
include "lzma/."
if not SERVER_MODE then
include "spmemvfs/."
end
project "ygopro"
if SERVER_MODE then
kind "ConsoleApp"
defines { "YGOPRO_SERVER_MODE" }
files { "gframe.cpp", "config.h",
"game.cpp", "game.h", "myfilesystem.h",
"deck_manager.cpp", "deck_manager.h",
"data_manager.cpp", "data_manager.h",
"replay.cpp", "replay.h",
"netserver.cpp", "netserver.h",
"single_duel.cpp", "single_duel.h",
"tag_duel.cpp", "tag_duel.h" }
includedirs { "../ocgcore" }
links { "ocgcore", "clzma", LUA_LIB_NAME, "sqlite3", "event" }
else
kind "WindowedApp"
files { "*.cpp", "*.h" }
includedirs { "../ocgcore" }
links { "ocgcore", "clzma", "cspmemvfs", LUA_LIB_NAME, "sqlite3", "irrlicht", "freetype", "event" }
end
if BUILD_EVENT then
includedirs { "../event/include" }
else
includedirs { EVENT_INCLUDE_DIR }
libdirs { EVENT_LIB_DIR }
end
if BUILD_IRRLICHT then
includedirs { "../irrlicht/include" }
else
includedirs { IRRLICHT_INCLUDE_DIR }
libdirs { IRRLICHT_LIB_DIR }
end
if BUILD_FREETYPE then
includedirs { "../freetype/include" }
else
includedirs { FREETYPE_INCLUDE_DIR }
libdirs { FREETYPE_LIB_DIR }
end
if BUILD_SQLITE then
includedirs { "../sqlite3" }
else
includedirs { SQLITE_INCLUDE_DIR }
libdirs { SQLITE_LIB_DIR }
end
if USE_IRRKLANG then
defines { "YGOPRO_USE_IRRKLANG" }
includedirs { IRRKLANG_INCLUDE_DIR }
if not IRRKLANG_PRO then
libdirs { IRRKLANG_LIB_DIR }
end
end
filter "system:windows"
defines { "_IRR_WCHAR_FILESYSTEM" }
files "ygopro.rc"
if not SERVER_MODE then
libdirs { "$(DXSDK_DIR)Lib/x86" }
end
if USE_IRRKLANG then
links { "irrKlang" }
if IRRKLANG_PRO then
defines { "IRRKLANG_STATIC" }
links { "ikpmp3" }
filter { "not configurations:Debug" }
libdirs { IRRKLANG_PRO_RELEASE_LIB_DIR }
filter { "configurations:Debug" }
libdirs { IRRKLANG_PRO_DEBUG_LIB_DIR }
filter {}
end
end
if SERVER_MODE then
links { "ws2_32" }
else
links { "opengl32", "ws2_32", "winmm", "gdi32", "kernel32", "user32", "imm32" }
end
filter "not action:vs*"
buildoptions { "-std=c++14", "-fno-rtti" }
filter "not system:windows"
links { "event_pthreads", "dl", "pthread" }
filter "system:macosx"
if not SERVER_MODE then
links { "z" }
defines { "GL_SILENCE_DEPRECATION" }
end
if MAC_ARM then
buildoptions { "--target=arm64-apple-macos12" }
linkoptions { "-arch arm64" }
end
if USE_IRRKLANG then
links { "irrklang" }
end
filter "system:linux"
if not SERVER_MODE then
links { "GL", "X11", "Xxf86vm" }
end
if USE_IRRKLANG then
links { "IrrKlang" }
linkoptions{ IRRKLANG_LINK_RPATH }
end
project "cspmemvfs"
kind "StaticLib"
files { "**.c", "**.h" }
files { "*.c", "*.h" }
configuration "windows"
if BUILD_SQLITE then
includedirs { "../../sqlite3" }
configuration "not windows"
if BUILD_SQLITE then
includedirs { "../../sqlite3" }
end
end
Subproject commit 2615ef6a609576d3fd34be6130620f30a30d21b7
Subproject commit d71e1ea4fa0564fc49736aa9e7c19afd99210499
......@@ -8,5 +8,6 @@ project "event"
"evmap.c", "log.c", "evutil.c", "evutil_rand.c", "strlcpy.c", "signal.c",
"event_tagging.c", "http.c", "evdns.c", "evrpc.c" }
configuration "windows"
filter "system:windows"
prebuildcommands { "xcopy /E /Y $(ProjectDir)..\\event\\WIN32-Code $(ProjectDir)..\\event\\include" }
files { "win32select.c", "evthread_win32.c", "buffer_iocp.c", "event_iocp.c", "bufferevent_async.c" }
project "freetype"
kind "StaticLib"
includedirs { "include" }
defines { "FT2_BUILD_LIBRARY" }
files { "src/autofit/autofit.c",
"src/base/ftbase.c",
"src/base/ftbbox.c",
"src/base/ftbdf.c",
"src/base/ftbitmap.c",
"src/base/ftcid.c",
"src/base/ftfstype.c",
"src/base/ftgasp.c",
"src/base/ftglyph.c",
"src/base/ftgxval.c",
"src/base/ftinit.c",
"src/base/ftmm.c",
"src/base/ftotval.c",
"src/base/ftpatent.c",
"src/base/ftpfr.c",
"src/base/ftstroke.c",
"src/base/ftsynth.c",
"src/base/fttype1.c",
"src/base/ftwinfnt.c",
"src/bdf/bdf.c",
"src/cache/ftcache.c",
"src/cff/cff.c",
"src/cid/type1cid.c",
"src/gzip/ftgzip.c",
"src/lzw/ftlzw.c",
"src/pcf/pcf.c",
"src/pfr/pfr.c",
"src/psaux/psaux.c",
"src/pshinter/pshinter.c",
"src/psnames/psmodule.c",
"src/raster/raster.c",
"src/sfnt/sfnt.c",
"src/sdf/sdf.c",
"src/smooth/smooth.c",
"src/truetype/truetype.c",
"src/type1/type1.c",
"src/type42/type42.c",
"src/winfonts/winfnt.c" }
filter "system:windows"
files { "builds/windows/ftsystem.c",
"builds/windows/ftdebug.c" }
filter "not system:windows"
files { "src/base/ftsystem.c",
"src/base/ftdebug.c" }
This diff is collapsed.
This diff is collapsed.
project "lua"
kind "StaticLib"
files { "src/*.c", "src/*.h", "src/*.hpp" }
removefiles { "src/lua.c", "src/luac.c" }
filter "action:vs*"
buildoptions { "/TP" }
filter "not action:vs*"
buildoptions { "-x c++" }
filter "system:bsd"
defines { "LUA_USE_POSIX" }
filter "system:macosx"
defines { "LUA_USE_MACOSX" }
filter "system:linux"
defines { "LUA_USE_LINUX" }
This diff is collapsed.
Subproject commit 97bbddc05f32aeab9127fdb50f93c2de380d51fd
Subproject commit 8e1536d0dd8f08f0cfec0ed723aa1c999f11cac7
......@@ -267,6 +267,7 @@
!system 1190 加入手卡
!system 1191 送去墓地
!system 1192 除外
!system 1193 回到卡组
#menu
!system 1200 联机模式
!system 1201 单人模式
......
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