- Joined
- Aug 10, 2006
- Messages
- 429
- Reaction score
- 119
As long as i have been running small priston tale servers, i have always had a dynamic ip address on my test server, this i use for good rl friends to connect and private testing. This has always been a problem as i have constantly had to keep giving people my ip address whenever it changes. I have written a piece of code that will get the ip of the server from its dynamic web address. I use no-ip. You can add this piece of code into a launcher to make it work that way if you wish. You can even change the string to a secure string so that it cant be hexed out easily. Here is the code.
Dns.GetHostEntry("openpt.servegame.com")
change the address within there to get what you are looking for. If you wish to add this into a launcher such as mine you will have to do something like:
Code:
Imports System.Net
Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Try
Dim iphost As IPHostEntry = Dns.GetHostEntry("openpt.servegame.com")
Dim ipreturn = iphost.AddressList(0).ToString()
MsgBox("Gzuz's Server ip is currently - " & ipreturn, vbInformation, "IP Tester")
End
Catch ex As Exception
MsgBox(ex)
End Try
End Sub
End Class
Dns.GetHostEntry("openpt.servegame.com")
change the address within there to get what you are looking for. If you wish to add this into a launcher such as mine you will have to do something like:
Code:
ipaddr = returnip
my.computer.registry.write({location},ipaddr)
my.computer.filesystem.deletefile({location of ptreg.rgx file})
Last edited: