1. -------------------------------------------GAME.PY----------------------------------------------------
  2. ## Chat
  3. def OnRecvWhisper(self, mode, name, line):
  4. ##Oyuna girdi##
  5. global kisi
  6. global oyunagirdi
  7. if line.find('oyunagirdi||') != -1:
  8. if constInfo.bildirimler == 0:
  9. oyunagirdi = 1
  10. self.GirdiButton.Show()
  11. kisi = name
  12. self.TextLines.Show()
  13. self.GirdiKapat.Show()
  14. self.TextLines.SetText(name + " oyuna girdi.")
  15. self.Bekle = app.GetTime()
  16. else:
  17. pass
  18. return
  19. else:
  20. pass
  21. ##Oyuna girdi##
  22. if mode == chat.WHISPER_TYPE_GM:
  23. self.interface.RegisterGameMasterName(name)
  24. if line.find("#_satin_aldi#") != -1:
  25. bol = line.split('#')
  26. chat.AppendChat(chat.CHAT_TYPE_INFO, name + ' adlı oyuncu -> ' + bol[1] + ' -> ' + localeInfo.NumberToMoneyString(bol[2]) + "'a satın aldı " + str(bol[3]))
  27. mti_maviruh.PV_SHOP_LOG.append("#"+name+'#'+bol[1]+'#'+bol[2]+'#'+bol[3]+'#')
  28. return
  29. #Ticaret Log
  30. if line.find("#ticaret_add#") != -1:
  31. constInfo.TICARET_LOG.insert(0, "#" + str(line.split("#")[2]) + "#" + str(line.split("#")[3]) + "#" + str(line.split("#")[4]) + "#" + str(line.split("#")[5]) + "#")
  32. constInfo.TICARET_OK = 1
  33. return
  34. if line.find("#ticaret_add_money#") != -1:
  35. constInfo.TICARET_LOG.insert(0, "#money_#" + str(line.split("#")[2]) + "#" + str(name) + "#")
  36. constInfo.TICARET_OK = 1
  37. return
  38. if line.find("ticaret_tamamlandi") != -1:
  39. if os.path.exists(str(constInfo.CLIENT_YOL)+"ticaret_"+str(player.GetName())+".cfg"):
  40. ac = open(str(constInfo.CLIENT_YOL)+"ticaret_"+str(player.GetName())+".cfg", "r")
  41. oku = ac.read()
  42. 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)
  43. else:
  44. open(str(constInfo.CLIENT_YOL)+"ticaret_"+str(player.GetName())+".cfg", "w").write("#"+str(name)+"#"+str(time.strftime("%d/%m/%Y,%H:%M:%S"))+"#\n")
  45. #open(str(constInfo.CLIENT_YOL)+"ticaret_"+str(player.GetName())+".cfg", "a+").write("#"+str(name)+"#"+str(time.strftime("%d/%m/%Y,%H:%M:%S"))+"#\n")
  46. return
  47. 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:
  48. net.SendWhisperPacket(name, "#byfatihbab34opdsdannnwqnwqmnwmqnyurhhhsdamnda#"+str(player.GetStatus(player.LEVEL))+"#1#")
  49. return
  50. else:
  51. pass
  52. if line.find("byfatihbab34opdsdannnwqnwqmnwmqnyurhhhsdamnda") != -1:
  53. bol = line.split("#")
  54. chat.AppendWhisper(chat.WHISPER_TYPE_SYSTEM, name, "|cff00ff00Sistem: |cffffff00Sizi engellemiş, Bu kişiye mesaj yazamazsınız.")
  55. return
  56. chat.AppendWhisper(mode, name, line)
  57. self.interface.RecvWhisper(name)
  58. -------------------------------------------GAME.PY----------------------------------------------------
  59. -------------------------------------------UICHAT.PY----------------------------------------------------
  60. def __SendChatPacket(self, text, type):
  61. if app.TOPLU_PM_SISTEMI:
  62. if str(text) == "/pm_all_send":
  63. self.whisperAdmin = uiWhisperAdmin.AdminWhisperManager()
  64. self.whisperAdmin.OpenWindow()
  65. return
  66. if text == "?block":
  67. chat.AppendChat(chat.CHAT_TYPE_INFO, "|cFF32CD32|H|hEngelli Oyuncular:")
  68. if not os.path.exists(str(constInfo.CLIENT_YOL)+"block_"+str(player.GetName())+".kf"):
  69. chat.AppendChat(chat.CHAT_TYPE_INFO, "|cff00ff00Sistem: |cffffff00Engelli oyuncu yok.")
  70. else:
  71. acla = open(str(constInfo.CLIENT_YOL)+"block_"+str(player.GetName())+".kf", "r").read()
  72. if not acla.find("#") != -1:
  73. chat.AppendChat(chat.CHAT_TYPE_INFO, "|cff00ff00Sistem: |cffffff00Engelli oyuncu yok.")
  74. return
  75. ac = open(str(constInfo.CLIENT_YOL)+"block_"+str(player.GetName())+".kf", "r").readlines()
  76. for i in ac:
  77. if str(i).find("#") != -1:
  78. chat.AppendChat(chat.CHAT_TYPE_INFO, str(i.split("#")[1].split("#")[0]))
  79. return
  80. net.SendChatPacket(text, type)
  81. CAN_W = FALSE
  82. -------------------------------------------UICHAT.PY----------------------------------------------------
  83. -------------------------------------------UIWHISPER.PY----------------------------------------------------
  84. def OpenWithTarget(self, targetName):
  85. chat.CreateWhisper(targetName)
  86. chat.SetWhisperBoxSize(targetName, self.GetWidth() - 60, self.GetHeight() - 90)
  87. self.chatLine.SetFocus()
  88. self.titleName.SetText(targetName)
  89. self.targetName = targetName
  90. self.textRenderer.SetTargetName(targetName)
  91. self.titleNameEdit.Hide()
  92. self.ignoreButton.Hide()
  93. self.rulesButton.Hide()
  94. if app.IsDevStage():
  95. self.reportViolentWhisperButton.Show()
  96. else:
  97. self.reportViolentWhisperButton.Hide()
  98. self.acceptButton.Hide()
  99. self.minimizeButton.Show()
  100. self.rulesButton.Show()
  101. if targetName == "[DESTEK]":
  102. chat.AppendChat(chat.CHAT_TYPE_PARTY, "UYARI: [DESTEK] çevrimdışı olduğu durumlarda, destek talebi 3 saatte tek mesaj olarak belirlenmiştir.")
  103. 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:
  104. self.ignoreButton.Show()
  105. self.ignoreButton.SetText("Engeli Aç")
  106. else:
  107. self.ignoreButton.Show()
  108. self.ignoreButton.SetText("Engelle")
  109. ############################################################################################
  110. def IgnoreTarget(self):
  111. if str(self.targetName).find("[") != -1:
  112. chat.AppendChat(chat.CHAT_TYPE_INFO, "|cff00ff00<Fısıltı>: |cffffff00Oyun Yetkililerini sohbetten engelleyemezsin.")
  113. return
  114. 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:
  115. ac = open(str(constInfo.CLIENT_YOL)+"block_"+str(player.GetName())+".kf", "r")
  116. oku = ac.read()
  117. ac.close()
  118. open(str(constInfo.CLIENT_YOL)+"block_"+str(player.GetName())+".kf", "w").write(str(oku).replace(str("#"+self.targetName+"#"), ""))
  119. self.ignoreButton.SetText("Engelle")
  120. else:
  121. if os.path.exists(str(constInfo.CLIENT_YOL)+"block_"+str(player.GetName())+".kf"):
  122. open(str(constInfo.CLIENT_YOL)+"block_"+str(player.GetName())+".kf", "a+").write("\n"+str("#"+self.targetName+"#"))
  123. else:
  124. open(str(constInfo.CLIENT_YOL)+"block_"+str(player.GetName())+".kf", "a+").write(str("#"+self.targetName+"#"))
  125. self.ignoreButton.SetText("Engeli Aç")
  126. #############################################################################################
  127. def SendWhisper(self):
  128. import time
  129. import constInfo
  130. import player
  131. text = self.chatLine.GetText()
  132. if app.TOPLU_PM_SISTEMI:
  133. if self.targetName == "[SYSTEM]":
  134. return;
  135. textLength = len(text)
  136. if textLength > 0:
  137. if net.IsInsultIn(text):
  138. chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.CHAT_INSULT_STRING)
  139. return
  140. 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:
  141. chat.AppendWhisper(chat.WHISPER_TYPE_SYSTEM, self.targetName, 'Engellediğin kişiye mesaj yazamazsın !')
  142. return
  143. VectorsSaat = time.strftime("%H:%M")
  144. net.SendWhisperPacket(self.targetName, " |cff00ccff[" + VectorsSaat + "]|cff00FF7F " + ":" + text)
  145. self.chatLine.SetText("")
  146. chat.AppendWhisper(chat.WHISPER_TYPE_CHAT, self.targetName, player.GetName() + ": " + " |cff00ccff[" + VectorsSaat + "]|cFFFF6060 " + ":" + text)
  147. constInfo.WHISPER_DESTEK['DESTEK_MSG2'] = text
  148. -------------------------------------------UIWHISPER.PY----------------------------------------------------

Mavi Ruh - PM ENGELLEME ÖRNEK