Add FSUseAis3Api debug setting to turn off AIS3

Ansariel 2015-02-23 09:31:21 +01:00
parent 7ebdeb97fb
commit 2de937d0bc
2 changed files with 23 additions and 3 deletions

View File

@ -23138,6 +23138,17 @@ Change of this parameter will affect the layout of buttons in notification toast
<key>Value</key>
<integer>0</integer>
</map>
<key>FSUseAis3Api</key>
<map>
<key>Comment</key>
<string>Option to disable the use of the new AISv3 inventory API</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>1</integer>
</map>
</map>
</llsd>

View File

@ -123,7 +123,10 @@ void AISCommand::httpFailure()
//static
bool AISCommand::isAPIAvailable()
{
if (gAgent.getRegion())
// <FS:Ansariel> Add AIS3 debug setting
//if (gAgent.getRegion())
if (gAgent.getRegion() && gSavedSettings.getBOOL("FSUseAis3Api"))
// </FS:Ansariel>
{
return gAgent.getRegion()->isCapabilityAvailable("InventoryAPIv3");
}
@ -133,7 +136,10 @@ bool AISCommand::isAPIAvailable()
//static
bool AISCommand::getInvCap(std::string& cap)
{
if (gAgent.getRegion())
// <FS:Ansariel> Add AIS3 debug setting
//if (gAgent.getRegion())
if (gAgent.getRegion() && gSavedSettings.getBOOL("FSUseAis3Api"))
// </FS:Ansariel>
{
cap = gAgent.getRegion()->getCapability("InventoryAPIv3");
}
@ -147,7 +153,10 @@ bool AISCommand::getInvCap(std::string& cap)
//static
bool AISCommand::getLibCap(std::string& cap)
{
if (gAgent.getRegion())
// <FS:Ansariel> Add AIS3 debug setting
//if (gAgent.getRegion())
if (gAgent.getRegion() && gSavedSettings.getBOOL("FSUseAis3Api"))
// </FS:Ansariel>
{
cap = gAgent.getRegion()->getCapability("LibraryAPIv3");
}