diff --git a/Flax's-Arma-Server-Tool/ImportMod.vb b/Flax's-Arma-Server-Tool/ImportMod.vb
index 65c6c9e..17ef7e7 100644
--- a/Flax's-Arma-Server-Tool/ImportMod.vb
+++ b/Flax's-Arma-Server-Tool/ImportMod.vb
@@ -24,63 +24,69 @@ Public Class ImportMod
MainWindow.CheckModFile()
Dim lines As List(Of String) = System.IO.File.ReadAllLines(modsfile).ToList
- modID = modUrl.Substring(modUrl.IndexOf("?id="))
- modID = Integer.Parse(Regex.Replace(modID, "[^\d]", ""))
-
- For Each line In lines
- Dim values() As String = line.Split(",")
- If modID = values(0) Then
- duplicate = True
- End If
- Next
+ If modUrl Like "http*://steamcommunity.com/*/filedetails/?id=*" Then
+ modID = modUrl.Substring(modUrl.IndexOf("?id="))
+ modID = Integer.Parse(Regex.Replace(modID, "[^\d]", ""))
+
+ For Each line In lines
+ Dim values() As String = line.Split(",")
+ If modID = values(0) Then
+ duplicate = True
+ End If
+ Next
- If Not duplicate Then
- Try
- sourceString = New System.Net.WebClient().DownloadString(modUrl)
+ If Not duplicate Then
+ Try
+ sourceString = New System.Net.WebClient().DownloadString(modUrl)
- appName = sourceString.Substring(sourceString.IndexOf("content=" & ControlChars.Quote & "Steam Workshop:") + 25, 6)
+ appName = sourceString.Substring(sourceString.IndexOf("content=" & ControlChars.Quote & "Steam Workshop:") + 25, 6)
- If appName Like "Arma 3" Then
- modName = sourceString.Substring(sourceString.IndexOf("
Steam Workshop :: ") + 25)
- modName = StrReverse(modName)
- modName = modName.Substring(modName.IndexOf(">eltit/<") + 8)
- modName = StrReverse(modName)
+ If appName Like "Arma 3" Then
+ modName = sourceString.Substring(sourceString.IndexOf("Steam Workshop :: ") + 25)
+ modName = StrReverse(modName)
+ modName = modName.Substring(modName.IndexOf(">eltit/<") + 8)
+ modName = StrReverse(modName)
- If modUrl Like "http*://steamcommunity.com/*/filedetails/?id=*" Then
- Try
- Dim steamUpdate As New DateTime(1970, 1, 1, 0, 0, 0)
- Dim modLine As String = modID & "," & modName & ",Not Installed," & steamUpdate & ",public" & Environment.NewLine
+ If modUrl Like "http*://steamcommunity.com/*/filedetails/?id=*" Then
+ Try
+ Dim steamUpdate As New DateTime(1970, 1, 1, 0, 0, 0)
+ Dim modLine As String = modID & "," & modName & ",Not Installed," & steamUpdate & ",public" & Environment.NewLine
- MainWindow.CheckModFile()
- Dim fs As StreamWriter = File.AppendText(modsfile)
+ MainWindow.CheckModFile()
+ Dim fs As StreamWriter = File.AppendText(modsfile)
- fs.Write(modLine)
- fs.Close()
+ fs.Write(modLine)
+ fs.Close()
- Me.Close()
- MainWindow.UpdateModGrid()
+ Me.Close()
+ MainWindow.UpdateModGrid()
- Catch ex As Exception
- modID = Nothing
- MessageBox.Show("Please remove any charcters after the mod ID in the url.")
- MsgBox("An exception occurred:" & vbCrLf & ex.Message)
- End Try
+ Catch ex As Exception
+ modID = Nothing
+ MessageBox.Show("Please remove any charcters after the mod ID in the url.")
+ MsgBox("An exception occurred:" & vbCrLf & ex.Message)
+ End Try
+ Else
+ MessageBox.Show("Please use format: https://steamcommunity.com/sharedfiles/filedetails/?id=*********")
+ End If
Else
- MessageBox.Show("Please use format: https://steamcommunity.com/sharedfiles/filedetails/?id=*********")
+ MessageBox.Show("This is a workshop Item for a different game.")
+ Me.Close()
End If
- Else
- MessageBox.Show("This is a workshop Item for a different game.")
- Me.Close()
- End If
- Catch ex As Exception
- MsgBox("An exception occurred:" & vbCrLf & ex.Message)
- End Try
+ Catch ex As Exception
+ MsgBox("An exception occurred:" & vbCrLf & ex.Message)
+ End Try
+ Else
+ Me.Close()
+ MsgBox("Mod already imported.")
+ End If
+
Else
- Me.Close()
- MsgBox("Mod already imported.")
+ MessageBox.Show("Please use format: https://steamcommunity.com/sharedfiles/filedetails/?id=*********")
End If
+
Cursor.Current = Cursors.Default
End Sub