Provide a GetApi method on the IScriptEngine to get a named API reference
This allows cross-api method calls on the implementation and also allows "Meta APIs" that only provide common functionality to other APIs0.6.0-stable
parent
9222c5154e
commit
fdb24c46ac
|
@ -58,6 +58,7 @@ namespace OpenSim.Region.ScriptEngine.Interfaces
|
||||||
void SetState(UUID itemID, string newState);
|
void SetState(UUID itemID, string newState);
|
||||||
int GetStartParameter(UUID itemID);
|
int GetStartParameter(UUID itemID);
|
||||||
IScriptWorkItem QueueEventHandler(object parms);
|
IScriptWorkItem QueueEventHandler(object parms);
|
||||||
|
IScriptApi GetApi(UUID itemID, string name);
|
||||||
|
|
||||||
DetectParams GetDetectParams(UUID item, int number);
|
DetectParams GetDetectParams(UUID item, int number);
|
||||||
}
|
}
|
||||||
|
|
|
@ -85,5 +85,7 @@ namespace OpenSim.Region.ScriptEngine.Interfaces
|
||||||
DetectParams GetDetectParams(int idx);
|
DetectParams GetDetectParams(int idx);
|
||||||
UUID GetDetectID(int idx);
|
UUID GetDetectID(int idx);
|
||||||
void SaveState(string assembly);
|
void SaveState(string assembly);
|
||||||
|
|
||||||
|
IScriptApi GetApi(string name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -714,5 +714,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance
|
||||||
throw new Exception("Completed persistence save, but no file was created");
|
throw new Exception("Completed persistence save, but no file was created");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public IScriptApi GetApi(string name)
|
||||||
|
{
|
||||||
|
if (m_Apis.ContainsKey(name))
|
||||||
|
return m_Apis[name];
|
||||||
|
return null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -869,5 +869,13 @@ namespace OpenSim.Region.ScriptEngine.XEngine
|
||||||
|
|
||||||
DoBackup(new Object[] {0});
|
DoBackup(new Object[] {0});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public IScriptApi GetApi(UUID itemID, string name)
|
||||||
|
{
|
||||||
|
IScriptInstance instance = GetInstance(itemID);
|
||||||
|
if (instance == null)
|
||||||
|
return null;
|
||||||
|
return instance.GetApi(name);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue