Fixed some issues related to File Validation and GJ saves. Updated the meta file.

This commit is contained in:
CaptainSegis 2019-01-05 13:41:59 -05:00
parent 4528b3789d
commit 03c6dbcf5b
3 changed files with 9 additions and 6 deletions

View File

@ -6,8 +6,8 @@
Shared _valid As Boolean = False Shared _valid As Boolean = False
Const RUNVALIDATION As Boolean = False Const RUNVALIDATION As Boolean = False
Const EXPECTEDSIZE As Integer = 977834 Const EXPECTEDSIZE As Integer = 45951523
Const METAHASH As String = "MEEzNjIzMUE5RkEwNEFCQjgwQUQwODQ1NDVDRjVCNzQ=" Const METAHASH As String = "OTBEOUM0RTgwQjFFNkJEQTVFNkIxQjM1OUJGM0ZDRkU="
Public Shared ReadOnly Property IsValid(ByVal ForceResult As Boolean) As Boolean Public Shared ReadOnly Property IsValid(ByVal ForceResult As Boolean) As Boolean
Get Get
@ -28,7 +28,7 @@
Dim MeasuredSize As Long = 0 Dim MeasuredSize As Long = 0
Dim files As New List(Of String) Dim files As New List(Of String)
Dim paths() As String = {"Content", "maps", "Scripts"} Dim paths() As String = {"Content"}
Dim includeExt() As String = {".dat", ".poke", ".lua", ".trainer"} Dim includeExt() As String = {".dat", ".poke", ".lua", ".trainer"}
If RUNVALIDATION = True Then If RUNVALIDATION = True Then
@ -65,7 +65,10 @@
Core.GameInstance.Exit() Core.GameInstance.Exit()
Else Else
If System.IO.File.Exists(GameController.GamePath & "\meta") = True Then If System.IO.File.Exists(GameController.GamePath & "\meta") = True Then
If GetMD5FromFile(GameController.GamePath & "\meta") = StringObfuscation.DeObfuscate(METAHASH) Then Dim A = GetMD5FromFile(GameController.GamePath & "\meta")
Dim X = StringObfuscation.Obfuscate(A)
Dim B = StringObfuscation.DeObfuscate(METAHASH)
If A = B Then
files = System.IO.File.ReadAllText(GameController.GamePath & "\meta").Split(CChar(",")).ToList() files = System.IO.File.ReadAllText(GameController.GamePath & "\meta").Split(CChar(",")).ToList()
Logger.Debug("Meta loaded. Files to check: " & files.Count) Logger.Debug("Meta loaded. Files to check: " & files.Count)
Else Else
@ -111,7 +114,7 @@
End Sub End Sub
Private Shared Function ValidateFile(ByVal file As String, ByVal relativePath As Boolean) As String Private Shared Function ValidateFile(ByVal file As String, ByVal relativePath As Boolean) As String
If Core.Player.IsGamejoltSave = True And GameController.IS_DEBUG_ACTIVE = False Then If Core.Player.IsGameJoltSave = True And GameController.IS_DEBUG_ACTIVE = False Then
Dim filePath As String = file.Replace("/", "\") Dim filePath As String = file.Replace("/", "\")
If relativePath = True Then If relativePath = True Then
filePath = GameController.GamePath & "\" & file filePath = GameController.GamePath & "\" & file

File diff suppressed because one or more lines are too long

Binary file not shown.