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
ac65734a
Commit
ac65734a
authored
Jul 07, 2019
by
DailyShana
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix swapping field when observing
parent
16219d2f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
2 deletions
+14
-2
gframe/duelclient.cpp
gframe/duelclient.cpp
+10
-0
gframe/duelclient.h
gframe/duelclient.h
+2
-0
gframe/event_handler.cpp
gframe/event_handler.cpp
+2
-2
No files found.
gframe/duelclient.cpp
View file @
ac65734a
...
...
@@ -23,6 +23,7 @@ bufferevent* DuelClient::client_bev = 0;
char
DuelClient
::
duel_client_read
[
0x2000
];
char
DuelClient
::
duel_client_write
[
0x2000
];
bool
DuelClient
::
is_closing
=
false
;
bool
DuelClient
::
is_swapping
=
false
;
int
DuelClient
::
select_hint
=
0
;
int
DuelClient
::
select_unselect_hint
=
0
;
int
DuelClient
::
last_select_hint
=
0
;
...
...
@@ -889,6 +890,12 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
}
if
(
mainGame
->
dInfo
.
time_player
==
1
)
mainGame
->
dInfo
.
time_player
=
2
;
if
(
is_swapping
)
{
mainGame
->
gMutex
.
Lock
();
mainGame
->
dField
.
ReplaySwap
();
mainGame
->
gMutex
.
Unlock
();
is_swapping
=
false
;
}
switch
(
mainGame
->
dInfo
.
curMsg
)
{
case
MSG_RETRY
:
{
if
(
last_successful_msg_length
)
{
...
...
@@ -3787,6 +3794,9 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
}
return
true
;
}
void
DuelClient
::
SwapField
()
{
is_swapping
=
true
;
}
void
DuelClient
::
SetResponseI
(
int
respI
)
{
*
((
int
*
)
response_buf
)
=
respI
;
response_len
=
4
;
...
...
gframe/duelclient.h
View file @
ac65734a
...
...
@@ -29,6 +29,7 @@ private:
static
char
duel_client_read
[
0x2000
];
static
char
duel_client_write
[
0x2000
];
static
bool
is_closing
;
static
bool
is_swapping
;
static
int
select_hint
;
static
int
select_unselect_hint
;
static
int
last_select_hint
;
...
...
@@ -45,6 +46,7 @@ public:
static
int
ClientThread
(
void
*
param
);
static
void
HandleSTOCPacketLan
(
char
*
data
,
unsigned
int
len
);
static
int
ClientAnalyze
(
char
*
msg
,
unsigned
int
len
);
static
void
SwapField
();
static
void
SetResponseI
(
int
respI
);
static
void
SetResponseB
(
void
*
respB
,
unsigned
char
len
);
static
void
SendResponse
();
...
...
gframe/event_handler.cpp
View file @
ac65734a
...
...
@@ -91,8 +91,8 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
soundManager
.
PlaySoundEffect
(
SOUND_BUTTON
);
if
(
mainGame
->
dInfo
.
isReplay
)
ReplayMode
::
SwapField
();
else
if
(
mainGame
->
dInfo
.
player_type
==
7
)
mainGame
->
dField
.
ReplaySwap
();
else
if
(
mainGame
->
dInfo
.
player_type
==
7
)
DuelClient
::
SwapField
();
break
;
}
case
BUTTON_REPLAY_UNDO
:
{
...
...
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