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
aba307ce
Commit
aba307ce
authored
May 04, 2025
by
Chen Bill
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replay: add can_read
parent
d908fd9a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
6 deletions
+6
-6
gframe/replay.cpp
gframe/replay.cpp
+5
-6
gframe/replay.h
gframe/replay.h
+1
-0
No files found.
gframe/replay.cpp
View file @
aba307ce
...
...
@@ -133,6 +133,7 @@ bool Replay::OpenReplay(const wchar_t* name) {
comp_size
=
0
;
}
is_replaying
=
true
;
can_read
=
true
;
if
(
!
ReadInfo
())
{
Reset
();
return
false
;
...
...
@@ -176,10 +177,6 @@ bool Replay::ReadNextResponse(unsigned char resp[]) {
unsigned
char
len
{};
if
(
!
ReadData
(
&
len
,
sizeof
len
))
return
false
;
if
(
len
>
SIZE_RETURN_VALUE
)
{
is_replaying
=
false
;
return
false
;
}
if
(
!
ReadData
(
resp
,
len
))
return
false
;
return
true
;
...
...
@@ -196,10 +193,10 @@ void Replay::ReadHeader(ReplayHeader& header) {
header
=
pheader
;
}
bool
Replay
::
ReadData
(
void
*
data
,
size_t
length
)
{
if
(
!
is_replaying
)
if
(
!
is_replaying
||
!
can_read
)
return
false
;
if
(
data_position
+
length
>
replay_size
)
{
is_replaying
=
false
;
can_read
=
false
;
return
false
;
}
if
(
length
)
...
...
@@ -212,10 +209,12 @@ int32_t Replay::ReadInt32() {
}
void
Replay
::
Rewind
()
{
data_position
=
0
;
can_read
=
true
;
}
void
Replay
::
Reset
()
{
is_recording
=
false
;
is_replaying
=
false
;
can_read
=
false
;
replay_size
=
0
;
comp_size
=
0
;
data_position
=
0
;
...
...
gframe/replay.h
View file @
aba307ce
...
...
@@ -94,6 +94,7 @@ private:
size_t
data_position
{};
bool
is_recording
{};
bool
is_replaying
{};
bool
can_read
{};
};
}
...
...
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