Don't store the unnecessary VERSIONMIN. VERSIONMAX, METHOD or UserID (present as column PrincipalID) parameters in the Avatars table.

These are used to invoke avatar service calls but are not in themselves persistable avatar data.
integration
Justin Clark-Casey (justincc) 2012-09-14 00:07:39 +01:00
parent dd0a89a0e6
commit 6f7825e310
1 changed files with 18 additions and 0 deletions

View File

@ -137,6 +137,8 @@ namespace OpenSim.Server.Handlers.Avatar
if (!UUID.TryParse(request["UserID"].ToString(), out user))
return FailureResult();
RemoveRequestParamsNotForStorage(request);
AvatarData avatar = new AvatarData(request);
if (m_AvatarService.SetAvatar(user, avatar))
return SuccessResult();
@ -153,11 +155,25 @@ namespace OpenSim.Server.Handlers.Avatar
if (!UUID.TryParse(request["UserID"].ToString(), out user))
return FailureResult();
RemoveRequestParamsNotForStorage(request);
if (m_AvatarService.ResetAvatar(user))
return SuccessResult();
return FailureResult();
}
/// <summary>
/// Remove parameters that were used to invoke the method and should not in themselves be persisted.
/// </summary>
/// <param name='request'></param>
private void RemoveRequestParamsNotForStorage(Dictionary<string, object> request)
{
request.Remove("VERSIONMAX");
request.Remove("VERSIONMIN");
request.Remove("METHOD");
request.Remove("UserID");
}
byte[] SetItems(Dictionary<string, object> request)
{
@ -173,6 +189,8 @@ namespace OpenSim.Server.Handlers.Avatar
if (!(request["Names"] is List<string> || request["Values"] is List<string>))
return FailureResult();
RemoveRequestParamsNotForStorage(request);
List<string> _names = (List<string>)request["Names"];
names = _names.ToArray();
List<string> _values = (List<string>)request["Values"];