Skip to content
This repository has been archived by the owner on Jun 8, 2022. It is now read-only.

Commit

Permalink
更新 1.2.1
Browse files Browse the repository at this point in the history
  • Loading branch information
luluxiaoyu authored Feb 2, 2021
1 parent c76bf90 commit bf4f494
Show file tree
Hide file tree
Showing 9 changed files with 114 additions and 12 deletions.
58 changes: 54 additions & 4 deletions Form1.Designer.vb

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions Form1.resx
Original file line number Diff line number Diff line change
Expand Up @@ -1256,4 +1256,7 @@
<metadata name="Timer1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>121, 17</value>
</metadata>
<metadata name="SaveFileDialog1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>213, 17</value>
</metadata>
</root>
61 changes: 55 additions & 6 deletions Form1.vb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Public Class Form1
bt.Arguments = " -o BuildTools.jar https://hub.spigotmc.org/jenkins/job/BuildTools/lastSuccessfulBuild/artifact/target/BuildTools.jar"
bt.WorkingDirectory = Application.StartupPath & "/BuildSpigot"
Process.Start(bt)
TextBox1.Text += (vbCrLf & "下载buildtools.jar后,请重新点击构建")
TextBox1.Text += ("[系统]下载buildtools.jar后,请重新点击构建(黑色窗口关闭后就是下载完了)" + Environment.NewLine)
End If
build.WindowStyle = ProcessWindowStyle.Hidden
build.Arguments = " -jar BuildTools.jar --rev " & ComboBox1.Text
Expand All @@ -36,8 +36,15 @@ Public Class Form1
Private Delegate Sub AddMessageHandler(ByVal msg As String)
Private Sub Process1_OutputDataReceived(sender As Object, e As DataReceivedEventArgs) Handles Process1.OutputDataReceived
Dim handler As AddMessageHandler = Function(msg As String)
TextBox1.AppendText(msg + Environment.NewLine)
'TextBox1.Text += msg + Environment.NewLine
TextBox1.AppendText("[信息]" & msg + Environment.NewLine)
If InStr(1, msg, "Everything completed successfully") <> 0 Then
MsgBox("Spigot服务端构建成功", 64, "构建成功!")
ComboBox1.Enabled = True
Button1.Enabled = True
Button2.Enabled = False


End If
End Function
If Me.TextBox1.InvokeRequired Then
Me.TextBox1.Invoke(handler, e.Data)
Expand All @@ -54,7 +61,12 @@ Public Class Form1
'禁止用户用鼠标改变窗体大小
Me.FormBorderStyle = Windows.Forms.FormBorderStyle.FixedSingle
Button2.Enabled = False
My.Computer.Network.DownloadFile("https://www.nstar.xyz/data/ver.txt", Application.StartupPath & "/BuildSpigot/ver.txt", "", "", True, 1000, True)
Try
My.Computer.Network.DownloadFile("https://www.nstar.xyz/data/ver.txt", Application.StartupPath & "/BuildSpigot/ver.txt", "", "", True, 1000, True)
Catch ex As Exception
MsgBox("无法更新版本列表!" & vbCrLf & ex.Message, 16, "版本获取失败!")
End Try

Dim textArr As String() = File.ReadAllLines(Application.StartupPath & "/BuildSpigot/ver.txt")
For Each s As String In textArr
Console.WriteLine(s)
Expand All @@ -63,11 +75,48 @@ Public Class Form1
End Sub

Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
_process.CancelOutputRead()
_process.Close()
Try
_process.CancelOutputRead()
_process.Close()
Catch ex As Exception
MsgBox(ex.Message, 16, "进程结束失败!(别点击那么多次)")
End Try

End Sub

Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click
Form2.Show()
End Sub

Private Sub Button4_Click(sender As Object, e As EventArgs) Handles Button4.Click
Dim re = MsgBox("该操作会删除Buildtools.jar在内的所有新生成的文件!", 32 + 1, "确认删除?")
If (re = 1) Then
Try
IO.Directory.Delete(Application.StartupPath & "/BuildSpigot", True)
Catch ex As Exception
MsgBox("无法删除文件,可能是由于文件被占用,请在重启电脑后再次尝试删除!" & vbCrLf & ex.Message, 16, "删除错误")
End Try

End If
End Sub

Private Sub Button5_Click(sender As Object, e As EventArgs) Handles Button5.Click
Try
MsgBox(Application.StartupPath & "\BuildSpigot\BuildTools.log.txt")
Shell("notepad " & Application.StartupPath & "\BuildSpigot\BuildTools.log.txt")
Catch ex As Exception
MsgBox("未找到日志!你删掉了?" & vbCrLf & ex.ToString, 16, "日志找不到···")
End Try
End Sub

Private Sub Button6_Click(sender As Object, e As EventArgs) Handles Button6.Click
Try
IO.File.Delete(Application.StartupPath & "/BuildSpigot/BuildTools.jar")
TextBox1.AppendText("[系统]删除旧版构建工具成功!" + Environment.NewLine)
Catch ex As Exception
MsgBox(ex.Message, 16, "构建Jar删除失败!")
End Try
End Sub


End Class
4 changes: 2 additions & 2 deletions My Project/AssemblyInfo.vb
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,5 @@ Imports System.Runtime.InteropServices
'通过使用 "*",如下所示:
' <Assembly: AssemblyVersion("1.0.*")>

<Assembly: AssemblyVersion("1.0.1.0")>
<Assembly: AssemblyFileVersion("1.0.1.0")>
<Assembly: AssemblyVersion("1.1.1.0")>
<Assembly: AssemblyFileVersion("1.1.1.0")>
Binary file not shown.
Binary file modified obj/Release/Quickly Build Spigot Server.exe
Binary file not shown.
Binary file modified obj/Release/Quickly Build Spigot Server.pdb
Binary file not shown.
Binary file not shown.
Binary file not shown.

0 comments on commit bf4f494

Please sign in to comment.