Implemented AI validation OXP verifier stage. Removed invalid and unused shuttleAI.plist.

git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@1993 127b21dd-08f5-0310-b4b7-95ae10353056
This commit is contained in:
Jens Ayton 2009-01-12 18:04:02 +00:00
parent 3b1db9072d
commit b02f108735
16 changed files with 355 additions and 79 deletions

View File

@ -34,7 +34,7 @@ endif
OBJC_PROGRAM_NAME = oolite OBJC_PROGRAM_NAME = oolite
oolite_C_FILES = legacy_random.c strlcpy.c OOTCPStreamDecoder.c oolite_C_FILES = legacy_random.c strlcpy.c OOTCPStreamDecoder.c
oolite_OBJC_FILES = OOCocoa.m Comparison.m AI.m DustEntity.m Entity.m GameController.m GuiDisplayGen.m HeadUpDisplay.m main.m MyOpenGLView.m OpenGLSprite.m ParticleEntity.m PlanetEntity.m PlayerEntityLegacyScriptEngine.m PlayerEntityContracts.m PlayerEntityControls.m PlayerEntityLoadSave.m PlayerEntitySound.m PlayerEntity.m ResourceManager.m RingEntity.m ShipEntityAI.m ShipEntity.m SkyEntity.m StationEntity.m Universe.m NSFileManagerOOExtensions.m JoystickHandler.m PlayerEntityStickMapper.m OOCharacter.m OOTrumble.m WormholeEntity.m NSScannerOOExtensions.m OOXMLExtensions.m NSMutableDictionaryOOExtensions.m Geometry.m Octree.m CollisionRegion.m OOColor.m OOLogging.m OOCacheManager.m OOCache.m OOStringParsing.m OOCollectionExtractors.m OOVector.m OOMatrix.m OOQuaternion.m OOVoxel.m OOTriangle.m OOPListParsing.m OOFastArithmetic.m OOTextureScaling.m OOConstToString.m OOScript.m OOJSScript.m OOJavaScriptEngine.m OOPListScript.m NSStringOOExtensions.m PlayerEntityScriptMethods.m OOWeakReference.m OOJSEntity.m EntityOOJavaScriptExtensions.m OOJSQuaternion.m OOMaterial.m OOShaderMaterial.m OOShaderProgram.m OOShaderUniform.m OOTexture.m OONullTexture.m OOTextureLoader.m OOPNGTextureLoader.m OOOpenGLExtensionManager.m OOBasicMaterial.m OOSingleTextureMaterial.m OOCPUInfo.m OOSelfDrawingEntity.m OOEntityWithDrawable.m OODrawable.m OOJSVector.m OOMesh.m OOOpenGL.m OOGraphicsResetManager.m OOProbabilisticTextureManager.m OODebugGLDrawing.m OOShaderUniformMethodType.m OOAsyncQueue.m TextureStore.m OOOXPVerifier.m OOOXPVerifierStage.m OOFileScannerVerifierStage.m OOCheckRequiresPListVerifierStage.m OOCheckDemoShipsPListVerifierStage.m OOCheckEquipmentPListVerifierStage.m OOTextureVerifierStage.m OOModelVerifierStage.m OOCheckShipDataPListVerifierStage.m OOPListSchemaVerifier.m OOJSShip.m OOJSPlayer.m OOJSCall.m OOJSStation.m OOJSSystem.m OOLegacyEventHandlerScript.m OOJSOolite.m OORoleSet.m OOJSGlobal.m OOJSMissionVariables.m OOJSMission.m OOPriorityQueue.m OOScriptTimer.m OOJSTimer.m OOJSClock.m OODebugSupport.m OODebugMonitor.m OOJSConsole.m OODebugTCPConsoleClient.m OOTCPStreamDecoderAbstractionLayer.m OOEntityFilterPredicate.m OOJSPlanet.m OOJSWorldScripts.m OOJSSun.m NSThreadOOExtensions.m OOEncodingConverter.m OOJSSound.m OOJSSoundSource.m OOMusicController.m OOLogHeader.m OOJSSpecialFunctions.m OOSpatialReference.m OOSkyDrawable.m OOFilteringEnumerator.m OOSoundSourcePool.m ShipEntityScriptMethods.m OOShipRegistry.m OOProbabilitySet.m OOJSSystemInfo.m NSDictionaryOOExtensions.m OOEquipmentType.m OOCamera.m OOJSPlayerShip.m OOSDLSound.m OOSDLConcreteSound.m OOSoundSource.m OOSDLSoundMixer.m OOSDLSoundChannel.m OOBasicSoundReferencePoint.m SDLMusic.m OOLogOutputHandler.m OOJSEquipmentInfo.m OOIsNumberLiteral.m OOConvertSystemDescriptions.m OldSchoolPropertyListWriting.m OOCrosshairs.m OOJSFunction.m oolite_OBJC_FILES = OOCocoa.m Comparison.m AI.m DustEntity.m Entity.m GameController.m GuiDisplayGen.m HeadUpDisplay.m main.m MyOpenGLView.m OpenGLSprite.m ParticleEntity.m PlanetEntity.m PlayerEntityLegacyScriptEngine.m PlayerEntityContracts.m PlayerEntityControls.m PlayerEntityLoadSave.m PlayerEntitySound.m PlayerEntity.m ResourceManager.m RingEntity.m ShipEntityAI.m ShipEntity.m SkyEntity.m StationEntity.m Universe.m NSFileManagerOOExtensions.m JoystickHandler.m PlayerEntityStickMapper.m OOCharacter.m OOTrumble.m WormholeEntity.m NSScannerOOExtensions.m OOXMLExtensions.m NSMutableDictionaryOOExtensions.m Geometry.m Octree.m CollisionRegion.m OOColor.m OOLogging.m OOCacheManager.m OOCache.m OOStringParsing.m OOCollectionExtractors.m OOVector.m OOMatrix.m OOQuaternion.m OOVoxel.m OOTriangle.m OOPListParsing.m OOFastArithmetic.m OOTextureScaling.m OOConstToString.m OOScript.m OOJSScript.m OOJavaScriptEngine.m OOPListScript.m NSStringOOExtensions.m PlayerEntityScriptMethods.m OOWeakReference.m OOJSEntity.m EntityOOJavaScriptExtensions.m OOJSQuaternion.m OOMaterial.m OOShaderMaterial.m OOShaderProgram.m OOShaderUniform.m OOTexture.m OONullTexture.m OOTextureLoader.m OOPNGTextureLoader.m OOOpenGLExtensionManager.m OOBasicMaterial.m OOSingleTextureMaterial.m OOCPUInfo.m OOSelfDrawingEntity.m OOEntityWithDrawable.m OODrawable.m OOJSVector.m OOMesh.m OOOpenGL.m OOGraphicsResetManager.m OOProbabilisticTextureManager.m OODebugGLDrawing.m OOShaderUniformMethodType.m OOAsyncQueue.m TextureStore.m OOOXPVerifier.m OOOXPVerifierStage.m OOFileScannerVerifierStage.m OOCheckRequiresPListVerifierStage.m OOCheckDemoShipsPListVerifierStage.m OOCheckEquipmentPListVerifierStage.m OOTextureVerifierStage.m OOModelVerifierStage.m OOCheckShipDataPListVerifierStage.m OOPListSchemaVerifier.m OOJSShip.m OOJSPlayer.m OOJSCall.m OOJSStation.m OOJSSystem.m OOLegacyEventHandlerScript.m OOJSOolite.m OORoleSet.m OOJSGlobal.m OOJSMissionVariables.m OOJSMission.m OOPriorityQueue.m OOScriptTimer.m OOJSTimer.m OOJSClock.m OODebugSupport.m OODebugMonitor.m OOJSConsole.m OODebugTCPConsoleClient.m OOTCPStreamDecoderAbstractionLayer.m OOEntityFilterPredicate.m OOJSPlanet.m OOJSWorldScripts.m OOJSSun.m NSThreadOOExtensions.m OOEncodingConverter.m OOJSSound.m OOJSSoundSource.m OOMusicController.m OOLogHeader.m OOJSSpecialFunctions.m OOSpatialReference.m OOSkyDrawable.m OOFilteringEnumerator.m OOSoundSourcePool.m ShipEntityScriptMethods.m OOShipRegistry.m OOProbabilitySet.m OOJSSystemInfo.m NSDictionaryOOExtensions.m OOEquipmentType.m OOCamera.m OOJSPlayerShip.m OOSDLSound.m OOSDLConcreteSound.m OOSoundSource.m OOSDLSoundMixer.m OOSDLSoundChannel.m OOBasicSoundReferencePoint.m SDLMusic.m OOLogOutputHandler.m OOJSEquipmentInfo.m OOIsNumberLiteral.m OOConvertSystemDescriptions.m OldSchoolPropertyListWriting.m OOCrosshairs.m OOJSFunction.m OOAIStateMachineVerifierStage.m
include $(GNUSTEP_MAKEFILES)/objc.make include $(GNUSTEP_MAKEFILES)/objc.make
include GNUmakefile.postamble include GNUmakefile.postamble

