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
REIKAI
ygopro
Commits
96e26ba2
Commit
96e26ba2
authored
May 15, 2019
by
nanahira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
really retrying one when MSG_RETRY
parent
4114ed92
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
29 additions
and
2 deletions
+29
-2
gframe/duelclient.cpp
gframe/duelclient.cpp
+24
-1
gframe/duelclient.h
gframe/duelclient.h
+4
-1
strings.conf
strings.conf
+1
-0
No files found.
gframe/duelclient.cpp
View file @
96e26ba2
...
@@ -25,6 +25,9 @@ char DuelClient::duel_client_write[0x2000];
...
@@ -25,6 +25,9 @@ char DuelClient::duel_client_write[0x2000];
bool
DuelClient
::
is_closing
=
false
;
bool
DuelClient
::
is_closing
=
false
;
int
DuelClient
::
select_hint
=
0
;
int
DuelClient
::
select_hint
=
0
;
int
DuelClient
::
select_unselect_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
];
wchar_t
DuelClient
::
event_string
[
256
];
mtrandom
DuelClient
::
rnd
;
mtrandom
DuelClient
::
rnd
;
...
@@ -859,10 +862,14 @@ void DuelClient::HandleSTOCPacketLan(char* data, unsigned int len) {
...
@@ -859,10 +862,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
;
char
*
pbuf
=
msg
;
wchar_t
textBuffer
[
256
];
wchar_t
textBuffer
[
256
];
mainGame
->
dInfo
.
curMsg
=
BufferIO
::
ReadUInt8
(
pbuf
);
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
);
mainGame
->
wCmdMenu
->
setVisible
(
false
);
if
(
!
mainGame
->
dInfo
.
isReplay
&&
mainGame
->
dInfo
.
curMsg
!=
MSG_WAITING
&&
mainGame
->
dInfo
.
curMsg
!=
MSG_CARD_SELECTED
)
{
if
(
!
mainGame
->
dInfo
.
isReplay
&&
mainGame
->
dInfo
.
curMsg
!=
MSG_WAITING
&&
mainGame
->
dInfo
.
curMsg
!=
MSG_CARD_SELECTED
)
{
mainGame
->
waitFrame
=
-
1
;
mainGame
->
waitFrame
=
-
1
;
...
@@ -884,6 +891,17 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
...
@@ -884,6 +891,17 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
mainGame
->
dInfo
.
time_player
=
2
;
mainGame
->
dInfo
.
time_player
=
2
;
switch
(
mainGame
->
dInfo
.
curMsg
)
{
switch
(
mainGame
->
dInfo
.
curMsg
)
{
case
MSG_RETRY
:
{
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
->
gMutex
.
Lock
();
mainGame
->
stMessage
->
setText
(
L"Error occurs."
);
mainGame
->
stMessage
->
setText
(
L"Error occurs."
);
mainGame
->
PopupElement
(
mainGame
->
wMessage
);
mainGame
->
PopupElement
(
mainGame
->
wMessage
);
...
@@ -935,6 +953,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
...
@@ -935,6 +953,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
}
}
case
HINT_SELECTMSG
:
{
case
HINT_SELECTMSG
:
{
select_hint
=
data
;
select_hint
=
data
;
last_select_hint
=
data
;
break
;
break
;
}
}
case
HINT_OPSELECTED
:
{
case
HINT_OPSELECTED
:
{
...
@@ -1078,6 +1097,10 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
...
@@ -1078,6 +1097,10 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
mainGame
->
dField
.
Initial
(
mainGame
->
LocalPlayer
(
1
),
deckc
,
extrac
);
mainGame
->
dField
.
Initial
(
mainGame
->
LocalPlayer
(
1
),
deckc
,
extrac
);
mainGame
->
dInfo
.
turn
=
0
;
mainGame
->
dInfo
.
turn
=
0
;
mainGame
->
dInfo
.
is_shuffling
=
false
;
mainGame
->
dInfo
.
is_shuffling
=
false
;
select_hint
=
0
;
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
,
mainGame
->
dInfo
.
clientname
);
std
::
swap
(
mainGame
->
dInfo
.
hostname_tag
,
mainGame
->
dInfo
.
clientname_tag
);
std
::
swap
(
mainGame
->
dInfo
.
hostname_tag
,
mainGame
->
dInfo
.
clientname_tag
);
...
...
gframe/duelclient.h
View file @
96e26ba2
...
@@ -31,6 +31,9 @@ private:
...
@@ -31,6 +31,9 @@ private:
static
bool
is_closing
;
static
bool
is_closing
;
static
int
select_hint
;
static
int
select_hint
;
static
int
select_unselect_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
wchar_t
event_string
[
256
];
static
mtrandom
rnd
;
static
mtrandom
rnd
;
public:
public:
...
@@ -41,7 +44,7 @@ public:
...
@@ -41,7 +44,7 @@ public:
static
void
ClientEvent
(
bufferevent
*
bev
,
short
events
,
void
*
ctx
);
static
void
ClientEvent
(
bufferevent
*
bev
,
short
events
,
void
*
ctx
);
static
int
ClientThread
(
void
*
param
);
static
int
ClientThread
(
void
*
param
);
static
void
HandleSTOCPacketLan
(
char
*
data
,
unsigned
int
len
);
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
SetResponseI
(
int
respI
);
static
void
SetResponseB
(
void
*
respB
,
unsigned
char
len
);
static
void
SetResponseB
(
void
*
respB
,
unsigned
char
len
);
static
void
SendResponse
();
static
void
SendResponse
();
...
...
strings.conf
View file @
96e26ba2
...
@@ -439,6 +439,7 @@
...
@@ -439,6 +439,7 @@
!
system
1419
副卡组数量应不超过
15
张,当前卡组数量为%
d
张。
!
system
1419
副卡组数量应不超过
15
张,当前卡组数量为%
d
张。
!
system
1420
有额外卡组卡片存在于主卡组,可能是额外卡组数量超过
15
张。
!
system
1420
有额外卡组卡片存在于主卡组,可能是额外卡组数量超过
15
张。
!
system
1421
宣言的卡不符合条件,或无法被主机识别。
!
system
1421
宣言的卡不符合条件,或无法被主机识别。
!
system
1422
操作无效,请重试。
!
system
1500
决斗结束。
!
system
1500
决斗结束。
!
system
1501
录像结束。
!
system
1501
录像结束。
!
system
1502
连接已断开。
!
system
1502
连接已断开。
...
...
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