Renamed misleading script.trace log message classes, and simplified the legacy script subset.
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@5410 127b21dd-08f5-0310-b4b7-95ae10353056
This commit is contained in:
parent
15502b9bf4
commit
b3b2005bc6
@ -16,8 +16,7 @@
|
|||||||
"General Errors", $error,
|
"General Errors", $error,
|
||||||
"Script Errors", $scriptError,
|
"Script Errors", $scriptError,
|
||||||
"Script Debug", $scriptDebug,
|
"Script Debug", $scriptDebug,
|
||||||
"JavaScript Run Trace", "script.trace.javaScript",
|
"Script Entry Points", $reportScriptEntry,
|
||||||
"Legacy Script Run Trace", "script.trace.legacy",
|
|
||||||
"Shader Debug", $shaderDebugOn,
|
"Shader Debug", $shaderDebugOn,
|
||||||
"Troubleshooting Dumps", $troubleShootingDump,
|
"Troubleshooting Dumps", $troubleShootingDump,
|
||||||
"Entity State", $entityState,
|
"Entity State", $entityState,
|
||||||
|
@ -300,15 +300,10 @@
|
|||||||
|
|
||||||
script.plist.run.badTarget = $error;
|
script.plist.run.badTarget = $error;
|
||||||
|
|
||||||
/*
|
// These messages are logged whenever Oolite calls a JS script method or runs a legacy script, respectively.
|
||||||
"Trace" events for legacy and JavaScript scripts. These indicate when
|
$reportScriptEntry = no;
|
||||||
a JavaScript method or legacy script is called by the game, and should
|
script.javaScript.call = $reportScriptEntry;
|
||||||
not be confused with the JavaScript trace facility (part of the Debug OXP).
|
script.legacy.run = $reportScriptEntry;
|
||||||
*/
|
|
||||||
script.trace.legacy = no;
|
|
||||||
script.trace.legacy.runWorld = inherit;
|
|
||||||
script.trace.legacy.plist.run = inherit;
|
|
||||||
script.trace.javaScript = no;
|
|
||||||
|
|
||||||
script.deprecated.scriptActionOnTarget = $scriptError; // Warning not to use scriptActionOnTarget:
|
script.deprecated.scriptActionOnTarget = $scriptError; // Warning not to use scriptActionOnTarget:
|
||||||
|
|
||||||
|
@ -323,10 +323,6 @@ static BOOL sRunningScript = NO;
|
|||||||
|
|
||||||
[self setScriptTarget:self];
|
[self setScriptTarget:self];
|
||||||
|
|
||||||
OOLogPushIndent();
|
|
||||||
OOLog(@"script.trace.legacy.runWorld", @"----- Running world script with state %@", [self status_string]);
|
|
||||||
OOLogIndentIf(@"script.trace.legacy.runWorld");
|
|
||||||
|
|
||||||
/* World scripts can potentially be invoked recursively, through
|
/* World scripts can potentially be invoked recursively, through
|
||||||
scriptActionOnTarget: and possibly other mechanisms. This is bad, but
|
scriptActionOnTarget: and possibly other mechanisms. This is bad, but
|
||||||
that's the way it is. Legacy world scripts rely on only seeing certain
|
that's the way it is. Legacy world scripts rely on only seeing certain
|
||||||
@ -355,14 +351,6 @@ static BOOL sRunningScript = NO;
|
|||||||
{
|
{
|
||||||
status = RecursiveRemapStatus(status);
|
status = RecursiveRemapStatus(status);
|
||||||
[self setStatus:status];
|
[self setStatus:status];
|
||||||
if (RecursiveRemapStatus(status) != restoreStatus)
|
|
||||||
{
|
|
||||||
OOLog(@"script.trace.legacy.runWorld.recurse.lying", @"----- Running world script recursively and temporarily changing player status from %@ to %@.", OOStringFromEntityStatus(restoreStatus), OOStringFromEntityStatus(status));
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
OOLog(@"script.trace.legacy.runWorld.recurse", @"----- Running world script recursively.");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
sRunningScript = YES;
|
sRunningScript = YES;
|
||||||
|
|
||||||
@ -377,8 +365,6 @@ static BOOL sRunningScript = NO;
|
|||||||
// Restore anti-recursion measures.
|
// Restore anti-recursion measures.
|
||||||
sRunningScript = wasRunningScript;
|
sRunningScript = wasRunningScript;
|
||||||
if (status != restoreStatus) [self setStatus:restoreStatus];
|
if (status != restoreStatus) [self setStatus:restoreStatus];
|
||||||
|
|
||||||
OOLogPopIndent();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -392,8 +392,8 @@ static JSFunctionSpec sScriptMethods[] =
|
|||||||
JS_ClearPendingException(context);
|
JS_ClearPendingException(context);
|
||||||
}
|
}
|
||||||
|
|
||||||
OOLog(@"script.trace.javaScript", @"Calling [%@].%@()", [self name], OOStringFromJSID(methodID));
|
OOLog(@"script.javaScript.call", @"Calling [%@].%@()", [self name], OOStringFromJSID(methodID));
|
||||||
OOLogIndentIf(@"script.trace.javaScript");
|
OOLogIndentIf(@"script.javaScript.call");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Push self on stack of running scripts.
|
// Push self on stack of running scripts.
|
||||||
@ -419,7 +419,7 @@ static JSFunctionSpec sScriptMethods[] =
|
|||||||
sRunningStack = stackElement.back;
|
sRunningStack = stackElement.back;
|
||||||
|
|
||||||
#ifndef NDEBUG
|
#ifndef NDEBUG
|
||||||
OOLogOutdentIf(@"script.trace.javaScript");
|
OOLogOutdentIf(@"script.javaScript.call");
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -107,14 +107,14 @@ static NSString * const kCacheName = @"sanitized legacy scripts";
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
OOLog(@"script.trace.legacy.plist.run", @"Running script %@", [self displayName]);
|
OOLog(@"script.legacy.run", @"Running script %@", [self displayName]);
|
||||||
OOLogIndentIf(@"script.trace.legacy.plist.run");
|
OOLogIndentIf(@"script.legacy.run");
|
||||||
|
|
||||||
[PLAYER runScriptActions:_script
|
[PLAYER runScriptActions:_script
|
||||||
withContextName:[self name]
|
withContextName:[self name]
|
||||||
forTarget:(ShipEntity *)target];
|
forTarget:(ShipEntity *)target];
|
||||||
|
|
||||||
OOLogOutdentIf(@"script.trace.legacy.plist.run");
|
OOLogOutdentIf(@"script.legacy.run");
|
||||||
}
|
}
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user