View File

@ -102,7 +102,6 @@
1A2317CC0B9D022500EF0852 /* route2patrolAI.plist in Copy AIs */ = {isa = PBXBuildFile; fileRef = 1A2317AA0B9D022500EF0852 /* route2patrolAI.plist */; }; 1A2317CC0B9D022500EF0852 /* route2patrolAI.plist in Copy AIs */ = {isa = PBXBuildFile; fileRef = 1A2317AA0B9D022500EF0852 /* route2patrolAI.plist */; };
1A2317CD0B9D022500EF0852 /* route2sunskimAI.plist in Copy AIs */ = {isa = PBXBuildFile; fileRef = 1A2317AB0B9D022500EF0852 /* route2sunskimAI.plist */; }; 1A2317CD0B9D022500EF0852 /* route2sunskimAI.plist in Copy AIs */ = {isa = PBXBuildFile; fileRef = 1A2317AB0B9D022500EF0852 /* route2sunskimAI.plist */; };
1A2317CE0B9D022500EF0852 /* scavengerAI.plist in Copy AIs */ = {isa = PBXBuildFile; fileRef = 1A2317AC0B9D022500EF0852 /* scavengerAI.plist */; }; 1A2317CE0B9D022500EF0852 /* scavengerAI.plist in Copy AIs */ = {isa = PBXBuildFile; fileRef = 1A2317AC0B9D022500EF0852 /* scavengerAI.plist */; };
1A2317CF0B9D022500EF0852 /* shuttleAI.plist in Copy AIs */ = {isa = PBXBuildFile; fileRef = 1A2317AD0B9D022500EF0852 /* shuttleAI.plist */; };
1A2317D00B9D022500EF0852 /* stationAI.plist in Copy AIs */ = {isa = PBXBuildFile; fileRef = 1A2317AE0B9D022500EF0852 /* stationAI.plist */; }; 1A2317D00B9D022500EF0852 /* stationAI.plist in Copy AIs */ = {isa = PBXBuildFile; fileRef = 1A2317AE0B9D022500EF0852 /* stationAI.plist */; };
1A2317D10B9D022500EF0852 /* sunSkimExitAI.plist in Copy AIs */ = {isa = PBXBuildFile; fileRef = 1A2317AF0B9D022500EF0852 /* sunSkimExitAI.plist */; }; 1A2317D10B9D022500EF0852 /* sunSkimExitAI.plist in Copy AIs */ = {isa = PBXBuildFile; fileRef = 1A2317AF0B9D022500EF0852 /* sunSkimExitAI.plist */; };
1A2317D20B9D022500EF0852 /* thargletAI.plist in Copy AIs */ = {isa = PBXBuildFile; fileRef = 1A2317B00B9D022500EF0852 /* thargletAI.plist */; }; 1A2317D20B9D022500EF0852 /* thargletAI.plist in Copy AIs */ = {isa = PBXBuildFile; fileRef = 1A2317B00B9D022500EF0852 /* thargletAI.plist */; };
@ -345,6 +344,10 @@
1A2DA3A40CB4D35800DE6823 /* OOJSConsole.m in Sources */ = {isa = PBXBuildFile; fileRef = 1A2DA34B0CB4D0D800DE6823 /* OOJSConsole.m */; }; 1A2DA3A40CB4D35800DE6823 /* OOJSConsole.m in Sources */ = {isa = PBXBuildFile; fileRef = 1A2DA34B0CB4D0D800DE6823 /* OOJSConsole.m */; };
1A2DA3EE0CB4E84900DE6823 /* OODebugSupport.m in Sources */ = {isa = PBXBuildFile; fileRef = 1A2DA3EC0CB4E84900DE6823 /* OODebugSupport.m */; }; 1A2DA3EE0CB4E84900DE6823 /* OODebugSupport.m in Sources */ = {isa = PBXBuildFile; fileRef = 1A2DA3EC0CB4E84900DE6823 /* OODebugSupport.m */; };
1A2DA3EF0CB4E84900DE6823 /* OODebugSupport.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A2DA3ED0CB4E84900DE6823 /* OODebugSupport.h */; }; 1A2DA3EF0CB4E84900DE6823 /* OODebugSupport.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A2DA3ED0CB4E84900DE6823 /* OODebugSupport.h */; };
1A3159270F1B7B7E00328E4A /* OOAIStateMachineVerifierStage.h in Copy Debug OXP */ = {isa = PBXBuildFile; fileRef = 1A3159250F1B7B7E00328E4A /* OOAIStateMachineVerifierStage.h */; };
1A3159280F1B7B7E00328E4A /* OOAIStateMachineVerifierStage.m in Copy Debug OXP */ = {isa = PBXBuildFile; fileRef = 1A3159260F1B7B7E00328E4A /* OOAIStateMachineVerifierStage.m */; };
1A3159590F1B894F00328E4A /* OOAIStateMachineVerifierStage.m in Sources */ = {isa = PBXBuildFile; fileRef = 1A3159260F1B7B7E00328E4A /* OOAIStateMachineVerifierStage.m */; };
1A31595A0F1B895000328E4A /* OOAIStateMachineVerifierStage.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A3159250F1B7B7E00328E4A /* OOAIStateMachineVerifierStage.h */; };
1A34912A0BC25EAA00802DA7 /* world-scripts.plist in Copy Config */ = {isa = PBXBuildFile; fileRef = 1A3491290BC25EAA00802DA7 /* world-scripts.plist */; }; 1A34912A0BC25EAA00802DA7 /* world-scripts.plist in Copy Config */ = {isa = PBXBuildFile; fileRef = 1A3491290BC25EAA00802DA7 /* world-scripts.plist */; };
1A358CE20C1AB80D00E52220 /* ReadMe.rtfd in Resources */ = {isa = PBXBuildFile; fileRef = 1A358CE10C1AB80D00E52220 /* ReadMe.rtfd */; }; 1A358CE20C1AB80D00E52220 /* ReadMe.rtfd in Resources */ = {isa = PBXBuildFile; fileRef = 1A358CE10C1AB80D00E52220 /* ReadMe.rtfd */; };
1A35916D0C1C375400E52220 /* oolite-nebula-1.png in Copy Textures */ = {isa = PBXBuildFile; fileRef = 1A3591690C1C375400E52220 /* oolite-nebula-1.png */; }; 1A35916D0C1C375400E52220 /* oolite-nebula-1.png in Copy Textures */ = {isa = PBXBuildFile; fileRef = 1A3591690C1C375400E52220 /* oolite-nebula-1.png */; };
@ -784,7 +787,6 @@
1A2317CC0B9D022500EF0852 /* route2patrolAI.plist in Copy AIs */, 1A2317CC0B9D022500EF0852 /* route2patrolAI.plist in Copy AIs */,
1A2317CD0B9D022500EF0852 /* route2sunskimAI.plist in Copy AIs */, 1A2317CD0B9D022500EF0852 /* route2sunskimAI.plist in Copy AIs */,
1A2317CE0B9D022500EF0852 /* scavengerAI.plist in Copy AIs */, 1A2317CE0B9D022500EF0852 /* scavengerAI.plist in Copy AIs */,
1A2317CF0B9D022500EF0852 /* shuttleAI.plist in Copy AIs */,
1A2317D00B9D022500EF0852 /* stationAI.plist in Copy AIs */, 1A2317D00B9D022500EF0852 /* stationAI.plist in Copy AIs */,
1A2317D10B9D022500EF0852 /* sunSkimExitAI.plist in Copy AIs */, 1A2317D10B9D022500EF0852 /* sunSkimExitAI.plist in Copy AIs */,
1A2317D20B9D022500EF0852 /* thargletAI.plist in Copy AIs */, 1A2317D20B9D022500EF0852 /* thargletAI.plist in Copy AIs */,
@ -1040,6 +1042,8 @@
files = ( files = (
1AD267650C83058C00B4BFD1 /* Debug.oxp in Copy Debug OXP */, 1AD267650C83058C00B4BFD1 /* Debug.oxp in Copy Debug OXP */,
1AAF55AC0F183C7D00A2F2E6 /* OOJSFunction.m in Copy Debug OXP */, 1AAF55AC0F183C7D00A2F2E6 /* OOJSFunction.m in Copy Debug OXP */,
1A3159270F1B7B7E00328E4A /* OOAIStateMachineVerifierStage.h in Copy Debug OXP */,
1A3159280F1B7B7E00328E4A /* OOAIStateMachineVerifierStage.m in Copy Debug OXP */,
); );
name = "Copy Debug OXP"; name = "Copy Debug OXP";
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
@ -1383,6 +1387,8 @@
1A2F63960C5CC737003872C8 /* hudSchema.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist; path = hudSchema.plist; sourceTree = "<group>"; }; 1A2F63960C5CC737003872C8 /* hudSchema.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist; path = hudSchema.plist; sourceTree = "<group>"; };
1A2F63980C5CC737003872C8 /* shipdataEntrySchema.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist; path = shipdataEntrySchema.plist; sourceTree = "<group>"; }; 1A2F63980C5CC737003872C8 /* shipdataEntrySchema.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist; path = shipdataEntrySchema.plist; sourceTree = "<group>"; };
1A2F63990C5CC737003872C8 /* shipyardSchema.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist; path = shipyardSchema.plist; sourceTree = "<group>"; }; 1A2F63990C5CC737003872C8 /* shipyardSchema.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist; path = shipyardSchema.plist; sourceTree = "<group>"; };
1A3159250F1B7B7E00328E4A /* OOAIStateMachineVerifierStage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OOAIStateMachineVerifierStage.h; sourceTree = "<group>"; };
1A3159260F1B7B7E00328E4A /* OOAIStateMachineVerifierStage.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OOAIStateMachineVerifierStage.m; sourceTree = "<group>"; };
1A3491290BC25EAA00802DA7 /* world-scripts.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist; path = "world-scripts.plist"; sourceTree = "<group>"; }; 1A3491290BC25EAA00802DA7 /* world-scripts.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist; path = "world-scripts.plist"; sourceTree = "<group>"; };
1A3491AA0BC282DE00802DA7 /* ReleaseLockProxy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ReleaseLockProxy.h; sourceTree = "<group>"; }; 1A3491AA0BC282DE00802DA7 /* ReleaseLockProxy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ReleaseLockProxy.h; sourceTree = "<group>"; };
1A3491AB0BC282DE00802DA7 /* ReleaseLockProxy.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ReleaseLockProxy.m; sourceTree = "<group>"; }; 1A3491AB0BC282DE00802DA7 /* ReleaseLockProxy.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ReleaseLockProxy.m; sourceTree = "<group>"; };
@ -2674,6 +2680,8 @@
1A7D3B9A0C4F7843008EDC33 /* OOCheckDemoShipsPListVerifierStage.m */, 1A7D3B9A0C4F7843008EDC33 /* OOCheckDemoShipsPListVerifierStage.m */,
1A7D3C470C4F818C008EDC33 /* OOCheckEquipmentPListVerifierStage.h */, 1A7D3C470C4F818C008EDC33 /* OOCheckEquipmentPListVerifierStage.h */,
1A7D3C480C4F818C008EDC33 /* OOCheckEquipmentPListVerifierStage.m */, 1A7D3C480C4F818C008EDC33 /* OOCheckEquipmentPListVerifierStage.m */,
1A3159250F1B7B7E00328E4A /* OOAIStateMachineVerifierStage.h */,
1A3159260F1B7B7E00328E4A /* OOAIStateMachineVerifierStage.m */,
1A7D3D290C4F8D01008EDC33 /* OOTextureVerifierStage.h */, 1A7D3D290C4F8D01008EDC33 /* OOTextureVerifierStage.h */,
1A7D3D2A0C4F8D02008EDC33 /* OOTextureVerifierStage.m */, 1A7D3D2A0C4F8D02008EDC33 /* OOTextureVerifierStage.m */,
1A7D41850C516B90008EDC33 /* OOModelVerifierStage.h */, 1A7D41850C516B90008EDC33 /* OOModelVerifierStage.h */,
@ -2976,6 +2984,7 @@
1ABC03ED0EF86110003B740A /* OOCrosshairs.h in Headers */, 1ABC03ED0EF86110003B740A /* OOCrosshairs.h in Headers */,
1ABC47FE0F155F0500B977AD /* OOJSFunction.h in Headers */, 1ABC47FE0F155F0500B977AD /* OOJSFunction.h in Headers */,
1AAF56170F1A198400A2F2E6 /* Comparison.h in Headers */, 1AAF56170F1A198400A2F2E6 /* Comparison.h in Headers */,
1A31595A0F1B895000328E4A /* OOAIStateMachineVerifierStage.h in Headers */,
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
}; };
@ -3336,6 +3345,7 @@
1A0729FF0EF5796500B0F925 /* OldSchoolPropertyListWriting.m in Sources */, 1A0729FF0EF5796500B0F925 /* OldSchoolPropertyListWriting.m in Sources */,
1ABC03EE0EF86110003B740A /* OOCrosshairs.m in Sources */, 1ABC03EE0EF86110003B740A /* OOCrosshairs.m in Sources */,
1ABC47FF0F155F0500B977AD /* OOJSFunction.m in Sources */, 1ABC47FF0F155F0500B977AD /* OOJSFunction.m in Sources */,
1A3159590F1B894F00328E4A /* OOAIStateMachineVerifierStage.m in Sources */,
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
}; };

