示例#1
0
def packetEvent(iEventId, eventInfoObj):
	msg = collect_pb2.eventInfo()
	msg.iEventId = iEventId
	msg.iEventNo = eventInfoObj.iEventNo
	msg.iServerId = eventInfoObj.iServerId
	msg.fPosX = "%.6f"%(eventInfoObj.fPosX)
	msg.fPosY = "%.6f"%(eventInfoObj.fPosY)
	msg.iTimeOut = eventInfoObj.iEndTime
	msg.iSchool = eventInfoObj.iSchool
	msg.sServerName = misc.zoneName()	#临时的
	#print "===========afasdfsfsad"
	return msg
示例#2
0
def packetAroundRoleInfo(roleInfoObj):
	msg = collect_pb2.roleInfo()
	msg.iRoleId = roleInfoObj.iRoleId
	msg.iServerId = roleInfoObj.iServerId
	msg.fPosX = "%.6f"%(roleInfoObj.fPosX)
	msg.fPosY = "%.6f"%(roleInfoObj.fPosY)
	msg.sPicture = roleInfoObj.sPicture
	msg.iGender = roleInfoObj.iGender
	msg.sName = roleInfoObj.sName
	msg.iSchool = roleInfoObj.iSchool
	msg.sServerName = misc.zoneName()	#临时的
	return msg
示例#3
0
def packetRoleInfo(dRoleInfo):
	msg = collect_pb2.eventInfo()
	msg.iEventId = dRoleInfo.get("iLastId", 0)#dRoleInfo.get("iEventId", 0)
	msg.iEventNo = dRoleInfo.get("iEventNo", 0)
	msg.iServerId = dRoleInfo.get("iServerId", 0)
	msg.sName = dRoleInfo.get("sName", "")
	msg.iDistance = int(dRoleInfo.get("iDistance", 0))
	msg.sPicture = dRoleInfo.get("sPicture", "")
	msg.iComTime = dRoleInfo.get("iComTime", 0)
	msg.iGender = dRoleInfo.get("iGender", 0)
	msg.iSchool = dRoleInfo.get("iSchool", 11)
	msg.iRoleId = dRoleInfo.get("iRoleId", 0)
	msg.sServerName = misc.zoneName()	#临时的
	return msg
示例#4
0
def packetMarkerEvent(dEventInfo):
	msg = collect_pb2.eventInfo()
	iEventId = dEventInfo.get("iEventId", 0)
	msg.iEventId = iEventId
	msg.iEventNo = dEventInfo.get("iEventNo", 0)
	msg.iServerId = dEventInfo.get("iServerId", 0)
	msg.sName = dEventInfo.get("sName", "")
	msg.sPicture = dEventInfo.get("sPicture", "")
	msg.fPosX = "%.6f"%(dEventInfo.get("fPosX", 0))
	msg.fPosY = "%.6f"%(dEventInfo.get("fPosY", 0))
	msg.iSchool = dEventInfo.get("iSchool", 11)
	msg.sServerName = misc.zoneName()	#临时的

	gCenterCollectObj = collect.getCenterCollectObj()
	eventObj = gCenterCollectObj.getEventInfoObj(iEventId)
	msg.iTimeOut = eventObj.iEndTime if eventObj else getSecond()
	return msg