Server Disconect (how to)
If you need help with a project or need to know how to do something specific in VB.NET then please ask your questions in here.
Forum rules
Please LOCK your topics once you have found the solution to your question so we know you no longer require help with your query.
Please LOCK your topics once you have found the solution to your question so we know you no longer require help with your query.
10 posts
Page 1 of 1
hello i have this code for launching minecraft to a server straight away
Code: Select all
but what i now want to know is, is their a way to make it so if a player disconects from that server to attempt single player is their a way to kill the game or just reconect to server and display a message box saying sorry you can not do that Process.Start(My.Settings.Minecraft_loc, String.Format("{0} {1} {2}", Label4.Text, "12345", My.Settings.server_ip))
you need to know the command line argument for that,
suppose the argument is -d for disconnect, the the code will be
Process.Start(My.Settings.Minecraft_loc, "-c")
suppose the argument is -d for disconnect, the the code will be
Process.Start(My.Settings.Minecraft_loc, "-c")
nope it aint were would it be inside the main jar file its for minecraft so
what do you mean, there is no documentation?
well, then you have to quit the process:
you can do this:
Dim server As New Process
server = Process.Start("MINECRAFT_SERVER.jar", "-connect")
server.Kill()
well, then you have to quit the process:
you can do this:
Dim server As New Process
server = Process.Start("MINECRAFT_SERVER.jar", "-connect")
server.Kill()
sorry modify the code like this
Dim server as Process
server = Process.Start(My.Settings.Minecraft_loc, String.Format("{0} {1} {2}", Label4.Text, "12345", My.Settings.server_ip) 'The code for connecting
'For Disconnecting:
server.Kill()
Dim server as Process
server = Process.Start(My.Settings.Minecraft_loc, String.Format("{0} {1} {2}", Label4.Text, "12345", My.Settings.server_ip) 'The code for connecting
'For Disconnecting:
server.Kill()
For reconnecting
kill the process with server.Kill() and then re-execute the connection bit i.e. server = Process.Start()
kill the process with server.Kill() and then re-execute the connection bit i.e. server = Process.Start()
i will try taht but allow me to explain my self better what i want to do is make a mincraft launcher that will launch staight to my server and then make it so if a user pressed the esc button and click the disconect button on that menu the program runing in the background will see this and restart the game back to the server and show a message box saying you cant do this
then you have to find each thread on which the JAR relies, then scan them for activity, if there is a disconnection activity then restart the server. that can get a little complicated if you are a amateur programmer.
10 posts
Page 1 of 1
Copyright Information
Copyright © Codenstuff.com 2020 - 2023