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
parent
dd0a89a0e6
commit
6f7825e310
|
@ -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,12 +155,26 @@ 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)
|
||||||
{
|
{
|
||||||
UUID user = UUID.Zero;
|
UUID user = UUID.Zero;
|
||||||
|
@ -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"];
|
||||||
|
|
Loading…
Reference in New Issue