Hey
Ich wollt ma eben euer 4Story ServerAdmin Leben einfacher machen und hab ein kleines programm geschrieben, das die services (wenn nötig) mit einem button stoppt und sie wieder startet.
screen:
Source (Könnt ihr wenn ihr wollt selbst compilen, ich hab nix dagegen):
Imports System.IO
Imports System.ServiceProcess
Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
End Sub
Private Sub start()
Label1.Text = "Services werden Gestartet"
ProgressBar1.Value = "50"
Try
Dim sc As New ServiceController("TCTRL_GSP")
sc.Start()
Catch
MsgBox("Error!!" + vbNewLine + "TCTRL_GSP Konnte nicht Gestatet werden.", MsgBoxStyle.Critical, "Error!")
End Try
ProgressBar1.Value = "58,33333"
Try
Dim sc As New ServiceController("TLOGIN_GSP")
sc.Start()
Catch
MsgBox("Error!!" + vbNewLine + "TLOGIN_GSP Konnte nicht Gestatet werden.", MsgBoxStyle.Critical, "Error!")
End Try
ProgressBar1.Value = "66,666666666"
Try
Dim sc As New ServiceController("TWORLD_GSP")
sc.Start()
Catch
MsgBox("Error!!" + vbNewLine + "TWORLD_GSP Konnte nicht Gestatet werden.", MsgBoxStyle.Critical, "Error!")
End Try
ProgressBar1.Value = "75"
Try
Dim sc As New ServiceController("TRELAY_GSP")
sc.Start()
Catch
MsgBox("Error!!" + vbNewLine + "TRELAY_GSP Konnte nicht Gestatet werden.", MsgBoxStyle.Critical, "Error!")
End Try
ProgressBar1.Value = "83,33333"
Try
Dim sc As New ServiceController("TMAP_GSP")
sc.Start()
Catch
MsgBox("Error!!" + vbNewLine + "TMAP_GSP Konnte nicht Gestatet werden.", MsgBoxStyle.Critical, "Error!")
End Try
ProgressBar1.Value = "91,666666633333"
'Try
'Dim sc As New ServiceController("TLOG0")
'sc.Start()
'Catch
'MsgBox("Error!!" + vbNewLine + "TLOG0 Konnte nicht Gestatet werden.", MsgBoxStyle.Critical, "Error!")
'End Try
ProgressBar1.Value = "100"
Label1.Text = "Fertig"
End Sub
Private Sub stops()
Label1.Text = "Services werden Gestoppt"
Try
Dim sc As New ServiceController("TCTRL_GSP")
sc.Stop()
Catch
End Try
Try
Dim sc As New ServiceController("TLOGIN_GSP")
sc.Stop()
Catch
End Try
Try
Dim sc As New ServiceController("TWORLD_GSP")
sc.Stop()
Catch
End Try
Try
Dim sc As New ServiceController("TRELAY_GSP")
sc.Stop()
Catch
End Try
Try
Dim sc As New ServiceController("TMAP_GSP")
sc.Stop()
Catch
End Try
Try
Dim sc As New ServiceController("TLOG0")
sc.Stop()
Catch
End Try
ProgressBar1.Value = "25"
Timer1.Start()
If checkserviceon() = True Then
Label1.Text = "Services on, press button..."
ElseIf checkserviceon() = False Then
Label1.Text = "Services off, starting..."
start()
End If
End Sub
Dim stcheck As Boolean = False
Private Sub Timer1_Tick(sender As System.Object, e As System.EventArgs) Handles Timer1.Tick
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Control.CheckForIllegalCrossThreadCalls = False
BackgroundWorker1.RunWorkerAsync()
End Sub
Private Sub BackgroundWorker1_DoWork(ByVal sender As System.Object, ByVal e As System.ComponentModel.DoWorkEventArgs) Handles BackgroundWorker1.DoWork
Call stops()
End Sub
Function checkserviceon()
If stcheck = False Then
Dim count As Integer
Dim Wait As String = ""
Dim TCTRL_GSP As New ServiceController("TCTRL_GSP")
Dim TLOGIN_GSP As New ServiceController("TLOGIN_GSP")
Dim TWORLD_GSP As New ServiceController("TWORLD_GSP")
Dim TRELAY_GSP As New ServiceController("TRELAY_GSP")
Dim TMAP_GSP As New ServiceController("TMAP_GSP")
If TCTRL_GSP.Status = ServiceControllerStatus.Running Then
count = count + 1
Wait &= "TCTRL,"
Else
End If
If TLOGIN_GSP.Status = ServiceControllerStatus.Running Then
count = count + 1
Wait &= "TLOGIN_GSP,"
Else
End If
If TWORLD_GSP.Status = ServiceControllerStatus.Running Then
count = count + 1
Wait &= "TWORLD_GSP,"
Else
End If
If TRELAY_GSP.Status = ServiceControllerStatus.Running Then
count = count + 1
Wait &= "TRELAY_GSP,"
Else
End If
If TMAP_GSP.Status = ServiceControllerStatus.Running Then
count = count + 1
Wait &= "TMAP_GSP,"
Else
End If
If count >= "1" Then
Label1.Text = "Waiting For " + count + " to close:" + vbNewLine + Wait
Return True
Else
stcheck = True
Label1.Text = "services stopped!"
Return False
End If
ElseIf stcheck = True Then
Label1.Text = "services stopped!"
Return False
End If
End Function
End Class
VT:
1/47 : virenscanner können auch mal irren
Kleine anmerkung am rande: Nicht schnell hintereinander den button drücken, sonst kommen viele errors raus
Es gibt Zwar schon ein Programm davon aber schaden Tut es ja nicht.
Allerdings würde ich noch eine Funktion "Kill Process" einbauen.
Mit dieser sollte man Prozesse die sich nicht mehr normal beenden lassen (Weil sich z.B. ein Service aufgehängt hat) killen können.
Btw:
Quote:
Originally Posted by [GA]Zero
Oh da ist ja wirklich die Source xD hab die wohl nicht gesehen ^^
Wie schon des öfteren erwähnt: Bitte nachdenken und erst dann Posten!
Private Sub Hardresett()
Label1.Text = "Hardreset Wird Durchgeführt"
Try
Dim p() As Process = Process.GetProcessesByName("TControlSvr")
p(0).Kill()
Catch ex As Exception
End Try
Try
Dim p() As Process = Process.GetProcessesByName("TLOG0")
p(0).Kill()
Catch ex As Exception
End Try
Try
Dim p() As Process = Process.GetProcessesByName("TLoginSvr")
p(0).Kill()
Catch ex As Exception
End Try
Try
Dim p() As Process = Process.GetProcessesByName("TMapSvr")
p(0).Kill()
Catch ex As Exception
End Try
Try
Dim p() As Process = Process.GetProcessesByName("TRelaySvr")
p(0).Kill()
Catch ex As Exception
End Try
Try
Dim p() As Process = Process.GetProcessesByName("TControlSvr")
p(0).Kill()
Catch ex As Exception
End Try
Try
Dim p() As Process = Process.GetProcessesByName("TWorldSvr")
p(0).Kill()
Catch ex As Exception
End Try
ProgressBar1.Value = "50"
start()
That's nice program, great job. You can do it also to at intervals - if services are running or no, to restart them automatically.
But can you say me advantages that you get, using the backgroundWorker in your project?
The advantage of the bgw is that the form is more stable if you use it.
You can also take a new thread, but in the backgroundworker are much more options.
Imports System.IO
Imports System.ServiceProcess
Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
End Sub
Private Sub start()
Label1.Text = "Services will be Started."
ProgressBar1.Value = "50"
Try
Dim sc As New ServiceController("TCTRL_GSP")
sc.Start()
Catch
MsgBox("Error!!" + vbNewLine + "TCTRL_GSP Can't Start .", MsgBoxStyle.Critical, "Error!")
End Try
ProgressBar1.Value = "58,33333"
Try
Dim sc As New ServiceController("TLOGIN_GSP")
sc.Start()
Catch
MsgBox("Error!!" + vbNewLine + "TLOGIN_GSP Can't Start.", MsgBoxStyle.Critical, "Error!")
End Try
ProgressBar1.Value = "66,666666666"
Try
Dim sc As New ServiceController("TWORLD_GSP")
sc.Start()
Catch
MsgBox("Error!!" + vbNewLine + "TWORLD_GSP Can't Start.", MsgBoxStyle.Critical, "Error!")
End Try
ProgressBar1.Value = "75"
Try
Dim sc As New ServiceController("TRELAY_GSP")
sc.Start()
Catch
MsgBox("Error!!" + vbNewLine + "TRELAY_GSP Can't Start.", MsgBoxStyle.Critical, "Error!")
End Try
ProgressBar1.Value = "83,33333"
Try
Dim sc As New ServiceController("TMAP_GSP")
sc.Start()
Catch
MsgBox("Error!!" + vbNewLine + "TMAP_GSP Can't Start.", MsgBoxStyle.Critical, "Error!")
End Try
ProgressBar1.Value = "91,666666633333"
'Try
'Dim sc As New ServiceController("TLOG0")
'sc.Start()
'Catch
'MsgBox("Error!!" + vbNewLine + "TLOG0 Can't Start.", MsgBoxStyle.Critical, "Error!")
'End Try
ProgressBar1.Value = "100"
Label1.Text = "Finish"
End Sub
Private Sub stops()
Label1.Text = "Services will be stopped"
Try
Dim sc As New ServiceController("TCTRL_GSP")
sc.Stop()
Catch
End Try
Try
Dim sc As New ServiceController("TLOGIN_GSP")
sc.Stop()
Catch
End Try
Try
Dim sc As New ServiceController("TWORLD_GSP")
sc.Stop()
Catch
End Try
Try
Dim sc As New ServiceController("TRELAY_GSP")
sc.Stop()
Catch
End Try
Try
Dim sc As New ServiceController("TMAP_GSP")
sc.Stop()
Catch
End Try
Try
Dim sc As New ServiceController("TLOG0")
sc.Stop()
Catch
End Try
ProgressBar1.Value = "25"
Timer1.Start()
If checkserviceon() = True Then
Label1.Text = "Services on, press button..."
ElseIf checkserviceon() = False Then
Label1.Text = "Services off, starting..."
start()
End If
End Sub
Dim stcheck As Boolean = False
Private Sub Timer1_Tick(sender As System.Object, e As System.EventArgs) Handles Timer1.Tick
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Control.CheckForIllegalCrossThreadCalls = False
BackgroundWorker1.RunWorkerAsync()
End Sub
Private Sub BackgroundWorker1_DoWork(ByVal sender As System.Object, ByVal e As System.ComponentModel.DoWorkEventArgs) Handles BackgroundWorker1.DoWork
Call stops()
End Sub
Function checkserviceon()
If stcheck = False Then
Dim count As Integer
Dim Wait As String = ""
Dim TCTRL_GSP As New ServiceController("TCTRL_GSP")
Dim TLOGIN_GSP As New ServiceController("TLOGIN_GSP")
Dim TWORLD_GSP As New ServiceController("TWORLD_GSP")
Dim TRELAY_GSP As New ServiceController("TRELAY_GSP")
Dim TMAP_GSP As New ServiceController("TMAP_GSP")
If TCTRL_GSP.Status = ServiceControllerStatus.Running Then
count = count + 1
Wait &= "TCTRL,"
Else
End If
If TLOGIN_GSP.Status = ServiceControllerStatus.Running Then
count = count + 1
Wait &= "TLOGIN_GSP,"
Else
End If
If TWORLD_GSP.Status = ServiceControllerStatus.Running Then
count = count + 1
Wait &= "TWORLD_GSP,"
Else
End If
If TRELAY_GSP.Status = ServiceControllerStatus.Running Then
count = count + 1
Wait &= "TRELAY_GSP,"
Else
End If
If TMAP_GSP.Status = ServiceControllerStatus.Running Then
count = count + 1
Wait &= "TMAP_GSP,"
Else
End If
If count >= "1" Then
Label1.Text = "Waiting For " + count + " to close:" + vbNewLine + Wait
Return True
Else
stcheck = True
Label1.Text = "services stopped!"
Return False
End If
ElseIf stcheck = True Then
Label1.Text = "services stopped!"
Return False
End If
End Function
End Class
Imports System.IO
Imports System.ServiceProcess
Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
End Sub
Private Sub start()
Label1.Text = "Services will be Started."
ProgressBar1.Value = "50"
Try
Dim sc As New ServiceController("TCTRL_GSP")
sc.Start()
Catch
MsgBox("Error!!" + vbNewLine + "TCTRL_GSP Can't Start .", MsgBoxStyle.Critical, "Error!")
End Try
ProgressBar1.Value = "58,33333"
Try
Dim sc As New ServiceController("TLOGIN_GSP")
sc.Start()
Catch
MsgBox("Error!!" + vbNewLine + "TLOGIN_GSP Can't Start.", MsgBoxStyle.Critical, "Error!")
End Try
ProgressBar1.Value = "66,666666666"
Try
Dim sc As New ServiceController("TWORLD_GSP")
sc.Start()
Catch
MsgBox("Error!!" + vbNewLine + "TWORLD_GSP Can't Start.", MsgBoxStyle.Critical, "Error!")
End Try
ProgressBar1.Value = "75"
Try
Dim sc As New ServiceController("TRELAY_GSP")
sc.Start()
Catch
MsgBox("Error!!" + vbNewLine + "TRELAY_GSP Can't Start.", MsgBoxStyle.Critical, "Error!")
End Try
ProgressBar1.Value = "83,33333"
Try
Dim sc As New ServiceController("TMAP_GSP")
sc.Start()
Catch
MsgBox("Error!!" + vbNewLine + "TMAP_GSP Can't Start.", MsgBoxStyle.Critical, "Error!")
End Try
ProgressBar1.Value = "91,666666633333"
'Try
'Dim sc As New ServiceController("TLOG0")
'sc.Start()
'Catch
'MsgBox("Error!!" + vbNewLine + "TLOG0 Can't Start.", MsgBoxStyle.Critical, "Error!")
'End Try
ProgressBar1.Value = "100"
Label1.Text = "Finish"
End Sub
Private Sub stops()
Label1.Text = "Services will be stopped"
Try
Dim sc As New ServiceController("TCTRL_GSP")
sc.Stop()
Catch
End Try
Try
Dim sc As New ServiceController("TLOGIN_GSP")
sc.Stop()
Catch
End Try
Try
Dim sc As New ServiceController("TWORLD_GSP")
sc.Stop()
Catch
End Try
Try
Dim sc As New ServiceController("TRELAY_GSP")
sc.Stop()
Catch
End Try
Try
Dim sc As New ServiceController("TMAP_GSP")
sc.Stop()
Catch
End Try
Try
Dim sc As New ServiceController("TLOG0")
sc.Stop()
Catch
End Try
ProgressBar1.Value = "25"
Timer1.Start()
If checkserviceon() = True Then
Label1.Text = "Services on, press button..."
ElseIf checkserviceon() = False Then
Label1.Text = "Services off, starting..."
start()
End If
End Sub
Dim stcheck As Boolean = False
Private Sub Timer1_Tick(sender As System.Object, e As System.EventArgs) Handles Timer1.Tick
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Control.CheckForIllegalCrossThreadCalls = False
BackgroundWorker1.RunWorkerAsync()
End Sub
Private Sub BackgroundWorker1_DoWork(ByVal sender As System.Object, ByVal e As System.ComponentModel.DoWorkEventArgs) Handles BackgroundWorker1.DoWork
Call stops()
End Sub
Function checkserviceon()
If stcheck = False Then
Dim count As Integer
Dim Wait As String = ""
Dim TCTRL_GSP As New ServiceController("TCTRL_GSP")
Dim TLOGIN_GSP As New ServiceController("TLOGIN_GSP")
Dim TWORLD_GSP As New ServiceController("TWORLD_GSP")
Dim TRELAY_GSP As New ServiceController("TRELAY_GSP")
Dim TMAP_GSP As New ServiceController("TMAP_GSP")
If TCTRL_GSP.Status = ServiceControllerStatus.Running Then
count = count + 1
Wait &= "TCTRL,"
Else
End If
If TLOGIN_GSP.Status = ServiceControllerStatus.Running Then
count = count + 1
Wait &= "TLOGIN_GSP,"
Else
End If
If TWORLD_GSP.Status = ServiceControllerStatus.Running Then
count = count + 1
Wait &= "TWORLD_GSP,"
Else
End If
If TRELAY_GSP.Status = ServiceControllerStatus.Running Then
count = count + 1
Wait &= "TRELAY_GSP,"
Else
End If
If TMAP_GSP.Status = ServiceControllerStatus.Running Then
count = count + 1
Wait &= "TMAP_GSP,"
Else
End If
If count >= "1" Then
Label1.Text = "Waiting For " + count + " to close:" + vbNewLine + Wait
Return True
Else
stcheck = True
Label1.Text = "services stopped!"
Return False
End If
ElseIf stcheck = True Then
Label1.Text = "services stopped!"
Return False
End If
End Function
End Class
Is mir eig. eh egal, is open source, find ich aba trozdem unnötig, weils nur1 button is xD
[RELEASE] M² Starter by EliteNMC 02/24/2013 - Metin2 Hacks, Bots, Cheats, Exploits & Macros - 43 Replies About M² Starter
That software bypass the patcher, it don't bypass the hackshield!
This application works for GameForge and every P-Server.
https://www.virustotal.com/static/img/logo-small. png
0/46
Tarvos Starter Service 02/11/2013 - Metin2 Trading - 5 Replies Service vorübergehend Geschlossen weil ich nur wenig Zeit habe.
Was biete ich hier genau an?
Charakter startet bei Level 30
Gewünschtes Reich/Rasse/Skillung
Mindestens 500k Yang zzgl. aller Drops
Einige Equip Teile +6
[Release]Metin2 Starter 02/04/2013 - Metin2 Hacks, Bots, Cheats, Exploits & Macros - 11 Replies Hi
ich habe gerade ein Programm gemacht das für folgende Server geeignet ist:
- Singapur
- Deutschland
- DarkFusion3
- Alle anderen mit Standard Start Funktion
es hat eine intigrierte Patch Funktion und Funktioniert nach jedem Update Problemlos
[RELEASE] Rappelz Starter 07/27/2011 - Rappelz - 9 Replies Hallo liebe epvp'ers,
ich weiß, eigentlich gehören Releases in die Release Section, allerdings halte ich es hier für sinnvoller, da es ein Tool für Rappelz ist.
Wir, JP Gaming, möchten einen Starter für Rappelz PServer releasen.
So sieht der gute aus:
Interface
http://spiel.justproject.eu/wartung/first.png
[Release] v12 + v13 Starter pack 02/18/2009 - Flyff PServer Guides & Releases - 49 Replies Hi Elitepvpers
Rikkami sagte mir, ich könne die DB uploaden, nur die Core nicht.
Ich habe mich mal etwas an aldimasters flyff DB gesetzt und mal die fehlenden Sachen Editiert
Zudem wirds den Client von mir geben,damit ihr alle Items und Mobs auch "benutzen" könnt
Und Serverfiles gibts noch obendrauf
Was jetzt drinne ist :
Alle V12 + V13 Mobs (Mit Orginal Stats xP) - Die alten natürlich auch ^^