View File

@ -1,27 +0,0 @@
{
GLOBAL =
{
ENTER = ("setStateTo: TRAVEL_TO_PLANET");
};
"DEFEND_SELF" =
{
ENTER = (performAttack);
"ENERGY_LOW" = ("setStateTo: FLEE");
"TARGET_DESTROYED" = ("setStateTo: TRAVEL_TO_PLANET");
};
"EXIT_SYSTEM" =
{
ENTER = (performLanding);
};
FLEE =
{
ENTER = (performFlee);
"REACHED_SAFETY" = (performIdle, "setStateTo: TRAVEL_TO_PLANET");
};
"TRAVEL_TO_PLANET" =
{
ENTER = (performFlyToPlanet);
ATTACK = (setTargetToPrimaryAggressor, "setStateTo: DEFEND_SELF");
"REACHED_SURFACE" = ("setStateTo: EXIT_SYSTEM");
};
}

View File

@ -367,7 +367,7 @@
universe.setup.badStation = $scriptError; // Message generated if the main station turns out not to be a station (for instance, this could happen if a non-station ship had the role coriolis). universe.setup.badStation = $scriptError; // Message generated if the main station turns out not to be a station (for instance, this could happen if a non-station ship had the role coriolis).
verifyOXP.verbose = no; verifyOXP.verbose = yes;
/*** Mac OS X/Cocoa-specific ***/ /*** Mac OS X/Cocoa-specific ***/

