Exemple #1
0
def sendMail(dynamicId, characterId, gamerName, title, content):
    '''添加邮件
	@param dynamicId:int 客户端的动态id
	@param characterId:int 角色的ID
	@param gamerName:str 接收人的名称
	@param content:str 邮件内容
	@param title:str 标题
	'''
    gamer = GamersManager().getGamerByID(characterId)
    if not gamer or not gamer.CheckClient(dynamicId):
        return {'result': False, 'message': u"角色不存在"}
    if not dbShieldWord.checkIllegalChar(title):
        return {'result': False, 'message': u""}
    if not dbShieldWord.checkIllegalChar(content):
        return {'result': False, 'message': u""}
    if len(title) > 12:
        return {'result': False, 'message': u""}
    toId = dbCharacter.getCharacterIdByNickName(gamerName)
    if not toId:
        return {'result': False, 'message': u""}
    if toId[0] == characterId:
        return {'result': False, 'message': u""}
    result = gamer.mail.sendMail(toId[0], title, content)
    if result:
        return {'result': True, 'message': u""}
    return {'result': False, 'message': u""}
Exemple #2
0
def sendMail(dynamicId, characterId, playerName, title, content):
    """添加邮件
    @param dynamicId: int 客户端的动态id
    @param characterId: int 角色的id
    @param playerName: str 发送人的名称
    @param content: str 邮件内容
    @param title: str 标题
    """
    player = PlayersManager().getPlayerByID(characterId)
    if not player or not player.CheckClient(dynamicId):
        return {'result': False, 'message': u""}
    if not dbShieldWord.checkIllegalChar(title):
        return {'result': False, 'message': u""}
    if not dbShieldWord.checkIllegalChar(content):
        return {'result': False, 'message': u""}
    if len(title) > 12:
        return {'result': False, 'message': u""}
    toId = dbCharacter.getCharacterIdByNickName(playerName)
    if not toId:
        return {'result': False, 'message': u""}
    if toId[0] == characterId:
        return {'result': False, 'message': u""}
    result = player.mail.sendMail(toId[0], title, content)
    if result:
        return {'result': True, 'message': u""}
    return {'result': False, 'message': u""}
Exemple #3
0
def sendMail(dynamicId, characterId, playerName, title, content):
    '''添加邮件
    @param dynamicId: int 客户端的动态id
    @param characterId: int 角色的id
    @param playerName: str 发送人的名称
    @param content: str 邮件内容
    @param title: str 标题
    '''
    player = PlayersManager().getPlayerByID(characterId)
    if not player or not player.CheckClient(dynamicId):
        return {'result': False, 'message': u""}
    if not dbShieldWord.checkIllegalChar(title):  # 查询 title 是否存在屏蔽词
        return {'result': False, 'message': u""}
    if not dbShieldWord.checkIllegalChar(content):  # 查询 content 是否存在屏蔽词
        return {'result': False, 'message': u""}
    if len(title) > 12:  # 标题长度限制
        return {'result': False, 'message': u""}
    toId = dbCharacter.getCharacterIdByNickName(
        playerName)  # 根据昵称获取 角色(发信人) 的id
    if not toId:
        return {'result': False, 'message': u""}
    if toId[0] == characterId:
        return {'result': False, 'message': u""}
    result = player.mail.sendMail(
        toId[0], title, content)  # 发送邮件(这里是保存到数据库,只有当收信人打开邮箱,才会收到从服务器更新)
    if result:
        return {'result': True, 'message': u""}
    return {'result': False, 'message': u""}
Exemple #4
0
def sendMail(dynamicId,characterId,gamerName,title,content):
	'''添加邮件
	@param dynamicId:int 客户端的动态id
	@param characterId:int 角色的ID
	@param gamerName:str 接收人的名称
	@param content:str 邮件内容
	@param title:str 标题
	'''
	gamer=GamersManager().getGamerByID(characterId)
	if not gamer or not gamer.CheckClient(dynamicId):
		return {'result':False,'message':u"角色不存在"}
	if not dbShieldWord.checkIllegalChar(title):
		return {'result':False,'message':u""}
	if not dbShieldWord.checkIllegalChar(content):
		return {'result':False,'message':u""}
	if len(title)>12:
		return {'result':False,'message':u""}
	toId=dbCharacter.getCharacterIdByNickName(gamerName)
	if not toId:
		return {'result':False,'message':u""}
	if toId[0]==characterId:
		return {'result':False,'message':u""}
	result=gamer.mail.sendMail(toId[0],title,content)
	if result:
		return {'result':True,'message':u""}
	return {'result':False,'message':u""}
Exemple #5
0
def sendMail(dynamicId,characterId,playerName,title,content):
    """添加邮件
    @param dynamicId: int 客户端的动态id
    @param characterId: int 角色的id
    @param playerName: str 发送人的名称
    @param content: str 邮件内容
    @param title: str 标题
    """
    player = PlayersManager().getPlayerByID(characterId)
    if not player or not player.CheckClient(dynamicId):
        return {'result':False,'message':u""}
    if not dbShieldWord.checkIllegalChar(title):
        return {'result':False,'message':u""}
    if not dbShieldWord.checkIllegalChar(content):
        return {'result':False,'message':u""}
    if len(title)>12:
        return {'result':False,'message':u""}
    toId = dbCharacter.getCharacterIdByNickName(playerName)
    if not toId:
        return {'result':False,'message':u""}
    if toId[0]==characterId:
        return {'result':False,'message':u""}
    result = player.mail.sendMail(toId[0],title,content)
    if  result:
        return {'result':True,'message':u""}
    return {'result':False,'message':u""}