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.
0.7.4-extended
Justin Clark-Casey (justincc) 2012-09-14 00:07:39 +01:00
parent f2e1f3e659
commit 63df56d613
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)) if (!UUID.TryParse(request["UserID"].ToString(), out user))
return FailureResult(); return FailureResult();
RemoveRequestParamsNotForStorage(request);
AvatarData avatar = new AvatarData(request); AvatarData avatar = new AvatarData(request);
if (m_AvatarService.SetAvatar(user, avatar)) if (m_AvatarService.SetAvatar(user, avatar))
return SuccessResult(); return SuccessResult();
@ -153,11 +155,25 @@ namespace OpenSim.Server.Handlers.Avatar
if (!UUID.TryParse(request["UserID"].ToString(), out user)) if (!UUID.TryParse(request["UserID"].ToString(), out user))
return FailureResult(); return FailureResult();
RemoveRequestParamsNotForStorage(request);
if (m_AvatarService.ResetAvatar(user)) if (m_AvatarService.ResetAvatar(user))
return SuccessResult(); return SuccessResult();
return FailureResult(); 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) 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>)) if (!(request["Names"] is List<string> || request["Values"] is List<string>))
return FailureResult(); return FailureResult();
RemoveRequestParamsNotForStorage(request);
List<string> _names = (List<string>)request["Names"]; List<string> _names = (List<string>)request["Names"];
names = _names.ToArray(); names = _names.ToArray();
List<string> _values = (List<string>)request["Values"]; List<string> _values = (List<string>)request["Values"];