View File

@ -6,11 +6,12 @@
{ {
stages = stages =
( (
"OOCheckRequiresPListVerifierStage", OOCheckRequiresPListVerifierStage,
"OOCheckDemoShipsPListVerifierStage", OOCheckDemoShipsPListVerifierStage,
"OOCheckEquipmentPListVerifierStage", OOCheckEquipmentPListVerifierStage,
"OOTextureVerifierStage", OOTextureVerifierStage,
"OOCheckShipDataPListVerifierStage" OOCheckShipDataPListVerifierStage,
OOAIStateMachineVerifierStage
); );
excludeStages = excludeStages =
( (
@ -24,13 +25,13 @@
logControlOverride = logControlOverride =
{ {
// Note: only yes and no here, no inherit or $metaclass // Note: only yes and no here, no inherit or $metaclass
dataCache.rebuild.pathsChanged = "no"; dataCache.rebuild.pathsChanged = no;
verifyOXP = "yes"; verifyOXP = yes;
verifyOXP.stage = "yes"; verifyOXP.stage = yes;
verifyOXP.verbose = "no"; verifyOXP.verbose = no;
}; };
logShowMessageClassOverride = "no"; logShowMessageClassOverride = no;
knownRootDirectories = knownRootDirectories =
( (
@ -108,8 +109,6 @@
"blur256.png", "blur256.png",
"asciitext.png", "asciitext.png",
"trumblekit.png" "trumblekit.png"
// star64.png and galaxy256.png fall into this category, but they're going to be replaced.
); );
}; };

View File

@ -174,7 +174,7 @@
"targetNextBeaconWithCode:", "targetNextBeaconWithCode:",
"setRacepointsFromTarget", "setRacepointsFromTarget",
"performFlyRacepoints", "performFlyRacepoints",
"performDocking", "performDocking", // Note: this method does nothing.
// StationEntity.m/stubs in ShipEntityAI.m // StationEntity.m/stubs in ShipEntityAI.m
"increaseAlertLevel", "increaseAlertLevel",
@ -262,6 +262,7 @@
"commanderShipDisplayName_string", "commanderShipDisplayName_string",
"fuel_leak_rate_number" "fuel_leak_rate_number"
); );
shader_binding_methods = shader_binding_methods =
( (
// FIXME: copy list from http://wiki.alioth.net/index.php/Shaders_in_Oolite:_uniforms when wiki is up. // FIXME: copy list from http://wiki.alioth.net/index.php/Shaders_in_Oolite:_uniforms when wiki is up.

View File

@ -3,7 +3,7 @@
AI.m AI.m
Oolite Oolite
Copyright (C) 2004-2008 Giles C Williams and contributors Copyright (C) 2004-2009 Giles C Williams and contributors
This program is free software; you can redistribute it and/or This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License modify it under the terms of the GNU General Public License
@ -643,13 +643,15 @@ static AI *sCurrentlyRunningAI = nil;
OOCacheManager *cacheMgr = [OOCacheManager sharedCache]; OOCacheManager *cacheMgr = [OOCacheManager sharedCache];
NSEnumerator *stateEnum = nil; NSEnumerator *stateEnum = nil;
NSString *stateKey = nil; NSString *stateKey = nil;
NSDictionary *stateMessages = nil; NSDictionary *stateHandlers = nil;
NSAutoreleasePool *pool = nil;
newSM = [cacheMgr objectForKey:smName inCache:@"AIs"]; newSM = [cacheMgr objectForKey:smName inCache:@"AIs"];
if (newSM != nil && ![newSM isKindOfClass:[NSDictionary class]]) return nil; // catches use of @"nil" to indicate no AI found. if (newSM != nil && ![newSM isKindOfClass:[NSDictionary class]]) return nil; // catches use of @"nil" to indicate no AI found.
if (newSM == nil) if (newSM == nil)
{ {
pool = [[NSAutoreleasePool alloc] init];
OOLog(@"ai.load", @"Loading and sanitizing AI \"%@\"", smName); OOLog(@"ai.load", @"Loading and sanitizing AI \"%@\"", smName);
OOLogPushIndent(); OOLogPushIndent();
OOLogIndentIf(@"ai.load"); OOLogIndentIf(@"ai.load");
@ -667,15 +669,15 @@ static AI *sCurrentlyRunningAI = nil;
for (stateEnum = [newSM keyEnumerator]; (stateKey = [stateEnum nextObject]); ) for (stateEnum = [newSM keyEnumerator]; (stateKey = [stateEnum nextObject]); )
{ {
stateMessages = [newSM objectForKey:stateKey]; stateHandlers = [newSM objectForKey:stateKey];
if (![stateMessages isKindOfClass:[NSDictionary class]]) if (![stateHandlers isKindOfClass:[NSDictionary class]])
{ {
OOLog(@"ai.invalidFormat.state", @"State \"%@\" in AI \"%@\" is not a dictionary, ignoring.", stateKey, smName); OOLog(@"ai.invalidFormat.state", @"State \"%@\" in AI \"%@\" is not a dictionary, ignoring.", stateKey, smName);
continue; continue;
} }
stateMessages = [self cleanHandlers:stateMessages forState:stateKey stateMachine:smName]; stateHandlers = [self cleanHandlers:stateHandlers forState:stateKey stateMachine:smName];
[cleanSM setObject:stateMessages forKey:stateKey]; [cleanSM setObject:stateHandlers forKey:stateKey];
} }
// Make immutable. // Make immutable.
@ -689,6 +691,7 @@ static AI *sCurrentlyRunningAI = nil;
NS_ENDHANDLER NS_ENDHANDLER
OOLogPopIndent(); OOLogPopIndent();
[pool release];
} }
return newSM; return newSM;
@ -754,6 +757,9 @@ static AI *sCurrentlyRunningAI = nil;
continue; continue;
} }
// Trim spaces from beginning and end.
action = [action stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]];
// Cut off parameters. // Cut off parameters.
spaceRange = [action rangeOfString:@" "]; spaceRange = [action rangeOfString:@" "];
if (spaceRange.location == NSNotFound) selector = action; if (spaceRange.location == NSNotFound) selector = action;

