Tek kodla game ve db ye strip çekme

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

Admin

Metin2Lobby
Yönetici
Founder
Katılım
6 Mayıs 2022
Mesajlar
52,647
Ticaret : 1 / 0 / 0
Kodun kullanımı:
Önce
gmake clean
gmake dep
gmake -j20
gmake strip

Game için;

Gidilir: /usr/src/mainline_released/Srcs/Server/game/src
Açılır: Makefile

Aranır:
Kod:
dep: makedepend -f Depend $(INCDIR) -I/usr/include/c++/3.3 -I/usr/include/c++/4.2 -p$(OBJDIR)/ $(CPPFILE) $(CFILE) $(MAINCPP) $(TESTCPP) 2> /dev/null > Depend

Altına eklenir:
Kod:
strip: @strip -s $(OBJS) $(BINDIR)/game

Son hali:

4x_GNqQuSP_2694ybcjAvQ.png



DB için;

Gidilir: /usr/src/mainline_released/Srcs/Server/db/src
Açılır Makefile

Aranır:
Kod:
dep:     @touch Depend     makedepend -fDepend $(INCDIR) -I/usr/include/c++/3.3 -I/usr/include/c++/4.2 -p$(OBJDIR)/ $(SRCS) 2> /dev/null

Altına eklenir:
Kod:
strip:     @strip -s $(OBJS) $(BINDIR)/db

Son hali:
vg7k6L9XSY2AMjcqQBp4xg.png

Tek Kodla Game ve DB'ye Strip Çekme Yöntemi

Metin2 özel sunucularında geliştirme yaparken, oyuncu envanterine veya belirli slotlara hızlıca strip (item) eklemek isteyebilirsiniz. Bu işlem genellikle manuel olarak database üzerinden yapılırken, bu işlemi otomatikleştirmek hem zaman kazandırır hem de daha profesyonel bir geliştirme süreci sağlar. Bu makalede, tek bir komut ile hem game hem de database üzerinde strip ekleme işlemini nasıl yapacağımızı detaylıca inceleyeceğiz.

Strip Nedir?

Strip, Metin2 oyununda belirli bir envanter slotuna item yerleştirmek anlamına gelir. Oyuncu envanterinde 45 slot bulunur ve her bir slot özel amaçlar için kullanılabilir. Örneğin, 0. slot genellikle başlık (title) için kullanılır. Strip komutları ile bu slotlara item atamak, test süreçlerinde çok büyük kolaylıklar sağlar.

Game ve DB Üzerinde Strip İşlemleri

Metin2 özel sunucu yapılarında strip işlemleri genellikle iki farklı katmanda yapılır: Game sunucusu ve Database (DB). Game sunucusu, oyuncu giriş yaptığında çalışan koddur ve DB ise kalıcı verilerin tutulduğu yerdir. Strip komutu, hem game hem de db katmanında çalışacak şekilde optimize edilmelidir.

Örnek Komut Yapısı

Kod:
strip slot_id item_vnum count

Bu komut, belirtilen slot numarasına belirtilen itemi ve miktarı ekler. Ancak bu işlem sadece geçici olur. Kalıcı olması için DB tarafına da yazılması gerekir. Bu yüzden tek bir komutla hem game hem de DB’ye yazmak çok önemlidir.

Python veya C++ ile Geliştirme

Metin2 özel sunucularında strip komutlarını geliştirmek için genellikle C++ veya Python kullanılır. Özellikle game core geliştirme sürecinde C++ bilgisi çok önemlidir. Python tarafında ise py root ve uiscript gibi yapılar ile GUI tabanlı sistemler oluşturulabilir. Ancak strip gibi işlemler genellikle doğrudan C++ ile game sunucusuna entegre edilir.

Kalıcı Strip Ekleme Sistemi Nasıl Geliştirilir?

Kalıcı strip ekleme sistemi için şu adımlar izlenmelidir:

- Oyuncu ID’si alınır
- Slot numarası belirlenir
- Item VNUM ve miktarı tanımlanır
- Hem game hem db’ye bu veri yazılır

SQL Sorgusu Örneği

Kod:
INSERT INTO player.item (owner_id, window_type, pos, vnum, count) VALUES ([USER_ID], 1, [SLOT], [VNUM], [COUNT]);

Bu sorgu ile veritabanına item yazılır. Game tarafında ise bu itemin oyuncuya görünmesi için refresh gerekir.

Martysama ve Diğer Kaynaklar

Metin2 geliştirme sürecinde, martysama gibi kaynaklardan faydalanmak oldukça yararlıdır. Bu tür platformlar, hem C++ hem de Python tabanlı sistemler için örnek kodlar içerir. Ayrıca Metin2Dev gibi topluluklar sayesinde güncel geliştirme tekniklerinden haberdar olabilirsiniz.

Sonuç

Tek bir komutla hem game hem de database katmanında strip ekleme işlemi yapmak, Metin2 özel sunucu geliştirme sürecinde önemli bir kolaylık sağlar. Bu tür sistemlerin doğru kurulması, hem test süreçlerini hızlandırır hem de daha profesyonel sunucuların oluşmasına yardımcı olur. Metin2Lobby olarak, tüm geliştiricilere kaynak ve destek sağlamaya devam ediyoruz.


How to Pull Strips into Game and DB with One Code

While developing Metin2 private servers, you may sometimes need to quickly add strips (items) to a player's inventory or specific slots. This process usually requires manual operations on the database, but automating it can save time and provide a more professional development experience. In this article, we will examine in detail how to perform strip insertion into both game and database layers using a single command.

What is a Strip?

In Metin2, 'strip' refers to placing an item in a specific inventory slot. The player's inventory has 45 slots, each potentially used for different purposes. For example, slot 0 is often reserved for titles. Using strip commands to assign items to these slots greatly facilitates testing processes.

Strip Operations in Game and DB

In Metin2 private server structures, strip operations are typically performed on two different layers: the game server and the database (DB). The game server runs when the player logs in, while the DB stores persistent data. The strip command should be optimized to operate on both layers simultaneously.

Example Command Structure

Kod:
strip slot_id item_vnum count

This command adds the specified item and its quantity to the given slot. However, this operation is temporary. To make it permanent, it must also be written to the DB layer.

Development with Python or C++

To develop strip commands in Metin2 private servers, developers typically use C++ or Python. In particular, knowledge of C++ is crucial for game core development. On the Python side, structures like py root and uiscript allow for GUI-based systems. However, operations like strip insertion are generally integrated directly into the game server via C++.

How to Develop a Permanent Strip Insertion System?

To build a permanent strip insertion system, follow these steps:

- Obtain the player ID
- Define the slot number
- Specify the item VNUM and count
- Write the data to both game and DB

Example SQL Query

Kod:
INSERT INTO player.item (owner_id, window_type, pos, vnum, count) VALUES ([USER_ID], 1, [SLOT], [VNUM], [COUNT]);

This query inserts the item into the database. On the game side, the item needs to be refreshed to appear for the player.

Martysama and Other Resources

During the Metin2 development process, resources like martysama are highly beneficial. Such platforms offer example codes for both C++ and Python-based systems. Additionally, communities like Metin2Dev keep developers updated on current techniques.

Conclusion

Inserting strips into both game and database layers using a single command provides significant convenience during Metin2 private server development. Properly implementing such systems accelerates testing and helps create more professional servers. At Metin2Lobby, we continue to provide resources and support to all developers.
 

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

Benzer konular

Geri
Üst Alt