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
MobiusMei
ygopro
Commits
4e324d60
Commit
4e324d60
authored
Jul 24, 2016
by
mercury233
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix player quit when finger-guessing
parent
c4222113
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
11 additions
and
5 deletions
+11
-5
gframe/single_duel.cpp
gframe/single_duel.cpp
+5
-3
gframe/single_duel.h
gframe/single_duel.h
+1
-0
gframe/tag_duel.cpp
gframe/tag_duel.cpp
+4
-2
gframe/tag_duel.h
gframe/tag_duel.h
+1
-0
No files found.
gframe/single_duel.cpp
View file @
4e324d60
...
...
@@ -10,6 +10,7 @@
namespace
ygo
{
SingleDuel
::
SingleDuel
(
bool
is_match
)
{
game_started
=
false
;
match_mode
=
is_match
;
match_kill
=
0
;
for
(
int
i
=
0
;
i
<
2
;
++
i
)
{
...
...
@@ -145,7 +146,7 @@ void SingleDuel::LeaveGame(DuelPlayer* dp) {
NetServer
::
StopServer
();
}
else
if
(
dp
->
type
==
NETPLAYER_TYPE_OBSERVER
)
{
observers
.
erase
(
dp
);
if
(
!
pduel
)
{
if
(
!
game_started
)
{
STOC_HS_WatchChange
scwc
;
scwc
.
watch_count
=
observers
.
size
();
if
(
players
[
0
])
...
...
@@ -157,7 +158,7 @@ void SingleDuel::LeaveGame(DuelPlayer* dp) {
}
NetServer
::
DisconnectPlayer
(
dp
);
}
else
{
if
(
!
pduel
&&
duel_count
==
0
)
{
if
(
!
game_started
&&
duel_count
==
0
)
{
STOC_HS_PlayerChange
scpc
;
players
[
dp
->
type
]
=
0
;
ready
[
dp
->
type
]
=
false
;
...
...
@@ -170,7 +171,7 @@ void SingleDuel::LeaveGame(DuelPlayer* dp) {
NetServer
::
SendPacketToPlayer
(
*
pit
,
STOC_HS_PLAYER_CHANGE
,
scpc
);
NetServer
::
DisconnectPlayer
(
dp
);
}
else
{
if
(
!
pduel
)
{
if
(
!
game_started
)
{
if
(
!
ready
[
0
])
NetServer
::
SendPacketToPlayer
(
players
[
0
],
STOC_DUEL_START
);
if
(
!
ready
[
1
])
...
...
@@ -310,6 +311,7 @@ void SingleDuel::StartDuel(DuelPlayer* dp) {
return
;
NetServer
::
StopListen
();
//NetServer::StopBroadcast();
game_started
=
true
;
NetServer
::
SendPacketToPlayer
(
players
[
0
],
STOC_DUEL_START
);
NetServer
::
ReSendToPlayer
(
players
[
1
]);
for
(
auto
oit
=
observers
.
begin
();
oit
!=
observers
.
end
();
++
oit
)
{
...
...
gframe/single_duel.h
View file @
4e324d60
...
...
@@ -52,6 +52,7 @@ protected:
Replay
last_replay
;
bool
match_mode
;
int
match_kill
;
bool
game_started
;
unsigned
char
duel_count
;
unsigned
char
tp_player
;
unsigned
char
match_result
[
3
];
...
...
gframe/tag_duel.cpp
View file @
4e324d60
...
...
@@ -10,6 +10,7 @@
namespace
ygo
{
TagDuel
::
TagDuel
()
{
game_started
=
false
;
for
(
int
i
=
0
;
i
<
4
;
++
i
)
{
players
[
i
]
=
0
;
ready
[
i
]
=
false
;
...
...
@@ -119,7 +120,7 @@ void TagDuel::LeaveGame(DuelPlayer* dp) {
NetServer
::
StopServer
();
}
else
if
(
dp
->
type
==
NETPLAYER_TYPE_OBSERVER
)
{
observers
.
erase
(
dp
);
if
(
!
pduel
)
{
if
(
!
game_started
)
{
STOC_HS_WatchChange
scwc
;
scwc
.
watch_count
=
observers
.
size
();
for
(
int
i
=
0
;
i
<
4
;
++
i
)
...
...
@@ -130,7 +131,7 @@ void TagDuel::LeaveGame(DuelPlayer* dp) {
}
NetServer
::
DisconnectPlayer
(
dp
);
}
else
{
if
(
!
pduel
)
{
if
(
!
game_started
)
{
STOC_HS_PlayerChange
scpc
;
players
[
dp
->
type
]
=
0
;
ready
[
dp
->
type
]
=
false
;
...
...
@@ -263,6 +264,7 @@ void TagDuel::StartDuel(DuelPlayer* dp) {
if
(
!
ready
[
0
]
||
!
ready
[
1
]
||
!
ready
[
2
]
||
!
ready
[
3
])
return
;
NetServer
::
StopListen
();
game_started
=
true
;
//NetServer::StopBroadcast();
for
(
int
i
=
0
;
i
<
4
;
++
i
)
NetServer
::
SendPacketToPlayer
(
players
[
i
],
STOC_DUEL_START
);
...
...
gframe/tag_duel.h
View file @
4e324d60
...
...
@@ -51,6 +51,7 @@ protected:
unsigned
char
hand_result
[
2
];
unsigned
char
last_response
;
Replay
last_replay
;
bool
game_started
;
unsigned
char
turn_count
;
unsigned
short
time_limit
[
2
];
unsigned
short
time_elapsed
;
...
...
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