Jump to content
  • 0

Interlude Vanganth and Dynamic IP


Question

Posted

Basically i need to setup a L2OFF server with a dynamic ip(this ip changes every time that the modem restarts)

I have a no-ip service,and vangath files ,so i use a noip of 15 letters (it can't containt more than 15 lettters on the dbo.server table)

Example serv67.ddns.net

So When Hauth Loads the server it says External IP "127.0.0.1" ,why not  serv67.ddns.net?

No problem i tried to log in the server but it get stucked on the server seleccion screen.

Both ports are open

 

 

1555.jpg

11 answers to this question

Recommended Posts

  • 0
Posted
14 hours ago, maxicroma said:

The Hauthd have a reload option ,there its some way to call this function every x time ?

 

Probably there is some way but this is much easier:

#!/usr/bin/env python

from urllib import urlopen
from json import loads
from sys import stderr
from time import sleep
from subprocess import Popen
from socket import inet_aton
from threading import Thread

period = 60.0 # seconds
serverId = 1 # server ID
sqlcmd = "C:\\Program Files (x86)\\Microsoft SQL Server\\Client SDK\\ODBC\\130\\Tools\\Binn\\SQLCMD.EXE" # put correct path here!
server = "(local)\SQLExpress" # put correct server string here!
database = "lin2db" # database name
hauthd = "C:\\l2\\auth\\hauthd.exe" # put correct path here!

class HauthdThread(Thread):
	def __init__(self):
		Thread.__init__(self)
		self.hauthdProcess = None
		self.doRun = True

	def run(self):
		while self.doRun:
			self.hauthdProcess = Popen([hauthd])
			self.hauthdProcess.wait()
			self.hauthdProcess = None

	def stop(self):
		self.doRun = False
		if self.hauthdProcess != None: self.hauthdProcess.kill()

	def restart(self):
		self.hauthdProcess.kill()

currentIp = None
ipUpdated = False
hauthdThread = None

try:
	while True:
		try:
			newIp = loads(urlopen("https://api.ipify.org?format=json").read())["ip"]
			if newIp != currentIp:
				inet_aton(newIp) # check IP
				print >> stderr, "New IP address:", newIp
				currentIp = newIp
				isUpdated = False
		except KeyboardInterrupt, e:
			raise
		except:
			print >> stderr, "Couldn't get current IP address, will retry later"
			sleep(period)
			continue

		if isUpdated:
			sleep(period)
			continue

		try:
			popen = Popen([sqlcmd, "-S", server, "-d", database, "-Q", "UPDATE dbo.server SET ip='%s' WHERE id=%s" % (currentIp, serverId, )], shell = True)
			popen.wait()
			isUpdated = True
			if hauthdThread == None:
				hauthdThread = HauthdThread()
				hauthdThread.start()
			else:
				hauthdThread.restart()
		except KeyboardInterrupt, e:
			raise
		except:
			print >> stderr, "Couldn't update IP address, will try later"

		sleep(period)
except:
	hauthdThread.stop()
	hauthdThread.join()
	raise

 

  • 0
Posted

LOL ... in the table place the actual ip of your dedicated.
And point the NO-IP to your dedicated, simple ip.

You do not need to put the ip of your DDNS or NO-IP in the settings, settling to point to pro IP enough.

So simple and they break the head with it!

  • 0
Posted (edited)
#!/usr/bin/env python

from urllib import urlopen
from json import loads
from sys import stderr
from time import sleep
from subprocess import Popen
from socket import inet_aton

period = 60.0 # seconds
serverId = 1 # server ID
sqlcmd = "C:\\Program Files (x86)\\Microsoft SQL Server\\Client SDK\\ODBC\\130\\Tools\\Binn\\SQLCMD.EXE" # put correct path here!
server = "(local)\SQLExpress" # put correct server string here!
database = "lin2db" # database name

currentIp = None
ipUpdated = False

while True:
	try:
		newIp = loads(urlopen("https://api.ipify.org?format=json").read())["ip"]
		if newIp != currentIp:
			inet_aton(newIp) # check IP
			print >> stderr, "New IP address:", newIp
			currentIp = newIp
			isUpdated = False
	except KeyboardInterrupt, e:
		raise
	except:
		print >> stderr, "Couldn't get current IP address, will retry later"
		sleep(period)
		continue

	if isUpdated:
		sleep(period)
		continue

	try:
		popen = Popen([sqlcmd, "-S", server, "-d", database, "-Q", "UPDATE dbo.server SET ip='%s' WHERE id=%s" % (currentIp, serverId, )], shell = True)
		popen.wait()
		isUpdated = True
	except KeyboardInterrupt, e:
		raise
	except:
		print >> stderr, "Couldn't update IP address, will try later"

	sleep(period)

 

EDIT: You'll also need to restart hauthd somehow...

Edited by eressea
  • 0
Posted

Pase por el mismo problema con advext64 y te comento como funciona. Tu licencia se asocia a una direccion IP o dominio, ahi es cuando te registras en NO-IP, te dan un dominio gratuito y dentro de la pagina de NO-ip le asignas tu IP de ISP. (cualesmiip)... Esta misma ip la pones en el campo IP en dbo.server.  Ej

 

NO-IP:

hostname: l2xx.ddns.net

IP / TARGET: le pones el ip de tu isp  (cualesmiip).

 

En la base de datos, en IP pones tu ip de ISP tambien. 

  • 0
Posted
5 hours ago, eressea said:

#!/usr/bin/env python

from urllib import urlopen
from json import loads
from sys import stderr
from time import sleep
from subprocess import Popen
from socket import inet_aton

period = 60.0 # seconds
serverId = 1 # server ID
sqlcmd = "C:\\Program Files (x86)\\Microsoft SQL Server\\Client SDK\\ODBC\\130\\Tools\\Binn\\SQLCMD.EXE" # put correct path here!
server = "(local)\SQLExpress" # put correct server string here!
database = "lin2db" # database name

currentIp = None
ipUpdated = False

while True:
	try:
		newIp = loads(urlopen("https://api.ipify.org?format=json").read())["ip"]
		if newIp != currentIp:
			inet_aton(newIp) # check IP
			print >> stderr, "New IP address:", newIp
			currentIp = newIp
			isUpdated = False
	except KeyboardInterrupt, e:
		raise
	except:
		print >> stderr, "Couldn't get current IP address, will retry later"
		sleep(period)
		continue

	if isUpdated:
		sleep(period)
		continue

	try:
		popen = Popen([sqlcmd, "-S", server, "-d", database, "-Q", "UPDATE dbo.server SET ip='%s' WHERE id=%s" % (currentIp, serverId, )], shell = True)
		popen.wait()
		isUpdated = True
	except KeyboardInterrupt, e:
		raise
	except:
		print >> stderr, "Couldn't update IP address, will try later"

	sleep(period)

 

EDIT: You'll also need to restart hauthd somehow...

The Hauthd have a reload option ,there its some way to call this function every x time ?

  • 0
Posted
13 hours ago, eressea said:

 

Probably there is some way but this is much easier:


#!/usr/bin/env python

from urllib import urlopen
from json import loads
from sys import stderr
from time import sleep
from subprocess import Popen
from socket import inet_aton
from threading import Thread

period = 60.0 # seconds
serverId = 1 # server ID
sqlcmd = "C:\\Program Files (x86)\\Microsoft SQL Server\\Client SDK\\ODBC\\130\\Tools\\Binn\\SQLCMD.EXE" # put correct path here!
server = "(local)\SQLExpress" # put correct server string here!
database = "lin2db" # database name
hauthd = "C:\\l2\\auth\\hauthd.exe" # put correct path here!

class HauthdThread(Thread):
	def __init__(self):
		Thread.__init__(self)
		self.hauthdProcess = None
		self.doRun = True

	def run(self):
		while self.doRun:
			self.hauthdProcess = Popen([hauthd])
			self.hauthdProcess.wait()
			self.hauthdProcess = None

	def stop(self):
		self.doRun = False
		if self.hauthdProcess != None: self.hauthdProcess.kill()

	def restart(self):
		self.hauthdProcess.kill()

currentIp = None
ipUpdated = False
hauthdThread = None

try:
	while True:
		try:
			newIp = loads(urlopen("https://api.ipify.org?format=json").read())["ip"]
			if newIp != currentIp:
				inet_aton(newIp) # check IP
				print >> stderr, "New IP address:", newIp
				currentIp = newIp
				isUpdated = False
		except KeyboardInterrupt, e:
			raise
		except:
			print >> stderr, "Couldn't get current IP address, will retry later"
			sleep(period)
			continue

		if isUpdated:
			sleep(period)
			continue

		try:
			popen = Popen([sqlcmd, "-S", server, "-d", database, "-Q", "UPDATE dbo.server SET ip='%s' WHERE id=%s" % (currentIp, serverId, )], shell = True)
			popen.wait()
			isUpdated = True
			if hauthdThread == None:
				hauthdThread = HauthdThread()
				hauthdThread.start()
			else:
				hauthdThread.restart()
		except KeyboardInterrupt, e:
			raise
		except:
			print >> stderr, "Couldn't update IP address, will try later"

		sleep(period)
except:
	hauthdThread.stop()
	hauthdThread.join()
	raise

 

Great how should i run this script ,(seriously ,have no idea )?

  • 0
Posted
4 hours ago, maxicroma said:

Great how should i run this script ,(seriously ,have no idea )?

 

Download and install Python 2.7 https://www.python.org/downloads/release/python-2715/ - use Windows x86-64 MSI installer.

Then just run the script as if it was normal application.

  • 0
Posted
3 hours ago, eressea said:

 

Download and install Python 2.7 https://www.python.org/downloads/release/python-2715/ - use Windows x86-64 MSI installer.

Then just run the script as if it was normal application.

Awesome its working ,thx you dude :)

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


  • Posts

    • LF the following chars / items on chronos   Elf - with class Aeore's Shillen Saint - this is possible if you had done a class change with a ticket in the past. Dwarf - with class Mystic Muse - same as above   Any greater jewels / Radiant Circle Grace or Foresight +5 and above Cloak      
    • First, you need to understand what you're doing and what you want to achieve. You have to choose a server core. After that, decide what you want your server to include, code it, modify the client to fit your server, go public, and drink champagne.   If you know how to code, creating a server is relatively easy — a few months of work and you can make it happen. Modifying the client is a completely different story. There’s a lack of tutorials, tools, and source materials. I’m currently working on the client myself, and I’ve already spent over three weeks just trying to get started due to the lack of information. If you don’t have the knowledge and experience, you’ll need a team and a bag of money — but realistically, it just won’t succeed.
    • The server has been online and stable for over 2 months now, and we’re still going strong! No wipes, no shortcuts ~ just continuous work, daily fixes, events, and improvements to ensure the best possible experience.   Great News! 🔥 CHAPTER II IS COMING — GRACIA FINAL 🔥 On February 16, L2Elixir enters a new era. The server will be officially updated to Gracia Final, opening Chapter II of our journey. Expect new content, improvements, and surprises that will refresh the gameplay while keeping the classic Gracia Final spirit alive.   More challenges, more competition, and more reasons to log in.   📅 Update Date: February 16 ⚔️ Chapter II: Gracia Final This is not a reset. This is evolution.   Prepare yourselves — Chapter II begins soon.   Website: https://l2elixir.org/ Discord: https://discord.gg/5ydPHvhbxs    
    • Server owners, Top.MaxCheaters.com is now live and accepting Lineage 2 server listings. There is no voting, no rankings manipulation, and no paid advantages. Visibility is clean and equal, and early listings naturally appear at the top while the platform grows. If your server is active, it should already be listed. Submit here 👉https://Top.MaxCheaters.com This platform is part of the MaxCheaters.com network and is being built as a long-term reference point for the Lineage 2 community. — MaxCheaters.com Team
  • Topics

×
×
  • Create New...

Important Information

This community uses essential cookies to function properly. Non-essential cookies and third-party services are used only with your consent. Read our Privacy Policy and We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue..