Dosyasız binekleri tamamlama

  • Konbuyu başlatan Konbuyu başlatan Admin
  • Başlangıç tarihi Başlangıç tarihi
  • Cevaplar Cevaplar 0
  • Görüntüleme Görüntüleme 85

Admin

Metin2Lobby
Yönetici
Founder
Katılım
6 Mayıs 2022
Mesajlar
52,647
Ticaret : 1 / 0 / 0
Selam, mob_proto'da eksik eklenmelerden kaynaklanan bineğin folder kısmının boş bırakılan yerlerini tamamlamanıza yardımcı olacak bir script.

UTF-8 convert için teşekkürler.

Kod:
import os import chardet ITEM_PROTO_PATH = "item_proto.txt" MOB_PROTO_PATH = "mob_proto.txt" NPC_LIST_PATH = "npclist.txt" LOG_FILE_PATH = "no_folder_mounts.txt" MOB_NAMES_FILE_PATH = "mob_names.txt" MOUNT_WITH_FOLDERS = "mount_with_folders.txt" SERVER_DATA_FOLDER = "C:\\git\\CarbonSFv2\\server\\srv1\\share\\data\\monster" SERVER_MISSING_FOLDERS = "server_missing_folders.txt" MOUNT_TYPE = "ITEM_COSTUME" MOUNT_SUBTYPE = "COSTUME_MOUNT" MOUNT_LIST = [] MOUNT_WITH_NO_FOLDER = [] ITEM_TYPE = 2 ITEM_SUBTYPE = 3 ITEM_MOUNT_VALUE = 28 MOB_PROTO_MOUNT_VNUM = 0 MOB_PROTO_FOLDER_INDEX = 12 def process_file(file_path):     with open(file_path, 'rb') as file:         rawdata = file.read()         encoding = chardet.detect(rawdata)['encoding']          #convert to utf-8 if not already     if encoding and encoding.lower() != 'utf-8':         with open(file_path, 'r', encoding=encoding) as file:             content = file.read()         with open(file_path, 'w', encoding='utf-8') as file:             file.write(content) def checkCostumeMount(file_path):     with open(file_path, 'r') as file:         for line in file:             if not line.strip():                 continue             split = line.split('\t')             try:                 if split[ITEM_TYPE] == MOUNT_TYPE and split[ITEM_SUBTYPE] == MOUNT_SUBTYPE:                     MOUNT_LIST.append(split[ITEM_MOUNT_VALUE])             except IndexError:                 print("Index Error on line: " + line) def checkMobLine(file_path):     process_file(file_path)     with open(file_path, 'r', encoding='utf-8') as file:         try:             for line in file:                 if not line.strip():                     continue                                      split = line.split('\t')                 try:                     if split[MOB_PROTO_MOUNT_VNUM] in MOUNT_LIST and split[MOB_PROTO_FOLDER_INDEX] == "":                         print("Mount with no folder: " + split[MOB_PROTO_MOUNT_VNUM])                         MOUNT_WITH_NO_FOLDER.append(split[MOB_PROTO_MOUNT_VNUM])                 except IndexError:                     print("Index Error on line: " + line)         except UnicodeDecodeError:             print("UnicodeDecodeError on line: " + line) def writeIntoFile(file_path, log_file_path):     logFile = open(log_file_path, 'w')     with open(file_path, 'r') as file:         for line in file:             if not line.strip():                 continue             split = line.split('\t')             try:                 if split[0] in MOUNT_WITH_NO_FOLDER:                     logFile.write(line)             except IndexError:                 print("Index Error on line: " + line)     logFile.close() def setFolder(file_path):     mountWithFolders = open(MOUNT_WITH_FOLDERS, 'w')     with open(file_path, 'r') as file:         for line in file:             if not line.strip():                 continue                              split = line.split('\t')             try:                 if split[0] in MOUNT_WITH_NO_FOLDER:                     mountWithFolders.write(line)             except IndexError:                 print("Index Error on line: " + line)     mountWithFolders.close() def checkFolderExist(folder_path):     serverMissingFolders = open(SERVER_MISSING_FOLDERS, 'w')     with open(MOUNT_WITH_FOLDERS, 'r') as file:         for line in file:             if not line.strip():                 continue             split = line.split('\t')             folder = os.path.join(folder_path, split[1])             if not os.path.exists(folder):                 serverMissingFolders.write(folder + "\n")             else:                 print("Folder exists: " + folder)     serverMissingFolders.close() def main():     checkCostumeMount(ITEM_PROTO_PATH)     checkMobLine(MOB_PROTO_PATH)     writeIntoFile(MOB_NAMES_FILE_PATH, LOG_FILE_PATH)     setFolder(NPC_LIST_PATH)     checkFolderExist(SERVER_DATA_FOLDER) if __name__ == "__main__":     main()

