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
YGOPRO-520DIY
ygopro
Commits
d642e791
Commit
d642e791
authored
May 15, 2020
by
mercury233
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update time limit handling
parent
5009c68e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
3 deletions
+9
-3
gframe/single_duel.cpp
gframe/single_duel.cpp
+9
-3
No files found.
gframe/single_duel.cpp
View file @
d642e791
...
@@ -490,6 +490,11 @@ void SingleDuel::TPResult(DuelPlayer* dp, unsigned char tp) {
...
@@ -490,6 +490,11 @@ void SingleDuel::TPResult(DuelPlayer* dp, unsigned char tp) {
RefreshExtra
(
0
);
RefreshExtra
(
0
);
RefreshExtra
(
1
);
RefreshExtra
(
1
);
start_duel
(
pduel
,
opt
);
start_duel
(
pduel
,
opt
);
if
(
host_info
.
time_limit
)
{
time_elapsed
=
0
;
timeval
timeout
=
{
1
,
0
};
event_add
(
etimer
,
&
timeout
);
}
Process
();
Process
();
}
}
void
SingleDuel
::
Process
()
{
void
SingleDuel
::
Process
()
{
...
@@ -1416,7 +1421,7 @@ void SingleDuel::GetResponse(DuelPlayer* dp, void* pdata, unsigned int len) {
...
@@ -1416,7 +1421,7 @@ void SingleDuel::GetResponse(DuelPlayer* dp, void* pdata, unsigned int len) {
if
(
time_limit
[
dp
->
type
]
>=
time_elapsed
)
if
(
time_limit
[
dp
->
type
]
>=
time_elapsed
)
time_limit
[
dp
->
type
]
-=
time_elapsed
;
time_limit
[
dp
->
type
]
-=
time_elapsed
;
else
time_limit
[
dp
->
type
]
=
0
;
else
time_limit
[
dp
->
type
]
=
0
;
event_del
(
etimer
)
;
time_elapsed
=
0
;
}
}
Process
();
Process
();
}
}
...
@@ -1456,8 +1461,6 @@ void SingleDuel::TimeConfirm(DuelPlayer* dp) {
...
@@ -1456,8 +1461,6 @@ void SingleDuel::TimeConfirm(DuelPlayer* dp) {
return
;
return
;
players
[
last_response
]
->
state
=
CTOS_RESPONSE
;
players
[
last_response
]
->
state
=
CTOS_RESPONSE
;
time_elapsed
=
0
;
time_elapsed
=
0
;
timeval
timeout
=
{
1
,
0
};
event_add
(
etimer
,
&
timeout
);
}
}
void
SingleDuel
::
RefreshMzone
(
int
player
,
int
flag
,
int
use_cache
)
{
void
SingleDuel
::
RefreshMzone
(
int
player
,
int
flag
,
int
use_cache
)
{
char
query_buffer
[
0x2000
];
char
query_buffer
[
0x2000
];
...
@@ -1597,7 +1600,10 @@ void SingleDuel::SingleTimer(evutil_socket_t fd, short events, void* arg) {
...
@@ -1597,7 +1600,10 @@ void SingleDuel::SingleTimer(evutil_socket_t fd, short events, void* arg) {
sd
->
EndDuel
();
sd
->
EndDuel
();
sd
->
DuelEndProc
();
sd
->
DuelEndProc
();
event_del
(
sd
->
etimer
);
event_del
(
sd
->
etimer
);
return
;
}
}
timeval
timeout
=
{
1
,
0
};
event_add
(
sd
->
etimer
,
&
timeout
);
}
}
}
}
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