Exemple #1
0
func (self *MultiplayerManager) drawAirplanes(phase display.DrawingPhase, isBefore bool, ref interface{}) int {
	defer func() {
		self.dumpDebugInfo = false
	}()
	if len(self.planes) == 0 {
		if self.dumpDebugInfo {
			logging.Debug("No planes this cycle.")
		}
		return 1
	}
	is_shadow := self.wrtDataRef != nil && dataAccess.GetIntData(self.wrtDataRef) != 0
	if self.prtDataRef != nil {
		self.isBlend = dataAccess.GetIntData(self.prtDataRef) == 2
	}
	var blendValue bool
	if is_shadow {
		blendValue = false
	} else {
		blendValue = self.isBlend
	}
	var startTime time.Time
	if self.dumpDebugInfo {
		startTime = time.Now()
	}
	self.planesMutex.RLock()
	self.renderer.Render(blendValue, self.renderAircraftLabels, self.planes, self.rendererRef)
	self.planesMutex.RUnlock()
	if !is_shadow {
		self.isBlend = !self.isBlend
	}
	if self.dumpDebugInfo {
		logging.Debugf("Drawing time: %v", time.Now().Sub(startTime))
		logging.Debug("Dumping one cycle map of planes")
		self.planesMutex.RLock()
		for _, plane := range self.planes {
			logging.Debugf("[%v] - icao=%v, airline=%v, livery:=%v", plane.PlaneId, plane.CslAircraft.Icao, plane.CslAircraft.Airline, plane.CslAircraft.Livery)
			if plane.PositionData == nil {
				logging.Debugf("Drawing plane: %v at <no position data>", plane.CslAircraft.ObjFile)
			} else {
				logging.Debugf("Drawing plane: %v at %v,%v,%v (%vx%vx%v full=%v)", plane.CslAircraft.ObjFile, plane.PositionData.Lat, plane.PositionData.Lon, plane.PositionData.Elevation, plane.PositionData.Pitch, plane.PositionData.Roll, plane.PositionData.Heading, plane.RenderFull)
			}
		}
		self.planesMutex.RUnlock()
		logging.Debug("End of cycle dump.")
	}
	return 1
}
Exemple #2
0
//Messagehandler der die empfange Nachricht als Debugmeldung schreibt.
func DebugMessageHandler(msg plugins.Message) {
	name, _, _, _ := plugins.GetPluginInfo(msg.PluginId)
	logging.Debug(fmt.Sprintf("receive message from %v (ID: %v): %v", name, msg.PluginId, msg.MessageId))
}