extra checks when caps system fails us
This commit is contained in:
parent
5853a807bb
commit
173f62b390
2 changed files with 35 additions and 23 deletions
|
|
@ -2091,30 +2091,37 @@ namespace OpenMetaverse
|
||||||
// TODO: create Current Outfit Folder
|
// TODO: create Current Outfit Folder
|
||||||
}
|
}
|
||||||
|
|
||||||
OSDMap request = new OSDMap(1) { ["cof_version"] = currentoutfitfolder.Version };
|
try
|
||||||
|
|
||||||
string msg = "Server side baking failed";
|
|
||||||
|
|
||||||
OSD res = null;
|
|
||||||
|
|
||||||
await Client.HttpCapsClient.PostRequestAsync(cap, OSDFormat.Xml, request, cancellationToken,
|
|
||||||
(response, data, error) => res = OSDParser.Deserialize(data));
|
|
||||||
|
|
||||||
if (res is OSDMap result)
|
|
||||||
{
|
{
|
||||||
if (result["success"])
|
OSDMap request = new OSDMap(1) { ["cof_version"] = currentoutfitfolder.Version };
|
||||||
{
|
|
||||||
Logger.Log("Successfully set appearance", Helpers.LogLevel.Info, Client);
|
|
||||||
// TODO: Set local visual params and baked textures based on the result here
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
if (result.ContainsKey("error"))
|
|
||||||
{
|
|
||||||
msg += ": " + result["error"].AsString();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Logger.Log(msg, Helpers.LogLevel.Error, Client);
|
string msg = "Server side baking failed";
|
||||||
|
|
||||||
|
OSD res = null;
|
||||||
|
|
||||||
|
await Client.HttpCapsClient.PostRequestAsync(cap, OSDFormat.Xml, request, cancellationToken,
|
||||||
|
(response, data, error) => res = OSDParser.Deserialize(data));
|
||||||
|
|
||||||
|
if (res is OSDMap result)
|
||||||
|
{
|
||||||
|
if (result["success"])
|
||||||
|
{
|
||||||
|
Logger.Log("Successfully set appearance", Helpers.LogLevel.Info, Client);
|
||||||
|
// TODO: Set local visual params and baked textures based on the result here
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if (result.ContainsKey("error"))
|
||||||
|
{
|
||||||
|
msg += ": " + result["error"].AsString();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Logger.Log(msg, Helpers.LogLevel.Error, Client);
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
Logger.Log("UpdateAvatarAppearanceAsync has failed to unpack data: "+e.Message, Helpers.LogLevel.Error, Client);
|
||||||
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1056,7 +1056,12 @@ namespace OpenMetaverse
|
||||||
if (error != null) { return; }
|
if (error != null) { return; }
|
||||||
|
|
||||||
OSD result = OSDParser.Deserialize(data);
|
OSD result = OSDParser.Deserialize(data);
|
||||||
GroupMembersHandlerCaps(requestID, result);
|
if (result != null)
|
||||||
|
{
|
||||||
|
GroupMembersHandlerCaps(requestID, result);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
Logger.Log("Failed to json decode data from uri "+cap.AbsoluteUri+": ", Helpers.LogLevel.Error, Client);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue