Commit eaaa8e64 authored by mercury233's avatar mercury233

Merge branch 'master' of https://github.com/Fluorohydride/ygopro into server

parents 8eb6fe1d 604ac65a
add_definitions ( "-wd4996" "-D_CRT_SECURE_NO_WARNINGS" "-D_ITERATOR_DEBUG_LEVEL=0" ) add_definitions ( "-wd4996" "-D_CRT_SECURE_NO_WARNINGS" )
add_definitions ( "-D_UNICODE" "-DUNICODE" "/utf-8" ) add_definitions ( "-D_UNICODE" "-DUNICODE" "/utf-8" )
include (MSVCMultipleProcessCompile) include (MSVCMultipleProcessCompile)
......
...@@ -213,14 +213,17 @@ bool ClientCard::client_card_sort(ClientCard* c1, ClientCard* c2) { ...@@ -213,14 +213,17 @@ bool ClientCard::client_card_sort(ClientCard* c1, ClientCard* c2) {
else return c1->sequence < c2->sequence; else return c1->sequence < c2->sequence;
else { else {
if(c1->location & (LOCATION_DECK | LOCATION_GRAVE | LOCATION_REMOVED | LOCATION_EXTRA)) { if(c1->location & (LOCATION_DECK | LOCATION_GRAVE | LOCATION_REMOVED | LOCATION_EXTRA)) {
for(size_t i = 0; i < mainGame->dField.chains.size(); ++i) { auto it1 = std::find_if(mainGame->dField.chains.rbegin(), mainGame->dField.chains.rend(), [c1](const auto& ch) {
auto chit = mainGame->dField.chains[i]; return c1 == ch.chain_card || ch.target.find(c1) != ch.target.end();
if(c1 == chit.chain_card || chit.target.find(c1) != chit.target.end()) });
return true; auto it2 = std::find_if(mainGame->dField.chains.rbegin(), mainGame->dField.chains.rend(), [c2](const auto& ch) {
return c2 == ch.chain_card || ch.target.find(c2) != ch.target.end();
});
if(it1 != mainGame->dField.chains.rend() || it2 != mainGame->dField.chains.rend()) {
return it1 < it2;
} }
return c1->sequence > c2->sequence; return c1->sequence > c2->sequence;
} } else
else
return c1->sequence < c2->sequence; return c1->sequence < c2->sequence;
} }
} }
......
...@@ -405,7 +405,7 @@ void ClientField::ShowSelectCard(bool buttonok, bool chain) { ...@@ -405,7 +405,7 @@ void ClientField::ShowSelectCard(bool buttonok, bool chain) {
mainGame->btnCardSelect[i]->setRelativePosition(rect<s32>(startpos + i * 125, 55, startpos + 120 + i * 125, 225)); mainGame->btnCardSelect[i]->setRelativePosition(rect<s32>(startpos + i * 125, 55, startpos + 120 + i * 125, 225));
mainGame->btnCardSelect[i]->setPressed(false); mainGame->btnCardSelect[i]->setPressed(false);
mainGame->btnCardSelect[i]->setVisible(true); mainGame->btnCardSelect[i]->setVisible(true);
if(mainGame->dInfo.curMsg != MSG_SORT_CHAIN && mainGame->dInfo.curMsg != MSG_SORT_CARD) { if(mainGame->dInfo.curMsg != MSG_SORT_CARD) {
// text // text
wchar_t formatBuffer[2048]; wchar_t formatBuffer[2048];
if(conti_selecting) if(conti_selecting)
......
...@@ -74,6 +74,7 @@ inline int myswprintf(wchar_t(&buf)[N], const wchar_t* fmt, TR... args) { ...@@ -74,6 +74,7 @@ inline int myswprintf(wchar_t(&buf)[N], const wchar_t* fmt, TR... args) {
#include <time.h> #include <time.h>
#include <thread> #include <thread>
#include <mutex> #include <mutex>
#include <algorithm>
#include "bufferio.h" #include "bufferio.h"
#include "myfilesystem.h" #include "myfilesystem.h"
#include "mysignal.h" #include "mysignal.h"
......
...@@ -6,7 +6,6 @@ ...@@ -6,7 +6,6 @@
#include "sound_manager.h" #include "sound_manager.h"
#include "game.h" #include "game.h"
#include "duelclient.h" #include "duelclient.h"
#include <algorithm>
namespace ygo { namespace ygo {
......
...@@ -2,7 +2,6 @@ ...@@ -2,7 +2,6 @@
#include "data_manager.h" #include "data_manager.h"
#include "network.h" #include "network.h"
#include "game.h" #include "game.h"
#include <algorithm>
namespace ygo { namespace ygo {
......
...@@ -1015,10 +1015,16 @@ void Game::HideElement(irr::gui::IGUIElement * win, bool set_action) { ...@@ -1015,10 +1015,16 @@ void Game::HideElement(irr::gui::IGUIElement * win, bool set_action) {
for(int i = 0; i < 5; ++i) for(int i = 0; i < 5; ++i)
btnCardSelect[i]->setDrawImage(false); btnCardSelect[i]->setDrawImage(false);
dField.conti_selecting = false; dField.conti_selecting = false;
stCardListTip->setVisible(false);
for(auto& pcard : dField.selectable_cards)
dField.SetShowMark(pcard, false);
} }
if(win == wCardDisplay) { if(win == wCardDisplay) {
for(int i = 0; i < 5; ++i) for(int i = 0; i < 5; ++i)
btnCardDisplay[i]->setDrawImage(false); btnCardDisplay[i]->setDrawImage(false);
stCardListTip->setVisible(false);
for(auto& pcard : dField.display_cards)
dField.SetShowMark(pcard, false);
} }
fadingList.push_back(fu); fadingList.push_back(fu);
} }
......
...@@ -8,7 +8,6 @@ ...@@ -8,7 +8,6 @@
#include "game.h" #include "game.h"
#include "replay.h" #include "replay.h"
#include "replay_mode.h" #include "replay_mode.h"
#include <algorithm>
namespace ygo { namespace ygo {
...@@ -1127,7 +1126,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) { ...@@ -1127,7 +1126,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
else if(mainGame->LocalPlayer(player) == 0) { else if(mainGame->LocalPlayer(player) == 0) {
mainGame->showcardcode = 1; mainGame->showcardcode = 1;
if(match_kill) if(match_kill)
myswprintf(vic_buf, dataManager.GetVictoryString(0x20), dataManager.GetName(match_kill)); myswprintf(vic_buf, dataManager.GetVictoryString(0xffff), dataManager.GetName(match_kill));
else if(type < 0x10) else if(type < 0x10)
myswprintf(vic_buf, L"[%ls] %ls", mainGame->dInfo.clientname, dataManager.GetVictoryString(type)); myswprintf(vic_buf, L"[%ls] %ls", mainGame->dInfo.clientname, dataManager.GetVictoryString(type));
else else
...@@ -1136,7 +1135,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) { ...@@ -1136,7 +1135,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
} else { } else {
mainGame->showcardcode = 2; mainGame->showcardcode = 2;
if(match_kill) if(match_kill)
myswprintf(vic_buf, dataManager.GetVictoryString(0x20), dataManager.GetName(match_kill)); myswprintf(vic_buf, dataManager.GetVictoryString(0xffff), dataManager.GetName(match_kill));
else if(type < 0x10) else if(type < 0x10)
myswprintf(vic_buf, L"[%ls] %ls", mainGame->dInfo.hostname, dataManager.GetVictoryString(type)); myswprintf(vic_buf, L"[%ls] %ls", mainGame->dInfo.hostname, dataManager.GetVictoryString(type));
else else
...@@ -1927,8 +1926,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) { ...@@ -1927,8 +1926,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
} }
return mainGame->dField.ShowSelectSum(mainGame->dField.select_panalmode); return mainGame->dField.ShowSelectSum(mainGame->dField.select_panalmode);
} }
case MSG_SORT_CARD: case MSG_SORT_CARD: {
case MSG_SORT_CHAIN: {
/*int player = */BufferIO::ReadInt8(pbuf); /*int player = */BufferIO::ReadInt8(pbuf);
int count = BufferIO::ReadInt8(pbuf); int count = BufferIO::ReadInt8(pbuf);
mainGame->dField.selectable_cards.clear(); mainGame->dField.selectable_cards.clear();
...@@ -1948,15 +1946,6 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) { ...@@ -1948,15 +1946,6 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
mainGame->dField.selectable_cards.push_back(pcard); mainGame->dField.selectable_cards.push_back(pcard);
mainGame->dField.sort_list.push_back(0); mainGame->dField.sort_list.push_back(0);
} }
if (mainGame->chkAutoChain->isChecked() && mainGame->dInfo.curMsg == MSG_SORT_CHAIN) {
mainGame->dField.sort_list.clear();
SetResponseI(-1);
DuelClient::SendResponse();
return true;
}
if(mainGame->dInfo.curMsg == MSG_SORT_CHAIN)
mainGame->wCardSelect->setText(dataManager.GetSysString(206));
else
mainGame->wCardSelect->setText(dataManager.GetSysString(205)); mainGame->wCardSelect->setText(dataManager.GetSysString(205));
mainGame->dField.select_min = 0; mainGame->dField.select_min = 0;
mainGame->dField.select_max = count; mainGame->dField.select_max = count;
......
...@@ -11,7 +11,6 @@ ...@@ -11,7 +11,6 @@
#include "single_mode.h" #include "single_mode.h"
#include "materials.h" #include "materials.h"
#include "../ocgcore/common.h" #include "../ocgcore/common.h"
#include <algorithm>
namespace ygo { namespace ygo {
...@@ -639,7 +638,6 @@ bool ClientField::OnEvent(const irr::SEvent& event) { ...@@ -639,7 +638,6 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
case BUTTON_CARD_4: { case BUTTON_CARD_4: {
if(mainGame->dInfo.isReplay) if(mainGame->dInfo.isReplay)
break; break;
mainGame->stCardListTip->setVisible(false);
switch(mainGame->dInfo.curMsg) { switch(mainGame->dInfo.curMsg) {
case MSG_SELECT_IDLECMD: case MSG_SELECT_IDLECMD:
case MSG_SELECT_BATTLECMD: case MSG_SELECT_BATTLECMD:
...@@ -736,7 +734,8 @@ bool ClientField::OnEvent(const irr::SEvent& event) { ...@@ -736,7 +734,8 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
if (selected_cards.size() > 0) { if (selected_cards.size() > 0) {
SetResponseSelectedCards(); SetResponseSelectedCards();
ShowCancelOrFinishButton(0); ShowCancelOrFinishButton(0);
mainGame->HideElement(mainGame->wCardSelect, true);} mainGame->HideElement(mainGame->wCardSelect, true);
}
break; break;
} }
case MSG_SELECT_SUM: { case MSG_SELECT_SUM: {
...@@ -745,7 +744,6 @@ bool ClientField::OnEvent(const irr::SEvent& event) { ...@@ -745,7 +744,6 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
ShowSelectSum(true); ShowSelectSum(true);
break; break;
} }
case MSG_SORT_CHAIN:
case MSG_SORT_CARD: { case MSG_SORT_CARD: {
int offset = mainGame->scrCardList->getPos() / 10; int offset = mainGame->scrCardList->getPos() / 10;
int sel_seq = id - BUTTON_CARD_0 + offset; int sel_seq = id - BUTTON_CARD_0 + offset;
...@@ -785,7 +783,6 @@ bool ClientField::OnEvent(const irr::SEvent& event) { ...@@ -785,7 +783,6 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
break; break;
} }
case BUTTON_CARD_SEL_OK: { case BUTTON_CARD_SEL_OK: {
mainGame->stCardListTip->setVisible(false);
if(mainGame->dInfo.isReplay) { if(mainGame->dInfo.isReplay) {
mainGame->HideElement(mainGame->wCardSelect); mainGame->HideElement(mainGame->wCardSelect);
break; break;
...@@ -1032,13 +1029,13 @@ bool ClientField::OnEvent(const irr::SEvent& event) { ...@@ -1032,13 +1029,13 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
break; break;
} }
case irr::gui::EGET_ELEMENT_LEFT: { case irr::gui::EGET_ELEMENT_LEFT: {
if(id >= BUTTON_CARD_0 && id <= BUTTON_CARD_4) { if(id >= BUTTON_CARD_0 && id <= BUTTON_CARD_4 && mainGame->stCardListTip->isVisible()) {
int pos = mainGame->scrCardList->getPos() / 10; int pos = mainGame->scrCardList->getPos() / 10;
ClientCard* mcard = selectable_cards[id - BUTTON_CARD_0 + pos]; ClientCard* mcard = selectable_cards[id - BUTTON_CARD_0 + pos];
SetShowMark(mcard, false); SetShowMark(mcard, false);
mainGame->stCardListTip->setVisible(false); mainGame->stCardListTip->setVisible(false);
} }
if(id >= BUTTON_DISPLAY_0 && id <= BUTTON_DISPLAY_4) { if(id >= BUTTON_DISPLAY_0 && id <= BUTTON_DISPLAY_4 && mainGame->stCardListTip->isVisible()) {
int pos = mainGame->scrDisplayList->getPos() / 10; int pos = mainGame->scrDisplayList->getPos() / 10;
ClientCard* mcard = display_cards[id - BUTTON_DISPLAY_0 + pos]; ClientCard* mcard = display_cards[id - BUTTON_DISPLAY_0 + pos];
SetShowMark(mcard, false); SetShowMark(mcard, false);
...@@ -2503,7 +2500,6 @@ void ClientField::CancelOrFinish() { ...@@ -2503,7 +2500,6 @@ void ClientField::CancelOrFinish() {
} }
break; break;
} }
case MSG_SORT_CHAIN:
case MSG_SORT_CARD: { case MSG_SORT_CARD: {
if(mainGame->wCardSelect->isVisible()) { if(mainGame->wCardSelect->isVisible()) {
DuelClient::SetResponseI(-1); DuelClient::SetResponseI(-1);
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
#include "single_mode.h" #include "single_mode.h"
#endif //YGOPRO_SERVER_MODE #endif //YGOPRO_SERVER_MODE
const unsigned short PRO_VERSION = 0x134B; const unsigned short PRO_VERSION = 0x1350;
namespace ygo { namespace ygo {
......
#include "replay.h" #include "replay.h"
#include "../ocgcore/ocgapi.h" #include "../ocgcore/ocgapi.h"
#include "../ocgcore/common.h" #include "../ocgcore/common.h"
#include <algorithm>
#include "lzma/LzmaLib.h" #include "lzma/LzmaLib.h"
namespace ygo { namespace ygo {
......
...@@ -425,8 +425,7 @@ bool ReplayMode::ReplayAnalyze(char* msg, unsigned int len) { ...@@ -425,8 +425,7 @@ bool ReplayMode::ReplayAnalyze(char* msg, unsigned int len) {
pbuf += count * 11; pbuf += count * 11;
return ReadReplayResponse(); return ReadReplayResponse();
} }
case MSG_SORT_CARD: case MSG_SORT_CARD: {
case MSG_SORT_CHAIN: {
player = BufferIO::ReadInt8(pbuf); player = BufferIO::ReadInt8(pbuf);
count = BufferIO::ReadInt8(pbuf); count = BufferIO::ReadInt8(pbuf);
pbuf += count * 7; pbuf += count * 7;
......
...@@ -938,8 +938,7 @@ int SingleDuel::Analyze(char* msgbuffer, unsigned int len) { ...@@ -938,8 +938,7 @@ int SingleDuel::Analyze(char* msgbuffer, unsigned int len) {
NetServer::SendBufferToPlayer(players[player], STOC_GAME_MSG, offset, pbuf - offset); NetServer::SendBufferToPlayer(players[player], STOC_GAME_MSG, offset, pbuf - offset);
return 1; return 1;
} }
case MSG_SORT_CARD: case MSG_SORT_CARD: {
case MSG_SORT_CHAIN: {
player = BufferIO::ReadInt8(pbuf); player = BufferIO::ReadInt8(pbuf);
count = BufferIO::ReadInt8(pbuf); count = BufferIO::ReadInt8(pbuf);
pbuf += count * 7; pbuf += count * 7;
......
...@@ -339,8 +339,7 @@ bool SingleMode::SinglePlayAnalyze(char* msg, unsigned int len) { ...@@ -339,8 +339,7 @@ bool SingleMode::SinglePlayAnalyze(char* msg, unsigned int len) {
} }
break; break;
} }
case MSG_SORT_CARD: case MSG_SORT_CARD: {
case MSG_SORT_CHAIN: {
player = BufferIO::ReadInt8(pbuf); player = BufferIO::ReadInt8(pbuf);
count = BufferIO::ReadInt8(pbuf); count = BufferIO::ReadInt8(pbuf);
pbuf += count * 7; pbuf += count * 7;
......
...@@ -865,8 +865,7 @@ int TagDuel::Analyze(char* msgbuffer, unsigned int len) { ...@@ -865,8 +865,7 @@ int TagDuel::Analyze(char* msgbuffer, unsigned int len) {
NetServer::SendBufferToPlayer(cur_player[player], STOC_GAME_MSG, offset, pbuf - offset); NetServer::SendBufferToPlayer(cur_player[player], STOC_GAME_MSG, offset, pbuf - offset);
return 1; return 1;
} }
case MSG_SORT_CARD: case MSG_SORT_CARD: {
case MSG_SORT_CHAIN: {
player = BufferIO::ReadInt8(pbuf); player = BufferIO::ReadInt8(pbuf);
count = BufferIO::ReadInt8(pbuf); count = BufferIO::ReadInt8(pbuf);
pbuf += count * 7; pbuf += count * 7;
......
This diff is collapsed.
Subproject commit b644fa90330446a834a49b7539dae9eafdfe2610 Subproject commit 86d502dbfb8fc058439b39945cb3384955a52aea
...@@ -41,9 +41,6 @@ solution "ygo" ...@@ -41,9 +41,6 @@ solution "ygo"
defines "NDEBUG" defines "NDEBUG"
buildoptions "-march=native" buildoptions "-march=native"
configuration { "Debug", "vs*" }
defines { "_ITERATOR_DEBUG_LEVEL=0" }
configuration "Release" configuration "Release"
flags { "OptimizeSpeed" } flags { "OptimizeSpeed" }
targetdir "bin/release" targetdir "bin/release"
......
Subproject commit 7dc4b3df15a51904a31bd967d3588cbdd3533c9c Subproject commit b820812a1ffb14eeb0022b2336c0c8c93d856d5c
...@@ -508,7 +508,8 @@ ...@@ -508,7 +508,8 @@
!victory 0x1d 「方程式运动员胜利团队」效果胜利 !victory 0x1d 「方程式运动员胜利团队」效果胜利
!victory 0x1e 「飞行象」效果胜利 !victory 0x1e 「飞行象」效果胜利
!victory 0x1f 「守护神 艾克佐迪亚」效果胜利 !victory 0x1f 「守护神 艾克佐迪亚」效果胜利
!victory 0x20 由于「%ls」的效果获得比赛胜利 !victory 0x20 「真艾克佐迪亚」效果胜利
!victory 0xffff 由于「%ls」的效果获得比赛胜利
#counters #counters
!counter 0x1 魔力指示物 !counter 0x1 魔力指示物
!counter 0x1002 楔指示物 !counter 0x1002 楔指示物
...@@ -993,3 +994,6 @@ ...@@ -993,3 +994,6 @@
!setname 0x139 守护神官 守護神官 !setname 0x139 守护神官 守護神官
!setname 0x13a 拟声 オノマト !setname 0x13a 拟声 オノマト
!setname 0x13b 叛逆 リベリオン !setname 0x13b 叛逆 リベリオン
!setname 0x13c 代码破坏者 コードブレイカー
!setname 0x13d 星义 ネメシス
!setname 0x13e 巴巴罗斯 バルバロス
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