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