- -------------------------------------------GAME.PY----------------------------------------------------
- ## Chat
- def OnRecvWhisper(self, mode, name, line):
- ##Oyuna girdi##
- global kisi
- global oyunagirdi
- if line.find('oyunagirdi||') != -1:
- if constInfo.bildirimler == 0:
- oyunagirdi = 1
- self.GirdiButton.Show()
- kisi = name
- self.TextLines.Show()
- self.GirdiKapat.Show()
- self.TextLines.SetText(name + " oyuna girdi.")
- self.Bekle = app.GetTime()
- else:
- pass
- return
- else:
- pass
- ##Oyuna girdi##
- if mode == chat.WHISPER_TYPE_GM:
- self.interface.RegisterGameMasterName(name)
- if line.find("#_satin_aldi#") != -1:
- bol = line.split('#')
- chat.AppendChat(chat.CHAT_TYPE_INFO, name + ' adlı oyuncu -> ' + bol[1] + ' -> ' + localeInfo.NumberToMoneyString(bol[2]) + "'a satın aldı " + str(bol[3]))
- mti_maviruh.PV_SHOP_LOG.append("#"+name+'#'+bol[1]+'#'+bol[2]+'#'+bol[3]+'#')
- return
- #Ticaret Log
- if line.find("#ticaret_add#") != -1:
- constInfo.TICARET_LOG.insert(0, "#" + str(line.split("#")[2]) + "#" + str(line.split("#")[3]) + "#" + str(line.split("#")[4]) + "#" + str(line.split("#")[5]) + "#")
- constInfo.TICARET_OK = 1
- return
- if line.find("#ticaret_add_money#") != -1:
- constInfo.TICARET_LOG.insert(0, "#money_#" + str(line.split("#")[2]) + "#" + str(name) + "#")
- constInfo.TICARET_OK = 1
- return
- 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
- if os.path.exists(str(constInfo.CLIENT_YOL)+"block_"+str(player.GetName())+".kf") and open(str(constInfo.CLIENT_YOL)+"block_"+str(player.GetName())+".kf", "r").read().find("#"+str(name)+"#") != -1:
- net.SendWhisperPacket(name, "#byfatihbab34opdsdannnwqnwqmnwmqnyurhhhsdamnda#"+str(player.GetStatus(player.LEVEL))+"#1#")
- return
- else:
- pass
- if line.find("byfatihbab34opdsdannnwqnwqmnwmqnyurhhhsdamnda") != -1:
- bol = line.split("#")
- chat.AppendWhisper(chat.WHISPER_TYPE_SYSTEM, name, "|cff00ff00Sistem: |cffffff00Sizi engellemiş, Bu kişiye mesaj yazamazsınız.")
- return
- chat.AppendWhisper(mode, name, line)
- self.interface.RecvWhisper(name)
- -------------------------------------------GAME.PY----------------------------------------------------
- -------------------------------------------UICHAT.PY----------------------------------------------------
- def __SendChatPacket(self, text, type):
- if app.TOPLU_PM_SISTEMI:
- if str(text) == "/pm_all_send":
- self.whisperAdmin = uiWhisperAdmin.AdminWhisperManager()
- self.whisperAdmin.OpenWindow()
- return
- if text == "?block":
- chat.AppendChat(chat.CHAT_TYPE_INFO, "|cFF32CD32|H|hEngelli Oyuncular:")
- if not os.path.exists(str(constInfo.CLIENT_YOL)+"block_"+str(player.GetName())+".kf"):
- chat.AppendChat(chat.CHAT_TYPE_INFO, "|cff00ff00Sistem: |cffffff00Engelli oyuncu yok.")
- else:
- acla = open(str(constInfo.CLIENT_YOL)+"block_"+str(player.GetName())+".kf", "r").read()
- if not acla.find("#") != -1:
- chat.AppendChat(chat.CHAT_TYPE_INFO, "|cff00ff00Sistem: |cffffff00Engelli oyuncu yok.")
- return
- ac = open(str(constInfo.CLIENT_YOL)+"block_"+str(player.GetName())+".kf", "r").readlines()
- for i in ac:
- if str(i).find("#") != -1:
- chat.AppendChat(chat.CHAT_TYPE_INFO, str(i.split("#")[1].split("#")[0]))
- return
- net.SendChatPacket(text, type)
- CAN_W = FALSE
- -------------------------------------------UICHAT.PY----------------------------------------------------
- -------------------------------------------UIWHISPER.PY----------------------------------------------------
- def OpenWithTarget(self, targetName):
- chat.CreateWhisper(targetName)
- chat.SetWhisperBoxSize(targetName, self.GetWidth() - 60, self.GetHeight() - 90)
- self.chatLine.SetFocus()
- self.titleName.SetText(targetName)
- self.targetName = targetName
- self.textRenderer.SetTargetName(targetName)
- self.titleNameEdit.Hide()
- self.ignoreButton.Hide()
- self.rulesButton.Hide()
- if app.IsDevStage():
- self.reportViolentWhisperButton.Show()
- else:
- self.reportViolentWhisperButton.Hide()
- self.acceptButton.Hide()
- self.minimizeButton.Show()
- self.rulesButton.Show()
- if targetName == "[DESTEK]":
- chat.AppendChat(chat.CHAT_TYPE_PARTY, "UYARI: [DESTEK] çevrimdışı olduğu durumlarda, destek talebi 3 saatte tek mesaj olarak belirlenmiştir.")
- if os.path.exists(str(constInfo.CLIENT_YOL)+"block_"+str(player.GetName())+".kf") and open(str(constInfo.CLIENT_YOL)+"block_"+str(player.GetName())+".kf", "r").read().find("#"+str(targetName)+"#") != -1:
- self.ignoreButton.Show()
- self.ignoreButton.SetText("Engeli Aç")
- else:
- self.ignoreButton.Show()
- self.ignoreButton.SetText("Engelle")
- ############################################################################################
- def IgnoreTarget(self):
- if str(self.targetName).find("[") != -1:
- chat.AppendChat(chat.CHAT_TYPE_INFO, "|cff00ff00<Fısıltı>: |cffffff00Oyun Yetkililerini sohbetten engelleyemezsin.")
- return
- if os.path.exists(str(constInfo.CLIENT_YOL)+"block_"+str(player.GetName())+".kf") and open(str(constInfo.CLIENT_YOL)+"block_"+str(player.GetName())+".kf", "r").read().find("#"+str(self.targetName)+"#") != -1:
- ac = open(str(constInfo.CLIENT_YOL)+"block_"+str(player.GetName())+".kf", "r")
- oku = ac.read()
- ac.close()
- open(str(constInfo.CLIENT_YOL)+"block_"+str(player.GetName())+".kf", "w").write(str(oku).replace(str("#"+self.targetName+"#"), ""))
- self.ignoreButton.SetText("Engelle")
- else:
- if os.path.exists(str(constInfo.CLIENT_YOL)+"block_"+str(player.GetName())+".kf"):
- open(str(constInfo.CLIENT_YOL)+"block_"+str(player.GetName())+".kf", "a+").write("\n"+str("#"+self.targetName+"#"))
- else:
- open(str(constInfo.CLIENT_YOL)+"block_"+str(player.GetName())+".kf", "a+").write(str("#"+self.targetName+"#"))
- self.ignoreButton.SetText("Engeli Aç")
- #############################################################################################
- def SendWhisper(self):
- import time
- import constInfo
- import player
- text = self.chatLine.GetText()
- if app.TOPLU_PM_SISTEMI:
- if self.targetName == "[SYSTEM]":
- return;
- textLength = len(text)
- if textLength > 0:
- if net.IsInsultIn(text):
- chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.CHAT_INSULT_STRING)
- return
- if os.path.exists(str(constInfo.CLIENT_YOL)+"block_"+str(player.GetName())+".kf") and open(str(constInfo.CLIENT_YOL)+"block_"+str(player.GetName())+".kf", "r").read().find("#"+str(self.targetName)+"#") != -1:
- chat.AppendWhisper(chat.WHISPER_TYPE_SYSTEM, self.targetName, 'Engellediğin kişiye mesaj yazamazsın !')
- return
- VectorsSaat = time.strftime("%H:%M")
- net.SendWhisperPacket(self.targetName, " |cff00ccff[" + VectorsSaat + "]|cff00FF7F " + ":" + text)
- self.chatLine.SetText("")
- chat.AppendWhisper(chat.WHISPER_TYPE_CHAT, self.targetName, player.GetName() + ": " + " |cff00ccff[" + VectorsSaat + "]|cFFFF6060 " + ":" + text)
- constInfo.WHISPER_DESTEK['DESTEK_MSG2'] = text
- -------------------------------------------UIWHISPER.PY----------------------------------------------------
Mavi Ruh - PM ENGELLEME ÖRNEK