Kod:
ITEM_TYPE = 2 ITEM_SUBTYPE = 3 ITEM_MOUNT_VALUE = 28 MOB_PROTO_MOUNT_VNUM = 0 MOB_PROTO_FOLDER_INDEX = 12

Bu kısımları değerleri kendinize göre ayarlayın.
Örn item_proto:
0->Vnum
1->locale_name
2->type
Mount'un mob vnumunu value'den alıyorsa kaçıncı column'da olduğuna bakın ve ITEM_MOUNT_VALUE ile değiştirin.
chardet paketini yükleyin.
Kod:
pip install chardet
Dosyanın içeriğini bu şekilde ayarlayın.

175927_218b4b600b2a03c5c64e1695f94dc1d8.png


Dosyayı bu şekilde ayarladıktan sonra;
Python ile scripti çalıştırın.
Kod:
python .\main.py


mount_with_folder.txt dosyasından tamamlamanız gereken vnumların dosyaları mevcut.
Bu çıktı üzerinden eksikleri tamamlayabilirsiniz.
175929_38c1d63a56cca53498f0fb55d441d65b.png

Metin2 Dosyasız Binek Sistemi Nasıl Tamamlanır?

Metin2 özel sunucularında binek sistemi, oyuncuların savaş gücünü artırmalarına ve karakterlerini geliştirmelerine yardımcı olan önemli bir özelliktir. Ancak bazı özel sunucularda dosya tabanlı olmayan yani 'dosyasız' binek sistemleri tercih edilir. Bu sistemde, binek verileri doğrudan game core üzerinden yönetilir ve client src üzerinde değişiklik yapılmaksızın dinamik olarak çalışır. Bu yazıda, dosyasız binek sisteminin nasıl tamamlanacağını ve bu sistemin avantajlarını inceleyeceğiz.

Dosyasız Binek Nedir?

Geleneksel Metin2 sistemlerinde binek verileri genellikle item_proto dosyasına eklenir ve client tarafında sabit olarak tanımlanır. Ancak dosyasız sistemlerde bu veriler doğrudan C++ source code üzerinden DB ile entegre şekilde üretilir. Bu sayede geliştiriciler daha esnek ve hızlı bir şekilde sistemleri özelleştirebilirler. Metin2Dev projelerinde bu tür sistemler sıkça kullanılır.

Önemli Not: Bu sistemlerde dikkat edilmesi gereken en büyük husus auth server ile game server senkronizasyonudur. Veri akışı doğru yapılandırılmazsa binek sistemi çalışmaz veya hata verebilir.

C++ Sistem Geliştirme[/CTYPE]

Dosyasız binek sistemi genellikle C++ dilinde geliştirilir. Martysama gibi geliştiriciler bu tür sistemleri uiscript ve py root ile birlikte kullanarak hem arayüz hem de arka uç işlemlerini optimize ederler. Bu sistemlerde binek verileri doğrudan server src üzerinde tanımlanır ve game core üzerinden yönetilir. Örneğin, bir bineğin ismi, gücü, evrim seviyesi gibi bilgiler db üzerinden alınır ve client'a aktarılır.

Python Entegrasyonu

Bazı durumlarda, Python tabanlı sistemler de entegre edilebilir. Özellikle Py GUI arayüzleri ile kullanıcı dostu binek yönetim panelleri oluşturulabilir. Bu paneller, pack sistemi ile client tarafına aktarılır. Böylece geliştiriciler binek sistemlerini hem backend hem de frontend tarafında kontrol edebilirler.

