示例#1
0
def SendChatMessageRequest_1013(dynamicId,request_proto):
	'''当前角色发送私聊信息'''
	import time
	from app.chatServer.core.ChaterManager import ChaterManager
	argument=SendChatMessage1013_pb2.SendChatMessageRequest()
	argument.ParseFromString(request_proto)
	response=SendChatMessage1013_pb2.SendChatMessageResponse()
	id=argument.id
	tid=argument.chatId
	context=argument.chatMessage

	chater=ChaterManager().getChaterByCharacterId(id)
	if chater.donttalk==0:#不禁言
		timet=ste(time.strftime('%Y-%m-%d %X'))
		title="<font color='#ffffff'>"
		title+=chater.getrCharacterName()
		title+=":</font><br/>"
		title+=u"<font color='#ffffff'>&nbsp;&nbsp;%s</font><br/>"%context
		ChaterLogManager().addLog(id,tid,title,timet)
		response.result=True
		response.message=u''
	else:#禁言
		response.result=True
		response.message=Lg().g(644)
	return response.SerializeToString()