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
161b5021
Commit
161b5021
authored
May 21, 2020
by
mercury233
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add time_compensator
parent
4541d3f0
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
26 additions
and
0 deletions
+26
-0
gframe/single_duel.cpp
gframe/single_duel.cpp
+10
-0
gframe/single_duel.h
gframe/single_duel.h
+3
-0
gframe/tag_duel.cpp
gframe/tag_duel.cpp
+10
-0
gframe/tag_duel.h
gframe/tag_duel.h
+3
-0
No files found.
gframe/single_duel.cpp
View file @
161b5021
...
...
@@ -628,6 +628,9 @@ void SingleDuel::TPResult(DuelPlayer* dp, unsigned char tp) {
start_duel
(
pduel
,
opt
);
if
(
host_info
.
time_limit
)
{
time_elapsed
=
0
;
#ifdef YGOPRO_SERVER_MODE
time_compensator
=
60
;
#endif
timeval
timeout
=
{
1
,
0
};
event_add
(
etimer
,
&
timeout
);
}
...
...
@@ -1876,8 +1879,15 @@ void SingleDuel::TimeConfirm(DuelPlayer* dp) {
if
(
dp
->
type
!=
last_response
)
return
;
players
[
last_response
]
->
state
=
CTOS_RESPONSE
;
#ifdef YGOPRO_SERVER_MODE
if
(
time_elapsed
<
10
&&
time_elapsed
<=
time_compensator
){
time_compensator
-=
time_elapsed
;
time_elapsed
=
0
;
}
#else
if
(
time_elapsed
<
10
)
time_elapsed
=
0
;
#endif //YGOPRO_SERVER_MODE
}
#ifdef YGOPRO_SERVER_MODE
void
SingleDuel
::
RefreshMzone
(
int
player
,
int
flag
,
int
use_cache
,
DuelPlayer
*
dp
)
...
...
gframe/single_duel.h
View file @
161b5021
...
...
@@ -76,6 +76,9 @@ protected:
unsigned
char
match_result
[
3
];
unsigned
short
time_limit
[
2
];
unsigned
short
time_elapsed
;
#ifdef YGOPRO_SERVER_MODE
unsigned
short
time_compensator
;
#endif
};
}
...
...
gframe/tag_duel.cpp
View file @
161b5021
...
...
@@ -633,6 +633,9 @@ void TagDuel::TPResult(DuelPlayer* dp, unsigned char tp) {
start_duel
(
pduel
,
opt
);
if
(
host_info
.
time_limit
)
{
time_elapsed
=
0
;
#ifdef YGOPRO_SERVER_MODE
time_compensator
=
60
;
#endif
timeval
timeout
=
{
1
,
0
};
event_add
(
etimer
,
&
timeout
);
}
...
...
@@ -1955,8 +1958,15 @@ void TagDuel::TimeConfirm(DuelPlayer* dp) {
if
(
dp
!=
cur_player
[
last_response
])
return
;
cur_player
[
last_response
]
->
state
=
CTOS_RESPONSE
;
#ifdef YGOPRO_SERVER_MODE
if
(
time_elapsed
<
10
&&
time_elapsed
<=
time_compensator
){
time_compensator
-=
time_elapsed
;
time_elapsed
=
0
;
}
#else
if
(
time_elapsed
<
10
)
time_elapsed
=
0
;
#endif //YGOPRO_SERVER_MODE
}
#ifdef YGOPRO_SERVER_MODE
void
TagDuel
::
RefreshMzone
(
int
player
,
int
flag
,
int
use_cache
,
DuelPlayer
*
dp
)
...
...
gframe/tag_duel.h
View file @
161b5021
...
...
@@ -73,6 +73,9 @@ protected:
unsigned
char
turn_count
;
unsigned
short
time_limit
[
2
];
unsigned
short
time_elapsed
;
#ifdef YGOPRO_SERVER_MODE
unsigned
short
time_compensator
;
#endif
};
}
...
...
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