Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Y
ygopro
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wyykak
ygopro
Commits
8cf9df4c
Commit
8cf9df4c
authored
Dec 27, 2020
by
nanahira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add no wait
parent
0803a304
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
52 additions
and
14 deletions
+52
-14
.gitignore
.gitignore
+1
-0
gframe/config.h
gframe/config.h
+1
-0
gframe/duelclient.cpp
gframe/duelclient.cpp
+15
-5
gframe/gframe.cpp
gframe/gframe.cpp
+22
-6
gframe/menu_handler.cpp
gframe/menu_handler.cpp
+3
-1
gframe/replay_mode.cpp
gframe/replay_mode.cpp
+10
-2
No files found.
.gitignore
View file @
8cf9df4c
...
@@ -94,3 +94,4 @@ core*
...
@@ -94,3 +94,4 @@ core*
/patch.exe.manifest
/patch.exe.manifest
/patch.exe
/patch.exe
/diff.exe
/diff.exe
*.mp4
gframe/config.h
View file @
8cf9df4c
...
@@ -91,6 +91,7 @@ extern int enable_log;
...
@@ -91,6 +91,7 @@ extern int enable_log;
extern
bool
exit_on_return
;
extern
bool
exit_on_return
;
extern
bool
auto_watch_mode
;
extern
bool
auto_watch_mode
;
extern
bool
raw_video_mode
;
extern
bool
raw_video_mode
;
extern
bool
no_wait_before_exit
;
extern
bool
open_file
;
extern
bool
open_file
;
extern
wchar_t
open_file_name
[
256
];
extern
wchar_t
open_file_name
[
256
];
extern
bool
bot_mode
;
extern
bool
bot_mode
;
...
...
gframe/duelclient.cpp
View file @
8cf9df4c
...
@@ -190,7 +190,9 @@ void DuelClient::ClientEvent(bufferevent *bev, short events, void *ctx) {
...
@@ -190,7 +190,9 @@ void DuelClient::ClientEvent(bufferevent *bev, short events, void *ctx) {
mainGame
->
env
->
addMessageBox
(
L""
,
dataManager
.
GetSysString
(
1400
));
mainGame
->
env
->
addMessageBox
(
L""
,
dataManager
.
GetSysString
(
1400
));
mainGame
->
gMutex
.
unlock
();
mainGame
->
gMutex
.
unlock
();
if
(
auto_watch_mode
)
{
if
(
auto_watch_mode
)
{
mainGame->actionSignal.Wait(2000);
if
(
!
no_wait_before_exit
)
{
mainGame
->
actionSignal
.
Wait
(
2000
);
}
mainGame
->
device
->
closeDevice
();
mainGame
->
device
->
closeDevice
();
}
}
}
else
if
(
connect_state
==
0x7
)
{
}
else
if
(
connect_state
==
0x7
)
{
...
@@ -213,7 +215,9 @@ void DuelClient::ClientEvent(bufferevent *bev, short events, void *ctx) {
...
@@ -213,7 +215,9 @@ void DuelClient::ClientEvent(bufferevent *bev, short events, void *ctx) {
else
mainGame
->
env
->
addMessageBox
(
L""
,
dataManager
.
GetSysString
(
1402
));
else
mainGame
->
env
->
addMessageBox
(
L""
,
dataManager
.
GetSysString
(
1402
));
mainGame
->
gMutex
.
unlock
();
mainGame
->
gMutex
.
unlock
();
if
(
auto_watch_mode
)
{
if
(
auto_watch_mode
)
{
mainGame->actionSignal.Wait(2000);
if
(
!
no_wait_before_exit
)
{
mainGame
->
actionSignal
.
Wait
(
2000
);
}
mainGame
->
device
->
closeDevice
();
mainGame
->
device
->
closeDevice
();
}
}
}
else
{
}
else
{
...
@@ -228,7 +232,9 @@ void DuelClient::ClientEvent(bufferevent *bev, short events, void *ctx) {
...
@@ -228,7 +232,9 @@ void DuelClient::ClientEvent(bufferevent *bev, short events, void *ctx) {
mainGame
->
stTip
->
setVisible
(
false
);
mainGame
->
stTip
->
setVisible
(
false
);
mainGame
->
gMutex
.
unlock
();
mainGame
->
gMutex
.
unlock
();
if
(
auto_watch_mode
)
{
if
(
auto_watch_mode
)
{
mainGame->actionSignal.Wait(2000);
if
(
!
no_wait_before_exit
)
{
mainGame
->
actionSignal
.
Wait
(
2000
);
}
mainGame
->
device
->
closeDevice
();
mainGame
->
device
->
closeDevice
();
}
}
mainGame
->
closeDoneSignal
.
Reset
();
mainGame
->
closeDoneSignal
.
Reset
();
...
@@ -292,7 +298,9 @@ void DuelClient::HandleSTOCPacketLan(char* data, unsigned int len) {
...
@@ -292,7 +298,9 @@ void DuelClient::HandleSTOCPacketLan(char* data, unsigned int len) {
mainGame
->
env
->
addMessageBox
(
L""
,
dataManager
.
GetSysString
(
1405
));
mainGame
->
env
->
addMessageBox
(
L""
,
dataManager
.
GetSysString
(
1405
));
mainGame
->
gMutex
.
unlock
();
mainGame
->
gMutex
.
unlock
();
if
(
auto_watch_mode
)
{
if
(
auto_watch_mode
)
{
mainGame->actionSignal.Wait(2000);
if
(
!
no_wait_before_exit
)
{
mainGame
->
actionSignal
.
Wait
(
2000
);
}
mainGame
->
device
->
closeDevice
();
mainGame
->
device
->
closeDevice
();
}
}
event_base_loopbreak
(
client_base
);
event_base_loopbreak
(
client_base
);
...
@@ -752,7 +760,9 @@ void DuelClient::HandleSTOCPacketLan(char* data, unsigned int len) {
...
@@ -752,7 +760,9 @@ void DuelClient::HandleSTOCPacketLan(char* data, unsigned int len) {
mainGame
->
PopupElement
(
mainGame
->
wMessage
);
mainGame
->
PopupElement
(
mainGame
->
wMessage
);
mainGame
->
gMutex
.
unlock
();
mainGame
->
gMutex
.
unlock
();
if
(
auto_watch_mode
)
{
if
(
auto_watch_mode
)
{
mainGame->actionSignal.Wait(2000);
if
(
!
no_wait_before_exit
)
{
mainGame
->
actionSignal
.
Wait
(
2000
);
}
mainGame
->
device
->
closeDevice
();
mainGame
->
device
->
closeDevice
();
}
}
else
{
else
{
...
...
gframe/gframe.cpp
View file @
8cf9df4c
...
@@ -11,6 +11,7 @@ int enable_log = 0;
...
@@ -11,6 +11,7 @@ int enable_log = 0;
bool
exit_on_return
=
false
;
bool
exit_on_return
=
false
;
bool
auto_watch_mode
=
false
;
bool
auto_watch_mode
=
false
;
bool
raw_video_mode
=
false
;
bool
raw_video_mode
=
false
;
bool
no_wait_before_exit
=
false
;
bool
open_file
=
false
;
bool
open_file
=
false
;
wchar_t
open_file_name
[
256
]
=
L""
;
wchar_t
open_file_name
[
256
]
=
L""
;
bool
bot_mode
=
false
;
bool
bot_mode
=
false
;
...
@@ -115,7 +116,12 @@ int main(int argc, char* argv[]) {
...
@@ -115,7 +116,12 @@ int main(int argc, char* argv[]) {
auto_watch_mode
=
true
;
auto_watch_mode
=
true
;
}
else
if
(
!
wcscmp
(
wargv
[
i
],
L"--raw-video"
))
{
// Raw video mode
}
else
if
(
!
wcscmp
(
wargv
[
i
],
L"--raw-video"
))
{
// Raw video mode
raw_video_mode
=
true
;
raw_video_mode
=
true
;
}
else
if
(
!
wcscmp
(
wargv
[
i
],
L"-d"
))
{
// Deck
}
else
if
(
!
wcscmp
(
wargv
[
i
],
L"--auto-watch-no-wait"
))
{
// Auto watch mode, but don't wait 2 sec
auto_watch_mode
=
true
;
no_wait_before_exit
=
true
;
}
else
if
(
!
wcscmp
(
wargv
[
i
],
L"-d"
))
{
// Deck
++
i
;
++
i
;
if
(
i
+
1
<
wargc
)
{
// select deck
if
(
i
+
1
<
wargc
)
{
// select deck
ygo
::
mainGame
->
gameConf
.
lastcategory
[
0
]
=
0
;
ygo
::
mainGame
->
gameConf
.
lastcategory
[
0
]
=
0
;
...
@@ -130,17 +136,23 @@ int main(int argc, char* argv[]) {
...
@@ -130,17 +136,23 @@ int main(int argc, char* argv[]) {
ClickButton
(
ygo
::
mainGame
->
btnDeckEdit
);
ClickButton
(
ygo
::
mainGame
->
btnDeckEdit
);
break
;
break
;
}
}
}
else
if
(
!
wcscmp
(
wargv
[
i
],
L"-c"
))
{
// Create host
}
else
if
(
!
wcscmp
(
wargv
[
i
],
L"-c"
))
{
// Create host
exit_on_return
=
!
keep_on_return
;
exit_on_return
=
!
keep_on_return
;
ygo
::
mainGame
->
HideElement
(
ygo
::
mainGame
->
wMainMenu
);
ygo
::
mainGame
->
HideElement
(
ygo
::
mainGame
->
wMainMenu
);
ClickButton
(
ygo
::
mainGame
->
btnHostConfirm
);
ClickButton
(
ygo
::
mainGame
->
btnHostConfirm
);
break
;
break
;
}
else
if
(
!
wcscmp
(
wargv
[
i
],
L"-j"
))
{
// Join host
}
else
if
(
!
wcscmp
(
wargv
[
i
],
L"-j"
))
{
// Join host
exit_on_return
=
!
keep_on_return
;
exit_on_return
=
!
keep_on_return
;
ygo
::
mainGame
->
HideElement
(
ygo
::
mainGame
->
wMainMenu
);
ygo
::
mainGame
->
HideElement
(
ygo
::
mainGame
->
wMainMenu
);
ClickButton
(
ygo
::
mainGame
->
btnJoinHost
);
ClickButton
(
ygo
::
mainGame
->
btnJoinHost
);
break
;
break
;
}
else
if
(
!
wcscmp
(
wargv
[
i
],
L"-r"
))
{
// Replay
}
else
if
(
!
wcscmp
(
wargv
[
i
],
L"-r"
))
{
// Replay
exit_on_return
=
!
keep_on_return
;
exit_on_return
=
!
keep_on_return
;
++
i
;
++
i
;
if
(
i
<
wargc
)
{
if
(
i
<
wargc
)
{
...
@@ -151,7 +163,9 @@ int main(int argc, char* argv[]) {
...
@@ -151,7 +163,9 @@ int main(int argc, char* argv[]) {
if
(
open_file
)
if
(
open_file
)
ClickButton
(
ygo
::
mainGame
->
btnLoadReplay
);
ClickButton
(
ygo
::
mainGame
->
btnLoadReplay
);
break
;
break
;
}
else
if
(
!
wcscmp
(
wargv
[
i
],
L"-s"
))
{
// Single
}
else
if
(
!
wcscmp
(
wargv
[
i
],
L"-s"
))
{
// Single
exit_on_return
=
!
keep_on_return
;
exit_on_return
=
!
keep_on_return
;
++
i
;
++
i
;
if
(
i
<
wargc
)
{
if
(
i
<
wargc
)
{
...
@@ -162,7 +176,9 @@ int main(int argc, char* argv[]) {
...
@@ -162,7 +176,9 @@ int main(int argc, char* argv[]) {
if
(
open_file
)
if
(
open_file
)
ClickButton
(
ygo
::
mainGame
->
btnLoadSinglePlay
);
ClickButton
(
ygo
::
mainGame
->
btnLoadSinglePlay
);
break
;
break
;
}
else
if
(
wargc
==
2
&&
wcslen
(
wargv
[
1
])
>=
4
)
{
}
else
if
(
wargc
==
2
&&
wcslen
(
wargv
[
1
])
>=
4
)
{
wchar_t
*
pstrext
=
wargv
[
1
]
+
wcslen
(
wargv
[
1
])
-
4
;
wchar_t
*
pstrext
=
wargv
[
1
]
+
wcslen
(
wargv
[
1
])
-
4
;
if
(
!
mywcsncasecmp
(
pstrext
,
L".ydk"
,
4
))
{
if
(
!
mywcsncasecmp
(
pstrext
,
L".ydk"
,
4
))
{
open_file
=
true
;
open_file
=
true
;
...
...
gframe/menu_handler.cpp
View file @
8cf9df4c
...
@@ -89,7 +89,9 @@ bool MenuHandler::OnEvent(const irr::SEvent& event) {
...
@@ -89,7 +89,9 @@ bool MenuHandler::OnEvent(const irr::SEvent& event) {
mainGame
->
env
->
addMessageBox
(
L""
,
dataManager
.
GetSysString
(
1412
));
mainGame
->
env
->
addMessageBox
(
L""
,
dataManager
.
GetSysString
(
1412
));
mainGame
->
gMutex
.
unlock
();
mainGame
->
gMutex
.
unlock
();
if
(
auto_watch_mode
)
{
if
(
auto_watch_mode
)
{
mainGame
->
actionSignal
.
Wait
(
2000
);
if
(
!
no_wait_before_exit
)
{
mainGame
->
actionSignal
.
Wait
(
2000
);
}
mainGame
->
device
->
closeDevice
();
mainGame
->
device
->
closeDevice
();
}
}
break
;
break
;
...
...
gframe/replay_mode.cpp
View file @
8cf9df4c
...
@@ -238,7 +238,9 @@ void ReplayMode::EndDuel() {
...
@@ -238,7 +238,9 @@ void ReplayMode::EndDuel() {
mainGame
->
PopupElement
(
mainGame
->
wMessage
);
mainGame
->
PopupElement
(
mainGame
->
wMessage
);
mainGame
->
gMutex
.
unlock
();
mainGame
->
gMutex
.
unlock
();
if
(
auto_watch_mode
)
{
if
(
auto_watch_mode
)
{
mainGame
->
actionSignal
.
Wait
(
2000
);
if
(
!
no_wait_before_exit
)
{
mainGame
->
actionSignal
.
Wait
(
2000
);
}
mainGame
->
device
->
closeDevice
();
mainGame
->
device
->
closeDevice
();
}
}
else
{
else
{
...
@@ -315,6 +317,10 @@ bool ReplayMode::ReplayAnalyze(char* msg, unsigned int len) {
...
@@ -315,6 +317,10 @@ bool ReplayMode::ReplayAnalyze(char* msg, unsigned int len) {
break
;
break
;
}
}
case
MSG_RETRY
:
{
case
MSG_RETRY
:
{
if
(
auto_watch_mode
&&
raw_video_mode
)
{
mainGame
->
device
->
closeDevice
();
return
false
;
}
if
(
mainGame
->
dInfo
.
isReplaySkiping
)
{
if
(
mainGame
->
dInfo
.
isReplaySkiping
)
{
mainGame
->
dInfo
.
isReplaySkiping
=
false
;
mainGame
->
dInfo
.
isReplaySkiping
=
false
;
mainGame
->
dField
.
RefreshAllCards
();
mainGame
->
dField
.
RefreshAllCards
();
...
@@ -326,7 +332,9 @@ bool ReplayMode::ReplayAnalyze(char* msg, unsigned int len) {
...
@@ -326,7 +332,9 @@ bool ReplayMode::ReplayAnalyze(char* msg, unsigned int len) {
mainGame
->
gMutex
.
unlock
();
mainGame
->
gMutex
.
unlock
();
mainGame
->
actionSignal
.
Reset
();
mainGame
->
actionSignal
.
Reset
();
if
(
auto_watch_mode
){
if
(
auto_watch_mode
){
mainGame
->
actionSignal
.
Wait
(
2000
);
if
(
!
no_wait_before_exit
)
{
mainGame
->
actionSignal
.
Wait
(
2000
);
}
mainGame
->
device
->
closeDevice
();
mainGame
->
device
->
closeDevice
();
}
}
else
{
else
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment