reportSvc.py (2663B)
1 #Embedded file name: C:\BuildAgent\work\20d73f1b24eed06e\eve\release\V24.01\eve\client\script\ui\shared\zhReport\reportSvc.py 2 import log 3 from carbon.common.script.sys import service 4 from carbon.common.script.util.format import FmtDate 5 from eve.client.script.ui.shared.zhReport.reportWindow import ReportWindow, TYPE_EXPLOIT_ABUSE, TYPE_GAMBLING, TYPE_INAPPROPRIATE_CHARACTER_NAME, TYPE_INAPPROPRIATE_LANGUAGE, TYPE_MACRO_USE, TYPE_OFFENSIVE_MAIL, TYPE_OTHER, TYPE_QUESTIONABLE_TRANSACTION 6 7 class ReportService(service.Service): 8 _exportedcalls = {} 9 __guid__ = 'svc.reportClientSvc' 10 __servicename__ = 'ReportSystemService' 11 __displayname__ = 'Report System Client Service' 12 13 def Report(self, charID, *args): 14 wnd = ReportWindow.Open() 15 wnd.SetReportedCharacter(charID) 16 17 def SubmitReportInformation(self, charID, type, comments): 18 if type == TYPE_INAPPROPRIATE_LANGUAGE: 19 focus_window = sm.GetService('focus').GetFocusChannel() 20 chat_time = '' 21 chat_channel = sm.GetService('XmppChat').GetDisplayName(focus_window.GetChannelId()) 22 chat_content = '' 23 log.LogInfo('reporting chat %s, %s' % (chat_time, chat_channel)) 24 for sender, text, timestamp, colorkey in focus_window.messages: 25 if sender == charID: 26 chat_content += '[%s] %s> %s\n' % (FmtDate(timestamp), cfg.eveowners.Get(sender).name, text) 27 chat_time = FmtDate(timestamp) 28 29 if chat_content == '': 30 return 'No chat content to report' 31 else: 32 sm.RemoteSvc('ingamereport').report_inappropriate_language(charID, comments, chat_time, chat_channel, chat_content) 33 return 'Report Success' 34 elif type == TYPE_OFFENSIVE_MAIL: 35 sm.RemoteSvc('ingamereport').report_offensive_mail(charID, comments) 36 elif type == TYPE_MACRO_USE: 37 sm.RemoteSvc('ingamereport').report_macro_use(charID, comments) 38 elif type == TYPE_QUESTIONABLE_TRANSACTION: 39 sm.RemoteSvc('ingamereport').report_questionable_transaction(charID, comments) 40 elif type == TYPE_INAPPROPRIATE_CHARACTER_NAME: 41 sm.RemoteSvc('ingamereport').report_inappropriate_character_name(charID, comments) 42 elif type == TYPE_EXPLOIT_ABUSE: 43 sm.RemoteSvc('ingamereport').report_exploit_abuse(charID, comments) 44 elif type == TYPE_GAMBLING: 45 sm.RemoteSvc('ingamereport').report_gambling(charID, comments) 46 elif type == TYPE_OTHER: 47 sm.RemoteSvc('ingamereport').report_other(charID, comments) 48 return 'Report Success'