Kanıt :
Anlatım :
İlk önce game.py açalım
Arat :
Altına :
Arat :
Altına :
Ve kaydetip çıkıyoruz. Sırada [FONT=&amp]interfacemodule.py açıyoruz.
[/FONT] Arat :
Altına :
Ve bitmiştir. Ctrl+P tuşu ile mesajları açıp kapayabilirsiniz.
Metin2 Oyunu İçin Phyton Tabanlı PM Gizleme Sistemi (Ctrl+P)
Metin2 özel sunucularında oyun içi özel mesajları (PM) gizlemek, hem oyun deneyimini artırmak hem de spam ve rahatsız edici mesajları engellemek açısından önemlidir. Bu yazıda, Python tabanlı bir PM gizleme sistemi nasıl entegre edilir ve nasıl çalışır konusunu detaylıca ele alacağız. Bu sistem sayesinde oyuncular, istedikleri zaman özel mesajları açıp kapatabileceklerdir.
Sistem Özellikleri:
- PM gizleme / gösterme özelliği
- Klavye kısayolu: Ctrl + P
- Python (Py) tabanlı komut seti
- Kullanıcı dostu arayüz
- Sunucu tarafında kolay entegrasyon
Kurulum Adımları
1. Python Dosyası Hazırlığı
Öncelikle, phyton dosyanızda bir PM kontrol modülü oluşturmalısınız. Bu modül, kullanıcıların PM alıp almayacağını belirleyen bir değişken tutar. Örneğin:
2. Klavye Kısayolu Tanımlama
Oyun içi klavye dinleyicisi üzerinden Ctrl+P kombinasyonuna tepki vermesi sağlanır. Bu işlem genellikle game.py veya benzeri bir dosya üzerinden yapılır.
3. Sunucu Tarafında Komut Tanımı
Sunucu tarafında '/hidepm' ve '/showpm' komutları tanımlanarak, kullanıcıya ait veritabanında PM durumu güncellenmelidir. Bu işlem genellikle char_manager.cpp veya input_main.cpp gibi dosyalarda yapılır.
Sunucu tarafında örnek C++ komut tanımı:
PM Gönderme Kontrolü
Sunucu, bir PM göndermek istendiğinde alıcının PM durumunu kontrol eder. Eğer gizleme açık ise mesaj gönderilmez. Bu sayede kullanıcılar istemedikleri mesajları almayacaktır.
Avantajlar
- Oyun içi rahatlık sağlar
- Spam engelleme
- Oyuncu memnuniyeti artar
- PvP odaklı sunucularda avantaj sağlar
Sonuç
Phyton ile geliştirilen bu PM gizleme sistemi, hem kullanıcı dostu hem de sunucu yöneticileri için etkili bir araçtır. Metin2Lobby olarak bu tür gelişmiş sistemleri siz oyuncular için detaylı şekilde açıklamaya devam edeceğiz.
Hiding PMs in Metin2 with Python-based System (Ctrl+P)
Hiding private messages (PMs) in Metin2 private servers is important for improving gameplay experience and reducing spam or unwanted communication. In this article, we will explain in detail how to implement and operate a Python-based PM hiding system. With this system, players can toggle private messages on or off at any time using a keyboard shortcut.
System Features:
- Hide/show private messages
- Keyboard shortcut: Ctrl + P
- Python (Py) based command module
- User-friendly interface
- Easy integration on server-side
Installation Steps
1. Preparing the Python File
First, you need to create a PM control module within your phyton file. This module maintains a variable that determines whether a user accepts PMs or not. For example:
2. Defining the Keyboard Shortcut
The game's key listener should respond to the Ctrl+P combination. This is typically done through files like game.py or similar.
3. Server-Side Command Definition
On the server side, commands like '/hidepm' and '/showpm' must be defined to update the PM status in the player's database entry. This is usually done in files such as char_manager.cpp or input_main.cpp.
Example server-side C++ command definition:
Controlling PM Sending
When a PM is attempted to be sent, the server checks if the recipient has enabled PM hiding. If so, the message will not be delivered. This ensures users only receive desired messages.
Benefits
- Enhances in-game comfort
- Reduces spam
- Increases player satisfaction
- Offers advantages in PvP-oriented servers
Conclusion
This PM hiding system developed with Phyton is both user-friendly and effective for server administrators. At Metin2Lobby, we continue to provide detailed explanations of such advanced systems for our players.
Ziyaretçiler için gizlenmiş link,görmek için üye olmalısınız!
Giriş yap veya üye ol.
Anlatım :
İlk önce game.py açalım
Arat :
Kod:
[COLOR=#272A34][FONT=monospace]onPressKeyDict [app.DIK_Q][/FONT][/COLOR]
Altına :
Kod:
[COLOR=#272A34][FONT=monospace]onPressKeyDict[app.DIK_P] = self.__PressPKey[/FONT][/COLOR]
Arat :
Kod:
[COLOR=#272A34][FONT=monospace]app.RotateCamera(app.CAMERA_TO_NEGATIVE)[/FONT][/COLOR]
Altına :
Ziyaretçiler için gizlenmiş link,görmek için üye olmalısınız!
Giriş yap veya üye ol.
Ve kaydetip çıkıyoruz. Sırada [FONT=&amp]interfacemodule.py açıyoruz.
[/FONT] Arat :
Kod:
[COLOR=#272A34][FONT=monospace]IsQBHide = 0[/FONT][/COLOR]
Altına :
Kod:
[COLOR=#272A34][FONT=monospace]IsWisperHide = 0[/FONT][/COLOR]
Ve bitmiştir. Ctrl+P tuşu ile mesajları açıp kapayabilirsiniz.
Metin2 Oyunu İçin Phyton Tabanlı PM Gizleme Sistemi (Ctrl+P)
Metin2 özel sunucularında oyun içi özel mesajları (PM) gizlemek, hem oyun deneyimini artırmak hem de spam ve rahatsız edici mesajları engellemek açısından önemlidir. Bu yazıda, Python tabanlı bir PM gizleme sistemi nasıl entegre edilir ve nasıl çalışır konusunu detaylıca ele alacağız. Bu sistem sayesinde oyuncular, istedikleri zaman özel mesajları açıp kapatabileceklerdir.
Sistem Özellikleri:
- PM gizleme / gösterme özelliği
- Klavye kısayolu: Ctrl + P
- Python (Py) tabanlı komut seti
- Kullanıcı dostu arayüz
- Sunucu tarafında kolay entegrasyon
Kurulum Adımları
1. Python Dosyası Hazırlığı
Öncelikle, phyton dosyanızda bir PM kontrol modülü oluşturmalısınız. Bu modül, kullanıcıların PM alıp almayacağını belirleyen bir değişken tutar. Örneğin:
Kod:
[COLOR=green]import ui[/COLOR][BR][/BR][COLOR=green]import net[/COLOR][BR][/BR][COLOR=green]import app[/COLOR][BR][/BR][BR][/BR][COLOR=red]class PMHideSystem(ui.ScriptWindow):[/COLOR][BR][/BR][COLOR=red]def __init__(self):[/COLOR][BR][/BR][COLOR=red]ui.ScriptWindow.__init__(self)[/COLOR][BR][/BR][COLOR=red]self.isPMHidden = False[/COLOR][BR][/BR][BR][/BR][COLOR=red]def TogglePM(self):[/COLOR][BR][/BR][COLOR=red]if self.isPMHidden:[/COLOR][BR][/BR][COLOR=red]net.SendChatPacket('/showpm')[/COLOR][BR][/BR][COLOR=red]self.isPMHidden = False[/COLOR][BR][/BR][COLOR=red]else:[/COLOR][BR][/BR][COLOR=red]net.SendChatPacket('/hidepm')[/COLOR][BR][/BR][COLOR=red]self.isPMHidden = True[/COLOR]
2. Klavye Kısayolu Tanımlama
Oyun içi klavye dinleyicisi üzerinden Ctrl+P kombinasyonuna tepki vermesi sağlanır. Bu işlem genellikle game.py veya benzeri bir dosya üzerinden yapılır.
Kod:
[COLOR=red]def OnKeyDown(self, key):[/COLOR][BR][/BR][COLOR=red]if app.IsPressed(app.DIK_LCONTROL) and key == app.DIK_P:[/COLOR][BR][/BR][COLOR=red]self.pmSystem.TogglePM()[/COLOR][BR][/BR][COLOR=red]return True[/COLOR]
3. Sunucu Tarafında Komut Tanımı
Sunucu tarafında '/hidepm' ve '/showpm' komutları tanımlanarak, kullanıcıya ait veritabanında PM durumu güncellenmelidir. Bu işlem genellikle char_manager.cpp veya input_main.cpp gibi dosyalarda yapılır.
Sunucu tarafında örnek C++ komut tanımı:
Kod:
[COLOR=red]ACMD(do_hide_pm)[/COLOR][BR][/BR][COLOR=red]{[/COLOR][BR][/BR][COLOR=red]LPCHARACTER ch = ch->GetDesc()->GetCharacter();[/COLOR][BR][/BR][COLOR=red]ch->SetPMHidden(true);[/COLOR][BR][/BR][COLOR=red]ch->ChatPacket(CHAT_TYPE_INFO, 'PM gizleme aktif');[/COLOR][BR][/BR][COLOR=red]}[/COLOR]
PM Gönderme Kontrolü
Sunucu, bir PM göndermek istendiğinde alıcının PM durumunu kontrol eder. Eğer gizleme açık ise mesaj gönderilmez. Bu sayede kullanıcılar istemedikleri mesajları almayacaktır.
Avantajlar
- Oyun içi rahatlık sağlar
- Spam engelleme
- Oyuncu memnuniyeti artar
- PvP odaklı sunucularda avantaj sağlar
Sonuç
Phyton ile geliştirilen bu PM gizleme sistemi, hem kullanıcı dostu hem de sunucu yöneticileri için etkili bir araçtır. Metin2Lobby olarak bu tür gelişmiş sistemleri siz oyuncular için detaylı şekilde açıklamaya devam edeceğiz.
Hiding PMs in Metin2 with Python-based System (Ctrl+P)
Hiding private messages (PMs) in Metin2 private servers is important for improving gameplay experience and reducing spam or unwanted communication. In this article, we will explain in detail how to implement and operate a Python-based PM hiding system. With this system, players can toggle private messages on or off at any time using a keyboard shortcut.
System Features:
- Hide/show private messages
- Keyboard shortcut: Ctrl + P
- Python (Py) based command module
- User-friendly interface
- Easy integration on server-side
Installation Steps
1. Preparing the Python File
First, you need to create a PM control module within your phyton file. This module maintains a variable that determines whether a user accepts PMs or not. For example:
Kod:
[COLOR=green]import ui[/COLOR][BR][/BR][COLOR=green]import net[/COLOR][BR][/BR][COLOR=green]import app[/COLOR][BR][/BR][BR][/BR][COLOR=red]class PMHideSystem(ui.ScriptWindow):[/COLOR][BR][/BR][COLOR=red]def __init__(self):[/COLOR][BR][/BR][COLOR=red]ui.ScriptWindow.__init__(self)[/COLOR][BR][/BR][COLOR=red]self.isPMHidden = False[/COLOR][BR][/BR][BR][/BR][COLOR=red]def TogglePM(self):[/COLOR][BR][/BR][COLOR=red]if self.isPMHidden:[/COLOR][BR][/BR][COLOR=red]net.SendChatPacket('/showpm')[/COLOR][BR][/BR][COLOR=red]self.isPMHidden = False[/COLOR][BR][/BR][COLOR=red]else:[/COLOR][BR][/BR][COLOR=red]net.SendChatPacket('/hidepm')[/COLOR][BR][/BR][COLOR=red]self.isPMHidden = True[/COLOR]
2. Defining the Keyboard Shortcut
The game's key listener should respond to the Ctrl+P combination. This is typically done through files like game.py or similar.
Kod:
[COLOR=red]def OnKeyDown(self, key):[/COLOR][BR][/BR][COLOR=red]if app.IsPressed(app.DIK_LCONTROL) and key == app.DIK_P:[/COLOR][BR][/BR][COLOR=red]self.pmSystem.TogglePM()[/COLOR][BR][/BR][COLOR=red]return True[/COLOR]
3. Server-Side Command Definition
On the server side, commands like '/hidepm' and '/showpm' must be defined to update the PM status in the player's database entry. This is usually done in files such as char_manager.cpp or input_main.cpp.
Example server-side C++ command definition:
Kod:
[COLOR=red]ACMD(do_hide_pm)[/COLOR][BR][/BR][COLOR=red]{[/COLOR][BR][/BR][COLOR=red]LPCHARACTER ch = ch->GetDesc()->GetCharacter();[/COLOR][BR][/BR][COLOR=red]ch->SetPMHidden(true);[/COLOR][BR][/BR][COLOR=red]ch->ChatPacket(CHAT_TYPE_INFO, 'PM hiding activated');[/COLOR][BR][/BR][COLOR=red]}[/COLOR]
Controlling PM Sending
When a PM is attempted to be sent, the server checks if the recipient has enabled PM hiding. If so, the message will not be delivered. This ensures users only receive desired messages.
Benefits
- Enhances in-game comfort
- Reduces spam
- Increases player satisfaction
- Offers advantages in PvP-oriented servers
Conclusion
This PM hiding system developed with Phyton is both user-friendly and effective for server administrators. At Metin2Lobby, we continue to provide detailed explanations of such advanced systems for our players.
