Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Y
ygopro-2pick
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
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
MyCard
ygopro-2pick
Commits
714d2bd0
Commit
714d2bd0
authored
Jun 25, 2019
by
nanahira
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' into server
parents
68bf8b63
0b075f6a
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
46 additions
and
37 deletions
+46
-37
gframe/duelclient.cpp
gframe/duelclient.cpp
+39
-28
gframe/single_mode.cpp
gframe/single_mode.cpp
+5
-7
ocgcore
ocgcore
+1
-1
script
script
+1
-1
No files found.
gframe/duelclient.cpp
View file @
714d2bd0
...
...
@@ -962,7 +962,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len, bool retry) {
char
*
pbuf
=
msg
;
wchar_t
textBuffer
[
256
];
mainGame
->
dInfo
.
curMsg
=
BufferIO
::
ReadUInt8
(
pbuf
);
if
(
mainGame
->
dInfo
.
curMsg
!=
MSG_RETRY
&&
!
retry
)
{
if
(
mainGame
->
dInfo
.
curMsg
!=
MSG_RETRY
)
{
memcpy
(
last_successful_msg
,
msg
,
len
);
last_successful_msg_length
=
len
;
}
...
...
@@ -987,16 +987,26 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len, bool retry) {
mainGame
->
dInfo
.
time_player
=
2
;
switch
(
mainGame
->
dInfo
.
curMsg
)
{
case
MSG_RETRY
:
{
if
(
!
retry
&&
last_successful_msg_length
)
{
if
(
last_successful_msg_length
)
{
char
*
p
=
last_successful_msg
;
auto
last_msg
=
BufferIO
::
ReadUInt8
(
p
);
int
err_desc
=
1422
;
switch
(
last_msg
)
{
case
MSG_ANNOUNCE_CARD
:
case
MSG_ANNOUNCE_CARD_FILTER
:
err_desc
=
1421
;
//TODO: other cases
default:
break
;
}
mainGame
->
gMutex
.
Lock
();
mainGame
->
stMessage
->
setText
(
dataManager
.
GetDesc
(
1422
));
mainGame
->
stMessage
->
setText
(
dataManager
.
GetDesc
(
err_desc
));
mainGame
->
PopupElement
(
mainGame
->
wMessage
);
mainGame
->
gMutex
.
Unlock
();
mainGame
->
actionSignal
.
Reset
();
mainGame
->
actionSignal
.
Wait
();
select_hint
=
last_select_hint
;
ClientAnalyze
(
last_successful_msg
,
last_successful_msg_length
,
true
);
break
;
return
ClientAnalyze
(
last_successful_msg
,
last_successful_msg_length
);
}
mainGame
->
gMutex
.
Lock
();
mainGame
->
stMessage
->
setText
(
L"Error occurs."
);
...
...
@@ -1004,27 +1014,29 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len, bool retry) {
mainGame
->
gMutex
.
Unlock
();
mainGame
->
actionSignal
.
Reset
();
mainGame
->
actionSignal
.
Wait
();
mainGame
->
closeDoneSignal
.
Reset
();
mainGame
->
closeSignal
.
Set
();
mainGame
->
closeDoneSignal
.
Wait
();
mainGame
->
gMutex
.
Lock
();
mainGame
->
dInfo
.
isStarted
=
false
;
mainGame
->
dInfo
.
isFinished
=
false
;
mainGame
->
btnCreateHost
->
setEnabled
(
true
);
mainGame
->
btnJoinHost
->
setEnabled
(
true
);
mainGame
->
btnJoinCancel
->
setEnabled
(
true
);
mainGame
->
btnStartBot
->
setEnabled
(
true
);
mainGame
->
btnBotCancel
->
setEnabled
(
true
);
mainGame
->
stTip
->
setVisible
(
false
);
mainGame
->
device
->
setEventReceiver
(
&
mainGame
->
menuHandler
);
if
(
bot_mode
)
mainGame
->
ShowElement
(
mainGame
->
wSinglePlay
);
else
mainGame
->
ShowElement
(
mainGame
->
wLanWindow
);
mainGame
->
gMutex
.
Unlock
();
event_base_loopbreak
(
client_base
);
if
(
exit_on_return
)
mainGame
->
device
->
closeDevice
();
if
(
!
mainGame
->
dInfo
.
isSingleMode
)
{
mainGame
->
closeDoneSignal
.
Reset
();
mainGame
->
closeSignal
.
Set
();
mainGame
->
closeDoneSignal
.
Wait
();
mainGame
->
gMutex
.
Lock
();
mainGame
->
dInfo
.
isStarted
=
false
;
mainGame
->
dInfo
.
isFinished
=
false
;
mainGame
->
btnCreateHost
->
setEnabled
(
true
);
mainGame
->
btnJoinHost
->
setEnabled
(
true
);
mainGame
->
btnJoinCancel
->
setEnabled
(
true
);
mainGame
->
btnStartBot
->
setEnabled
(
true
);
mainGame
->
btnBotCancel
->
setEnabled
(
true
);
mainGame
->
stTip
->
setVisible
(
false
);
mainGame
->
device
->
setEventReceiver
(
&
mainGame
->
menuHandler
);
if
(
bot_mode
)
mainGame
->
ShowElement
(
mainGame
->
wSinglePlay
);
else
mainGame
->
ShowElement
(
mainGame
->
wLanWindow
);
mainGame
->
gMutex
.
Unlock
();
event_base_loopbreak
(
client_base
);
if
(
exit_on_return
)
mainGame
->
device
->
closeDevice
();
}
return
false
;
}
case
MSG_HINT
:
{
...
...
@@ -1242,8 +1254,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len, bool retry) {
select_unselect_hint
=
0
;
last_select_hint
=
0
;
last_successful_msg_length
=
0
;
if
(
mainGame
->
dInfo
.
isReplaySwapped
)
{
if
(
mainGame
->
dInfo
.
isReplaySwapped
)
{
std
::
swap
(
mainGame
->
dInfo
.
hostname
,
mainGame
->
dInfo
.
clientname
);
std
::
swap
(
mainGame
->
dInfo
.
hostname_tag
,
mainGame
->
dInfo
.
clientname_tag
);
mainGame
->
dInfo
.
isReplaySwapped
=
false
;
...
...
gframe/single_mode.cpp
View file @
714d2bd0
...
...
@@ -181,13 +181,11 @@ bool SingleMode::SinglePlayAnalyze(char* msg, unsigned int len) {
mainGame
->
dInfo
.
curMsg
=
BufferIO
::
ReadUInt8
(
pbuf
);
switch
(
mainGame
->
dInfo
.
curMsg
)
{
case
MSG_RETRY
:
{
mainGame
->
gMutex
.
Lock
();
mainGame
->
stMessage
->
setText
(
L"Error occurs."
);
mainGame
->
PopupElement
(
mainGame
->
wMessage
);
mainGame
->
gMutex
.
Unlock
();
mainGame
->
actionSignal
.
Reset
();
mainGame
->
actionSignal
.
Wait
();
return
false
;
if
(
!
DuelClient
::
ClientAnalyze
(
offset
,
pbuf
-
offset
))
{
mainGame
->
singleSignal
.
Reset
();
mainGame
->
singleSignal
.
Wait
();
}
break
;
}
case
MSG_HINT
:
{
/*int type = */
BufferIO
::
ReadInt8
(
pbuf
);
...
...
ocgcore
@
cfbe5a15
Subproject commit
9f7a67a34b0a345df2b98fd550765afb565c9107
Subproject commit
cfbe5a15215c7168d962f540ed63d02d5ab804e1
script
@
a5a534da
Subproject commit
4ee3551e3be02d6527a62b2d473b9c3740516963
Subproject commit
a5a534da7c7fed9fe8bc67e7f533be7eb2db5ded
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