def initVarDatas(self, tasklet): # ReadWrite Data self.robotclientmap = {} # kye=<ip:port> value=<UDP Client> self.clientmap = {} # kye=<serverid> value=<UDP Client> self.usermap = {} # key=<userId> value=<ConnUser|User> self.new_protocols = {} # item=<ConnTCPSrvProtocol=ConnTCPSrvProtocol> self.maproom = {} # key=<roomId> value=<Room> self.eventBus = TyContext.TYEventBus() self.initVarDatas2() self.heartCounter = 0
# -*- coding: utf-8 -*- ''' Created on 2014年4月29日 @author: [email protected] ''' from tyframework.context import TyContext from tysdk.entity.user_common.events import UserEvent SdkEventBus = TyContext.TYEventBus() class UserPhotoChangedEvent(UserEvent): def __str__(self): return str({ 'userId': self.userId, 'photoType': self.photoType, 'oldPhoto': self.oldPhoto, 'newPhoto': self.newPhoto, 'reason': self.reason, 'timestamp': self.timestamp, }) def __init__(self, userId, photoType, oldPhoto, newPhoto, reason=None, timestamp=None): super(UserPhotoChangedEvent, self).__init__(userId, timestamp)