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
29d8350a
Commit
29d8350a
authored
Jan 05, 2016
by
mercury233
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix player leave when finger-guessing
parent
314d9d3a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
5 deletions
+9
-5
gframe/single_duel.cpp
gframe/single_duel.cpp
+5
-3
gframe/tag_duel.cpp
gframe/tag_duel.cpp
+4
-2
No files found.
gframe/single_duel.cpp
View file @
29d8350a
...
...
@@ -20,6 +20,7 @@ extern unsigned short time_limit;
extern
unsigned
char
start_hand
;
extern
unsigned
char
draw_count
;
bool
runasserver
=
true
;
bool
started_hand
=
false
;
SingleDuel
::
SingleDuel
(
bool
is_match
)
{
match_mode
=
is_match
;
...
...
@@ -196,7 +197,7 @@ void SingleDuel::LeaveGame(DuelPlayer* dp) {
}
if
(
dp
->
type
==
NETPLAYER_TYPE_OBSERVER
)
{
observers
.
erase
(
dp
);
if
(
!
pduel
)
{
if
(
!
started_hand
)
{
STOC_HS_WatchChange
scwc
;
scwc
.
watch_count
=
observers
.
size
();
if
(
players
[
0
])
...
...
@@ -208,7 +209,7 @@ void SingleDuel::LeaveGame(DuelPlayer* dp) {
}
NetServer
::
DisconnectPlayer
(
dp
);
}
else
{
if
(
!
pduel
&&
duel_count
==
0
)
{
if
(
!
started_hand
&&
duel_count
==
0
)
{
STOC_HS_PlayerChange
scpc
;
players
[
dp
->
type
]
=
0
;
ready
[
dp
->
type
]
=
false
;
...
...
@@ -221,7 +222,7 @@ void SingleDuel::LeaveGame(DuelPlayer* dp) {
NetServer
::
SendPacketToPlayer
(
*
pit
,
STOC_HS_PLAYER_CHANGE
,
scpc
);
NetServer
::
DisconnectPlayer
(
dp
);
}
else
{
if
(
!
pduel
)
{
if
(
!
started_hand
)
{
if
(
!
ready
[
0
])
NetServer
::
SendPacketToPlayer
(
players
[
0
],
STOC_DUEL_START
);
if
(
!
ready
[
1
])
...
...
@@ -367,6 +368,7 @@ void SingleDuel::StartDuel(DuelPlayer* dp) {
(
*
oit
)
->
state
=
CTOS_LEAVE_GAME
;
NetServer
::
ReSendToPlayer
(
*
oit
);
}
started_hand
=
true
;
NetServer
::
SendPacketToPlayer
(
players
[
0
],
STOC_SELECT_HAND
);
NetServer
::
ReSendToPlayer
(
players
[
1
]);
hand_result
[
0
]
=
0
;
...
...
gframe/tag_duel.cpp
View file @
29d8350a
...
...
@@ -19,6 +19,7 @@ extern unsigned int start_lp;
extern
unsigned
short
time_limit
;
extern
unsigned
char
start_hand
;
extern
unsigned
char
draw_count
;
bool
started_hand_tag
=
false
;
TagDuel
::
TagDuel
()
{
for
(
int
i
=
0
;
i
<
4
;
++
i
)
{
...
...
@@ -174,7 +175,7 @@ void TagDuel::LeaveGame(DuelPlayer* dp) {
}
if
(
dp
->
type
==
NETPLAYER_TYPE_OBSERVER
)
{
observers
.
erase
(
dp
);
if
(
!
pduel
)
{
if
(
!
started_hand_tag
)
{
STOC_HS_WatchChange
scwc
;
scwc
.
watch_count
=
observers
.
size
();
for
(
int
i
=
0
;
i
<
4
;
++
i
)
...
...
@@ -185,7 +186,7 @@ void TagDuel::LeaveGame(DuelPlayer* dp) {
}
NetServer
::
DisconnectPlayer
(
dp
);
}
else
{
if
(
!
pduel
)
{
if
(
!
started_hand_tag
)
{
STOC_HS_PlayerChange
scpc
;
players
[
dp
->
type
]
=
0
;
ready
[
dp
->
type
]
=
false
;
...
...
@@ -325,6 +326,7 @@ void TagDuel::StartDuel(DuelPlayer* dp) {
(
*
oit
)
->
state
=
CTOS_LEAVE_GAME
;
NetServer
::
ReSendToPlayer
(
*
oit
);
}
started_hand_tag
=
true
;
NetServer
::
SendPacketToPlayer
(
players
[
0
],
STOC_SELECT_HAND
);
NetServer
::
ReSendToPlayer
(
players
[
2
]);
hand_result
[
0
]
=
0
;
...
...
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