Skip to content

Commit

Permalink
checkpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
Shin0by committed May 17, 2021
1 parent e475bbc commit 87f1921
Show file tree
Hide file tree
Showing 8 changed files with 29 additions and 7 deletions.
10 changes: 7 additions & 3 deletions StarCitizen Helper/Controls/WL_Check.vb
Original file line number Diff line number Diff line change
Expand Up @@ -288,21 +288,24 @@ Public Class WL_Check
Me.Invoke(Sub()
Me.Property_Text_Label_Value_OnlineVersion = _GIT_Request._LatestElement._tag_name
Me.Property_Text_Label_Value_OnlineDate = _GIT_Request._LatestElement._published
Me.Property_Text_TextBox_Value_OnlineInformation = _GIT_Request._LatestElement._body
Me.Property_Text_TextBox_Value_OnlineInformation = _GIT_Request._ParseInformationBody(_GIT_Request._LatestElement._body)
End Sub)
RaiseEvent _Event_NewVersion_Available_After(_GIT_Request._JSON, _GIT_Request._LatestElement, Me)
End If
End If
RaiseEvent _Event_Update_Complete_After(_GIT_Request._JSON, _GIT_Request._LatestElement, Me)
If _GIT_Request._LatestElement IsNot Nothing Then Property_DateOnline = _GIT_Request._LatestElement._published
If _GIT_Request._LatestElement IsNot Nothing Then
Property_DateOnline = _GIT_Request._LatestElement._published
Else
Property_DateOnline = Convert.ToDateTime("01.01.2000 00:00:00")
End If
End If

For i = 1 To 1000
Thread.Sleep(iUpdateGitListInterval \ 1000)

If Temp_Property_URLApi <> Me.Property_URLApi Then
'Property_DateOnline = Convert.ToDateTime("01.01.2000 00:00:00")

Temp_Property_URLApi = Me.Property_URLApi
Exit For
End If
Expand All @@ -311,4 +314,5 @@ Public Class WL_Check
Loop
End Sub
'-----------------------------------> Thread

End Class
2 changes: 1 addition & 1 deletion StarCitizen Helper/Forms/MainForm.vb
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,7 @@ Public Class MainForm
Me.Invoke(Sub()
Me.WL_SysUpdateCheck.Property_Text_Label_Value_OnlineVersion = LatestElement._tag_name
Me.WL_SysUpdateCheck.Property_Text_Label_Value_OnlineDate = LatestElement._published
Me.WL_SysUpdateCheck.Property_Text_TextBox_Value_OnlineInformation = LatestElement._body
Me.WL_SysUpdateCheck.Property_Text_TextBox_Value_OnlineInformation = _GIT._ParseInformationBody(LatestElement._body)
End Sub)

If _APP.Version <> LatestElement._tag_name Then
Expand Down
18 changes: 18 additions & 0 deletions StarCitizen Helper/Modules/Module_GIT.vb
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ Module Module_GIT
Public _JSON As Object
Public _LatestElement As Class_GitUpdateElement = Nothing

Private URL_Preview As String = Nothing
Private URL_Current As String = Nothing

Public Function _GetGitList(URL As String, PreRelease As Boolean) As List(Of Class_GitUpdateElement)
_LIST._Clear()
Dim Header As New Net.WebHeaderCollection
Expand All @@ -16,6 +19,7 @@ Module Module_GIT
Dim result As ResultClass
result = _INET._GetHTTP(URL, Net.SecurityProtocolType.Tls12, Header)
If result.Err._Flag = True Then
Me._LatestElement = Nothing
If result.Err._Number = 403 Then
result.Err._Description_Sys = _LANG._Get("GIT_MSG_AccessDeniedLimit", result.Err._Description_Sys)
End If
Expand All @@ -25,6 +29,7 @@ Module Module_GIT
End If
If Len(temp) < 10 Then _LOG._sAdd("GIT_NET", _LANG._Get("GIT_MSG_CannotLoadBuildList", result.Err._Description_Sys), Nothing, 2) : Return _LIST._GetAll

Me.URL_Current = URL
temp = "{" & Chr(34) & "data" & Chr(34) & ":" & temp & "}"
Me._JSON = JsonConvert.DeserializeObject(temp)
Dim Assets As Object = Nothing
Expand All @@ -37,12 +42,18 @@ Module Module_GIT
Next

Me._LatestElement = Me._GetLatestElement(_LIST._GetAll)
Me.URL_Preview = URL
Return _LIST._GetAll
End Function

Public Function _GetLatestElement(GitList As List(Of Class_GitUpdateElement)) As Class_GitUpdateElement
Dim result As Class_GitUpdateElement = Nothing
Dim LastDate As DateTime = Nothing

'If Me.URL_Preview = Me.URL_Current Then
If GitList.Count = 0 Then Return result
'End If

For Each elem In GitList
If DateTime.Compare(elem._published, LastDate) > 0 Then
LastDate = elem._published
Expand Down Expand Up @@ -70,6 +81,13 @@ Module Module_GIT
Return Nothing
End Function

Public Function _ParseInformationBody(Value As String) As String
Value = Strings.Replace(Value, " * ", "- ")
Value = Strings.Replace(Value, " ", vbTab)
Value = Strings.Replace(Value, "###", vbNewLine)
Return Value
End Function

Class Class_GitUpdateList
Private data As New List(Of Class_GitUpdateElement)

Expand Down
4 changes: 2 additions & 2 deletions StarCitizen Helper/My Project/AssemblyInfo.vb
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,5 @@ Imports System.Runtime.InteropServices
' by using the '*' as shown below:
' <Assembly: AssemblyVersion("1.0.*")>

<Assembly: AssemblyVersion("1.8.15.107")>
<Assembly: AssemblyFileVersion("1.8.15.107")>
<Assembly: AssemblyVersion("1.8.16.108")>
<Assembly: AssemblyFileVersion("1.8.16.108")>
Binary file modified install/package/Input/StarCitizen Helper.exe
Binary file not shown.
Binary file modified install/package/Output/mysetup.exe
Binary file not shown.
2 changes: 1 addition & 1 deletion install/package/install.iss
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

[Setup]
AppVersion=1.8.15.107
AppVersion=1.8.16.108
AppName=StarCitizen Helper
DefaultDirName={userappdata}\StarCitizen Helper
DefaultGroupName=StarCitizen Helper
Expand Down
Binary file modified install/setup.exe
Binary file not shown.

0 comments on commit 87f1921

Please sign in to comment.