sh make.sh Mantığı ve Kullanımı [BİLGİLENDİRME]

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

Admin

Metin2Lobby
Yönetici
Founder
Katılım
6 Mayıs 2022
Mesajlar
52,647
Ticaret : 1 / 0 / 0
Merhaba turkmmo sakinleri,

Günümüzde çoğu kişi sh make.sh mantığını yanlış biliyor ve kötü bir işlem olarak algılıyor.
Aslında sh make.sh mantığı düzenli işlem yapan birisi için çok büyük bir avantaj ve kolaylıktır.

Gelelim nasıl çalışır;


sh make.sh yazıldığında önce quest klasörü içerisinde bulunan object klasörü tamen silinir.
sh make.sh içerisinde bulunan quest_list dosyası quest dizininde mutlaka olmalıdır.


Bu dosya sh make.sh içerisinde şu şekilde geçmektedir ;
Kod:
LIST_FILE='quest_list'

Gelelim bu liste nedir ve içerisinde ne var;
Bu liste içerisinde quest dizininde veya quest dizininde alt bir dizindeki quest dosyalarının listesi vardır.

Örnek bir fotoğraf;
178637f4158c4e6193520e24bc88664c.png


Oyun içerisinde kaynak kodu bulunan bütün quest veya lua dosyaları bu listeye girilmelidir.

sh make.sh komutu verildiğinde önce object klasörü silinir ve liste içerisindeki bütün questler tekrar ./qc mantığı ile yeniden okutulur.


Hangi durumlarda sh make.sh çekilebilir;
- liste içerisindeki herhangi bir quest dosyası düzenlendiğinde.
- listeye yeni bir quest dosyası dahil edildiğinde (ekleme)
- listeden bir quest dosyası silindiğinde (kaldırma)

Kısacası listede ismi geçen bütün dosyaların kaynağı quest dizininde olduğu halde her türlü çekilebilir.

quest kaldırırken use,notarget,state,timer gibi klasörleri tek tek silmeye gerek duyulmaz.


NOT : sh make.sh kullanabilmek için kullanılan bütün quest ve lua dosyalarının kaynağı dizinlerde olmalıdır.

sh make.sh çekildikten sonra ve ./qc işlemlerinde qc.core verme durumu vardır. Kendi düzenlediğim qc dosyasınıda konuya dahil ediyorum.







sh make.sh Mantığı ve Kullanımı [BİLGİLENDİRME]

Metin2 Lobby olarak Metin2 quest geliştirme süreçlerinde geliştiricilerin karşılaştığı yaygın komutlardan birisi olan sh make.sh komutunu açıklamak istiyoruz. Bu komut özellikle.quest dosyalarının derlenmesi ve sunucuya entegrasyonu sırasında oldukça önemli bir rol oynar. Metin2 quest sistematiğinde, özellikle Lua tabanlı scriptlerin derlenmesi ve test edilmesi aşamasında bu komut, otomasyon sağlar.

sh make.sh Nedir?
sh make.sh, genellikle Linux/Unix tabanlı sistemlerde kullanılan bir shell script dosyasıdır. Bu script, derleme veya yükleme süreçlerini otomatikleştirmek için tasarlanmıştır. Metin2 geliştirme ortamlarında, quest scriptlerinizi derlemek ve sunucu yapılandırmasına göre aktarmak için bu komutu kullanabilirsiniz.

Metin2 Quest Geliştirme Sürecinde Kullanımı
Metin2 oyununda quest sistematiği, oyuncuların görevleri tamamlamasını sağlayan merkezi yapılardandır. Quest scriptleri genellikle Lua dili ile yazılmaktadır. Bu scriptlerin doğru çalışması için derlenip sunucu tarafına aktarılması gerekir. İşte burada devreye make.sh girer. Script dosyalarınızda değişiklik yaptıktan sonra sh make.sh komutunu çalıştırmak, tüm derleme işlemlerini otomatik olarak yapar.

make.sh Dosyasının İçeriği
make.sh dosyası genellikle aşağıdaki gibi basit bir yapıya sahiptir:

Kod:
#!/bin/bash[BR][/BR]echo 'Quest derleme işlemi başlatılıyor...'[BR][/BR]gcc -o quest_compiler quest_compiler.c[BR][/BR]./quest_compiler[BR][/BR]cp output/* /path/to/server/quests/[BR][/BR]echo 'Derleme tamamlandı ve dosyalar kopyalandı.'


Bu örnekte, gcc ile bir derleyici çağrılır, ardından çıktılar belirtilen dizine kopyalanır. Tabii ki bu örnek sadece temsili niteliktedir; gerçek Metin2 sunucularında farklı yapılar da bulunabilir.

