Jump to content

Save Account System


Recommended Posts

M2 Download Center

This is the hidden content, please
( Internal )

Spoiler

172914Immagine.png.671f47d6a3e25201df714


Extract root and open intrologin.py
At the beginning add:

import os
from _winreg import *


Search:

self.loginExitButton        = GetObject("LoginExitButton")


Add:

            self.saveLoginButton        = GetObject("SaveLoginButton")
            self.loadCredentialButton    = GetObject("LoadCredentials")


Finally at the end add:
 

def ICDev_ECRYPT(self,data):
        Data = ''
        for l in data:
            Data = Data+str(int(ord(l) + 2) * 2)+' '
        return Data

    def ICDev_DECRYPT(self,data):
        Data = ''
        data = data.split()
        for l in data:
            Data = Data+chr((int(l) / 2) - 2)
        return Data
 
    def __OnClickSaveLoginButton(self):
        id = self.idEditLine.GetText()
        pwd = self.pwdEditLine.GetText()
        if (len(id) != 0 and len(pwd) != 0):
            if not os.path.exists("SOFTWARE\ICDev"):
                key = CreateKey(HKEY_CURRENT_USER,"SOFTWARE\ICDev")
            SetValueEx(key, "UserID", 0, REG_SZ, self.ICDev_ECRYPT(id))
            SetValueEx(key, "Passwd", 0, REG_SZ, self.ICDev_ECRYPT(pwd))
            CloseKey(key)
            self.PopupNotifyMessage("Datele au fost salvate!",self.SetIDEditLineFocus)
 
 
    def __OnClickLoadInfoButton(self):
        try:
            key = OpenKey(HKEY_CURRENT_USER, "SOFTWARE\ICDev", 0, KEY_ALL_ACCESS)
            self.Connect(self.ICDev_DECRYPT(QueryValueEx(key, "UserID")[0]),self.ICDev_DECRYPT(QueryValueEx(key, "Passwd")[0]))
        except:
            self.PopupNotifyMessage("Nu exista nici un account salvat!",self.SetIDEditLineFocus)


Extract locale_xx and open loginwindow.py
Search:
 

"text" : uiScriptLocale.LOGIN_CONNECT,
                },
            ),
        },

Add: 

        ## userDataBoard
        {
            "name" : "UserDataBoard",
            "type" : "thinboard",

            "x" : (SCREEN_WIDTH - 208) / 2,
            "y" : (SCREEN_HEIGHT - 355),
            "width" : 205,
            "height" : 55,

            "children" :
            (
                {
                    "name" : "SaveLoginButton",
                    "type" : "button",

                    "x" : 10,
                    "y" : 0,
                    "vertical_align" : "center",
                    "default_image" : "d:/ymir work/ui/public/large_button_01.sub",
                   
                    "over_image" : "d:/ymir work/ui/public/large_button_02.sub",
                    "down_image" : "d:/ymir work/ui/public/large_button_03.sub",

                    "text" : uiScriptLocale.LOGIN_SAVE_BUTTON,
                },
                {
                    "name" : "LoadCredentials",
                    "type" : "button",

                    "x" : 105,
                    "y" : 0,
                    "vertical_align" : "center",
                    "default_image" : "d:/ymir work/ui/public/large_button_01.sub",
                   
                    "over_image" : "d:/ymir work/ui/public/large_button_02.sub",
                    "down_image" : "d:/ymir work/ui/public/large_button_03.sub",

                    "text" : uiScriptLocale.LOGIN_LOAD_BUTTON,
                },
            ),
        },

In local_interface.txt (local_xx) add:

LOGIN_SAVE_BUTTON Save 
LOGIN_LOAD_BUTTON Load 

Now add in YourClient/lib: 

This is the hidden content, please

  • Metin2 Dev 112
  • kekw 3
  • Eyes 2
  • Dislove 1
  • Angry 3
  • Not Good 1
  • Smile Tear 2
  • Think 2
  • Confused 2
  • Scream 1
  • Good 44
  • Love 5
  • Love 57
Link to comment
Share on other sites

  • 2 weeks later...
  • 2 weeks later...

i have the error:

1126 11:28:00353 ::   File "
1126 11:28:00353 :: introLogin.py
1126 11:28:00353 :: ", line
1126 11:28:00353 :: 1376
1126 11:28:00353 ::

