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
4dad413a
Commit
4dad413a
authored
May 22, 2025
by
Chen Bill
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
check header in OpenReplay
parent
c3e25993
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
13 deletions
+9
-13
gframe/game.cpp
gframe/game.cpp
+1
-1
gframe/replay.cpp
gframe/replay.cpp
+8
-11
gframe/replay.h
gframe/replay.h
+0
-1
No files found.
gframe/game.cpp
View file @
4dad413a
...
@@ -1256,7 +1256,7 @@ void Game::RefreshDeck(const wchar_t* deckpath, const std::function<void(const w
...
@@ -1256,7 +1256,7 @@ void Game::RefreshDeck(const wchar_t* deckpath, const std::function<void(const w
void
Game
::
RefreshReplay
()
{
void
Game
::
RefreshReplay
()
{
lstReplayList
->
clear
();
lstReplayList
->
clear
();
FileSystem
::
TraversalDir
(
L"./replay"
,
[
this
](
const
wchar_t
*
name
,
bool
isdir
)
{
FileSystem
::
TraversalDir
(
L"./replay"
,
[
this
](
const
wchar_t
*
name
,
bool
isdir
)
{
if
(
!
isdir
&&
IsExtension
(
name
,
L".yrp"
)
&&
Replay
::
CheckReplay
(
name
)
)
if
(
!
isdir
&&
IsExtension
(
name
,
L".yrp"
))
lstReplayList
->
addItem
(
name
);
lstReplayList
->
addItem
(
name
);
});
});
}
}
...
...
gframe/replay.cpp
View file @
4dad413a
...
@@ -115,6 +115,14 @@ bool Replay::OpenReplay(const wchar_t* name) {
...
@@ -115,6 +115,14 @@ bool Replay::OpenReplay(const wchar_t* name) {
std
::
fclose
(
rfp
);
std
::
fclose
(
rfp
);
return
false
;
return
false
;
}
}
if
(
pheader
.
id
!=
0x31707279
||
pheader
.
version
<
0x12d0u
)
{
std
::
fclose
(
rfp
);
return
false
;
}
if
(
pheader
.
version
>=
0x1353u
&&
!
(
pheader
.
flag
&
REPLAY_UNIFORM
))
{
std
::
fclose
(
rfp
);
return
false
;
}
if
(
pheader
.
flag
&
REPLAY_COMPRESSED
)
{
if
(
pheader
.
flag
&
REPLAY_COMPRESSED
)
{
comp_size
=
std
::
fread
(
comp_data
,
1
,
MAX_COMP_SIZE
,
rfp
);
comp_size
=
std
::
fread
(
comp_data
,
1
,
MAX_COMP_SIZE
,
rfp
);
std
::
fclose
(
rfp
);
std
::
fclose
(
rfp
);
...
@@ -142,17 +150,6 @@ bool Replay::OpenReplay(const wchar_t* name) {
...
@@ -142,17 +150,6 @@ bool Replay::OpenReplay(const wchar_t* name) {
data_position
=
0
;
data_position
=
0
;
return
true
;
return
true
;
}
}
bool
Replay
::
CheckReplay
(
const
wchar_t
*
name
)
{
wchar_t
fname
[
256
];
myswprintf
(
fname
,
L"./replay/%ls"
,
name
);
FILE
*
rfp
=
mywfopen
(
fname
,
"rb"
);
if
(
!
rfp
)
return
false
;
ReplayHeader
rheader
;
size_t
count
=
std
::
fread
(
&
rheader
,
sizeof
rheader
,
1
,
rfp
);
std
::
fclose
(
rfp
);
return
count
==
1
&&
rheader
.
id
==
0x31707279
&&
rheader
.
version
>=
0x12d0u
&&
(
rheader
.
version
<
0x1353u
||
(
rheader
.
flag
&
REPLAY_UNIFORM
));
}
bool
Replay
::
DeleteReplay
(
const
wchar_t
*
name
)
{
bool
Replay
::
DeleteReplay
(
const
wchar_t
*
name
)
{
wchar_t
fname
[
256
];
wchar_t
fname
[
256
];
myswprintf
(
fname
,
L"./replay/%ls"
,
name
);
myswprintf
(
fname
,
L"./replay/%ls"
,
name
);
...
...
gframe/replay.h
View file @
4dad413a
...
@@ -53,7 +53,6 @@ public:
...
@@ -53,7 +53,6 @@ public:
void
SaveReplay
(
const
wchar_t
*
name
);
void
SaveReplay
(
const
wchar_t
*
name
);
// play
// play
static
bool
CheckReplay
(
const
wchar_t
*
name
);
static
bool
DeleteReplay
(
const
wchar_t
*
name
);
static
bool
DeleteReplay
(
const
wchar_t
*
name
);
static
bool
RenameReplay
(
const
wchar_t
*
oldname
,
const
wchar_t
*
newname
);
static
bool
RenameReplay
(
const
wchar_t
*
oldname
,
const
wchar_t
*
newname
);
static
size_t
GetDeckPlayer
(
size_t
deck_index
)
{
static
size_t
GetDeckPlayer
(
size_t
deck_index
)
{
...
...
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