View File

@ -54,6 +54,7 @@ MA 02110-1301, USA.
return YES; return YES;
} }
- (BOOL) ooliteScanUpToCharactersFromSet:(NSCharacterSet *)set intoString:(NSString **)value - (BOOL) ooliteScanUpToCharactersFromSet:(NSCharacterSet *)set intoString:(NSString **)value
{ {
unsigned int currentLocation = [self scanLocation]; unsigned int currentLocation = [self scanLocation];

View File

@ -70,6 +70,7 @@ NSMutableArray *ScanTokensFromString(NSString *values)
return result; return result;
} }
BOOL ScanVectorFromString(NSString *xyzString, Vector *outVector) BOOL ScanVectorFromString(NSString *xyzString, Vector *outVector)
{ {
GLfloat xyz[] = {0.0, 0.0, 0.0}; GLfloat xyz[] = {0.0, 0.0, 0.0};

View File

@ -0,0 +1,46 @@
/*
OOAIStateMachineVerifierStage.h
OOOXPVerifierStage which validates AI plists.
Oolite
Copyright (C) 2004-2009 Giles C Williams and contributors
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
MA 02110-1301, USA.
*/
#import "OOFileScannerVerifierStage.h"
#if OO_OXP_VERIFIER_ENABLED
@interface OOAIStateMachineVerifierStage: OOFileHandlingVerifierStage
{
@private
NSSet *_whitelist;
NSMutableSet *_usedAIs;
}
// Returns name to be used in -dependents by other stages.
+ (NSString *) nameForReverseDependencyForVerifier:(OOOXPVerifier *)verifier;
- (void) stateMachineNamed:(NSString *)name usedByShip:(NSString *)shipName;
@end
#endif

View File

@ -0,0 +1,216 @@
/*
OOAIStateMachineVerifierStage.m
Oolite
Copyright (C) 2004-2009 Giles C Williams and contributors
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
MA 02110-1301, USA.
*/
#import "OOAIStateMachineVerifierStage.h"
#import "OOCollectionExtractors.h"
#import "OOPListParsing.h"
#if OO_OXP_VERIFIER_ENABLED
#import "ResourceManager.h"
static NSString * const kStageName = @"Validating AIs";
@interface OOAIStateMachineVerifierStage (Private)
- (void) validateAI:(NSString *)aiName;
@end
@implementation OOAIStateMachineVerifierStage
- (void) dealloc
{
[_whitelist release];
[_usedAIs release];
[super dealloc];
}
- (NSString *) name
{
return kStageName;
}
- (BOOL) shouldRun
{
return [_usedAIs count] != 0;
}
- (void) run
{
NSArray *aiNames = nil;
NSEnumerator *aiEnum = nil;
NSString *aiName = nil;
NSMutableSet *whitelist = nil;
// Build whitelist. Note that we merge in aliases since the distinction doesn't matter when just validating.
whitelist = [[NSMutableSet alloc] init];
[whitelist addObjectsFromArray:[[ResourceManager whitelistDictionary] arrayForKey:@"ai_methods"]];
[whitelist addObjectsFromArray:[[ResourceManager whitelistDictionary] arrayForKey:@"ai_and_action_methods"]];
[whitelist addObjectsFromArray:[[[ResourceManager whitelistDictionary] dictionaryForKey:@"ai_method_aliases"] allKeys]];
_whitelist = [whitelist copy];
[whitelist release];
aiNames = [[_usedAIs allObjects] sortedArrayUsingSelector:@selector(caseInsensitiveCompare:)];
for (aiEnum = [aiNames objectEnumerator]; (aiName = [aiEnum nextObject]); )
{
[self validateAI:aiName];
}
[_whitelist release];
_whitelist = nil;
}
+ (NSString *) nameForReverseDependencyForVerifier:(OOOXPVerifier *)verifier
{
return kStageName;
}
- (void) stateMachineNamed:(NSString *)name usedByShip:(NSString *)shipName
{
OOFileScannerVerifierStage *fileScanner = nil;
if (name == nil) return;
if ([_usedAIs containsObject:name]) return;
if (_usedAIs == nil) _usedAIs = [[NSMutableSet alloc] init];
[_usedAIs addObject:name];
fileScanner = [[self verifier] fileScannerStage];
if (![fileScanner fileExists:name
inFolder:@"AIs"
referencedFrom:[NSString stringWithFormat:@"shipdata.plist entry \"%@\"", shipName]
checkBuiltIn:YES])
{
OOLog(@"verifyOXP.validateAI.notFound", @"WARNING: AI state machine \"%@\" referenced in shipdata.plist entry \"%@\" could not be found in %@ or in Oolite.", name, shipName, [[self verifier] oxpDisplayName]);
}
}
@end
@implementation OOAIStateMachineVerifierStage (Private)
- (void) validateAI:(NSString *)aiName
{
NSString *path = nil;
NSDictionary *aiStateMachine = nil;
NSEnumerator *stateEnum = nil;
NSString *stateKey = nil;
NSDictionary *stateHandlers = nil;
NSEnumerator *handlerEnum = nil;
NSString *handlerKey = nil;
NSArray *handlerActions = nil;
NSEnumerator *actionEnum = nil;
NSString *action = nil;
NSRange spaceRange;
NSString *selector = nil;
NSMutableSet *badSelectors = nil;
NSString *badSelectorDesc = nil;
OOUInteger index = 0;
OOLog(@"verifyOXP.verbose.validateAI", @"- Validating AI \"%@\".", aiName);
OOLogIndentIf(@"verifyOXP.verbose.validateAI");
// Attempt to load AI.
path = [[[self verifier] fileScannerStage] pathForFile:aiName inFolder:@"AIs" referencedFrom:@"AI list" checkBuiltIn:NO];
if (path == nil) return;
badSelectors = [NSMutableSet set];
aiStateMachine = OODictionaryFromFile(path);
if (aiStateMachine == nil)
{
OOLog(@"verifyOXP.validateAI.failed.notDictPlist", @"ERROR: could not interpret \"%@\" as a dictionary.");
return;
}
// Validate each state.
for (stateEnum = [aiStateMachine keyEnumerator]; (stateKey = [stateEnum nextObject]); )
{
stateHandlers = [aiStateMachine objectForKey:stateKey];
if (![stateHandlers isKindOfClass:[NSDictionary class]])
{
OOLog(@"verifyOXP.validateAI.failed.invalidFormat.state", @"ERROR: state \"%@\" in AI \"%@\" is not a dictionary.", stateKey, aiName);
continue;
}
// Verify handlers for this state.
for (handlerEnum = [stateHandlers keyEnumerator]; (handlerKey = [handlerEnum nextObject]); )
{
handlerActions = [stateHandlers objectForKey:handlerKey];
if (![handlerActions isKindOfClass:[NSArray class]])
{
OOLog(@"verifyOXP.validateAI.failed.invalidFormat.handler", @"ERROR: gandler \"%@\" for state \"%@\" in AI \"%@\" is not an array, ignoring.", handlerKey, stateKey, aiName);
continue;
}
// Verify commands for this handler.
index = 0;
for (actionEnum = [handlerActions objectEnumerator]; (action = [actionEnum nextObject]); )
{
index++;
if (![action isKindOfClass:[NSString class]])
{
OOLog(@"verifyOXP.validateAI.failed.invalidFormat.action", @"ERROR: action %u in handler \"%@\" for state \"%@\" in AI \"%@\" is not a string, ignoring.", index - 1, handlerKey, stateKey, aiName);
continue;
}
// Trim spaces from beginning and end.
action = [action stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]];
// Cut off parameters.
spaceRange = [action rangeOfString:@" "];
if (spaceRange.location == NSNotFound) selector = action;
else selector = [action substringToIndex:spaceRange.location];
// Check against whitelist.
if (![_whitelist containsObject:selector])
{
[badSelectors addObject:selector];
}
}
}
}
if ([badSelectors count] != 0)
{
badSelectorDesc = [[[badSelectors allObjects] sortedArrayUsingSelector:@selector(caseInsensitiveCompare:)] componentsJoinedByString:@", "];
OOLog(@"verifyOXP.validateAI.failed.badSelector", @"ERROR: the AI \"%@\" uses %u unpermitted method%s: %@", aiName, [badSelectors count], ([badSelectors count] == 1) ? "" : "s", badSelectorDesc);
}
OOLogOutdentIf(@"verifyOXP.verbose.validateAI");
}
@end
#endif

View File

@ -29,7 +29,7 @@ MA 02110-1301, USA.
#if OO_OXP_VERIFIER_ENABLED #if OO_OXP_VERIFIER_ENABLED
@class OOPListSchemaVerifier; @class OOPListSchemaVerifier, OOAIStateMachineVerifierStage;
@interface OOCheckShipDataPListVerifierStage: OOTextureHandlingStage @interface OOCheckShipDataPListVerifierStage: OOTextureHandlingStage
{ {
@ -40,8 +40,9 @@ MA 02110-1301, USA.
*_playerKeys, *_playerKeys,
*_allKeys; *_allKeys;
OOPListSchemaVerifier *_schemaVerifier; OOPListSchemaVerifier *_schemaVerifier;
OOAIStateMachineVerifierStage *_aiVerifierStage;
// Info about ship currently being checked. None of these are retained! // Info about ship currently being checked.
NSString *_name; NSString *_name;
NSDictionary *_info; NSDictionary *_info;
NSSet *_roles; NSSet *_roles;

View File

@ -34,6 +34,7 @@ MA 02110-1301, USA.
#import "OOCollectionExtractors.h" #import "OOCollectionExtractors.h"
#import "OOStringParsing.h" #import "OOStringParsing.h"
#import "OOPListSchemaVerifier.h" #import "OOPListSchemaVerifier.h"
#import "OOAIStateMachineVerifierStage.h"
static NSString * const kStageName = @"Checking shipdata.plist"; static NSString * const kStageName = @"Checking shipdata.plist";
@ -77,6 +78,7 @@ static NSString * const kStageName = @"Checking shipdata.plist";
{ {
NSMutableSet *result = [[super dependents] mutableCopy]; NSMutableSet *result = [[super dependents] mutableCopy];
[result addObject:[OOModelVerifierStage nameForReverseDependencyForVerifier:[self verifier]]]; [result addObject:[OOModelVerifierStage nameForReverseDependencyForVerifier:[self verifier]]];
[result addObject:[OOAIStateMachineVerifierStage nameForReverseDependencyForVerifier:[self verifier]]];
return [result autorelease]; return [result autorelease];
} }
@ -113,6 +115,9 @@ static NSString * const kStageName = @"Checking shipdata.plist";
if (_shipdataPList == nil) return; if (_shipdataPList == nil) return;
// Get AI verifier stage (may be nil).
_aiVerifierStage = [[self verifier] stageWithName:[OOAIStateMachineVerifierStage nameForReverseDependencyForVerifier:[self verifier]]];
ooliteShipData = [ResourceManager dictionaryFromFilesNamed:@"shipdata.plist" ooliteShipData = [ResourceManager dictionaryFromFilesNamed:@"shipdata.plist"
inFolder:@"Config" inFolder:@"Config"
andMerge:YES]; andMerge:YES];
@ -188,6 +193,9 @@ static NSString * const kStageName = @"Checking shipdata.plist";
[self checkSchema]; [self checkSchema];
[self checkModel]; [self checkModel];
NSString *aiName = [info stringForKey:@"ai_type"];
if (aiName != nil) [_aiVerifierStage stateMachineNamed:aiName usedByShip:name];
// Todo: check for pirates with 0 bounty // Todo: check for pirates with 0 bounty
OOLogPopIndent(); OOLogPopIndent();

View File

@ -178,6 +178,12 @@ static void OpenLogFile(NSString *name);
// Sanity checking // Sanity checking
if (stage == nil) return; if (stage == nil) return;
if (![stage isKindOfClass:[OOOXPVerifierStage class]])
{
OOLog(@"verifyOXP.registration.failed", @"Attempt to register class %@ as a verifier stage, but it is not a subclass of OOOXPVerifierStage; ignoring.", [stage class]);
return;
}
if (!_openForRegistration) if (!_openForRegistration)
{ {
OOLog(@"verifyOXP.registration.failed", @"Attempt to register verifier stage %@ after registration closed, ignoring.", stage); OOLog(@"verifyOXP.registration.failed", @"Attempt to register verifier stage %@ after registration closed, ignoring.", stage);
@ -323,6 +329,7 @@ static void OpenLogFile(NSString *name);
NSDictionary *overrides = nil; NSDictionary *overrides = nil;
NSEnumerator *messageClassEnum = nil; NSEnumerator *messageClassEnum = nil;
NSString *messageClass = nil; NSString *messageClass = nil;
id verbose = nil;
OOLogSetShowMessageClassTemporary([_verifierPList boolForKey:@"logShowMessageClassOverride" defaultValue:NO]); OOLogSetShowMessageClassTemporary([_verifierPList boolForKey:@"logShowMessageClassOverride" defaultValue:NO]);
@ -331,6 +338,13 @@ static void OpenLogFile(NSString *name);
{ {
OOLogSetDisplayMessagesInClass(messageClass, [overrides boolForKey:messageClass defaultValue:NO]); OOLogSetDisplayMessagesInClass(messageClass, [overrides boolForKey:messageClass defaultValue:NO]);
} }
/* Since actually editing logControlOverride is a pain, we also allow
overriding verifyOXP.verbose through user defaults. This is at least
as much a pain under GNUstep, but very convenient under OS X.
*/
verbose = [[NSUserDefaults standardUserDefaults] objectForKey:@"oxp-verifier-verbose-logging"];
if (verbose != nil) OOLogSetDisplayMessagesInClass(@"verifyOXP.verbose", OOBooleanFromObject(verbose, NO));
} }
@ -359,6 +373,11 @@ static void OpenLogFile(NSString *name);
if ([stageName isKindOfClass:[NSString class]]) if ([stageName isKindOfClass:[NSString class]])
{ {
stageClass = NSClassFromString(stageName); stageClass = NSClassFromString(stageName);
if (stageClass == Nil)
{
OOLog(@"verifyOXP.registration.failed", @"Attempt to register unknown class %@ as a verifier stage, ignoring.", stageName);
continue;
}
stage = [[stageClass alloc] init]; stage = [[stageClass alloc] init];
[self registerStage:stage]; [self registerStage:stage];
[stage release]; [stage release];
@ -512,21 +531,27 @@ static void OpenLogFile(NSString *name);
break; break;
} }
stageName = [stageToRun name]; stageName = nil;
if ([stageToRun shouldRun]) OOLogPushIndent();
{ NS_DURING
NoteVerificationStage(_displayName, stageName); stageName = [stageToRun name];
OOLog(@"verifyOXP.runStage", @"%@", stageName); if ([stageToRun shouldRun])
OOLogPushIndent(); {
OOLogIndent(); NoteVerificationStage(_displayName, stageName);
[stageToRun performRun]; OOLog(@"verifyOXP.runStage", @"%@", stageName);
OOLogPopIndent(); OOLogIndent();
} [stageToRun performRun];
else }
{ else
OOLog(@"verifyOXP.verbose.skipStage", @"- Skipping stage: %@ (nothing to do).", stageName); {
[stageToRun noteSkipped]; OOLog(@"verifyOXP.verbose.skipStage", @"- Skipping stage: %@ (nothing to do).", stageName);
} [stageToRun noteSkipped];
}
NS_HANDLER
if (stageName == nil) stageName = [[stageToRun class] description];
OOLog(@"verifyOXP.exception", @"***** Exception occurred when running OXP verifier stage \"%@\": %@: %@", stageName, [localException name], [localException reason]);
NS_ENDHANDLER
OOLogPopIndent();
[_waitingStages removeObject:stageToRun]; [_waitingStages removeObject:stageToRun];
[pool release]; [pool release];

View File

@ -35,7 +35,7 @@ MA 02110-1301, USA.
NSMutableSet *_usedTextures; NSMutableSet *_usedTextures;
} }
// Returns name to be used in -dependents by other stages; also registers stage. // Returns name to be used in -dependents by other stages.
+ (NSString *)nameForReverseDependencyForVerifier:(OOOXPVerifier *)verifier; + (NSString *)nameForReverseDependencyForVerifier:(OOOXPVerifier *)verifier;
/* This can be called by other stages *before* the texture stage runs. /* This can be called by other stages *before* the texture stage runs.

View File

@ -64,17 +64,6 @@ static NSString * const kStageName = @"Testing textures and images";
+ (NSString *)nameForReverseDependencyForVerifier:(OOOXPVerifier *)verifier + (NSString *)nameForReverseDependencyForVerifier:(OOOXPVerifier *)verifier
{ {
#if 0
// In order to allow this stage to be disabled with excludeStages, it is _not_ implicitly pulled in but rather listed explicitly.
OOTextureVerifierStage *stage = [verifier stageWithName:kStageName];
if (stage == nil)
{
stage = [[OOListUnusedFilesStage alloc] init];
[verifier registerStage:stage];
[stage release];
}
#endif
return kStageName; return kStageName;
} }