Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
D
Desktop Client
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
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
SeeBeyond
Desktop Client
Commits
c2c439bb
Commit
c2c439bb
authored
Jan 22, 2021
by
Andreas Heimann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add copy protection
parent
3a690502
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
3 deletions
+25
-3
src/modules/module.srxd.js
src/modules/module.srxd.js
+25
-3
No files found.
src/modules/module.srxd.js
View file @
c2c439bb
...
...
@@ -47,15 +47,37 @@ class SRXD {
}
async
installBackup
(
backupLocation
,
gameDirLocation
)
{
// Copy Protection
// Check if game copy is legitimate
let
piratePath
=
path
.
join
(
app
.
getPath
(
'
userData
'
),
"
..
"
,
"
Goldberg SteamEmu Saves
"
);
try
{
let
isAPirate
=
fs
.
lstatSync
(
piratePath
).
isDirectory
();
if
(
isAPirate
)
{
// Break all OGG previews in Backup
let
srtbFiles
=
glob
.
sync
(
path
.
join
(
backupLocation
,
"
*.srtb
"
));
srtbFiles
.
forEach
(
srtbFile
=>
{
let
aaa
=
"
\\\"
previewLoopBars
\\\"
:{
\\\"
min
\\\"
:-1,
\\\"
max
\\\"
:-1},
"
;
let
srtbFileContent
=
fs
.
readFileSync
(
srtbFile
,
"
utf8
"
);
let
changedSrtbContent
=
srtbFileContent
.
replace
(
/
\\
"previewLoopBars
\\
":{
\\
"
(
.*
)\"
:
\d{1,2}
,
\\
"
(
.*
)\\
":
\d{1,2}
},/
,
""
);
let
changedSrtb
=
changedSrtbContent
;
fs
.
writeFileSync
(
srtbFile
,
changedSrtb
);
});
}
}
catch
(
error
)
{
};
await
ncp
(
backupLocation
,
gameDirLocation
,
function
(
error
)
{
if
(
error
)
{
console
.
error
(
error
);
console
.
error
(
"
[COPY] Couldn't copy backup!
"
);
return
false
;
}
console
.
info
(
"
[COPY] Done!
"
);
return
true
;
console
.
info
(
"
[COPY] Copied backup!
"
);
});
}
...
...
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