Commit f97b104d authored by nanahira's avatar nanahira

Merge branch 'server' of https://github.com/purerosefallen/ygopro

parents 302cc6af e865216b
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
# build files # build files
/bin /bin
/build build
/obj /obj
# dependencies # dependencies
......
No preview for this file type
...@@ -77,6 +77,9 @@ bool DuelClient::StartClient(unsigned int ip, unsigned short port, bool create_g ...@@ -77,6 +77,9 @@ bool DuelClient::StartClient(unsigned int ip, unsigned short port, bool create_g
return true; return true;
} }
void DuelClient::ConnectTimeout(evutil_socket_t fd, short events, void* arg) { void DuelClient::ConnectTimeout(evutil_socket_t fd, short events, void* arg) {
if (auto_watch_mode) {
mainGame->device->closeDevice();
}
if(connect_state == 0x7) if(connect_state == 0x7)
return; return;
if(!is_closing) { if(!is_closing) {
...@@ -2143,6 +2146,12 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) { ...@@ -2143,6 +2146,12 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
pcard = *(mainGame->dField.deck[player].rbegin() + i); pcard = *(mainGame->dField.deck[player].rbegin() + i);
if (code != 0) if (code != 0)
pcard->SetCode(code); pcard->SetCode(code);
if (auto_watch_mode && code > 0) {
mainGame->showcardcode = code;
mainGame->showcarddif = 0;
mainGame->showcardp = 0;
mainGame->showcard = 4;
}
} }
if(mainGame->dInfo.isReplaySkiping) if(mainGame->dInfo.isReplaySkiping)
return true; return true;
...@@ -2181,6 +2190,12 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) { ...@@ -2181,6 +2190,12 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
pcard = *(mainGame->dField.extra[player].rbegin() + i + mainGame->dField.extra_p_count[player]); pcard = *(mainGame->dField.extra[player].rbegin() + i + mainGame->dField.extra_p_count[player]);
if (code != 0) if (code != 0)
pcard->SetCode(code); pcard->SetCode(code);
if (auto_watch_mode && code > 0) {
mainGame->showcardcode = code;
mainGame->showcarddif = 0;
mainGame->showcardp = 0;
mainGame->showcard = 4;
}
} }
if(mainGame->dInfo.isReplaySkiping) if(mainGame->dInfo.isReplaySkiping)
return true; return true;
...@@ -2232,6 +2247,12 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) { ...@@ -2232,6 +2247,12 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
pcard = mainGame->dField.GetCard(c, l, s); pcard = mainGame->dField.GetCard(c, l, s);
if (code != 0) if (code != 0)
pcard->SetCode(code); pcard->SetCode(code);
if (auto_watch_mode && code > 0) {
mainGame->showcardcode = code;
mainGame->showcarddif = 0;
mainGame->showcardp = 0;
mainGame->showcard = 4;
}
mainGame->gMutex.lock(); mainGame->gMutex.lock();
myswprintf(textBuffer, L"*[%ls]", dataManager.GetName(code)); myswprintf(textBuffer, L"*[%ls]", dataManager.GetName(code));
mainGame->AddLog(textBuffer, code); mainGame->AddLog(textBuffer, code);
...@@ -3454,14 +3475,10 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) { ...@@ -3454,14 +3475,10 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
int count = BufferIO::ReadInt16(pbuf); int count = BufferIO::ReadInt16(pbuf);
ClientCard* pc = mainGame->dField.GetCard(c, l, s); ClientCard* pc = mainGame->dField.GetCard(c, l, s);
if (auto_watch_mode && pc->code > 0) { if (auto_watch_mode && pc->code > 0) {
myswprintf(event_string, dataManager.GetSysString(1610), dataManager.GetName(pc->code));
mainGame->showcardcode = pc->code; mainGame->showcardcode = pc->code;
mainGame->showcarddif = 0; mainGame->showcarddif = 0;
mainGame->showcardp = 0; mainGame->showcardp = 0;
mainGame->showcard = 5; mainGame->showcard = 2;
mainGame->WaitFrameSignal(30);
mainGame->showcard = 0;
mainGame->WaitFrameSignal(11);
} }
if (pc->counters.count(type)) if (pc->counters.count(type))
pc->counters[type] += count; pc->counters[type] += count;
......
...@@ -149,7 +149,7 @@ bool Game::Initialize() { ...@@ -149,7 +149,7 @@ bool Game::Initialize() {
SetWindowsIcon(); SetWindowsIcon();
//main menu //main menu
wchar_t strbuf[256]; wchar_t strbuf[256];
myswprintf(strbuf, L"KoishiPro %X.0%X.%X Chocolate", PRO_VERSION >> 12, (PRO_VERSION >> 4) & 0xff, PRO_VERSION & 0xf); myswprintf(strbuf, L"KoishiPro %X.0%X.%X Colorful", PRO_VERSION >> 12, (PRO_VERSION >> 4) & 0xff, PRO_VERSION & 0xf);
wMainMenu = env->addWindow(rect<s32>(370, 200, 650, 415), false, strbuf); wMainMenu = env->addWindow(rect<s32>(370, 200, 650, 415), false, strbuf);
wMainMenu->getCloseButton()->setVisible(false); wMainMenu->getCloseButton()->setVisible(false);
btnLanMode = env->addButton(rect<s32>(10, 30, 270, 60), wMainMenu, BUTTON_LAN_MODE, dataManager.GetSysString(1200)); btnLanMode = env->addButton(rect<s32>(10, 30, 270, 60), wMainMenu, BUTTON_LAN_MODE, dataManager.GetSysString(1200));
......
...@@ -118,7 +118,7 @@ void NetServer::StopServer() { ...@@ -118,7 +118,7 @@ void NetServer::StopServer() {
if(duel_mode) if(duel_mode)
duel_mode->EndDuel(); duel_mode->EndDuel();
#ifdef YGOPRO_SERVER_MODE // For solving the problem of connection lost after duel. See https://github.com/Fluorohydride/ygopro/issues/2067 for details. #ifdef YGOPRO_SERVER_MODE // For solving the problem of connection lost after duel. See https://github.com/Fluorohydride/ygopro/issues/2067 for details.
timeval etv = { 0, 1000000 }; timeval etv = { 0, 1 };
event_base_loopexit(net_evbase, &etv); event_base_loopexit(net_evbase, &etv);
#else #else
event_base_loopexit(net_evbase, 0); event_base_loopexit(net_evbase, 0);
......
This diff is collapsed.
...@@ -136,6 +136,8 @@ ...@@ -136,6 +136,8 @@
!system 570 请选择要变成不能使用的卡片区域 !system 570 请选择要变成不能使用的卡片区域
!system 571 请选择要移动到的位置 !system 571 请选择要移动到的位置
!system 572 请选择要放置指示物的卡 !system 572 请选择要放置指示物的卡
!system 573 请选择要无效的卡
!system 574 请选择要操作的卡
!system 1000 卡组 !system 1000 卡组
!system 1001 手卡 !system 1001 手卡
!system 1002 怪兽区 !system 1002 怪兽区
...@@ -621,6 +623,7 @@ ...@@ -621,6 +623,7 @@
!counter 0x54 指示物(星遗物引导的前路) !counter 0x54 指示物(星遗物引导的前路)
!counter 0x55 指示物(隐居者的大釜) !counter 0x55 指示物(隐居者的大釜)
!counter 0x56 炎星指示物 !counter 0x56 炎星指示物
!counter 0x57 幻魔指示物
#setnames, using tab for comment #setnames, using tab for comment
!setname 0x1 正义盟军 AOJ !setname 0x1 正义盟军 AOJ
!setname 0x2 次世代 ジェネクス !setname 0x2 次世代 ジェネクス
...@@ -731,7 +734,7 @@ ...@@ -731,7 +734,7 @@
#setname 0x4d N/A #setname 0x4d N/A
#setname 0x4e 进化 エヴォル #setname 0x4e 进化 エヴォル
!setname 0x304e 进化虫 エヴォルド !setname 0x304e 进化虫 エヴォルド
!setname 0x604e 进化龙 エヴォルダ !setname 0x604e 进化龙 エヴォルダ
!setname 0x504e 进化帝 エヴォルカイザー !setname 0x504e 进化帝 エヴォルカイザー
#setname 0x4f 爆裂 バスター #setname 0x4f 爆裂 バスター
!setname 0x104f /爆裂体 /バスター !setname 0x104f /爆裂体 /バスター
...@@ -1034,3 +1037,4 @@ ...@@ -1034,3 +1037,4 @@
!setname 0x1142 黄金国巫妖 エルドリッチ !setname 0x1142 黄金国巫妖 エルドリッチ
!setname 0x2142 黄金国永生药 エルドリクシル !setname 0x2142 黄金国永生药 エルドリクシル
!setname 0x143 黄金乡 黄金郷 !setname 0x143 黄金乡 黄金郷
!setname 0x144 幻魔
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