Example #1
0
 def delReaderList(self,id):
     '''删除未读信息
     @param id: int 未读信息的角色id
     '''
     from app.scense.netInterface import pushObjectNetInterface
     if id in self.readerList: #如果未读信息中有此角色id
         self.readerList.remove(id)
         pushObjectNetInterface.pushChatToObjectList(self.id, id)
Example #2
0
 def addReaderList(self,id):
     '''设置未读信息
     @param id: int 未读信息de角色id
     '''
     from app.scense.netInterface import pushObjectNetInterface
     if not id in self.readerList:
         self.readerList.append(id)
         pushObjectNetInterface.pushChatToObjectList(self.id, id)
Example #3
0
 def addReaderList(self, id):
     '''设置未读信息
     @param id: int 未读信息de角色id
     '''
     from app.scense.netInterface import pushObjectNetInterface
     if not id in self.readerList:
         self.readerList.append(id)
         pushObjectNetInterface.pushChatToObjectList(self.id, id)
Example #4
0
 def delReaderList(self, id):
     '''删除未读信息
     @param id: int 未读信息的角色id
     '''
     from app.scense.netInterface import pushObjectNetInterface
     if id in self.readerList:  #如果未读信息中有此角色id
         self.readerList.remove(id)
         pushObjectNetInterface.pushChatToObjectList(self.id, id)
Example #5
0
    def addLog(self,id,tid,context,time):
        '''添加聊天记录
        @param id: int  当前角色id
        @param tid: int 接受聊天信息对象id
        @param contxt: int 聊天内容
        '''
        from app.scense.core.PlayersManager import PlayersManager
        py=PlayersManager().getPlayerByID(id) #聊天接收者
        from app.scense.utils.dbopera import dbFriend
        from app.scense.netInterface import pushObjectNetInterface
        ftypeid=dbFriend.getis(tid, id)#1好友  2黑名单  0没有关系
        if ftypeid==2:
            pushObjectNetInterface.pushOtherMessage(905, Lg().g(643), [py.getDynamicId()])
            return
        
        clog=self.addChatLog(id) #获取或添加私聊类
        clog.addFriends(tid) #当前角色添加私聊好友
        clog.addChat(tid,context,time) #添加聊天记录
        
        clog1=self.addChatLog(tid) #获取或添加私聊类(聊天接受者聊天类)
        clog1.addReaderList(id) #设置聊天接受者有未读信息
        clog1.addFriends(id) #聊天接受者角色添加私聊好友
        pye1=PlayersManager().getPlayerByID(tid) #聊天接收者
        
        sid=clog.getReading()#获取正在聊天角色id
        if sid==tid : #当前角色正在跟聊天接受者私聊中(并且私聊面板开启中)
            ct=self.getLogonly(id, tid)
            pushObjectNetInterface.pushChatToObjectList(id, tid) #推送给聊天发送者,聊天成员列表
            if pye1:#如果聊天接收者在线
                pushObjectNetInterface.pushChatToObjectList(tid, id) #推送给聊天发接收者,聊天成员列表
            pushObjectNetInterface.pushServerSendChatInfo(id, ct,tid) #推送聊天信息
            if clog1.getReading()==id: #如果对方也正在跟我聊天
                pushObjectNetInterface.pushServerSendChatInfo(tid, ct,id) #推送聊天信息
                clog1.delReaderList(id)
#            else:
#                pushObjectNetInterface.pushChatToObjectList(tid, id) #推送给聊天接受者,聊天成员列表
        else: # 当前角色正在跟其他角色饲料中(或者私聊面板关闭)
            pushObjectNetInterface.pushChatToObjectList(id, tid) #推送给聊天发送者,聊天成员列表
            if not pye1: #如果对方已经下线
                return
            pushObjectNetInterface.pushChatToObjectList(tid, id) #推送给聊天接受者,聊天成员列表
#            pushObjectNetInterface.pushServerSendChatInfo(id, context)
            
        clog.setReading(tid) #设置当前角色正在和tid聊天