From 63df56d613440779c6b4a9f50afd2c9267acfc9b Mon Sep 17 00:00:00 2001 From: "Justin Clark-Casey (justincc)" Date: Fri, 14 Sep 2012 00:07:39 +0100 Subject: [PATCH] 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. --- .../Handlers/Avatar/AvatarServerPostHandler.cs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/OpenSim/Server/Handlers/Avatar/AvatarServerPostHandler.cs b/OpenSim/Server/Handlers/Avatar/AvatarServerPostHandler.cs index 393584e932..8cd747ee17 100644 --- a/OpenSim/Server/Handlers/Avatar/AvatarServerPostHandler.cs +++ b/OpenSim/Server/Handlers/Avatar/AvatarServerPostHandler.cs @@ -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(); } + + /// + /// Remove parameters that were used to invoke the method and should not in themselves be persisted. + /// + /// + private void RemoveRequestParamsNotForStorage(Dictionary request) + { + request.Remove("VERSIONMAX"); + request.Remove("VERSIONMIN"); + request.Remove("METHOD"); + request.Remove("UserID"); + } byte[] SetItems(Dictionary request) { @@ -173,6 +189,8 @@ namespace OpenSim.Server.Handlers.Avatar if (!(request["Names"] is List || request["Values"] is List)) return FailureResult(); + RemoveRequestParamsNotForStorage(request); + List _names = (List)request["Names"]; names = _names.ToArray(); List _values = (List)request["Values"];