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
nanahira
ygopro
Commits
055b523f
Commit
055b523f
authored
May 15, 2019
by
nanahira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
really retrying one when MSG_RETRY
parent
7476a432
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
32 additions
and
4 deletions
+32
-4
gframe/duelclient.cpp
gframe/duelclient.cpp
+27
-3
gframe/duelclient.h
gframe/duelclient.h
+4
-1
strings.conf
strings.conf
+1
-0
No files found.
gframe/duelclient.cpp
View file @
055b523f
...
...
@@ -25,6 +25,9 @@ char DuelClient::duel_client_write[0x2000];
bool
DuelClient
::
is_closing
=
false
;
int
DuelClient
::
select_hint
=
0
;
int
DuelClient
::
select_unselect_hint
=
0
;
int
DuelClient
::
last_select_hint
=
0
;
char
DuelClient
::
last_successful_msg
[
2048
];
unsigned
int
DuelClient
::
last_successful_msg_length
=
0
;
wchar_t
DuelClient
::
event_string
[
256
];
mtrandom
DuelClient
::
rnd
;
...
...
@@ -955,10 +958,14 @@ void DuelClient::HandleSTOCPacketLan(char* data, unsigned int len) {
}
}
}
int
DuelClient
::
ClientAnalyze
(
char
*
msg
,
unsigned
int
len
)
{
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
)
{
memcpy
(
last_successful_msg
,
msg
,
len
);
last_successful_msg_length
=
len
;
}
mainGame
->
wCmdMenu
->
setVisible
(
false
);
if
(
!
mainGame
->
dInfo
.
isReplay
&&
mainGame
->
dInfo
.
curMsg
!=
MSG_WAITING
&&
mainGame
->
dInfo
.
curMsg
!=
MSG_CARD_SELECTED
)
{
mainGame
->
waitFrame
=
-
1
;
...
...
@@ -980,6 +987,17 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
mainGame
->
dInfo
.
time_player
=
2
;
switch
(
mainGame
->
dInfo
.
curMsg
)
{
case
MSG_RETRY
:
{
if
(
!
retry
&&
last_successful_msg_length
)
{
mainGame
->
gMutex
.
Lock
();
mainGame
->
stMessage
->
setText
(
dataManager
.
GetDesc
(
1422
));
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
;
}
mainGame
->
gMutex
.
Lock
();
mainGame
->
stMessage
->
setText
(
L"Error occurs."
);
mainGame
->
PopupElement
(
mainGame
->
wMessage
);
...
...
@@ -1031,6 +1049,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
}
case
HINT_SELECTMSG
:
{
select_hint
=
data
;
last_select_hint
=
data
;
break
;
}
case
HINT_OPSELECTED
:
{
...
...
@@ -1218,8 +1237,13 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
mainGame
->
dField
.
Initial
(
mainGame
->
LocalPlayer
(
1
),
deckc
,
extrac
);
mainGame
->
dInfo
.
turn
=
0
;
mainGame
->
dInfo
.
is_shuffling
=
false
;
mainGame
->
dInfo
.
is_swapped
=
false
;
if
(
mainGame
->
dInfo
.
isReplaySwapped
)
{
mainGame
->
dInfo
.
is_swapped
=
false
;
select_hint
=
0
;
select_unselect_hint
=
0
;
last_select_hint
=
0
;
last_successful_msg_length
=
0
;
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/duelclient.h
View file @
055b523f
...
...
@@ -31,6 +31,9 @@ private:
static
bool
is_closing
;
static
int
select_hint
;
static
int
select_unselect_hint
;
static
int
last_select_hint
;
static
char
last_successful_msg
[
2048
];
static
unsigned
int
last_successful_msg_length
;
static
wchar_t
event_string
[
256
];
static
mtrandom
rnd
;
public:
...
...
@@ -46,7 +49,7 @@ public:
static
void
ClientEvent
(
bufferevent
*
bev
,
short
events
,
void
*
ctx
);
static
int
ClientThread
(
void
*
param
);
static
void
HandleSTOCPacketLan
(
char
*
data
,
unsigned
int
len
);
static
int
ClientAnalyze
(
char
*
msg
,
unsigned
int
len
);
static
int
ClientAnalyze
(
char
*
msg
,
unsigned
int
len
,
bool
retry
=
false
);
static
void
SetResponseI
(
int
respI
);
static
void
SetResponseB
(
void
*
respB
,
unsigned
char
len
);
static
void
SendResponse
();
...
...
strings.conf
View file @
055b523f
...
...
@@ -448,6 +448,7 @@
!
system
1419
副卡组数量应不超过
15
张,当前卡组数量为%
d
张。
!
system
1420
有额外卡组卡片存在于主卡组,可能是额外卡组数量超过
15
张。
!
system
1421
宣言的卡不符合条件,或无法被主机识别。
!
system
1422
操作无效,请重试。
!
system
1450
卡包展示
!
system
1451
人机卡组
!
system
1452
未分类卡组
...
...
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