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
3b71ec00
Commit
3b71ec00
authored
Dec 17, 2015
by
mercury233
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
change room host when host leave
parent
30f9062a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
3 deletions
+16
-3
gframe/single_duel.cpp
gframe/single_duel.cpp
+16
-3
No files found.
gframe/single_duel.cpp
View file @
3b71ec00
...
...
@@ -179,9 +179,22 @@ void SingleDuel::JoinGame(DuelPlayer* dp, void* pdata, bool is_creater) {
}
void
SingleDuel
::
LeaveGame
(
DuelPlayer
*
dp
)
{
if
(
dp
==
host_player
)
{
EndDuel
();
NetServer
::
StopServer
();
}
else
if
(
dp
->
type
==
NETPLAYER_TYPE_OBSERVER
)
{
int
host_pos
;
if
(
players
[
0
]
&&
dp
->
type
!=
0
)
{
host_pos
=
0
;
host_player
=
players
[
0
];
}
else
if
(
players
[
1
]
&&
dp
->
type
!=
1
)
{
host_pos
=
1
;
host_player
=
players
[
1
];
}
else
{
EndDuel
();
NetServer
::
StopServer
();
}
STOC_TypeChange
sctc
;
sctc
.
type
=
0x10
|
host_pos
;
NetServer
::
SendPacketToPlayer
(
players
[
host_pos
],
STOC_TYPE_CHANGE
,
sctc
);
}
if
(
dp
->
type
==
NETPLAYER_TYPE_OBSERVER
)
{
observers
.
erase
(
dp
);
if
(
!
pduel
)
{
STOC_HS_WatchChange
scwc
;
...
...
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