1126 11:28:00353 ::     
1126 11:28:00353 :: Data = ''

1126 11:28:00353 ::     
1126 11:28:00353 ::  
1126 11:28:00353 ::  
1126 11:28:00353 ::  
1126 11:28:00353 :: ^

1126 11:28:00353 :: IndentationError
1126 11:28:00353 :: :
1126 11:28:00353 :: expected an indented block
1126 11:28:00353 ::

 

Link to comment
Share on other sites

  • 3 months later...
  • 1 year later...
  • 2 years later...
  • Contributor
2 hours ago, Historia said:

I did all the copy & paste stuff. But dont know where do I put the winreg.pyc data? 

Now the Client shut downs, I did put the winreg in filezilla usr/home/game/quest..

why did you put it on serverside, when it is a clientside thing?

Anyway put it to the lib folder clientside (or even root should work).

Edited by TMP4
Link to comment
Share on other sites

  • 1 month later...
  • 2 weeks later...
0306 07:25:00721 :: Traceback (most recent call last):

0306 07:25:00721 ::   File "introLogo.py", line 60, in OnUpdate

0306 07:25:00721 ::   File "networkModule.py", line 177, in SetLoginPhase

0306 07:25:00721 ::   File "system.py", line 130, in __pack_import

0306 07:25:00721 ::   File "
0306 07:25:00721 :: <string>
0306 07:25:00721 :: ", line 
0306 07:25:00721 :: 530
0306 07:25:00722 :: 

0306 07:25:00722 ::     
0306 07:25:00722 :: self.saveLoginButton        = GetObject("SaveLoginButton")

0306 07:25:00722 ::     
0306 07:25:00722 ::  
0306 07:25:00722 ::  
0306 07:25:00722 ::  
0306 07:25:00722 ::  
0306 07:25:00722 ::  
0306 07:25:00722 ::  
0306 07:25:00722 ::  
0306 07:25:00722 ::  
0306 07:25:00722 ::  
0306 07:25:00722 ::  
0306 07:25:00722 ::  
0306 07:25:00722 ::  
0306 07:25:00722 ::  
0306 07:25:00723 ::  
0306 07:25:00723 ::  
0306 07:25:00723 ::  
0306 07:25:00723 ::  
0306 07:25:00723 ::  
0306 07:25:00723 ::  
0306 07:25:00723 ::  
0306 07:25:00723 ::  
0306 07:25:00723 ::  
0306 07:25:00723 ::  
0306 07:25:00723 ::  
0306 07:25:00723 ::  
0306 07:25:00723 ::  
0306 07:25:00723 ::  
0306 07:25:00723 ::  
0306 07:25:00723 ::  
0306 07:25:00723 ::  
0306 07:25:00723 ::  
0306 07:25:00723 ::  
0306 07:25:00724 ::  
0306 07:25:00724 ::  
0306 07:25:00724 ::  
0306 07:25:00724 ::  
0306 07:25:00724 ::  
0306 07:25:00724 ::  
0306 07:25:00724 ::  
0306 07:25:00724 ::  
0306 07:25:00724 ::  
0306 07:25:00724 ::  
0306 07:25:00724 ::  
0306 07:25:00724 ::  
0306 07:25:00724 ::  
0306 07:25:00724 ::  
0306 07:25:00724 ::  
0306 07:25:00724 ::  
0306 07:25:00724 ::  
0306 07:25:00724 ::  
0306 07:25:00724 ::  
0306 07:25:00725 ::  
0306 07:25:00725 ::  
0306 07:25:00725 ::  
0306 07:25:00725 ::  
0306 07:25:00725 ::  
0306 07:25:00725 ::  
0306 07:25:00725 :: ^

0306 07:25:00725 :: IndentationError
0306 07:25:00725 :: : 
0306 07:25:00725 :: unindent does not match any outer indentation level
0306 07:25:00725 :: 

I have blackscreen and this says my client syserr.txt

 

Link to comment
Share on other sites

  • 1 month later...

 With tabs, working for me.

Spoiler

spacer.png

Extract root and open intrologin.py
At the beginning add:

import os
from _winreg import *


Search:

