diff options
author | Justin Clark-Casey (justincc) | 2012-09-14 00:07:39 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2012-09-14 00:07:39 +0100 |
commit | 6f7825e31046fd3ea4df72147b4d28d8a7a071ce (patch) | |
tree | 73c75187334f8a6a14d8329c2e6c756f1081fc26 /OpenSim/Server/Handlers/Avatar | |
parent | Merge branch 'master' of ssh://opensimulator.org/var/git/opensim (diff) | |
download | opensim-SC_OLD-6f7825e31046fd3ea4df72147b4d28d8a7a071ce.zip opensim-SC_OLD-6f7825e31046fd3ea4df72147b4d28d8a7a071ce.tar.gz opensim-SC_OLD-6f7825e31046fd3ea4df72147b4d28d8a7a071ce.tar.bz2 opensim-SC_OLD-6f7825e31046fd3ea4df72147b4d28d8a7a071ce.tar.xz |
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.
Diffstat (limited to 'OpenSim/Server/Handlers/Avatar')
-rw-r--r-- | OpenSim/Server/Handlers/Avatar/AvatarServerPostHandler.cs | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/OpenSim/Server/Handlers/Avatar/AvatarServerPostHandler.cs b/OpenSim/Server/Handlers/Avatar/AvatarServerPostHandler.cs index 393584e..8cd747e 100644 --- a/OpenSim/Server/Handlers/Avatar/AvatarServerPostHandler.cs +++ b/OpenSim/Server/Handlers/Avatar/AvatarServerPostHandler.cs | |||
@@ -137,6 +137,8 @@ namespace OpenSim.Server.Handlers.Avatar | |||
137 | if (!UUID.TryParse(request["UserID"].ToString(), out user)) | 137 | if (!UUID.TryParse(request["UserID"].ToString(), out user)) |
138 | return FailureResult(); | 138 | return FailureResult(); |
139 | 139 | ||
140 | RemoveRequestParamsNotForStorage(request); | ||
141 | |||
140 | AvatarData avatar = new AvatarData(request); | 142 | AvatarData avatar = new AvatarData(request); |
141 | if (m_AvatarService.SetAvatar(user, avatar)) | 143 | if (m_AvatarService.SetAvatar(user, avatar)) |
142 | return SuccessResult(); | 144 | return SuccessResult(); |
@@ -153,11 +155,25 @@ namespace OpenSim.Server.Handlers.Avatar | |||
153 | if (!UUID.TryParse(request["UserID"].ToString(), out user)) | 155 | if (!UUID.TryParse(request["UserID"].ToString(), out user)) |
154 | return FailureResult(); | 156 | return FailureResult(); |
155 | 157 | ||
158 | RemoveRequestParamsNotForStorage(request); | ||
159 | |||
156 | if (m_AvatarService.ResetAvatar(user)) | 160 | if (m_AvatarService.ResetAvatar(user)) |
157 | return SuccessResult(); | 161 | return SuccessResult(); |
158 | 162 | ||
159 | return FailureResult(); | 163 | return FailureResult(); |
160 | } | 164 | } |
165 | |||
166 | /// <summary> | ||
167 | /// Remove parameters that were used to invoke the method and should not in themselves be persisted. | ||
168 | /// </summary> | ||
169 | /// <param name='request'></param> | ||
170 | private void RemoveRequestParamsNotForStorage(Dictionary<string, object> request) | ||
171 | { | ||
172 | request.Remove("VERSIONMAX"); | ||
173 | request.Remove("VERSIONMIN"); | ||
174 | request.Remove("METHOD"); | ||
175 | request.Remove("UserID"); | ||
176 | } | ||
161 | 177 | ||
162 | byte[] SetItems(Dictionary<string, object> request) | 178 | byte[] SetItems(Dictionary<string, object> request) |
163 | { | 179 | { |
@@ -173,6 +189,8 @@ namespace OpenSim.Server.Handlers.Avatar | |||
173 | if (!(request["Names"] is List<string> || request["Values"] is List<string>)) | 189 | if (!(request["Names"] is List<string> || request["Values"] is List<string>)) |
174 | return FailureResult(); | 190 | return FailureResult(); |
175 | 191 | ||
192 | RemoveRequestParamsNotForStorage(request); | ||
193 | |||
176 | List<string> _names = (List<string>)request["Names"]; | 194 | List<string> _names = (List<string>)request["Names"]; |
177 | names = _names.ToArray(); | 195 | names = _names.ToArray(); |
178 | List<string> _values = (List<string>)request["Values"]; | 196 | List<string> _values = (List<string>)request["Values"]; |