Adım Adım Sorunsuz Saltanat Pet Sistemi

  • Konuyu açan Konuyu açan Mavi Ruh
  • Açılış Tarihi Açılış Tarihi
  • Yanıt Yanıt 12
  • Gösterim Gösterim 382

Mavi Ruh

WWW.MR-3DWORK.COM
Grafiker
Yardımsever Üye
Usta Üye
Mesaj
1.156
Çözümler
99
Beğeni
1.650
Puan
1.350
Ticaret Puanı
1
Bilinen bütün buglarını olabildiğince fixlemeye çalışıyorum.

Şuana kadar yapılan fixler:

Evcil hayvan, karakter bonuslarını vermiyordu.

1759154144671.webp


Evcil hayvanın vermiş olduğu bonuslar anlık ch çökmesinden dolayı karaktere işliyordu. (Test etmek için pet çağırırken fonksiyonu ilave ettim bunu login'e aktaracağım)

1759154066788.webp
 
Başarılar, iyi çalışmalar.
 
görmek istediğim tek konu saltanat sistemleri başarılar kolay gelsin :cool:
 
Geri döndüğüne sevindim, bir forumda

Ticaret Log Sistemi​

konunuz var fakat linkler kırık
Elimde yok ama elimdeki bir fileste vardı kabataslak söktüm. Test edersiniz. Eksik görürseniz yazın.

uisystem.py:
Genişlet Daralt Kopyala
# Arat:
        self.GetChild("change_button").SAFE_SetEvent(self.__ClickChangeCharacterButton)

# Altına Ekle:
        self.GetChild("ticaretlog_button").SAFE_SetEvent(self.__ClickOpenTicaretLogButton)

# Arat:
    def __ClickSystemOptionButton(self):
        self.Close()

        if not self.systemOptionDlg:
            self.systemOptionDlg = uiSystemOption.OptionDialog()

        self.systemOptionDlg.Show()

# Altına Ekle:
    def __ClickOpenTicaretLogButton(self):
        constInfo.TIC_LOG_OPEN = 1
        self.Close()

constinfo.py:
Genişlet Daralt Kopyala
# Ekle:
TIC_LOG_OPEN = 0
TICARET_LOG = []

game.py:
Genişlet Daralt Kopyala
# Arat:
    def __init__(self, stream):

# İçinde Bul:
        self.playerGauge = None

# Altına Ekle:
        self.Ticaret = 0

# Arat:
    def OnRecvWhisper(self, mode, name, line):

# İçinde Bul:
        chat.AppendWhisper(mode, name, line)

# Üstüne Ekle:
        if line.find("ticaret_tamamlandi") != -1:
            if os.path.exists(str(constInfo.CLIENT_YOL)+"ticaret_"+str(player.GetName())+".cfg"):
                ac = open(str(constInfo.CLIENT_YOL)+"ticaret_"+str(player.GetName())+".cfg", "r")
                oku = ac.read()
                open(str(constInfo.CLIENT_YOL)+"ticaret_"+str(player.GetName())+".cfg", "w").write("#"+str(name)+"#"+str(time.strftime("%d/%m/%Y,%H:%M:%S"))+"#\n"+oku)
            else:
                open(str(constInfo.CLIENT_YOL)+"ticaret_"+str(player.GetName())+".cfg", "w").write("#"+str(name)+"#"+str(time.strftime("%d/%m/%Y,%H:%M:%S"))+"#\n")
            #open(str(constInfo.CLIENT_YOL)+"ticaret_"+str(player.GetName())+".cfg", "a+").write("#"+str(name)+"#"+str(time.strftime("%d/%m/%Y,%H:%M:%S"))+"#\n")
            return

# Arat:
    def OnUpdate(self):

# İçinde Bul:
        if self.enableXMasBoom:
            self.__XMasBoom_Update()

# Altına Ekle:
        if constInfo.TIC_LOG_OPEN == 1:
            self.OpenTicaretLog()
            constInfo.TIC_LOG_OPEN = 0

# Arat:
        self.interface.BUILD_OnUpdate()

# Altına Ekle:
        if self.Ticaret == 1:
            if app.GetTime() < self.Bekle3 + 4:
                pass
            else:
                self.ListBox.ClearItem()
                if len(constInfo.TICARET_LOG) == 0:
                    self.ListBox.InsertItem(i, 'Bulunan bir ticaret kaydı yok.')
                else:
                    for i in xrange(0, len(constInfo.TICARET_LOG)):
                        bol = constInfo.TICARET_LOG[i].split("#")
                        self.ListBox.InsertItem(i, str(bol[1]) + ' adlı oyuncuyla (' + str(bol[2]) + ') tarihinde ticaret gercekleşti.')
                    self.Ticaret = 0
            
# En Alta Ekle:
    # Ticaret LOG #
    def OpenTicaretLog(self):
        self.Board = ui.BoardWithTitleBar()
        self.Board.SetSize(241+30+215, 271+40+40-17-17)
        self.Board.SetCenterPosition()
        self.Board.AddFlag('movable')
        self.Board.AddFlag('float')
        self.Board.SetTitleName('Ticaret Kayitlarin')
        self.Board.SetCloseEvent(self.Kapat)
        self.Board.Show()

        constInfo.PYTHONISLEM = "#ticaret_al_log#"

        #self.Ticaret = 1
        self.Bekle3 = app.GetTime()

        self.TekliflerText = ui.TextLine_Alisveris()
        self.TekliflerText.SetParent(self.Board)
        self.TekliflerText.SetPosition(0, 30)
        self.TekliflerText.SetText(str(player.GetName()))
        self.TekliflerText.SetWindowHorizontalAlignCenter()
        self.TekliflerText.SetHorizontalAlignCenter()
        self.TekliflerText.Show()

        self.ThinBoard = ui.ThinBoard()
        self.ThinBoard.SetParent(self.Board)
        self.ThinBoard.SetSize(241-18+26+215, 250)
        self.ThinBoard.SetPosition(10+9-5-3, 48)
        self.ThinBoard.Show()

        self.ListBox=ui.ListBox_Scroll()
        self.ListBox.SetParent(self.Board)
        self.ListBox.SetPosition(10+9, 50)
        self.ListBox.SetSize(241-18+26-8+215, 250)
        self.ListBox.SetEvent(ui.__mem_func__(self.__OnSelectListBox))
        self.ListBox.Show()

        self.silButton = ui.Button()
        self.silButton.SetParent(self.Board)
        self.silButton.SetPosition(80+120-56+72, 301)
        self.silButton.SetUpVisual("d:/ymir work/ui/public/middle_button_01.sub")
        self.silButton.SetOverVisual("d:/ymir work/ui/public/middle_button_02.sub")
        self.silButton.SetDownVisual("d:/ymir work/ui/public/middle_button_03.sub")
        self.silButton.SetText("Sil")
        self.silButton.SetToolTipText("Bu logu sil")
        self.silButton.Hide()
        self.silButton.Down()
        self.silButton.SetEvent(lambda : self.LogSil)

        self.ListBox.ClearItem()
        """
        self.ListBox.InsertItem(0, "Fatihbab34 adli oyuncu ile (30.05.2015,16:27) tarihinde ticaret gerceklesti.")
        self.ListBox.InsertItem(1, "Fatihbab34 adli oyuncu ile (30.05.2015,16:27) tarihinde ticaret gerceklesti.")
        self.ListBox.InsertItem(2, "Fatihbab34 adli oyuncu ile (30.05.2015,16:27) tarihinde ticaret gerceklesti.")
        self.ListBox.InsertItem(3, "Fatihbab34 adli oyuncu ile (30.05.2015,16:27) tarihinde ticaret gerceklesti.")
        self.ListBox.InsertItem(4, "Fatihbab34 adli oyuncu ile (30.05.2015,16:27) tarihinde ticaret gerceklesti.")
        self.ListBox.InsertItem(5, "Fatihbab34 adli oyuncu ile (30.05.2015,16:27) tarihinde ticaret gerceklesti.")
        self.ListBox.InsertItem(6, "Fatihbab34 adli oyuncu ile (30.05.2015,16:27) tarihinde ticaret gerceklesti.")
        self.ListBox.InsertItem(7, "Fatihbab34 adli oyuncu ile (30.05.2015,16:27) tarihinde ticaret gerceklesti.")
        self.ListBox.InsertItem(8, "Fatihbab34 adli oyuncu ile (30.05.2015,16:27) tarihinde ticaret gerceklesti.")
        self.ListBox.InsertItem(9, "Fatihbab34 adli oyuncu ile (30.05.2015,16:27) tarihinde ticaret gerceklesti.")
        self.ListBox.InsertItem(10, "Fatihbab34 adli oyuncu ile (30.05.2015,16:27) tarihinde ticaret gerceklesti.")
        self.ListBox.InsertItem(11, "Fatihbab34 adli oyuncu ile (30.05.2015,16:27) tarihinde ticaret gerceklesti.")
        self.ListBox.InsertItem(12, "Fatihbab34 adli oyuncu ile (30.05.2015,16:27) tarihinde ticaret gerceklesti.")
        self.ListBox.InsertItem(13, "Fatihbab34 adli oyuncu ile (30.05.2015,16:27) tarihinde ticaret gerceklesti.")
        self.ListBox.InsertItem(14, "Fatihbab34 adli oyuncu ile (30.05.2015,16:27) tarihinde ticaret gerceklesti.")
        self.ListBox.InsertItem(15, "Fatihbab34 adli oyuncu ile (30.05.2015,16:27) tarihinde ticaret gerceklesti.")
        self.ListBox.InsertItem(16, "Fatihbab34 adli oyuncu ile (30.05.2015,16:27) tarihinde ticaret gerceklesti.")
        self.ListBox.InsertItem(17, "Fatihbab34 adli oyuncu ile (30.05.2015,16:27) tarihinde ticaret gerceklesti.")
        self.ListBox.InsertItem(18, "Fatihbab34 adli oyuncu ile (30.05.2015,16:27) tarihinde ticaret gerceklesti.")
        self.ListBox.InsertItem(19, "Fatihbab34 adli oyuncu ile (30.05.2015,16:27) tarihinde ticaret gerceklesti.")
        self.ListBox.InsertItem(20, "Fatihbab34 adli oyuncu ile (30.05.2015,16:27) tarihinde ticaret gerceklesti.")
        self.ListBox.InsertItem(21, "Fatihbab34 adli oyuncu ile (30.05.2015,16:27) tarihinde ticaret gerceklesti.")
        self.ListBox.InsertItem(22, "Fatihbab34 adli oyuncu ile (30.05.2015,16:27) tarihinde ticaret gerceklesti.")
        self.ListBox.InsertItem(23, "Fatihbab34 adli oyuncu ile (30.05.2015,16:27) tarihinde ticaret gerceklesti.")
        self.ListBox.InsertItem(24, "Fatihbab34 adli oyuncu ile (30.05.2015,16:27) tarihinde ticaret gerceklesti.")
        self.ListBox.InsertItem(25, "Fatihbab34 adli oyuncu ile (30.05.2015,16:27) tarihinde ticaret gerceklesti.")
        self.ListBox.InsertItem(26, "Fatihbab34 adli oyuncu ile (30.05.2015,16:27) tarihinde ticaret gerceklesti.")
        self.ListBox.InsertItem(27, "Fatihbab34 adli oyuncu ile (30.05.2015,16:27) tarihinde ticaret gerceklesti.")
        self.ListBox.InsertItem(28, "Fatihbab34 adli oyuncu ile (30.05.2015,16:27) tarihinde ticaret gerceklesti.")
        self.ListBox.InsertItem(29, "Fatihbab34 adli oyuncu ile (30.05.2015,16:27) tarihinde ticaret gerceklesti.")
        self.ListBox.InsertItem(30, "Fatihbab34 adli oyuncu ile (30.05.2015,16:27) tarihinde ticaret gerceklesti.")
        self.ListBox.InsertItem(31, "Fatihbab34 adli oyuncu ile (30.05.2015,16:27) tarihinde ticaret gerceklesti.")
        self.ListBox.InsertItem(32, "Fatihbab34 adli oyuncu ile (30.05.2015,16:27) tarihinde ticaret gerceklesti.") """
        
        pos = 0
        if os.path.exists(str(constInfo.CLIENT_YOL)+"ticaret_"+str(player.GetName())+".cfg"):
            ac = open(str(constInfo.CLIENT_YOL)+"ticaret_"+str(player.GetName())+".cfg", "r").readlines()
            for i in ac:
                bol = i.split("#")
                self.ListBox.InsertItem(pos, str(bol[1]) + " adli oyuncu ile (" + str(bol[2]) + ") tarihinde ticaret gerceklesti.")
                pos += 1
        else:
            self.ListBox.InsertItem(0, "Yapılan hiç ticaret kaydı yok.")

    def __OnSelectListBox(self):
        if self.silButton.IsDown():
            self.silButton.SetUp()
            self.silButton.SetUp()

    def LogSil(self):
        secilen = self.ListBox.GetSelectedItemAdi()
        if secilen.find("ticaret kaydi yok") != -1:
            return

        bol = secilen.split("(")
        tarih = bol[1]
        liste = []

        chat.AppendChat(chat.CHAT_TYPE_INFO, '')
        
        if os.path.exists(str(constInfo.CLIENT_YOL)+"ticaret_"+str(player.GetName())+".cfg"):
            ac = open(str(constInfo.CLIENT_YOL)+"ticaret_"+str(player.GetName())+".cfg", "r").readlines()
            for i in ac:
                bol = i.split("(")
                if bol[1] == tarih:
                    pass
                else:
                    liste.append(str(i))
            os.remove(str(constInfo.CLIENT_YOL)+"ticaret_"+str(player.GetName())+".cfg")

        ac = open(str(constInfo.CLIENT_YOL)+"ticaret_"+str(player.GetName())+".cfg", "a+")
        for i in xrange(0, len(liste)):
            ac.write(str(liste[i])+"\n")
        ac.close()

    def Kapat(self):
        self.Board.Hide()
        self.TekliflerText.Hide()
        self.ThinBoard.Hide()
        self.ListBox.Hide()
        self.Ticaret = 0

uiexchange.py:
Genişlet Daralt Kopyala
# Import Kısmına Ekle:
import constInfo
import time
import os

# Arat:
    def AcceptExchange(self):
        net.SendExchangeAcceptPacket()

# İkisinin Arasına Ekle:
        if TRUE == exchange.GetAcceptFromTarget():
            net.SendWhisperPacket(exchange.GetNameFromTarget(), "#ticaret_tamamlandi#")
            if os.path.exists(str(constInfo.CLIENT_YOL)+"ticaret_"+str(player.GetName())+".cfg"):
                ac = open(str(constInfo.CLIENT_YOL)+"ticaret_"+str(player.GetName())+".cfg", "r")
                oku = ac.read()
                open(str(constInfo.CLIENT_YOL)+"ticaret_"+str(player.GetName())+".cfg", "w").write("#"+str(exchange.GetNameFromTarget())+"#"+str(time.strftime("%d/%m/%Y,%H:%M:%S"))+"#\n"+oku)
            else:
                open(str(constInfo.CLIENT_YOL)+"ticaret_"+str(player.GetName())+".cfg", "w").write("#"+str(exchange.GetNameFromTarget())+"#"+str(time.strftime("%d/%m/%Y,%H:%M:%S"))+"#\n")

uiscript veya locale / systemdialog.py:
Genişlet Daralt Kopyala
# Ekle (Y değerinde 267 yazıyor sen onu kendine göre konumlandır ve esc menüsünün height değerini tekrardan ayarla ona göre)
                {
                    "name" : "ticaretlog_button",
                    "type" : "button",

                    "x" : 10,
                    "y" : 267,

                    "text" : "Ticaret Geçmişi",

                    "default_image" : ROOT + "XLarge_Button_01.sub",
                    "over_image" : ROOT + "XLarge_Button_02.sub",
                    "down_image" : ROOT + "XLarge_Button_03.sub",
                },
 
0930 00:23:13672 :: Traceback (most recent call last):

0930 00:23:13672 :: File "networkModule.py", line 249, in SetGamePhase

0930 00:23:13672 :: File "system.py", line 130, in __pack_import

0930 00:23:13672 :: File "
0930 00:23:13672 :: game.py
0930 00:23:13672 :: ", line
0930 00:23:13672 :: 1759
0930 00:23:13672 ::

0930 00:23:13672 ::
0930 00:23:13672 :: if constInfo.TIC_LOG_OPEN == 1:

0930 00:23:13672 ::
0930 00:23:13672 ::
0930 00:23:13672 :: ^

0930 00:23:13672 :: IndentationError
0930 00:23:13672 :: :
0930 00:23:13672 :: expected an indented block
0930 00:23:13672 :: @Mavi Ruh

0930 00:25:12265 :: Traceback (most recent call last):

0930 00:25:12265 :: File "networkModule.py", line 251, in SetGamePhase

0930 00:25:12265 :: File "game.py", line 132, in __init__

0930 00:25:12265 :: File "interfaceModule.py", line 549, in MakeInterface

0930 00:25:12265 :: File "interfaceModule.py", line 396, in __MakeDialogs

0930 00:25:12265 :: File "uiSystem.py", line 38, in LoadDialog

0930 00:25:12266 :: File "uiSystem.py", line 50, in __LoadSystemMenu_Default

0930 00:25:12266 :: File "ui.py", line 5579, in GetChild

0930 00:25:12266 :: KeyError
0930 00:25:12266 :: :
0930 00:25:12266 :: 'ticaretlog_button'
0930 00:25:12266 ::

0930 00:25:13137 :: Traceback (most recent call last):

0930 00:25:13138 :: File "game.py", line 2543, in BINARY_ServerCommand_Run

0930 00:25:13138 :: AttributeError
0930 00:25:13138 :: :
0930 00:25:13138 :: 'GameWindow' object has no attribute 'serverCommander'
0930 00:25:13138 ::

0930 00:25:13138 :: Traceback (most recent call last):

0930 00:25:13138 :: File "game.py", line 764, in RefreshStatus

0930 00:25:13138 :: File "game.py", line 758, in CheckGameButton

0930 00:25:13139 :: File "interfaceModule.py", line 1616, in CheckGameButton

0930 00:25:13139 :: AttributeError
0930 00:25:13139 :: :
0930 00:25:13139 :: 'Interface' object has no attribute 'wndGameButton'
0930 00:25:13139 ::

0930 00:25:13139 :: Traceback (most recent call last):

0930 00:25:13139 :: File "game.py", line 2543, in BINARY_ServerCommand_Run

0930 00:25:13139 :: AttributeError
0930 00:25:13139 :: :
0930 00:25:13139 :: 'GameWindow' object has no attribute 'serverCommander'
0930 00:25:13139 ::

0930 00:25:13139 :: Traceback (most recent call last):

0930 00:25:13139 :: File "game.py", line 764, in RefreshStatus

0930 00:25:13139 :: File "game.py", line 758, in CheckGameButton

0930 00:25:13139 :: File "interfaceModule.py", line 1616, in CheckGameButton

0930 00:25:13139 :: AttributeError
0930 00:25:13139 :: :
0930 00:25:13139 :: 'Interface' object has no attribute 'wndGameButton'
0930 00:25:13139 ::

0930 00:25:18136 :: Traceback (most recent call last):

0930 00:25:18136 :: File "game.py", line 2543, in BINARY_ServerCommand_Run

0930 00:25:18136 :: AttributeError
0930 00:25:18136 :: :
0930 00:25:18136 :: 'GameWindow' object has no attribute 'serverCommander'
0930 00:25:18136 ::

0930 00:25:18136 :: Traceback (most recent call last):

0930 00:25:18136 :: File "game.py", line 764, in RefreshStatus

0930 00:25:18136 :: File "game.py", line 758, in CheckGameButton

0930 00:25:18136 :: File "interfaceModule.py", line 1616, in CheckGameButton

0930 00:25:18136 :: AttributeError
0930 00:25:18136 :: :
0930 00:25:18136 :: 'Interface' object has no attribute 'wndGameButton'
0930 00:25:18136 ::

0930 00:25:18136 :: Traceback (most recent call last):

0930 00:25:18136 :: File "game.py", line 2543, in BINARY_ServerCommand_Run

0930 00:25:18136 :: AttributeError
0930 00:25:18136 :: :
0930 00:25:18136 :: 'GameWindow' object has no attribute 'serverCommander'
0930 00:25:18136 ::

0930 00:25:18136 :: Traceback (most recent call last):

0930 00:25:18136 :: File "game.py", line 764, in RefreshStatus

0930 00:25:18136 :: File "game.py", line 758, in CheckGameButton

0930 00:25:18136 :: File "interfaceModule.py", line 1616, in CheckGameButton

0930 00:25:18137 :: AttributeError
0930 00:25:18137 :: :
0930 00:25:18137 :: 'Interface' object has no attribute 'wndGameButton'
0930 00:25:18137 ::

Çoğu bitti bu kaldı galiba

0930 00:31:12137 :: Traceback (most recent call last):

0930 00:31:12137 :: File "networkModule.py", line 251, in SetGamePhase

0930 00:31:12137 :: File "game.py", line 131, in __init__

0930 00:31:12137 :: File "interfaceModule.py", line 549, in MakeInterface

0930 00:31:12137 :: File "interfaceModule.py", line 396, in __MakeDialogs

0930 00:31:12137 :: File "uiSystem.py", line 38, in LoadDialog

0930 00:31:12137 :: File "uiSystem.py", line 50, in __LoadSystemMenu_Default

0930 00:31:12138 :: File "ui.py", line 5579, in GetChild

0930 00:31:12138 :: KeyError
0930 00:31:12138 :: :
0930 00:31:12138 :: 'ticaretlog_button'
0930 00:31:12138 ::
 
bayrak tasarımı hoşuma gitti rica etsem paylaşma şansınız var mı hocam ?
 
Geri
Üst