Jump to content

Recommended Posts

Hello m2dev, as you may know we all like old metin2 stuff and such, and once I asked what was PassPod and Newcibn, as some of you saw I tried to implement a count on the home tab and although I managed to make some progress, I didn't know how to make it work properly, until today. It's something simple, maybe a silly thing but I like this kind of things, so I will facilitate the function for whoever is interested. Let's get to it.

The post with question:

1º Open your Src client and add on Locale_inc.h:

#define ENABLE_CUENTA_ATRAS_LOGIN //Time Back Login Like Chinese version

2ºNow open PythonApplicationModule.py and add:

#ifdef ENABLE_CUENTA_ATRAS_LOGIN
PyModule_AddIntConstant(poModule, "ENABLE_CUENTA_ATRAS_LOGIN", 1);
#else
PyModule_AddIntConstant(poModule, "ENABLE_CUENTA_ATRAS_LOGIN", 0);
#endif

3ºCompile, replace .exe and go to root folder, and open ConstInfo.py:

#Add:
if app.ENABLE_CUENTA_ATRAS_LOGIN:
	LOGIN_UI_MODIFY = True

4ºNow Open NetworkModule.py find and replace:

	def Connect(self):		
		import constInfo
		if app.ENABLE_CUENTA_ATRAS_LOGIN:
			result = False
			if constInfo.KEEP_ACCOUNT_CONNETION_ENABLE:
				result = net.ConnectToAccountServer(self.addr, self.port, self.account_addr, self.account_port)
			else:
				result = net.ConnectTCP(self.addr, self.port)

			return result
		else:
			if constInfo.KEEP_ACCOUNT_CONNETION_ENABLE:
				net.ConnectToAccountServer(self.addr, self.port, self.account_addr, self.account_port)
			else:
				net.ConnectTCP(self.addr, self.port)

5ºNow open intrologin.py and find localeInfo.IsYMIR() or wherever you use:

#Replace or adapt:
elif localeInfo.IsYMIR() or localeInfo.IsCHEONMA() or constInfo.LOGIN_UI_MODIFY:
	if app.ENABLE_CUENTA_ATRAS_LOGIN:
		LOGIN_DELAY_SEC = 10.0 #Change time 10 seconds default
		FULL_BACK_IMAGE = False

elif localeInfo.IsBRAZIL() or constInfo.LOGIN_UI_MODIFY:
	if app.ENABLE_CUENTA_ATRAS_LOGIN:
		LOGIN_DELAY_SEC = 10.0 #Change time 10 seconds default
	else:
		LOGIN_DELAY_SEC = 60.0

6ºNow add after def OnEndCountDown(self):

	def OnEndCountDown(self):
		[...]

	if app.ENABLE_CUENTA_ATRAS_LOGIN:
		def SetNowCountDown(self, value):
			self.isNowCountDown = value

7ºOn def Connect comment this:

	def Connect(self, id, pwd):

		if constInfo.SEQUENCE_PACKET_ENABLE:
			net.SetPacketSequenceMode()

		if IsLoginDelay():
			loginDelay = GetLoginDelay()
			self.connectingDialog = ConnectingDialog()
			self.connectingDialog.Open(loginDelay)
			self.connectingDialog.SAFE_SetTimeOverEvent(self.OnEndCountDown)
			self.connectingDialog.SAFE_SetExitEvent(self.OnPressExitKey)
			self.isNowCountDown = True

		else:
			self.stream.popupWindow.Close()
			self.stream.popupWindow.Open(localeInfo.LOGIN_CONNETING, self.SetPasswordEditLineFocus, localeInfo.UI_CANCEL)

		self.stream.SetLoginInfo(id, pwd)
		#self.stream.Connect() #Comentar en cuenta regresiva

8ºCheck if the same function without extra lines, if you have other code, remove and put like this:

	def OnUpdate(self):
		ServerStateChecker.Update()

Finish!!:

bMSua.gif

#Mini Update -> Open intrologin.py and find 'def OnEndCountDown(self): and add or replace:

	def OnEndCountDown(self):
		self.isNowCountDown = False
		if localeInfo.IsBRAZIL():
			self.timeOutMsg = True
		else:
			self.timeOutMsg = False
		snd.PlaySound("sound/ui/loginok.wav") #Sound
		self.PopupDisplayMessage(localeInfo.LOGIN_PROCESSING) #Second Message
		self.stream.Connect() #Connection

#Update gif:

.gif

Special thanks to @ Gurgarath for explaining to me at the time what me what is PassPod/Newcibn, enjoy 🙂 btw if you know other better method please tell me. Regards.

Edited by Nazox
Core X - External 2 Internal
  • Metin2 Dev 2

KH.jpg

Nicks: Nazox™ Krone™ Nagato™ Yahiko™ Yakiro™
Proyecto: Trabajando en el.
Compañeros & firma: DreamHQ  - 2009-2015 [Nostalgia]

Link to comment
https://metin2.dev/topic/33604-passpodnewcibn-working-similar/
Share on other sites

  • Active+ Member

I’ve seen something like that on another server, but it was a bit different. It only displayed the time required to log in — a 10-second countdown. However, it usually took only about 3 seconds to log in, and then you were logged in. If the server was offline, the countdown just went down to 0. It felt more user-friendly than the countdown you showed here. But good job.

  • Love 1

I'll be always helpful!  😉

On 4/1/2025 at 8:01 PM, ReFresh said:

I’ve seen something like that on another server, but it was a bit different. It only displayed the time required to log in — a 10-second countdown. However, it usually took only about 3 seconds to log in, and then you were logged in. If the server was offline, the countdown just went down to 0. It felt more user-friendly than the countdown you showed here. But good job.

Thanks!! Yes, the first version I made in the first post, apart from having too much useless code something similar happened to me, it showed the countdown but it entered instantly, I didn't want this, this happens, because although it started a counter, it independently executed 'self.stream. Connect()' in 'def Connect' The 2 version I made was in c++ but to avoid this I modified parts like the SetStateCheck, but it gave me many problems, finally, it was too much absurd and problematic code, so when I saw the system that shows the amount of players per ch (don't ask me why XD) I came up with this way, I use a mix of the 2, c++ + certain lines from my first version, and I got the counter to work and configured it so that if or if you wait the seconds, I am currently trying to add the later messages of 'You are connected to te server' etc, after the 0 as it has a mini delay, #I updated now you can listen the sound and  see the processing message.

Edited by Nazox
update message

KH.jpg

Nicks: Nazox™ Krone™ Nagato™ Yahiko™ Yakiro™
Proyecto: Trabajando en el.
Compañeros & firma: DreamHQ  - 2009-2015 [Nostalgia]

Don't use any images from : imgur, turkmmop, freakgamers, inforge, hizliresim... Or your content will be deleted without notice...
Use : https://metin2.download/media/add/

Please use https://metin2.download/ when uploading files smaller than 100MB, otherwise the approval will take longer due to manual upload.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / 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.