self.loginExitButton		= GetObject("LoginExitButton")


Add:

			self.saveLoginButton		= GetObject("SaveLoginButton")
			self.loadCredentialButton	= GetObject("LoadCredentials")

 

Search

self.pwdEditLine.SetTabEvent(ui.__mem_func__(self.idEditLine.SetFocus))

Add:

self.saveLoginButton.SetEvent(ui.__mem_func__(self.__OnClickSaveLoginButton))
self.loadCredentialButton.SetEvent(ui.__mem_func__(self.__OnClickLoadInfoButton))


Finally at the end add:
 

	def ICDev_ECRYPT(self,data):
		Data = ''
		for l in data:
			Data = Data+str(int(ord(l) + 2) * 2)+' '
		return Data

	def ICDev_DECRYPT(self,data):
		Data = ''
		data = data.split()
		for l in data:
			Data = Data+chr((int(l) / 2) - 2)
		return Data
 
	def __OnClickSaveLoginButton(self):
		id = self.idEditLine.GetText()
		pwd = self.pwdEditLine.GetText()
		if (len(id) != 0 and len(pwd) != 0):
			if not os.path.exists("SOFTWARE\ICDev"):
				key = CreateKey(HKEY_CURRENT_USER,"SOFTWARE\ICDev")
			SetValueEx(key, "UserID", 0, REG_SZ, self.ICDev_ECRYPT(id))
			SetValueEx(key, "Passwd", 0, REG_SZ, self.ICDev_ECRYPT(pwd))
			CloseKey(key)
			self.PopupNotifyMessage("Saved successfully.",self.SetIDEditLineFocus)
            
	def __OnClickLoadInfoButton(self):
		try:
			key = OpenKey(HKEY_CURRENT_USER, "SOFTWARE\ICDev", 0, KEY_ALL_ACCESS)
			self.Connect(self.ICDev_DECRYPT(QueryValueEx(key, "UserID")[0]),self.ICDev_DECRYPT(QueryValueEx(key, "Passwd")[0]))
		except:
			self.PopupNotifyMessage("Save before load.",self.SetIDEditLineFocus)


Extract locale_xx and open loginwindow.py
Search:
 

					"text" : uiScriptLocale.LOGIN_EXIT,
				},
			),
		},

Add: 

		## userDataBoard
		{
			"name" : "UserDataBoard",
			"type" : "thinboard",

			"x" : (SCREEN_WIDTH - 208) / 2,
			"y" : (SCREEN_HEIGHT - 410 - 70),
			"width" : 208,
			"height" : 35,

			"children" :
			(
				{
					"name" : "SaveLoginButton",
					"type" : "button",

					"x" : 10,
					"y" : 0,
					"vertical_align" : "center",
					"default_image" : "d:/ymir work/ui/public/large_button_01.sub",
				   
					"over_image" : "d:/ymir work/ui/public/large_button_02.sub",
					"down_image" : "d:/ymir work/ui/public/large_button_03.sub",

					"text" : uiScriptLocale.LOGIN_SAVE_BUTTON,
				},
				{
					"name" : "LoadCredentials",
					"type" : "button",

					"x" : 105,
					"y" : 0,
					"vertical_align" : "center",
					"default_image" : "d:/ymir work/ui/public/large_button_01.sub",
				   
					"over_image" : "d:/ymir work/ui/public/large_button_02.sub",
					"down_image" : "d:/ymir work/ui/public/large_button_03.sub",

					"text" : uiScriptLocale.LOGIN_LOAD_BUTTON,
				},
			),
		},

In local_interface.txt (local_xx) add:

LOGIN_SAVE_BUTTON	Save
LOGIN_LOAD_BUTTON	Load
Edited by Metin2 Dev
Core X - External 2 Internal
Link to comment
Share on other sites

  • 1 month later...

Hello i have this problem please help me
 

0609 20:19:00880 :: 
introLogin.py(line:533) __LoadScript
ui.py(line:2704) GetChild

LoginWindow.__LoadScript.BindObject - <type 'exceptions.KeyError'>:'SaveLoginButton'

0609 20:19:00880 :: ============================================================================================================
0609 20:19:00880 :: Abort!!!!
 

Link to comment
Share on other sites

Announcements



×
×
  • 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.