Sistem Kurulum Adımları

1. Server src üzerinde binek veritabanı tablosunu oluşturun.
2. Game core kısmında binek sınıfını tanımlayın.
3. Client src üzerinde UI ile bağlantı kurun.
4. Auth ve game sunucuları arasında veri senkronizasyonunu sağlayın.
5. Test ederek sistemi aktif hale getirin.

PVP ve Geliştirme Avantajları

Dosyasız sistemler, PvP sunucularında özellikle avantaj sağlar. Çünkü binek verileri dinamik olarak değişebilir. Oyuncuların kazandığı binekler anlık olarak DB'ye yazılır ve diğer sunucularla senkronize edilir. Bu sayede Metin2 Lobby gibi platformlarda daha güçlü ve esnek PvP sistemleri kurulabilir.

Hatalar ve Çözümler

Genellikle karşılaşılan sorunlardan biri binek verilerinin client'da görünmemesidir. Bu durumda uiscript dosyalarının doğru yapılandırıldığından emin olunmalıdır. Ayrıca source edit sırasında yapılan küçük hatalar sistemin tamamını etkileyebilir. Bu nedenle dikkatli ve test odaklı çalışmak gerekir.

Sonuç

Dosyasız binek sistemi, Metin2 özel sunucularında gelişmiş ve esnek bir yöntemdir. C++ ve Python tabanlı geliştirme ile birlikte, core sistemler üzerinde güçlü yapılar kurulabilir. Bu sistem, PvP sunucularında rekabeti artırırken, geliştiricilere de geniş bir özelleştirme alanı sunar.


How to Complete Fileless Mount System in Metin2?

In Metin2 private servers, the mount system is an important feature that helps players increase their combat strength and enhance their characters. However, on some private servers, fileless mount systems are preferred, where mounts are handled dynamically without relying on client-side files. In this system, mount data is managed directly via the game core and works without modifications to the client src. In this article, we will explore how to fully implement the fileless mount system and its advantages.

What Is a Fileless Mount System?

In traditional Metin2 systems, mount data is typically added to the item_proto file and hardcoded into the client. However, in fileless systems, this data is generated dynamically through C++ source code integrated with the database (DB). This allows developers to customize the system more flexibly and quickly. Such systems are frequently used in Metin2Dev projects.

Important Note: The most critical aspect of these systems is synchronization between the auth server and the game server. If the data flow is not configured correctly, the mount system may fail or produce errors.

C++ System Development

The fileless mount system is generally developed using C++. Developers like Martysama use such systems alongside uiscript and py root to optimize both interface and backend operations. In these systems, mount data is defined directly within the server src and managed by the game core. For example, attributes such as the mount's name, power, and evolution level are retrieved from the DB and sent to the client.

Python Integration

In certain cases, Python-based systems can also be integrated. User-friendly mount management panels can be created using Py GUI interfaces. These panels can be transferred to the client side via the pack system, allowing developers to control the mount system on both the backend and frontend.

Installation Steps

1. Create the mount database table in the server src.
2. Define the mount class in the game core.
3. Establish connection with the UI on the client src.
4. Ensure data synchronization between auth and game servers.
5. Activate the system after testing.

PvP and Development Advantages

Fileless systems provide particular advantages in PvP servers. Since mount data can change dynamically, mounts earned by players are instantly saved to the DB and synchronized across other servers. This allows for stronger and more flexible PvP systems on platforms like Metin2 Lobby.

Common Issues and Solutions

A common issue is that mount data does not appear on the client. In such cases, ensure that the uiscript files are properly configured. Additionally, small mistakes during source edit can affect the entire system. Therefore, working carefully and with extensive testing is essential.

Conclusion

The fileless mount system is an advanced and flexible approach for Metin2 private servers. Combined with C++ and Python based development, powerful structures can be built on top of core systems. This system increases competitiveness in PvP servers while offering developers a wide range of customization options.
 

Şuan Bu Konuyu Görüntüleyen Kullanıcılar (Toplam : 0, Üye : 0, Misafir : 0)

Benzer konular

Geri
Üst Alt