Uzaktan ticaret sistemi

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

Admin

Metin2Lobby
Yönetici
Founder
Katılım
6 Mayıs 2022
Mesajlar
52,647
Ticaret : 1 / 0 / 0
Game py açın Importlara ekleyın

Kod:
[COLOR=#333333]import localegame[/COLOR] import gameInfo import event  [COLOR=#333333]import uiExchange_Multi[/COLOR]

Aratın

Kod:
[COLOR=#333333]def OnRecvWhisper(self, mode, name, line):[/COLOR]

Altına Ekleyin
Kod:
[COLOR=#333333]if line.find("uzaktan_ticaret_teklifi") != -1:            bol = line.split("#")[/COLOR]            if line.find("cevap") != -1:                 if gameInfo.UZAKTAN_TICARET_DURUM != 0:                     net.SendWhisperPacket(name, "#uzaktan_ticaret_teklifi_kapat#")                     return                 target_level = bol[3]                 target_lonca = bol[4]                 target_sinif = bol[5]                 gameInfo.UZAKTAN_TICARET_KISILER["kisi_"+str(name)] = "#"+str(target_level)+"#"+str(target_lonca)+"#"+str(target_sinif)+"#"                 gameInfo.UZAKTAN_TICARET_RAKIP = name                 self.ac = uiExchange_Multi.MultiExchangeDialog()                 self.ac.Open()                 self.interface.ToggleInventoryWindow()                 return                          if line.find("kapat") != -1:                 uiExchange_Multi.TICARET_KAPAT = 1                 chat.AppendChat(chat.CHAT_TYPE_INFO, localegame.UZAKTAN_TICARET_RAKIP_TICARETTE)                 return             if gameInfo.UZAKTAN_TICARET_DURUM != 0:                 net.SendWhisperPacket(name, "#uzaktan_ticaret_teklifi_kapat#")                 return             target_level = bol[2]             target_lonca = bol[3]             target_sinif = bol[4]             self.TicaretDialog = uiCommon.QuestionDialog()             self.TicaretDialog.SetText(localegame.UZAKTAN_TICARET % (str(name)))             self.TicaretDialog.SetAcceptEvent(lambda arg=TRUE: self.OnExchangeDialog(name, 1, target_level, target_lonca, target_sinif))             self.TicaretDialog.SetCancelEvent(lambda arg=FALSE: self.OnExchangeDialog(name, 0, target_level, target_lonca, target_sinif))             self.TicaretDialog.Open()             return         if line.find("uzaktan_ticaret_itemekle") != -1:             bol = line.split("#")             uiExchange_Multi.ITEMSLOT_INFO = "#"+str(bol[2])+"#"+str(bol[3])+"#"+str(bol[4])+"#"+str(bol[5])+"#"+bol[6]+"#"+bol[7]+"#"             uiExchange_Multi.ITEM_EKLE = 1             return         if line.find("uzaktan_ticaret_kabul") != -1:             if gameInfo.UZAKTAN_TICARET_DURUM == 2:                 gameInfo.UZAKTAN_TICARET_DURUM = 4                 uiExchange_Multi.TICARET_BASARILI = 1             else:                 gameInfo.UZAKTAN_TICARET_DURUM = 3             return         if line.find("uzaktan_ticaret_iptal") != -1:             uiExchange_Multi.TICARET_KAPAT = 1             return         if line.find("uzaktan_ticaret_paraekle") != -1:             bol = line.split("#")             gameInfo.UZAKTAN_TICARET_PARA_TARGET = int(bol[2]) [COLOR=#333333]            return[/COLOR]

Aratın
Kod:
[COLOR=#333333]def OnRecvWhisperError(self, mode, name, line):[/COLOR]

Kod blogunun altına ekleyin.
Kod:
[COLOR=#333333]def OnExchangeDialog(self, ad, flag, target_level, target_lonca, target_sinif):[/COLOR]        if flag == 0:             self.TicaretDialog.Close()             return         self.TicaretDialog.Close()         gameInfo.UZAKTAN_TICARET_KISILER["kisi_"+str(ad)] = "#"+str(target_level)+"#"+str(target_lonca)+"#"+str(target_sinif)+"#"         gameInfo.UZAKTAN_TICARET_RAKIP = ad         race = net.GetMainActorRace()         if not guild.IsGuildEnable():             net.SendWhisperPacket(ad, "#uzaktan_ticaret_teklifi#cevap#"+str(player.GetStatus(player.LEVEL))+"#Lonca yok.#"+str(race)+"#")         else:             net.SendWhisperPacket(ad, "#uzaktan_ticaret_teklifi#cevap#"+str(player.GetStatus(player.LEVEL))+"#"+str(player.GetGuildName())+"#"+str(race)+"#")                      self.ac = uiExchange_Multi.MultiExchangeDialog()         self.ac.Open() [COLOR=#333333]        self.interface.ToggleInventoryWindow()[/COLOR]

Aratın
Kod:
[COLOR=#333333]def BINARY_ServerCommand_Run(self, line):[/COLOR]

Altına ekleyin
Kod:
[COLOR=#333333]def __PythonToLua(self, id):        constInfo.PYTHONTOLUA = int(id)[/COLOR]             def __PythonIslem(self, PythonIslem):         if PythonIslem == "PYTHONISLEM":             net.SendQuestInputStringPacket(constInfo.PYTHONISLEM)         elif PythonIslem == "PLAYER_VID":             net.SendQuestInputStringPacket(str(constInfo.PLAYER_VID))                  def __LuaToPython(self, LuaToPython):         if LuaToPython.find("#quest_input#") != -1:             constInfo.INPUT = 1         elif LuaToPython.find("#quest_inputbitir#") != -1:             constInfo.INPUT = 0         elif LuaToPython.find("ticaret_log") != -1:             bol = LuaToPython.split("#")             bol2 = LuaToPython.split("|") [COLOR=#333333]            constInfo.TICARET_LOG.insert(0, bol2[1])[/COLOR]

Aratın
Kod:
[COLOR=#333333]"CloseSafebox"            : self.CommandCloseSafebox,[/COLOR]

Altına bır boşluk bırakıp ekleyın

Kod:
[COLOR=#333333]"PythonToLua"            : self.__PythonToLua, # .python to Quest             "PythonIslem"            : self.__PythonIslem, # .python to Quest[/COLOR] [COLOR=#333333]            "LuaToPython"            : self.__LuaToPython, # Quest to .python[/COLOR]
uiExchange py açın ve Importların arasına ekleyın

Kod:
[COLOR=#333333]import localegame[/COLOR] [COLOR=#333333]import gameInfo [/COLOR][COLOR=#333333]import uiexchange_multi[/COLOR]
Aratın
Kod:
[COLOR=#333333]def SelectOwnerEmptySlot(self, SlotIndex):[/COLOR]

ve bu kod bloğun ıçındekının bu kodun altına
Kod:
[COLOR=#333333]DstSlotNumber = SlotIndex[/COLOR]


Bu kodu ekleyin
Kod:
[COLOR=#333333]if srcSlotNumber in uiExchange_Multi.ITEMSLOT:[/COLOR] [COLOR=#333333]                    return[/COLOR]


Aratın
Kod:
[COLOR=#333333]def OnUpdate(self):[/COLOR]
bu kodun üstüne alttakı kodu ekleyın
Kod:
USE_EXCHANGE_LIMIT_RANGE = 1000



Kod:
if gameInfo.UZAKTAN_TICARET_DURUM != 0:             if DUELLO_YAPAMASSIN == 0:                 chat.AppendChat(chat.CHAT_TYPE_INFO, '<Sistem> : Zaten ticaret yapiyorsun.')                     DUELLO_YAPAMASSIN = 1             net.SendExchangeExitPacket()

uiinventory.py açın ve ımportların arasına ekleyın
Kod:
Kod:
import gameInfo import event import localegame import uiExchange_Multi


Aratın
Kod:
Kod:
def SelectItemSlot(self, itemSlotIndex):

Bu kodun altına bı boşluk bırakıp
Kod:
Kod:
attachedItemVID = mouseModule.mouseController.GetAttachedItemIndex()
alttakı kodu ekleyın

Kod:
Kod:
if player.GetItemIndex(attachedSlotPos) == 71084 or player.GetItemIndex(attachedSlotPos) == 71085:                 if gameInfo.UZAKTAN_TICARET_DURUM != 0:                     return                 if gameInfo.DUELLO_DURUM != 0:                     return

Aratın ve kod bloğunun ıçıne alttakı kodları ekleyın
Kod:
Kod:
def __DropSrcItemToDestItemInInventory(self, srcItemVID, srcItemSlotPos, dstItemSlotPos):


Kod:
Kod:
if srcItemSlotPos in uiExchange_Multi.ITEMSLOT:             #chat.AppendChat(chat.CHAT_TYPE_INFO, localegame.DUELLO_ITEMI_HAREKET_ETTIREMESSIN)             return


Aratın ve kod bloğunun ıçıne alttakı kodu ekleyın
Kod:
Kod:
def __SendUseItemPacket(self, slotPos):


Kod:
Kod:
if slotPos in uiExchange_Multi.ITEMSLOT:             #chat.AppendChat(chat.CHAT_TYPE_INFO, localegame.DUELLO_ITEMI_KULLANAMASSIN)             return


Aratın ve Kod bloğunun ıçıne alttakı kodu ekleyın
Kod:
Kod:
def __SendMoveItemPacket(self, srcSlotPos, dstSlotPos, srcItemCount):


Kod:
Kod:
if srcSlotPos in uiExchange_Multi.ITEMSLOT:             #chat.AppendChat(chat.CHAT_TYPE_INFO, localegame.DUELLO_ITEMI_HAREKET_ETTIREMESSIN)             return


uiprivateshopbuilder.py açın

Aratın
Kod:
Kod:
def Open(self, title):

Altına Ekleyın

Kod:
Kod:
if gameInfo.UZAKTAN_TICARET_DURUM != 0:             self.Hide()             return


uisafebox.py açın ve ımportların arasına ekleyın
Kod:
Kod:
import localegame import uiexchange_multi import gameInfo


Aratın ve altına bı boşluk bırakıp
Kod:
Kod:
def OnUpdate(self):

Ekleyın

Kod:
Kod:
if gameInfo.UZAKTAN_TICARET_DURUM != 0:             self.Close()



Aynı Kodu bı daha Aratıyoruz ve altına eklıyoruz
Kod:
Kod:
if gameInfo.UZAKTAN_TICARET_DURUM != 0:             self.Close()


uiwhisper.py açın ve ımportların arasına ekleyın
Kod:
Kod:
import gameInfo import os import uiCommon


Aratın ve kod bloğunun üstüne ekleyın
Kod:
Kod:
def OnTop(self):


Kod:
Kod:
def OnUpdate(self):        if gameInfo.UZAKTAN_TICARET_CANSEND == 0 and self.uzaktanticaret_yapabilirsin == 1:             self.uzaktanticaret.Show()         else:             self.uzaktanticaret.Hide()                          self.gamemasterMark = GetObject("gamemastermark")  bunu aratın altına bı boşlk bırakıp             self.uzaktanticaret = GetObject("uzaktanticaretbutton")             self.uzaktanticaret_yapabilirsin = 0


Aratın ve altına bı boşluk bırakıp
Kod:
Kod:
self.acceptButton.SetEvent(ui.__mem_func__(self.AcceptTarget))

Ekleyın

Kod:
Kod:
self.uzaktanticaret.SetEvent(ui.__mem_func__(self.UzaktanTicaret))

Aratın ve bu bloğun en sonunda bı boşluk bırakıp
Kod:
Kod:
def OpenWithTarget(self, targetName):

Ekleyın

Kod:
Kod:
self.uzaktanticaret.Show()         self.uzaktanticaret_yapabilirsin = 1         if gameInfo.UZAKTAN_TICARET_CANSEND == 1:             self.uzaktanticaret.Hide()
Kod:
Aratın ve en altında bı boşluk bırakın
Kod:
Kod:
def OpenWithoutTarget(self, event):

Ekleyın

Kod:
Kod:
self.uzaktanticaret.Hide()         self.uzaktanticaret_yapabilirsin = 0

Aratın ve kod bloğunun altına
Kod:
Kod:
def Close(self):

Bu kod bloğunu ekleyın

Kod:
Kod:
def UzaktanTicaret(self):         race = net.GetMainActorRace()         if not guild.IsGuildEnable():             net.SendWhisperPacket(self.targetName, "#uzaktan_ticaret_teklifi#"+str(player.GetStatus(player.LEVEL))+"#Lonca yok.#"+str(race))         else:             net.SendWhisperPacket(self.targetName, "#uzaktan_ticaret_teklifi#"+str(player.GetStatus(player.LEVEL))+"#"+str(player.GetGuildName())+"#"+str(race))             self.uzaktanticaret.Hide()         gameInfo.UZAKTAN_TICARET_ZAMAN = app.GetTime() + 30         gameInfo.UZAKTAN_TICARET_CANSEND = 1

İNDİR;

Ekli Pack Ve Virüstotali;



Gerekli Dosyalar Ve Virüstotali;




HATA ALAN ARKADAŞLAR KONU ALTINDAN BELİRTEBİLİR...
Uzaktan Ticaret Sistemi Nedir?
Metin2 özel sunucularında oyun içi ekonomiyi düzenlemek ve oyuncuların eşyalarını güvenli şekilde alıp satmasını sağlamak adına uzaktan ticaret sistemi oldukça yaygın bir yapıdır. Bu sistem, oyuncuların doğrudan temas etmeden, belirli bir mesafe veya kanal farkı olsa bile güvenli şekilde eşya ve altın alışveriş yapmalarına olanak tanır. Özellikle PvP sunucularında, oyuncuların birbirleriyle güvenli bir şekilde işlem yapabilmesi büyük önem taşır.

Uzaktan Ticaret Sisteminin Temel Özellikleri
Uzaktan ticaret sistemi genellikle C++ tabanlı sunucu kaynak kodları üzerinde geliştirilir. Bu sistemde oyuncular birbirlerine belirli bir menzilde değilken bile bir teklif gönderebilir. Alıcı ve satıcı birbirlerine eşya ve altın miktarını belirttikten sonra işlem onaylanır. Eğer her iki taraf da onay verirse, sistem otomatik olarak eşya ve altın transferini başlatır. Bu yöntem, dolandırıcılık riskini büyük ölçüde azaltır.

Metin2 Sunucularında Uzaktan Ticaret Nasıl Çalışır?
Bu sistem genellikle Python GUI arayüzü ile desteklenen bir istemci tarafında aktif edilir. Oyuncu bir başka oyuncuya uzaktan ticaret teklifi gönderdiğinde, karşı tarafın kabul etmesi gerekir. Kabul edildiğinde, her iki oyuncu da kendi envanterlerinden belirledikleri eşyaları ve altın miktarlarını koyar. İşlem onaylandıktan sonra sistem, iki oyuncunun da envanterlerine erişim sağlayarak eşya ve altın transferini başlatır. Bu işlem sırasında DB core devreye girerek veritabanındaki kayıtları günceller.

Sistem Geliştirme ve Kaynak Kodlar
Metin2 uzaktan ticaret sistemi genellikle game server programming ile entegre çalışır. Geliştiriciler bu sistemi source edit yoluyla mevcut server src dosyalarına entegre ederler. Bu işlem sırasında hem auth hem de game sunucularında değişiklikler yapılabilir. Sistem genellikle Martysama gibi popüler frameworkler üzerinden geliştirilir. Bu sayede geliştirme süreci hızlanır ve hata oranı düşer.

Güvenlik ve Hile Önlemleri
Uzaktan ticaret sistemi, oyuncular arasında güvenli alışveriş sağlarken aynı zamanda hilelere karşı da koruma sunar. Sistem, işlem sırasında her iki tarafın da eşyalarını kilitler ve işlem bitene kadar envanterine erişimlerini engeller. Bu sayede bir oyuncunun işlem esnasında kaçması veya eşyaları başka birine geçirmesi engellenir. Ayrıca, core seviyesinde güvenlik kontrolleri ile veri bütünlüğü sağlanır.

Uzaktan Ticaret Sisteminin Avantajları
Oyuncuların doğrudan temas etmeden eşya alışverişi yapabilmesi, sistemin en büyük avantajıdır. Ayrıca PvP sunucularında bu sistem sayesinde çete baskınları ve dolandırıcılık olayları azalır. Oyuncuların daha fazla eşya ve altın dolaşımı sağlanması, sunucu ekonomisinin dengelenmesine yardımcı olur. Sistem ayrıca channel bazında da çalışabilir, farklı kanallarda bulunan oyuncular bile işlem yapabilir.

Sonuç
Metin2 özel sunucularında uzaktan ticaret sistemi, hem oyuncu deneyimini artırır hem de sunucu yöneticilerine daha kolay bir ekonomi kontrolü sağlar. C++ ve Python tabanlı sistemlerle entegre çalışan bu yapı, doğru şekilde geliştirildiğinde güvenli ve verimli bir oyun içi ekonomi sunar. Metin2 development projelerinde bu tür sistemlerin yer alması, sunucuların rekabet gücünü artırır.


What is Remote Trade System?
In Metin2 private servers, the remote trade system is a widely used feature to regulate in-game economy and allow players to safely buy and sell items. This system allows players to securely trade items and gold even without direct contact or across different channels. Especially on PvP servers, ensuring safe transactions between players is of great importance.

Key Features of Remote Trade System
The remote trade system is typically developed on C++-based server source codes. In this system, players can send trade offers to each other even if they are not within a certain distance. After both the buyer and seller specify their items and gold amounts, the transaction is confirmed. If both parties approve, the system automatically initiates the item and gold transfer, significantly reducing fraud risks.

How Does Remote Trade Work in Metin2 Servers?
This system is often supported by a Python GUI interface on the client side. When a player sends a remote trade request to another player, the other party must accept it. Once accepted, both players place the items and gold amounts they have chosen from their inventories. After confirmation, the system accesses both players' inventories to initiate the item and gold transfer. During this process, the DB core intervenes to update database records.

System Development and Source Codes
The Metin2 remote trade system usually integrates with game server programming. Developers integrate this system into existing server src files through source edit. During this process, modifications may be made to both auth and game servers. The system is commonly developed using popular frameworks like Martysama, speeding up the development process and reducing error rates.

Security and Anti-Cheat Measures
While the remote trade system enables secure trading between players, it also provides protection against cheating. The system locks both players' items during the transaction, preventing access to their inventories until the process is completed. This prevents players from escaping mid-trade or transferring items to others. Additionally, security checks at the core level ensure data integrity.

Advantages of Remote Trade System
One of the main advantages is that players can exchange items without direct contact. On PvP servers, this system reduces gang attacks and fraud incidents. Increased item and gold circulation among players helps balance the server economy. The system can also operate across channels, allowing players in different channels to trade.

Conclusion
In Metin2 private servers, the remote trade system enhances player experience and provides easier economic control for server administrators. Integrated with C++ and Python-based systems, this structure offers a secure and efficient in-game economy when properly developed. Including such systems in Metin2 development projects increases the competitive strength of servers.
 

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

Benzer konular

Geri
Üst Alt