diff options
author | Dr Scofield | 2009-05-12 13:09:16 +0000 |
---|---|---|
committer | Dr Scofield | 2009-05-12 13:09:16 +0000 |
commit | e96071eb6e84d097d0e0df995a4c4b0c80aafde0 (patch) | |
tree | 6caa1aea84096247f2d7c7d62cde8bcd9b10e365 /OpenSim/ApplicationPlugins/RemoteController | |
parent | partially fixing avatar appearance code (diff) | |
download | opensim-SC_OLD-e96071eb6e84d097d0e0df995a4c4b0c80aafde0.zip opensim-SC_OLD-e96071eb6e84d097d0e0df995a4c4b0c80aafde0.tar.gz opensim-SC_OLD-e96071eb6e84d097d0e0df995a4c4b0c80aafde0.tar.bz2 opensim-SC_OLD-e96071eb6e84d097d0e0df995a4c4b0c80aafde0.tar.xz |
From: Alan Webb <alan_webb@us.ibm.com>
Change updateAppearance so that nothing is done to the user's
appearance unless explicitly requested.
Diffstat (limited to 'OpenSim/ApplicationPlugins/RemoteController')
-rw-r--r-- | OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs | 73 |
1 files changed, 34 insertions, 39 deletions
diff --git a/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs b/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs index 83a1916..61ccc74 100644 --- a/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs +++ b/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs | |||
@@ -904,8 +904,8 @@ namespace OpenSim.ApplicationPlugins.RemoteController | |||
904 | firstname, lastname)); | 904 | firstname, lastname)); |
905 | 905 | ||
906 | // Establish the avatar's initial appearance | 906 | // Establish the avatar's initial appearance |
907 | 907 | // TODO: need to add code to do this only when requested | |
908 | updateUserAppearance(responseData, requestData, userID); | 908 | // updateUserAppearance(responseData, requestData, userID); |
909 | 909 | ||
910 | responseData["success"] = true; | 910 | responseData["success"] = true; |
911 | responseData["avatar_uuid"] = userID.ToString(); | 911 | responseData["avatar_uuid"] = userID.ToString(); |
@@ -1180,31 +1180,39 @@ namespace OpenSim.ApplicationPlugins.RemoteController | |||
1180 | 1180 | ||
1181 | m_log.DebugFormat("[RADMIN] updateUserAppearance"); | 1181 | m_log.DebugFormat("[RADMIN] updateUserAppearance"); |
1182 | 1182 | ||
1183 | // string dmale = m_config.GetString("default_male", "Default Male"); | 1183 | string dmale = m_config.GetString("default_male", "Default Male"); |
1184 | // string dfemale = m_config.GetString("default_female", "Default Female"); | 1184 | string dfemale = m_config.GetString("default_female", "Default Female"); |
1185 | // string dneut = m_config.GetString("default_female", "Default Default"); | 1185 | string dneut = m_config.GetString("default_female", "Default Default"); |
1186 | // string dmodel = dneut; | ||
1187 | // string model = dneut; | ||
1188 | // string dmodel = String.Empty; | ||
1189 | string model = String.Empty; | 1186 | string model = String.Empty; |
1190 | 1187 | ||
1191 | // Has a gender preference been supplied? | 1188 | // Has a gender preference been supplied? |
1192 | 1189 | ||
1193 | // if (requestData.Contains("gender")) | 1190 | if (requestData.Contains("gender")) |
1194 | // { | 1191 | { |
1195 | // if ((string)requestData["gender"] == "f") | 1192 | switch((string)requestData["gender"]) |
1196 | // dmodel = dmale; | 1193 | { |
1197 | // else | 1194 | case "m" : |
1198 | // dmodel = dfemale; | 1195 | model = dmale; |
1199 | // } | 1196 | break; |
1200 | // else | 1197 | case "f" : |
1201 | // dmodel = dneut; | 1198 | model = dfemale; |
1199 | break; | ||
1200 | case "n" : | ||
1201 | default : | ||
1202 | model = dneut; | ||
1203 | break; | ||
1204 | } | ||
1205 | } | ||
1202 | 1206 | ||
1203 | // Has an explicit model been specified? | 1207 | // Has an explicit model been specified? |
1204 | 1208 | ||
1205 | if (!requestData.Contains("model")) | 1209 | if (requestData.Contains("model")) |
1210 | model = (string)requestData["model"]; | ||
1211 | |||
1212 | // No appearance attributes were set | ||
1213 | |||
1214 | if (model == String.Empty) | ||
1206 | return; | 1215 | return; |
1207 | model = (string)requestData["model"]; | ||
1208 | 1216 | ||
1209 | m_log.DebugFormat("[RADMIN] Setting appearance for avatar {0}, using model {1}", userid, model); | 1217 | m_log.DebugFormat("[RADMIN] Setting appearance for avatar {0}, using model {1}", userid, model); |
1210 | 1218 | ||
@@ -1221,23 +1229,9 @@ namespace OpenSim.ApplicationPlugins.RemoteController | |||
1221 | // Is this the first time one of the default models has been used? Create it if that is the case | 1229 | // Is this the first time one of the default models has been used? Create it if that is the case |
1222 | // otherwise default to male. | 1230 | // otherwise default to male. |
1223 | 1231 | ||
1224 | // if (mprof == null) | ||
1225 | // { | ||
1226 | // if (model != dmale && model != dfemale) | ||
1227 | // { | ||
1228 | // m_log.WarnFormat("[RADMIN] Requested model ({0}) not found. Default appearance assumed", | ||
1229 | // model); | ||
1230 | // nomens = dmodel.Split(); | ||
1231 | // } | ||
1232 | // if (createDefaultAvatars()) | ||
1233 | // { | ||
1234 | // mprof = m_app.CommunicationsManager.UserService.GetUserProfile(nomens[0], nomens[1]); | ||
1235 | // } | ||
1236 | // } | ||
1237 | |||
1238 | if (mprof == null) | 1232 | if (mprof == null) |
1239 | { | 1233 | { |
1240 | m_log.WarnFormat("[RADMIN] User appearance not set for {0}. Model avatar not found : <{1}>", userid, model); | 1234 | m_log.WarnFormat("[RADMIN] Requested model ({0}) not found. Appearance unchanged", model); |
1241 | return; | 1235 | return; |
1242 | } | 1236 | } |
1243 | 1237 | ||
@@ -1250,7 +1244,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController | |||
1250 | m_log.DebugFormat("[RADMIN] Finished setting appearance for avatar {0}, using model {1}", | 1244 | m_log.DebugFormat("[RADMIN] Finished setting appearance for avatar {0}, using model {1}", |
1251 | userid, model); | 1245 | userid, model); |
1252 | } | 1246 | } |
1253 | 1247 | ||
1254 | /// <summary> | 1248 | /// <summary> |
1255 | /// This method is called by updateAvatarAppearance once any specified model has been | 1249 | /// This method is called by updateAvatarAppearance once any specified model has been |
1256 | /// ratified, or an appropriate default value has been adopted. The intended prototype | 1250 | /// ratified, or an appropriate default value has been adopted. The intended prototype |
@@ -1280,6 +1274,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController | |||
1280 | 1274 | ||
1281 | try | 1275 | try |
1282 | { | 1276 | { |
1277 | |||
1283 | Dictionary<UUID,UUID> imap = new Dictionary<UUID,UUID>(); | 1278 | Dictionary<UUID,UUID> imap = new Dictionary<UUID,UUID>(); |
1284 | 1279 | ||
1285 | iserv.RequestInventoryForUser(dest, dic.callback); | 1280 | iserv.RequestInventoryForUser(dest, dic.callback); |
@@ -1356,17 +1351,17 @@ namespace OpenSim.ApplicationPlugins.RemoteController | |||
1356 | { | 1351 | { |
1357 | throw new Exception("Unable to load both inventories"); | 1352 | throw new Exception("Unable to load both inventories"); |
1358 | } | 1353 | } |
1354 | |||
1355 | m_app.CommunicationsManager.AvatarService.UpdateUserAppearance(dest, ava); | ||
1356 | |||
1359 | } | 1357 | } |
1360 | catch (Exception e) | 1358 | catch (Exception e) |
1361 | { | 1359 | { |
1362 | m_log.WarnFormat("[RADMIN] Error transferring inventory for {0} : {1}", | 1360 | m_log.WarnFormat("[RADMIN] Error transferring inventory for {0} : {1}", |
1363 | dest, e.Message); | 1361 | dest, e.Message); |
1364 | // return new AvatarAppearance(); | ||
1365 | return; | 1362 | return; |
1366 | } | 1363 | } |
1367 | 1364 | ||
1368 | m_app.CommunicationsManager.AvatarService.UpdateUserAppearance(dest, ava); | ||
1369 | // return ava; | ||
1370 | return; | 1365 | return; |
1371 | 1366 | ||
1372 | } | 1367 | } |