Metin2 Quest Hata Ayıklama ve Debug
sh make.sh komutu aynı zamanda debug süreçlerinde de oldukça faydalıdır. Eğer quest scriptinizde bir hata varsa, derleme esnasında bu hatalar terminalde görünecektir. Böylece geliştiriciler, hangi satırda ne tür bir sorun olduğunu kolayca görebilir ve hızlıca müdahale edebilirler.

Quest Trigger ve Timer Sistemleriyle Entegrasyon
Metin2 quest sistemlerinde trigger ve timer mekanizmaları önemlidir. sh make.sh ile derlenen scriptler, bu tetikleyici ve zamanlayıcı sistemlerle uyumlu çalışacak şekilde optimize edilebilir. Örneğin, bir görevin belirli bir süre sonra aktif olması ya da belirli bir NPC ile etkileşim sonrası başlaması gibi durumlar, doğru derleme ile sağlanır.

Quest Reward ve Item Sistemleri
Metin2 questlerde ödüller (reward), item, EXP, gold gibi çeşitli ögeler olabilir. sh make.sh komutu ile derlenen scriptler, bu reward sistemlerini eksiksiz ve doğru şekilde işletebilir. Özellikle özel quest sistemlerinde (custom quest), bu komut sayesinde tüm reward mantığı kontrol edilir.

Martysama ve Metin2Dev ile Uyum
Geliştiricilerin sıklıkla kullandığı Martysama ve Metin2Dev gibi frameworklerde, sh make.sh komutu doğrudan entegre edilmiş olabilir. Bu sayede geliştirme süreci daha hızlı ve daha az hataya açık hale gelir. Bu frameworklerde yer alan özel fonksiyonlar, make.sh üzerinden daha verimli çalışabilir.

Sonuç
sh make.sh komutu, Metin2 quest geliştirme sürecinde önemli bir araçtır. Geliştiricilere zaman kazandırır, hata ayıklamayı kolaylaştırır ve otomasyon sağlar. Özellikle büyük projelerde, script yönetimini kolaylaştıran bu komut, quest geliştiricilerinin vazgeçilmezidir.


Logic and Usage of sh make.sh [INFORMATION]

At Metin2 Lobby, we aim to explain the commonly encountered command sh make.sh during Metin2 quest development processes. This command plays an important role especially during compilation and integration of .quest files into the server. Within the Metin2 quest system, this command provides automation for compiling Lua-based scripts and testing them.

What is sh make.sh?
sh make.sh is a shell script file typically used on Linux/Unix-based systems. It is designed to automate build or installation processes. In Metin2 development environments, you can use this command to compile your quest scripts and transfer them according to server configuration.

Usage in Metin2 Quest Development Process
In Metin2, the quest system is one of the central structures that allows players to complete tasks. Quest scripts are generally written in Lua language. For these scripts to function properly, they need to be compiled and transferred to the server side. Here is where make.sh comes into play. Running the sh make.sh command after making changes to your script files automatically performs all compilation operations.

Contents of the make.sh File
make.sh usually has a simple structure like the following:

Kod:
#!/bin/bash[BR][/BR]echo 'Starting quest compilation...'[BR][/BR]gcc -o quest_compiler quest_compiler.c[BR][/BR]./quest_compiler[BR][/BR]cp output/* /path/to/server/quests/[BR][/BR]echo 'Compilation completed and files copied.'


In this example, a compiler is invoked via gcc, then outputs are copied to the specified directory. Of course, this example is only representative; real Metin2 servers may have different structures.

Debugging and Debugging in Metin2 Quests
sh make.sh is also very useful during debugging processes. If there is an error in your quest script, these errors will appear in the terminal during compilation. Thus, developers can easily see what kind of problem occurs on which line and respond quickly.

Integration with Quest Trigger and Timer Systems
Trigger and timer mechanisms are important in Metin2 quest systems. Scripts compiled with sh make.sh can be optimized to work seamlessly with these trigger and timer systems. For example, activation of a quest after a certain period or its start after interaction with a specific NPC can be achieved through correct compilation.

Quest Reward and Item Systems
In Metin2 quests, rewards can include items, EXP, gold, etc. Scripts compiled with sh make.sh can fully and correctly execute these reward systems. Especially in custom quest systems, this command ensures that the entire reward logic is checked.

Compatibility with Martysama and Metin2Dev
Within frequently used frameworks like Martysama and Metin2Dev, the sh make.sh command may already be integrated. This makes the development process faster and less prone to errors. Special functions within these frameworks can operate more efficiently via make.sh.

Conclusion
sh make.sh is an essential tool in the Metin2 quest development process. It saves time for developers, simplifies debugging, and provides automation. Especially in large projects, this command becomes indispensable for quest developers by facilitating script management.
 

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

Benzer konular

Geri
Üst Alt