Commit e2c4ebf6 authored by nanahira's avatar nanahira

Merge branch 'develop' into server-develop

parents 8b7b984e ef41ff54
......@@ -90,17 +90,6 @@ jobs:
7z x ${{ steps.sqlite.outputs.filepath }}
move sqlite-amalgamation-3490100 sqlite3
- name: Download irrKlang
id: irrKlang
uses: mercury233/action-cache-download-file@v1.0.0
with:
url: https://www.ambiera.at/downloads/irrKlang-32bit-1.6.0.zip
- name: Extract irrKlang
run: |
7z x ${{ steps.irrKlang.outputs.filepath }}
move irrKlang-1.6.0 irrKlang
- name: Download irrlicht
run: |
git clone --depth=1 https://github.com/mercury233/irrlicht
......@@ -232,7 +221,6 @@ jobs:
- name: Use premake to generate make files
run: |
./premake5 gmake \
--no-use-irrklang \
--freetype-include-dir="/usr/include/freetype2"
- name: Make
......@@ -327,7 +315,6 @@ jobs:
run: |
./premake5 gmake \
--cc=clang \
--no-use-irrklang \
--freetype-include-dir="/usr/local/include/freetype2" \
--irrlicht-include-dir="../irrlicht/include" \
--irrlicht-lib-dir="../irrlicht/source/Irrlicht/MacOSX/build/Release"
......@@ -337,7 +324,6 @@ jobs:
run: |
./premake5 gmake \
--cc=clang \
--no-use-irrklang \
--event-include-dir="/opt/homebrew/include" \
--event-lib-dir="/opt/homebrew/lib" \
--freetype-include-dir="/opt/homebrew/include/freetype2" \
......
......@@ -52,13 +52,9 @@ mat_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-beta2-linux.tar.gz | tar zfx -
- env PROCESSOR_COUNT=$(nproc) ./.ci/libevent-prebuild.sh
artifacts:
paths:
- premake5
- irrlicht
- libevent-stable
mat_windows:
stage: prepare
......@@ -67,8 +63,8 @@ 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-beta2-windows.zip
- 7z x -y premake-5.0.0-beta2-windows.zip
- wget https://cdn01.moecube.com/ygopro-build-materials/premake-5.0.0-beta5-windows.zip
- 7z x -y premake-5.0.0-beta5-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
......@@ -107,18 +103,17 @@ exec_windows:
paths:
- ygopro.exe
exec_linux:
.exec_linux_common:
extends: ._exec_build
tags:
- linux
image: git-registry.mycard.moe/mycard/docker-runner-base:debian11
image: git-registry.moenext.com/mycard/docker-ygopro-builder
dependencies:
- mat_common
- mat_linux
- mat_submodules
script:
- apt update; apt -y install git build-essential
- ./premake5 gmake --build-sqlite --server-zip-support
- premake5 gmake
- cd build
- make config=release -j$(nproc)
- cd ..
......@@ -128,25 +123,41 @@ exec_linux:
paths:
- ygopro
exec_debian:
extends: ._exec_build
tags:
- linux
dependencies:
- mat_common
- mat_linux
- mat_submodules
script:
.exec_linux:
extends: .exec_linux_common
variables:
BUILD_SQLITE: '1'
SERVER_ZIP_SUPPORT: '1'
EVENT_INCLUDE_DIR: /usr/share/libevent-stable/include
EVENT_LIB_DIR: /usr/share/libevent-stable/lib
.exec_debian:
extends: .exec_linux_common
variables:
BUILD_SQLITE: '1'
SERVER_ZIP_SUPPORT: '1'
before_script:
- apt update; apt -y install git build-essential liblua5.3-dev libsqlite3-dev libevent-dev
- ./premake5 gmake --lua-deb
- cd build
- make config=release -j$(nproc)
- cd ..
- mv bin/release/ygopro ./ygopro
- strip ygopro
artifacts:
paths:
- ygopro
.use_arm:
tags:
- arm
exec_linux:
extends: .exec_linux
exec_debian:
extends: .exec_debian
exec_linuxarm:
extends:
- .exec_linux
- .use_arm
exec_debianarm:
extends:
- .exec_debian
- .use_arm
#win_server_pack:
# stage: pack
......@@ -158,7 +169,6 @@ exec_debian:
# - apt update; apt -y install p7zip-full wget
# - wget https://nodejs.org/dist/v14.17.0/node-v14.17.0-win-x64.7z
upload_to_minio:
stage: deploy
dependencies:
......
......@@ -7,8 +7,8 @@ install:
- git submodule update --init --recursive
# environment and system dependency
- 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-beta2/premake-5.0.0-beta2-windows.zip ; exit 0"
- 7z x premake-5.0.0-beta2-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-beta5/premake-5.0.0-beta5-windows.zip ; exit 0"
- 7z x premake-5.0.0-beta5-windows.zip
- 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
......
......@@ -83,6 +83,11 @@ void ClientField::Clear() {
for(auto cit = extra[i].begin(); cit != extra[i].end(); ++cit)
delete *cit;
extra[i].clear();
deck_act[i] = false;
grave_act[i] = false;
remove_act[i] = false;
extra_act[i] = false;
pzone_act[i] = false;
}
for(auto cit = limbo_temp.begin(); cit != limbo_temp.end(); ++cit)
delete *cit;
......@@ -111,12 +116,6 @@ void ClientField::Clear() {
hovered_controler = 0;
hovered_location = 0;
hovered_sequence = 0;
deck_act = false;
grave_act = false;
remove_act = false;
extra_act = false;
pzone_act[0] = false;
pzone_act[1] = false;
conti_act = false;
deck_reversed = false;
cant_check_grave = false;
......@@ -367,13 +366,14 @@ void ClientField::ClearCommandFlag() {
(*cit)->cmdFlag = 0;
for(auto cit = attackable_cards.begin(); cit != attackable_cards.end(); ++cit)
(*cit)->cmdFlag = 0;
for(int i = 0; i < 2; ++i) {
deck_act[i] = false;
extra_act[i] = false;
grave_act[i] = false;
remove_act[i] = false;
pzone_act[i] = false;
}
conti_cards.clear();
deck_act = false;
extra_act = false;
grave_act = false;
remove_act = false;
pzone_act[0] = false;
pzone_act[1] = false;
conti_act = false;
}
void ClientField::ClearSelect() {
......@@ -401,11 +401,14 @@ void ClientField::ClearChainSelect() {
(*cit)->is_selectable = false;
(*cit)->is_selected = false;
}
for(int i = 0; i < 2; ++i) {
deck_act[i] = false;
extra_act[i] = false;
grave_act[i] = false;
remove_act[i] = false;
pzone_act[i] = false;
}
conti_cards.clear();
deck_act = false;
grave_act = false;
remove_act = false;
extra_act = false;
conti_act = false;
}
// needs to be synchronized with EGET_SCROLL_BAR_CHANGED
......
......@@ -78,11 +78,11 @@ public:
std::vector<ClientCard*> display_cards;
std::vector<int> sort_list;
std::map<int, int> player_desc_hints[2];
bool grave_act{ false };
bool remove_act{ false };
bool deck_act{ false };
bool extra_act{ false };
bool pzone_act[2]{};
bool grave_act[2]{ false };
bool remove_act[2]{ false };
bool deck_act[2]{ false };
bool extra_act[2]{ false };
bool pzone_act[2]{ false };
bool conti_act{ false };
bool chain_forced{ false };
ChainInfo current_chain;
......
......@@ -142,7 +142,8 @@ bool DeckBuilder::OnEvent(const irr::SEvent& event) {
(mainGame->wQuery->isVisible() && id != BUTTON_YES && id != BUTTON_NO) ||
(mainGame->wLinkMarks->isVisible() && id != BUTTON_MARKERS_OK) ||
(mainGame->wDMQuery->isVisible() && id != BUTTON_DM_OK && id != BUTTON_DM_CANCEL) ||
(mainGame->wDeckManage->isVisible() && !(id >= WINDOW_DECK_MANAGE && id < COMBOBOX_LFLIST)))
(mainGame->wDeckManage->isVisible() && !(id >= WINDOW_DECK_MANAGE && id < COMBOBOX_LFLIST)) ||
(mainGame->wDeckCode->isVisible() && id != BUTTON_DECK_CODE_SAVE && id != BUTTON_DECK_CODE_CANCEL))
&& event.GUIEvent.EventType != irr::gui::EGET_LISTBOX_CHANGED
&& event.GUIEvent.EventType != irr::gui::EGET_COMBO_BOX_CHANGED) {
if(mainGame->wDMQuery->isVisible())
......
......@@ -467,43 +467,38 @@ void Game::DrawMisc() {
im.setRotationRadians(act_rot);
matManager.mTexture.setTexture(0, imageManager.tAct);
driver->setMaterial(matManager.mTexture);
if(dField.deck_act) {
im.setTranslation(irr::core::vector3df((matManager.vFieldDeck[0][0].Pos.X + matManager.vFieldDeck[0][1].Pos.X) / 2,
(matManager.vFieldDeck[0][0].Pos.Y + matManager.vFieldDeck[0][2].Pos.Y) / 2, dField.deck[0].size() * 0.01f + 0.02f));
for(int player = 0; player < 2; ++player) {
if(dField.deck_act[player]) {
im.setTranslation(irr::core::vector3df((matManager.vFieldDeck[player][0].Pos.X + matManager.vFieldDeck[player][1].Pos.X) / 2,
(matManager.vFieldDeck[player][0].Pos.Y + matManager.vFieldDeck[player][2].Pos.Y) / 2, dField.deck[player].size() * 0.01f + 0.02f));
driver->setTransform(irr::video::ETS_WORLD, im);
driver->drawVertexPrimitiveList(matManager.vActivate, 4, matManager.iRectangle, 2);
}
if(dField.grave_act) {
im.setTranslation(irr::core::vector3df((matManager.vFieldGrave[0][rule][0].Pos.X + matManager.vFieldGrave[0][rule][1].Pos.X) / 2,
(matManager.vFieldGrave[0][rule][0].Pos.Y + matManager.vFieldGrave[0][rule][2].Pos.Y) / 2, dField.grave[0].size() * 0.01f + 0.02f));
if(dField.grave_act[player]) {
im.setTranslation(irr::core::vector3df((matManager.vFieldGrave[player][rule][0].Pos.X + matManager.vFieldGrave[player][rule][1].Pos.X) / 2,
(matManager.vFieldGrave[player][rule][0].Pos.Y + matManager.vFieldGrave[player][rule][2].Pos.Y) / 2, dField.grave[player].size() * 0.01f + 0.02f));
driver->setTransform(irr::video::ETS_WORLD, im);
driver->drawVertexPrimitiveList(matManager.vActivate, 4, matManager.iRectangle, 2);
}
if(dField.remove_act) {
im.setTranslation(irr::core::vector3df((matManager.vFieldRemove[0][rule][0].Pos.X + matManager.vFieldRemove[0][rule][1].Pos.X) / 2,
(matManager.vFieldRemove[0][rule][0].Pos.Y + matManager.vFieldRemove[0][rule][2].Pos.Y) / 2, dField.remove[0].size() * 0.01f + 0.02f));
if(dField.remove_act[player]) {
im.setTranslation(irr::core::vector3df((matManager.vFieldRemove[player][rule][0].Pos.X + matManager.vFieldRemove[player][rule][1].Pos.X) / 2,
(matManager.vFieldRemove[player][rule][0].Pos.Y + matManager.vFieldRemove[player][rule][2].Pos.Y) / 2, dField.remove[player].size() * 0.01f + 0.02f));
driver->setTransform(irr::video::ETS_WORLD, im);
driver->drawVertexPrimitiveList(matManager.vActivate, 4, matManager.iRectangle, 2);
}
if(dField.extra_act) {
im.setTranslation(irr::core::vector3df((matManager.vFieldExtra[0][0].Pos.X + matManager.vFieldExtra[0][1].Pos.X) / 2,
(matManager.vFieldExtra[0][0].Pos.Y + matManager.vFieldExtra[0][2].Pos.Y) / 2, dField.extra[0].size() * 0.01f + 0.02f));
if(dField.extra_act[player]) {
im.setTranslation(irr::core::vector3df((matManager.vFieldExtra[player][0].Pos.X + matManager.vFieldExtra[player][1].Pos.X) / 2,
(matManager.vFieldExtra[player][0].Pos.Y + matManager.vFieldExtra[player][2].Pos.Y) / 2, dField.extra[player].size() * 0.01f + 0.02f));
driver->setTransform(irr::video::ETS_WORLD, im);
driver->drawVertexPrimitiveList(matManager.vActivate, 4, matManager.iRectangle, 2);
}
if(dField.pzone_act[0]) {
if(dField.pzone_act[player]) {
int seq = dInfo.duel_rule >= 4 ? 0 : 6;
im.setTranslation(irr::core::vector3df((matManager.vFieldSzone[0][seq][rule][0].Pos.X + matManager.vFieldSzone[0][seq][rule][1].Pos.X) / 2,
(matManager.vFieldSzone[0][seq][rule][0].Pos.Y + matManager.vFieldSzone[0][seq][rule][2].Pos.Y) / 2, 0.03f));
im.setTranslation(irr::core::vector3df((matManager.vFieldSzone[player][seq][rule][0].Pos.X + matManager.vFieldSzone[player][seq][rule][1].Pos.X) / 2,
(matManager.vFieldSzone[player][seq][rule][0].Pos.Y + matManager.vFieldSzone[player][seq][rule][2].Pos.Y) / 2, 0.03f));
driver->setTransform(irr::video::ETS_WORLD, im);
driver->drawVertexPrimitiveList(matManager.vActivate, 4, matManager.iRectangle, 2);
}
if(dField.pzone_act[1]) {
int seq = dInfo.duel_rule >= 4 ? 0 : 6;
im.setTranslation(irr::core::vector3df((matManager.vFieldSzone[1][seq][rule][0].Pos.X + matManager.vFieldSzone[1][seq][rule][1].Pos.X) / 2,
(matManager.vFieldSzone[1][seq][rule][0].Pos.Y + matManager.vFieldSzone[1][seq][rule][2].Pos.Y) / 2, 0.03f));
driver->setTransform(irr::video::ETS_WORLD, im);
driver->drawVertexPrimitiveList(matManager.vActivate, 4, matManager.iRectangle, 2);
}
if(dField.conti_act) {
irr::core::vector3df pos = irr::core::vector3df((matManager.vFieldContiAct[0].X + matManager.vFieldContiAct[1].X) / 2,
......
......@@ -1495,14 +1495,12 @@ bool DuelClient::ClientAnalyze(unsigned char* msg, int len) {
mainGame->dField.conti_act = true;
} else {
pcard->cmdFlag |= COMMAND_ACTIVATE;
if(pcard->controler == 0) {
if(pcard->location == LOCATION_GRAVE)
mainGame->dField.grave_act = true;
mainGame->dField.grave_act[con] = true;
else if(pcard->location == LOCATION_REMOVED)
mainGame->dField.remove_act = true;
mainGame->dField.remove_act[con] = true;
else if(pcard->location == LOCATION_EXTRA)
mainGame->dField.extra_act = true;
}
mainGame->dField.extra_act[con] = true;
}
}
mainGame->dField.attackable_cards.clear();
......@@ -1560,17 +1558,17 @@ bool DuelClient::ClientAnalyze(unsigned char* msg, int len) {
pcard->cmdFlag |= COMMAND_SPSUMMON;
if (pcard->location == LOCATION_DECK) {
pcard->SetCode(code);
mainGame->dField.deck_act = true;
mainGame->dField.deck_act[con] = true;
} else if (pcard->location == LOCATION_GRAVE)
mainGame->dField.grave_act = true;
mainGame->dField.grave_act[con] = true;
else if (pcard->location == LOCATION_REMOVED)
mainGame->dField.remove_act = true;
mainGame->dField.remove_act[con] = true;
else if (pcard->location == LOCATION_EXTRA)
mainGame->dField.extra_act = true;
mainGame->dField.extra_act[con] = true;
else {
int left_seq = mainGame->dInfo.duel_rule >= 4 ? 0 : 6;
if (pcard->location == LOCATION_SZONE && pcard->sequence == left_seq && (pcard->type & TYPE_PENDULUM) && !pcard->equipTarget)
mainGame->dField.pzone_act[pcard->controler] = true;
mainGame->dField.pzone_act[con] = true;
}
}
mainGame->dField.reposable_cards.clear();
......@@ -1630,14 +1628,12 @@ bool DuelClient::ClientAnalyze(unsigned char* msg, int len) {
mainGame->dField.conti_act = true;
} else {
pcard->cmdFlag |= COMMAND_ACTIVATE;
if(pcard->controler == 0) {
if(pcard->location == LOCATION_GRAVE)
mainGame->dField.grave_act = true;
mainGame->dField.grave_act[con] = true;
else if(pcard->location == LOCATION_REMOVED)
mainGame->dField.remove_act = true;
mainGame->dField.remove_act[con] = true;
else if(pcard->location == LOCATION_EXTRA)
mainGame->dField.extra_act = true;
}
mainGame->dField.extra_act[con] = true;
}
}
if(BufferIO::ReadUInt8(pbuf)) {
......@@ -1924,13 +1920,13 @@ bool DuelClient::ClientAnalyze(unsigned char* msg, int len) {
pcard->cmdFlag |= COMMAND_ACTIVATE;
if(pcard->location == LOCATION_DECK) {
pcard->SetCode(code);
mainGame->dField.deck_act = true;
mainGame->dField.deck_act[c] = true;
} else if(l == LOCATION_GRAVE)
mainGame->dField.grave_act = true;
mainGame->dField.grave_act[c] = true;
else if(l == LOCATION_REMOVED)
mainGame->dField.remove_act = true;
mainGame->dField.remove_act[c] = true;
else if(l == LOCATION_EXTRA)
mainGame->dField.extra_act = true;
mainGame->dField.extra_act[c] = true;
else if(l == LOCATION_OVERLAY)
panelmode = true;
}
......
Subproject commit 39de78189126c70aa25f927d1033599f4b501ae7
Subproject commit 1d7398c7e92cf9a53fa483527a9328cc82a067f5
project "lua"
kind "StaticLib"
compileas "C++"
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++" }
files { "src/*.c", "src/*.h" }
removefiles { "src/lua.c", "src/luac.c", "src/linit.c", "src/onelua.c" }
filter "configurations:Debug"
defines { "LUA_USE_APICHECK" }
......
Subproject commit 0e92e4d32b2073615f5bc8005bfba50283844734
Subproject commit 65a4ab26c4f556e0388a9b6c80cbb090cc5569be
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