Arkadaşlar Öncelikle Video Koydum
Paylaşım Olarak Sanırım Herkezin Tarzına Uygun
Güzel Olacağına inanıyorum
Bu Sistemsiz Pvp Server Kalmaz Diye Düşünüyorum.
Kayıt Sistemi Yapımı: :ka19:
1. intrologin.py
2. introselect.py
1. Dosyamız Açılır.
İmport Kısıma Ekleyin.
VIRTUAL_KEYBOARD_RAND_KEY = TRUE |Aratılır
Atına Eklenir.
def __init__(self, stream): |içide.
net.SetAccountConnectorHandler(self) Altına
Eklenir.
self.loadingImage = None | Aratılır.
Altına Eklenir.
def __del__(self): Aratın Resimdeki Gibi Ekleyin.
[/CENTER]
Altına Ekleyin..
global SKIP_LOGIN_PHASE içinde
self.serverBoard.Hide() Aratılır. Return Altında Yere Ekleyin.
Altına Eklenir.
self.connectBoard = None Aratılır.
Altına Ekleyin.
ime.ClearExceptKey() Aratılır.
Altına Eklenir.
self.loginExitButton = GetObject("LoginExitButton") |Aratılır..
Bulunamadı Diyorsa ("LoginExitButton") Aratın.
Altına Ekleyin.
self.pwdEditLine.SetTabEvent(ui.__mem_func__(self. idEditLine.SetFocus)) |Aratılır..
Altına Ekleyin.
self.stream.popupWindow.Open(locale.LOGIN_CONNETIN G, self.SetPasswordEditLineFocus, locale.UI_CANCEL
Aratılır.
Eklenir. Altında 2 Kod daha Olacaktır.
self.stream.SetLoginInfo(id, pwd)
self.stream.Connect()
Bunlar normalde Olan Kodlardır Bunlara Değişiklik Yapmıyoruz.(Bilgi)
def __SetServerInfo(self, name): |Aratılır.
Altına Eklenir.
def __LoadLoginInfo | Aratılır Kopmle Değiştirilmeli.
Değiştirilir.
def __OnClickMatrixAnswerCancel(self): |Aratın içinde
self.loginBoard.Show() |Aratın
Altına Ekleyin.
def __OnClickNEWCIBNPasspodAnswerCancel(self): |Aratılır içinde
self.loginBoard.Show() | Aratılır
Altına Eklenir.
def __OnCloseInputDialog(self): | Aratılır
def OnPressExitKey(self): Düzenleyin Yada Değiştirin.
Değiştirilir.
self.serverBoard.SetPosition(self.xServerBoard, self.yServerBoard) | Aratılır..
Altına Eklenir.
self.virtualKeyboard.Hide() |Aratılır altına
self.showBoard.Hide()
Eklenir.
elif not self.stream.isAutoLogin: Aratılır içinde
self.loginBoard.Show() Aratılır
self.__RefreshAccountSystem()
Altına Eklenir.
def __OnClickLoginButton(self): Aratın içinde
self.Connect(id, pwd) Bu Kodu Bulun Altına Verdiğim Tüm Kodları Ekleyin.
1. Ekelemeler Bitti.
2. Eklenecek Dosyamızı Açalım.
importların En Altına. Eklenir.
self.btnExit = GetObject("exit_button") |Aratılır..
Altına Eklenir.
self.btnRight.SetEvent(ui.__mem_func__(self.Increa seSlotIndex)) || Aratılır..
Altına Eklenir.
self.chrRenderer.Show() Aratılır
return 1 Altında Bu Kod vardır.
Aşağıdaki Kodlar.
def MakeCharacter 'e Kadar Eklenir.
chr.PushOnceMotion(chr.MOTION_INTRO_NOT_SELECTED, 0.1)
Aratılır..
Alt Kısıma Eklenir.
if LEAVE_BUTTON_FOR_POTAL: |Aratılır içinde
self.stream.SetLoginPhase() Aratılır
self.Hide() ||Kadar Eklenir.
if 4 == key: Aratılır
if 5 == key:
self.SelectSlot(3)
if 28 == key or 156 == key: |Değiştirin.
Altına eklenir.
Bitti.
Bir Teşekkür Etmeyi Ihmal Etmeyelim Sabitlik için Ne Gerekir.
40K Client Yapımı Eklenmiştir.
Metin2 Lobby olarak Metin2 Private Server geliştirmeye odaklı bir platformsunuz. Bu bağlamda sunucularınızda oyuncuların güvenli ve kolay bir şekilde hesap oluşturabilmesi için sağlam bir hesap kayıt sistemi kurmak oldukça kritik bir adımdır. Bu yazıda, Python dilini kullanarak nasıl bir kayıt sistemi geliştirilebileceğini detaylıca ele alacağız.
Python dili özellikle backend işlemlerinde kolay kullanım, güçlü kütüphaneleri ve okunabilirliği ile öne çıkar. Metin2 sunucularında Auth sunucusu ile entegre çalışacak bir kayıt sistemi oluşturmak, hem güvenlik hem de kullanıcı deneyimi açısından büyük önem taşır.
Kayıt Sisteminin Temel Özellikleri
Bir hesap kayıt sistemi geliştirilirken dikkat edilmesi gereken temel başlıklar şunlardır:
- Güvenli parola hashing (SHA-256, bcrypt gibi)
- E-posta onayı (isteğe bağlı)
- Spam koruma (Captcha entegrasyonu)
- IP bazlı giriş sınırlaması
- Veritabanı bağlantısı (MySQL, SQLite vb.)
Python ile Basit Bir Kayıt Sistemi Örneği
Aşağıda basit bir Python tabanlı kayıt sistemi örneği verilmiştir. Bu sistem, kullanıcıdan gelen verileri doğrular, parolayı hash'ler ve veritabanına kaydeder.
Metin2 Sunucularında Kullanım Senaryosu
Bu Python modülü, Metin2 Auth sunucusuna entegre edilebilir veya bağımsız bir web arayüzü üzerinden çalıştırılabilir. Py GUI[/COORD] ya da Flask gibi kütüphaneler ile kullanıcı dostu bir arayüz oluşturulabilir.
Gelişmiş Özellikler
Daha gelişmiş bir sistemde aşağıdaki özellikler eklenebilir:
- Otomatik spam tespiti
- OTP doğrulama
- API entegrasyonları
- IP engelleme listesi
Sonuç
Python kullanarak Metin2 özel sunucuları için geliştirilen hesap kayıt sistemi, hem geliştirici dostu hem de güvenlidir. Metin2 Lobby olarak bu tür sistemleri paylaşmak, topluluğun gelişimine katkı sağlar. Core[/COORD], DB Core[/COORD] ve Game Server Programming[/COORD] konularında daha fazla örnek paylaşımı yapmaya devam edeceğiz.
Metin2 Lobby operates as a platform focused on Metin2 Private Server development. In this context, establishing a reliable account registration system that allows players to securely and easily create accounts on your servers is a critical step. This article will detail how to develop such a registration system using the Python language.
Python stands out especially in backend operations due to its ease of use, powerful libraries, and readability. Creating a registration system integrated with the Auth server for Metin2 servers is vital in terms of both security and user experience.
Key Features of a Registration System
When developing a account registration system, the following main points should be considered:
- Secure password hashing (SHA-256, bcrypt, etc.)
- Email verification (optional)
- Spam protection (Captcha integration)
- IP-based login limitations
- Database connection (MySQL, SQLite, etc.)
Simple Registration System Example with Python
Below is a basic Python-based registration system example. This system validates incoming data from the user, hashes the password, and stores it in the database.
Usage Scenario in Metin2 Servers
This Python module can be integrated into the Metin2 Auth server or run through an independent web interface. User-friendly interfaces can be created using libraries like Py GUI or Flask.
Advanced Features
In a more advanced system, the following features could be added:
- Automatic spam detection
- OTP verification
- API integrations
- IP blocking lists
Conclusion
An account registration system developed using Python for Metin2 private servers is both developer-friendly and secure. As Metin2 Lobby, sharing such systems contributes to community growth. We will continue to share more examples regarding Core, DB Core, and Game Server Programming.
Paylaşım Olarak Sanırım Herkezin Tarzına Uygun
Güzel Olacağına inanıyorum
Bu Sistemsiz Pvp Server Kalmaz Diye Düşünüyorum.
Kayıt Sistemi Yapımı: :ka19:
1. intrologin.py
2. introselect.py
1. Dosyamız Açılır.
Kod:
import os import grp import textTail import uiPhaseCurtain from binascii import unhexlify as unhex import cPickle import crypt
İmport Kısıma Ekleyin.
VIRTUAL_KEYBOARD_RAND_KEY = TRUE |Aratılır
Kod:
FACE_IMAGE_DICT = { 0 : "icon/face/warrior_m.tga", 1 : "icon/face/assassin_w.tga", 2 : "icon/face/sura_m.tga", 3 : "icon/face/shaman_w.tga", 4 : "icon/face/warrior_w.tga", 5 : "icon/face/assassin_m.tga", 6 : "icon/face/sura_w.tga", 7 : "icon/face/shaman_m.tga", }
def __init__(self, stream): |içide.
net.SetAccountConnectorHandler(self) Altına
Kod:
self.curtain = uiPhaseCurtain.PhaseCurtain() self.curtain.speed = 0.3 self.curtain.Hide()
self.loadingImage = None | Aratılır.
Kod:
self.loginnedServer = None self.loginnedChannel = None app.loggined = FALSE
def __del__(self): Aratın Resimdeki Gibi Ekleyin.
Kod:
def OnUpdate(self): app.UpdateGame() ServerStateChecker.Update() def OnRender(self): app.RenderGame() grp.PopState() grp.SetInterfaceRenderState() textTail.Render() textTail.HideAllTextTail()
Kod:
self.__LoadLoginInfo("loginInfo.py") Satılır Aratılır ve Silinir.
global SKIP_LOGIN_PHASE içinde
self.serverBoard.Hide() Aratılır. Return Altında Yere Ekleyin.
Kod:
self.__RefreshAccountSystem()
self.connectBoard = None Aratılır.
Kod:
self.AccountBoard = None self.NewAccountBoard = None self.showBoard = None
ime.ClearExceptKey() Aratılır.
Kod:
self.Hide() self.__del__()
self.loginExitButton = GetObject("LoginExitButton") |Aratılır..
Bulunamadı Diyorsa ("LoginExitButton") Aratın.
Kod:
###Account ##AccountBoard self.NewAccountBoard = GetObject("NewAccountBoard") self.showBoard = GetObject("ShowBoard") #Panher: self.AccidEditLine = GetObject("Account_ID_EditLine") self.AccpwEditLine = GetObject("Account_Password_EditLine") self.AccountSaveButton = GetObject("SaveAccountButton") self.AccountBackButton = GetObject("AccountBackButton") self.AccountBoard = GetObject("AccountBoard") self.NewAccount1Button = GetObject("NewAccount1Button") self.NewAccount2Button = GetObject("NewAccount2Button") self.NewAccount3Button = GetObject("NewAccount3Button") self.NewAccount4Button = GetObject("NewAccount4Button") self.Account1Button = GetObject("Account1Button") self.Account2Button = GetObject("Account2Button") self.Account3Button = GetObject("Account3Button") self.Account4Button = GetObject("Account4Button") self.DeleteAccount1Button = GetObject("DeleteAcc1Button") self.DeleteAccount2Button = GetObject("DeleteAcc2Button") self.DeleteAccount3Button = GetObject("DeleteAcc3Button") self.DeleteAccount4Button = GetObject("DeleteAcc4Button") ##Loginlines self.loginBoard = GetObject("LoginBoard") self.idEditLine = GetObject("ID_EditLine") self.pwdEditLine = GetObject("Password_EditLine") self.serverInfo = GetObject("ConnectName") self.selectConnectButton = GetObject("SelectConnectButton") self.loginButton = GetObject("LoginButton") self.loginExitButton = GetObject("LoginExitButton") ##direclogin self.DirectLogin1Button = GetObject("MemoryPg1_button") self.DirectLogin2Button = GetObject("MemoryPg2_button") self.DirectLogin1Icon = GetObject("MemoryPg1_icon") self.DirectLogin2Icon = GetObject("MemoryPg2_icon") self.DirectLogin1Name = GetObject("MemoryPg1_name_txt") self.DirectLogin2Name = GetObject("MemoryPg2_name_txt") self.DirectLogin1Level = GetObject("MemoryPg1_lvl_txt") self.DirectLogin2Level = GetObject("MemoryPg2_lvl_txt") self.Delete1PgDLButton = GetObject("DeletePg1Button") self.Delete2PgDLButton = GetObject("DeletePg2Button")
Altına Ekleyin.
self.pwdEditLine.SetTabEvent(ui.__mem_func__(self. idEditLine.SetFocus)) |Aratılır..
Kod:
##Panher:Account self.NewAccount1Button.SetEvent(lambda : self.__OnClickNewAccountButton(1)) self.NewAccount2Button.SetEvent(lambda : self.__OnClickNewAccountButton(2)) self.NewAccount3Button.SetEvent(lambda : self.__OnClickNewAccountButton(3)) self.NewAccount4Button.SetEvent(lambda : self.__OnClickNewAccountButton(4)) self.AccountBackButton.SetEvent(ui.__mem_func__(self.__OnClickAccountBackButton)) self.AccountSaveButton.SetEvent(ui.__mem_func__(self.__OnClickAccountSaveButton)) self.AccidEditLine.SetReturnEvent(ui.__mem_func__(self.AccpwEditLine.SetFocus)) self.AccidEditLine.SetTabEvent(ui.__mem_func__(self.AccpwEditLine.SetFocus)) self.AccpwEditLine.SetReturnEvent(ui.__mem_func__(self.__OnClickAccountSaveButton)) self.AccpwEditLine.SetTabEvent(ui.__mem_func__(self.AccidEditLine.SetFocus)) self.Account1Button.SetEvent(lambda : self.__OnClickAccountButton(1)) self.Account2Button.SetEvent(lambda : self.__OnClickAccountButton(2)) self.Account3Button.SetEvent(lambda : self.__OnClickAccountButton(3)) self.Account4Button.SetEvent(lambda : self.__OnClickAccountButton(4)) self.DeleteAccount1Button.SetEvent(lambda : self.__OnClickDeleteAccountButton(1)) self.DeleteAccount2Button.SetEvent(lambda : self.__OnClickDeleteAccountButton(2)) self.DeleteAccount3Button.SetEvent(lambda : self.__OnClickDeleteAccountButton(3)) self.DeleteAccount4Button.SetEvent(lambda : self.__OnClickDeleteAccountButton(4)) ##DirectLogin self.DirectLogin1Button.SetEvent(lambda : self.__OnClickDirctLogInButton(1)) self.DirectLogin2Button.SetEvent(lambda : self.__OnClickDirctLogInButton(2)) self.Delete1PgDLButton.SetEvent(lambda : self.__OnClickDeletePgDLButton(1)) self.Delete2PgDLButton.SetEvent(lambda : self.__OnClickDeletePgDLButton(2))
Altına Ekleyin.
self.stream.popupWindow.Open(locale.LOGIN_CONNETIN G, self.SetPasswordEditLineFocus, locale.UI_CANCEL
Aratılır.
Kod:
lastdata = { "lastid": id, "lastpwd": pwd } self.__EncryptLastLoginInfo("lastlogin.cfg", lastdata)
self.stream.SetLoginInfo(id, pwd)
self.stream.Connect()
Bunlar normalde Olan Kodlardır Bunlara Değişiklik Yapmıyoruz.(Bilgi)
def __SetServerInfo(self, name): |Aratılır.
Kod:
def __SaveLoginInfo(self, autoLogin, id, pwd, addr, port, addr2, port2): loginInfoF=open("loginsetting1.cfg", "wb"); if not autoLogin: rememberData=1 else: rememberData=0 data = { "id": id, "pwd": pwd, "addr": addr, "server_name": "UniversalElements", "port": port, "account_addr": addr2, "account_port": port2, "autoSelect": 1, "autoLogin": autoLogin, "rememberData": rememberData } loginInfo = cPickle.dumps(data) dInfo = crypt.triple_des(unhex("F3B720EBDA328EE2190DA9DA9D212E0A8DCBD326CDACBE98")) cryptedInfo = dInfo.encrypt(loginInfo, " ") loginInfoF.write(cryptedInfo) loginInfoF.close()
Altına Eklenir.
def __LoadLoginInfo | Aratılır Kopmle Değiştirilmeli.
Kod:
def __LoadLoginInfo(self, pgInfo): id=pgInfo.get("id", "") pwd=pgInfo.get("pwd", "") net.ACCOUNT_ID = id net.ACCOUNT_PW = pwd if self.IS_TEST: try: addr=pgInfo["addr"] port=pgInfo["port"] account_addr=addr account_port=port net.SetMarkServer(addr, port) self.__SetServerInfo(locale.CHANNEL_TEST_SERVER_ADDR % (addr, port)) except: try: addr=serverInfo.TESTADDR["ip"] port=serverInfo.TESTADDR["tcp_port"] net.SetMarkServer(addr, port) self.__SetServerInfo(locale.CHANNEL_TEST_SERVER) except: import exception exception.Abort("LoginWindow.__LoadLoginInfo - Å×½ºÆ®¼*¹ö ÁÖ¼Ò°¡ ¾ø½À´Ï´Ù") else: addr = pgInfo["addr"] serverName = pgInfo.get("Panher") port = pgInfo.get("port", 0) account_addr = pgInfo["account_addr"] account_port = pgInfo["account_port"] addr=pgInfo.get("addr", "") port=pgInfo.get("port", 0) serverName = pgInfo.get("Panher") account_addr=pgInfo.get("account_addr", addr) account_port=pgInfo.get("account_port", port) if addr and port: net.SetMarkServer(addr, port) net.SetServerInfo(serverName) self.serverInfo.SetText(serverName) slot = pgInfo["slot"] isAutoLogin=pgInfo["autoLogin"] isAutoSelect=pgInfo["autoSelect"] if isAutoLogin: self.stream.SetCharacterSlot(slot) self.stream.SetConnectInfo(addr, port, account_addr, account_port) self.stream.isAutoLogin=isAutoLogin self.stream.isAutoSelect=isAutoSelect self.id = id self.pwd = pwd self.loginnedServer = None self.loginnedChannel = None app.loggined = FALSE if self.id and self.pwd and isAutoLogin: app.loggined = TRUE if isAutoLogin: self.Connect(id, pwd)
Değiştirilir.
def __OnClickMatrixAnswerCancel(self): |Aratın içinde
self.loginBoard.Show() |Aratın
Kod:
self.__RefreshAccountSystem()
def __OnClickNEWCIBNPasspodAnswerCancel(self): |Aratılır içinde
self.loginBoard.Show() | Aratılır
Kod:
self.__RefreshAccountSystem()
def __OnCloseInputDialog(self): | Aratılır
def OnPressExitKey(self): Düzenleyin Yada Değiştirin.
Kod:
def OnPressExitKey(self): [COLOR="#FF0000"] if os.path.exists("lastlogin.cfg"): os.remove("lastlogin.cfg")[/COLOR] self.stream.popupWindow.Close() self.stream.SetPhaseWindow(0) return TRUE
self.serverBoard.SetPosition(self.xServerBoard, self.yServerBoard) | Aratılır..
Kod:
self.NewAccountBoard.Hide()
self.virtualKeyboard.Hide() |Aratılır altına
self.showBoard.Hide()
Eklenir.
elif not self.stream.isAutoLogin: Aratılır içinde
self.loginBoard.Show() Aratılır
self.__RefreshAccountSystem()
Altına Eklenir.
def __OnClickLoginButton(self): Aratın içinde
self.Connect(id, pwd) Bu Kodu Bulun Altına Verdiğim Tüm Kodları Ekleyin.
Kod:
def __EncryptLastLoginInfo(self, fileName, data): loginInfoF=open(fileName, "wb"); loginInfo = cPickle.dumps(data) dInfo = crypt.triple_des(unhex("F3B720EBDA328EE2190DA9DA9D212E0A8DCBD326CDACBE98")) cryptedInfo = dInfo.encrypt(loginInfo, " ") loginInfoF.write(cryptedInfo) loginInfoF.close() def __EncryptLoginInfo(self, fileName, data): datafull = {} if os.path.exists(fileName): self.__DecryptLoginInfo(fileName) for i in xrange(1, 5): if "account" + str(i) in data: self.decryptedLoginInfo["account" + str(i)] = data.get("account" + str(i)) datafull = self.decryptedLoginInfo self.decryptedLoginInfo = None else: for i in xrange(1, 5): if "account" + str(i) in data: datafull["account" + str(i)] = data.get("account" + str(i)) loginInfoF=open(fileName, "wb"); loginInfo = cPickle.dumps(datafull) dInfo = crypt.triple_des(unhex("F3B720EBDA328EE2190DA9DA9D212E0A8DCBD326CDACBE98")) cryptedInfo = dInfo.encrypt(loginInfo, " ") loginInfoF.write(cryptedInfo) loginInfoF.close() def __EncryptLoginAndPgInfo(self, fileName, data): loginInfoF=open(fileName, "wb"); loginInfo = cPickle.dumps(data) dInfo = crypt.triple_des(unhex("F3B720EBDA328EE2190DA9DA9D212E0A8DCBD326CDACBE98")) cryptedInfo = dInfo.encrypt(loginInfo, " ") loginInfoF.write(cryptedInfo) loginInfoF.close() def __DecryptLoginInfo(self, fileName): self.decryptedLoginInfo = {} loginInfoF=open(fileName, "rb"); if not loginInfoF: return dInfo = crypt.triple_des(unhex("F3B720EBDA328EE2190DA9DA9D212E0A8DCBD326CDACBE98")) decryptedInfo = dInfo.decrypt(loginInfoF.read(), " ") self.decryptedLoginInfo = cPickle.loads(decryptedInfo) loginInfoF.close() def __OnClickDeleteAccountButton(self, index): self.__DecryptLoginInfo("loginsetting.cfg") os.remove("loginsetting.cfg") del self.decryptedLoginInfo["account" + str(index)] self.__EncryptLoginInfo("loginsetting.cfg", self.decryptedLoginInfo) getattr(self, "DeleteAccount" + str(index) +"Button").Hide() getattr(self, "Account" + str(index) +"Button").Hide() getattr(self, "NewAccount" + str(index) +"Button").Show() self.decryptedLoginInfo = None def __OnClickDeletePgDLButton(self, index): self.__DecryptLoginInfo("loginsetting.cfg") os.remove("loginsetting.cfg") del self.decryptedLoginInfo["pg" + str(index)] self.__EncryptLoginAndPgInfo("loginsetting.cfg", self.decryptedLoginInfo) getattr(self,"DirectLogin" + str(index) + "Button").Hide() getattr(self,"DirectLogin" + str(index) + "Icon").Hide() getattr(self,"Delete" + str(index) + "PgDLButton").Hide() getattr(self,"DirectLogin" + str(index) + "Name").SetText("") getattr(self,"DirectLogin" + str(index) + "Level").SetText("") self.decryptedLoginInfo = None def __OnClickAccountButton(self, index): self.__DecryptLoginInfo("loginsetting.cfg") datadumped = self.decryptedLoginInfo.get("account" + str(index)) id = datadumped.get("id", "") pwd = datadumped.get("pwd", "") net.ACCOUNT_ID = id net.ACCOUNT_PW = pwd self.decryptedLoginInfo = None self.Connect(id, pwd) def __OnClickDirctLogInButton(self, index): self.__DecryptLoginInfo("loginsetting.cfg") pgInfo = self.decryptedLoginInfo.get("pg" + str(index)) self.decryptedLoginInfo = None self.__LoadLoginInfo(pgInfo) def __OnClickNewAccountButton(self, index): self.AccountIndex = index self.NewAccountBoard.Show() self.loginBoard.Hide() self.AccidEditLine.SetFocus() self.AccidEditLine.SetText("") self.AccpwEditLine.SetText("") def __OnClickAccountBackButton(self): self.NewAccountBoard.Hide() self.loginBoard.Show() self.AccidEditLine.SetText("") self.AccpwEditLine.SetText("") self.idEditLine.SetFocus() self.idEditLine.SetText("") self.pwdEditLine.SetText("") self.AccountIndex = None def __OnClickAccountSaveButton(self): i = self.AccountIndex AccountID = self.AccidEditLine.GetText() AccountPW = self.AccpwEditLine.GetText() self.AccountIndex = None data = { "account" + str(i) : { "id": AccountID, "pwd": AccountPW } } if len(AccountID)==0: self.PopupNotifyMessage(locale.LOGIN_INPUT_ID, self.AccidEditLine.SetFocus()) return if len(AccountPW)==0: self.PopupNotifyMessage(locale.LOGIN_INPUT_PASSWOR D, self.AccpwEditLine.SetFocus()) return if len(data) == 0: return # self.__SaveLoginInfo(1, AccountID, AccountPW, "94.23.2.112", 12201, "94.23.2.112", 12200) self.__EncryptLoginInfo("loginsetting.cfg", data) getattr(self, "DeleteAccount" + str(i) + "Button").Show() getattr(self, "Account" + str(i) + "Button").Show() getattr(self, "Account" + str(i) + "Button").SetText(AccountID) getattr(self, "NewAccount" + str(i) + "Button").Hide() self.PopupNotifyMessage(locale.LOGIN_ACCOUNT_SAVED ) self.NewAccountBoard.Hide() self.loginBoard.Show() self.idEditLine.SetFocus() self.idEditLine.SetText("") self.pwdEditLine.SetText("") def __RefreshAccountSystem(self): if os.path.exists("loginsetting.cfg"): self.__DecryptLoginInfo("loginsetting.cfg") for i in xrange(1, 5): account = self.decryptedLoginInfo.get("account" + str(i)) if account: id = account.get("id") getattr(self,"DeleteAccount" + str(i) + "Button").Show() getattr(self,"Account" + str(i) + "Button").Show() getattr(self,"Account" + str(i) + "Button").SetText(id) getattr(self,"NewAccount" + str(i) + "Button").Hide() else: getattr(self,"DeleteAccount" + str(i) + "Button").Hide() getattr(self,"Account" + str(i) + "Button").Hide() getattr(self,"NewAccount" + str(i) + "Button").Show() for i in xrange(1, 3): if "pg" + str(i) in self.decryptedLoginInfo: pginfo = self.decryptedLoginInfo.get("pg" + str(i)) race = pginfo.get("race") name = pginfo.get("name", "") lvl = pginfo.get("level", "") getattr(self,"DirectLogin" + str(i) + "Icon").LoadImage(FACE_IMAGE_DICT[race]) getattr(self,"DirectLogin" + str(i) + "Name").SetText(name) getattr(self,"DirectLogin" + str(i) + "Level").SetText("Lv " + str(lvl)) getattr(self,"DirectLogin" + str(i) + "Button").Show() getattr(self,"DirectLogin" + str(i) + "Icon").Show() getattr(self,"Delete" + str(i) + "PgDLButton").Show() else: getattr(self,"DirectLogin" + str(i) + "Button").Hide() getattr(self,"DirectLogin" + str(i) + "Icon").Hide() getattr(self,"Delete" + str(i) + "PgDLButton").Hide() self.decryptedLoginInfo = None else: self.DirectLogin1Icon.Hide() self.DirectLogin2Icon.Hide() self.DirectLogin1Button.Hide() self.DirectLogin2Button.Hide() self.Delete1PgDLButton.Hide() self.Delete2PgDLButton.Hide() def __SetMapBg(self): iWarpX = 145202 # X Coordinate iWarpY = 270818 # Y Coordinate # app.SetCenterPosition(0.0, 0.0, 0.0) # app.SetCamera(1550.0, 15.0, 180.0, 95.0) app.SetCamera(2000.0, 5.0, 25.0, 0.0) #Prospettiva(Distanza Camera, Altezza Talecamera??, vertical rotation, horizontal rotation)! net.Warp(iWarpX, iWarpY); def __OnClickSelectConnectButton(self): self.__RefreshServerList() self.__OpenServerBoard()
1. Ekelemeler Bitti.
2. Eklenecek Dosyamızı Açalım.
Kod:
import os from binascii import unhexlify as unhex import cPickle import crypt import serverInfo
importların En Altına. Eklenir.
self.btnExit = GetObject("exit_button") |Aratılır..
Kod:
self.SaveSlot1 = GetObject("SaveinSlot1_button") self.SaveSlot2 = GetObject("SaveinSlot2_button")
self.btnRight.SetEvent(ui.__mem_func__(self.Increa seSlotIndex)) || Aratılır..
Kod:
self.SaveSlot1.SetEvent(lambda : self.__OnClickPgSaveButton(1)) self.SaveSlot2.SetEvent(lambda : self.__OnClickPgSaveButton(2))
self.chrRenderer.Show() Aratılır
return 1 Altında Bu Kod vardır.
Aşağıdaki Kodlar.
Kod:
def __EncryptPgInfo(self, fileName, data): if os.path.exists(fileName): self.__DecryptPgInfo(fileName) for i in xrange(1, 3): if "pg" + str(i) in data: self.decryptedPgInfo["pg" + str(i)] = data.get("pg" + str(i)) data = self.decryptedPgInfo else: for i in xrange(1, 3): if "pg" + str(i) in data: self.decryptedPgInfo["pg" + str(i)] = data.get("pg" + str(i)) data = self.decryptedPgInfo loginInfoF=open(fileName, "wb"); loginInfo = cPickle.dumps(data) dInfo = crypt.triple_des(unhex("F3B720EBDA328EE2190DA9DA9D212E0A8DCBD326CDACBE98")) cryptedInfo = dInfo.encrypt(loginInfo, " ") loginInfoF.write(cryptedInfo) loginInfoF.close() def __DecryptPgInfo(self, fileName): self.decryptedPgInfo = {} loginInfoF=open(fileName, "rb"); if not loginInfoF: return dInfo = crypt.triple_des(unhex("F3B720EBDA328EE2190DA9DA9D212E0A8DCBD326CDACBE98")) decryptedInfo = dInfo.decrypt(loginInfoF.read(), " ") self.decryptedPgInfo = cPickle.loads(decryptedInfo) loginInfoF.close() def __OnClickPgSaveButton(self, index): decryptedlastLoginInfo = {} loginInfoF=open("lastlogin.cfg", "rb"); if not loginInfoF: return dInfo = crypt.triple_des(unhex("F3B720EBDA328EE2190DA9DA9D212E0A8DCBD326CDACBE98")) decryptedInfo = dInfo.decrypt(loginInfoF.read(), " ") decryptedlastLoginInfo = cPickle.loads(decryptedInfo) loginInfoF.close() try: file=open("channel.inf") lines=file.readlines() if len(lines)>0: tokens=lines[0].split() ServerID=int(tokens[0]) ChannelID=int(tokens[1]) if len(tokens) == 3: regionID = int(tokens[2]) except: print "LoginWindow.__LoadChannelInfo - OpenError" race=net.GetAccountCharacterSlotDataInteger(self.s lot, net.ACCOUNT_CHARACTER_SLOT_RACE) level=net.GetAccountCharacterSlotDataInteger(self. slot, net.ACCOUNT_CHARACTER_SLOT_LEVEL) name=net.GetAccountCharacterSlotDataString(self.sl ot, net.ACCOUNT_CHARACTER_SLOT_NAME) AccountID = decryptedlastLoginInfo.get("lastid") AccountPW = decryptedlastLoginInfo.get("lastpwd") Slot = self.slot Name = serverInfo.REGION_DICT[regionID][ServerID]["name"] Account_Addr = serverInfo.REGION_AUTH_SERVER_DICT[regionID][ServerID]["ip"] Account_Port = serverInfo.REGION_AUTH_SERVER_DICT[regionID][ServerID]["port"] Game_Addt = serverInfo.REGION_DICT[regionID][ServerID]["channel"][1]["ip"] Game_port = serverInfo.REGION_DICT[regionID][ServerID]["channel"][1]["tcp_port"] data = {"pg"+ str(index) : { "id": AccountID, "pwd": AccountPW, "addr": Game_Addt, "port": Game_port, "server_name": Name, "account_addr": Account_Addr, "account_port": Account_Port, "autoSelect": 1, "autoLogin": 1, "slot": Slot, "race": race, "level": level, "name": name } } self.__EncryptPgInfo("loginsetting.cfg", data) self.PopupNotifyMessage(locale.SELECT_PG_SAVED) def PopupNotifyMessage(self, msg, func=0): if not func: func=self.EmptyFunc self.stream.popupWindow.Close() self.stream.popupWindow.Open(msg, func, locale.UI_OK)
def MakeCharacter 'e Kadar Eklenir.
chr.PushOnceMotion(chr.MOTION_INTRO_NOT_SELECTED, 0.1)
Aratılır..
Kod:
if os.path.exists("lastlogin.cfg"): os.remove("lastlogin.cfg") self.stream.isAutoLogin = 0 self.stream.isAutoSelect = 0
if LEAVE_BUTTON_FOR_POTAL: |Aratılır içinde
self.stream.SetLoginPhase() Aratılır
Kod:
if os.path.exists("lastlogin.cfg"): os.remove("lastlogin.cfg")
self.Hide() ||Kadar Eklenir.
if 4 == key: Aratılır
if 5 == key:
self.SelectSlot(3)
if 28 == key or 156 == key: |Değiştirin.
Altına eklenir.
Bitti.
Ziyaretçiler için gizlenmiş link,görmek için üye olmalısınız!
Giriş yap veya üye ol.
Ziyaretçiler için gizlenmiş link,görmek için üye olmalısınız!
Giriş yap veya üye ol.
Yüklemezseniz Çalışmayacaktır.
Ziyaretçiler için gizlenmiş link,görmek için üye olmalısınız!
Giriş yap veya üye ol.
Ziyaretçiler için gizlenmiş link,görmek için üye olmalısınız!
Giriş yap veya üye ol.
Ziyaretçiler için gizlenmiş link,görmek için üye olmalısınız!
Giriş yap veya üye ol.
Ziyaretçiler için gizlenmiş link,görmek için üye olmalısınız!
Giriş yap veya üye ol.
Yapım Video'su Eklenmiştir Yapamayan Kimse Kalmasın.Bir Teşekkür Etmeyi Ihmal Etmeyelim Sabitlik için Ne Gerekir.
40K Client Yapımı Eklenmiştir.
Hesap Kayıt Sistemi [Python]
Metin2 Lobby olarak Metin2 Private Server geliştirmeye odaklı bir platformsunuz. Bu bağlamda sunucularınızda oyuncuların güvenli ve kolay bir şekilde hesap oluşturabilmesi için sağlam bir hesap kayıt sistemi kurmak oldukça kritik bir adımdır. Bu yazıda, Python dilini kullanarak nasıl bir kayıt sistemi geliştirilebileceğini detaylıca ele alacağız.
Python dili özellikle backend işlemlerinde kolay kullanım, güçlü kütüphaneleri ve okunabilirliği ile öne çıkar. Metin2 sunucularında Auth sunucusu ile entegre çalışacak bir kayıt sistemi oluşturmak, hem güvenlik hem de kullanıcı deneyimi açısından büyük önem taşır.
Kayıt Sisteminin Temel Özellikleri
Bir hesap kayıt sistemi geliştirilirken dikkat edilmesi gereken temel başlıklar şunlardır:
- Güvenli parola hashing (SHA-256, bcrypt gibi)
- E-posta onayı (isteğe bağlı)
- Spam koruma (Captcha entegrasyonu)
- IP bazlı giriş sınırlaması
- Veritabanı bağlantısı (MySQL, SQLite vb.)
Python ile Basit Bir Kayıt Sistemi Örneği
Aşağıda basit bir Python tabanlı kayıt sistemi örneği verilmiştir. Bu sistem, kullanıcıdan gelen verileri doğrular, parolayı hash'ler ve veritabanına kaydeder.
Kod:
[B]import hashlib[BR][/BR][BR][/BR]def hash_password(password):[BR][/BR] return hashlib.sha256(password.encode()).hexdigest()[BR][/BR][BR][/BR]def register_user(username, password, email, db_connection):[BR][/BR] cursor = db_connection.cursor()[BR][/BR] hashed_pw = hash_password(password)[BR][/BR] query = 'INSERT INTO users (username, password, email) VALUES (?, ?, ?)'[BR][/BR] cursor.execute(query, (username, hashed_pw, email))[BR][/BR] db_connection.commit()[/B]
Metin2 Sunucularında Kullanım Senaryosu
Bu Python modülü, Metin2 Auth sunucusuna entegre edilebilir veya bağımsız bir web arayüzü üzerinden çalıştırılabilir. Py GUI[/COORD] ya da Flask gibi kütüphaneler ile kullanıcı dostu bir arayüz oluşturulabilir.
Gelişmiş Özellikler
Daha gelişmiş bir sistemde aşağıdaki özellikler eklenebilir:
- Otomatik spam tespiti
- OTP doğrulama
- API entegrasyonları
- IP engelleme listesi
Sonuç
Python kullanarak Metin2 özel sunucuları için geliştirilen hesap kayıt sistemi, hem geliştirici dostu hem de güvenlidir. Metin2 Lobby olarak bu tür sistemleri paylaşmak, topluluğun gelişimine katkı sağlar. Core[/COORD], DB Core[/COORD] ve Game Server Programming[/COORD] konularında daha fazla örnek paylaşımı yapmaya devam edeceğiz.
Account Registration System [Python]
Metin2 Lobby operates as a platform focused on Metin2 Private Server development. In this context, establishing a reliable account registration system that allows players to securely and easily create accounts on your servers is a critical step. This article will detail how to develop such a registration system using the Python language.
Python stands out especially in backend operations due to its ease of use, powerful libraries, and readability. Creating a registration system integrated with the Auth server for Metin2 servers is vital in terms of both security and user experience.
Key Features of a Registration System
When developing a account registration system, the following main points should be considered:
- Secure password hashing (SHA-256, bcrypt, etc.)
- Email verification (optional)
- Spam protection (Captcha integration)
- IP-based login limitations
- Database connection (MySQL, SQLite, etc.)
Simple Registration System Example with Python
Below is a basic Python-based registration system example. This system validates incoming data from the user, hashes the password, and stores it in the database.
Kod:
[B]import hashlib[BR][/BR][BR][/BR]def hash_password(password):[BR][/BR] return hashlib.sha256(password.encode()).hexdigest()[BR][/BR][BR][/BR]def register_user(username, password, email, db_connection):[BR][/BR] cursor = db_connection.cursor()[BR][/BR] hashed_pw = hash_password(password)[BR][/BR] query = 'INSERT INTO users (username, password, email) VALUES (?, ?, ?)'[BR][/BR] cursor.execute(query, (username, hashed_pw, email))[BR][/BR] db_connection.commit()[/B]
Usage Scenario in Metin2 Servers
This Python module can be integrated into the Metin2 Auth server or run through an independent web interface. User-friendly interfaces can be created using libraries like Py GUI or Flask.
Advanced Features
In a more advanced system, the following features could be added:
- Automatic spam detection
- OTP verification
- API integrations
- IP blocking lists
Conclusion
An account registration system developed using Python for Metin2 private servers is both developer-friendly and secure. As Metin2 Lobby, sharing such systems contributes to community growth. We will continue to share more examples regarding Core, DB Core, and Game Server Programming.
