aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2011-07-30 00:58:17 +0100
committerJustin Clark-Casey (justincc)2011-07-30 00:58:17 +0100
commit2f5995f5c0a7720e28a8d88296dd1b8f07a9ac9a (patch)
treef2de94eb11c91b0851b170291eb78c5a0ab0f119
parentTemporarily put in a log line which shows which locale the user is running in. (diff)
downloadopensim-SC_OLD-2f5995f5c0a7720e28a8d88296dd1b8f07a9ac9a.zip
opensim-SC_OLD-2f5995f5c0a7720e28a8d88296dd1b8f07a9ac9a.tar.gz
opensim-SC_OLD-2f5995f5c0a7720e28a8d88296dd1b8f07a9ac9a.tar.bz2
opensim-SC_OLD-2f5995f5c0a7720e28a8d88296dd1b8f07a9ac9a.tar.xz
Temporary code to change bad AvatarHeight values in the AvatarService to the default Ruth height.
I was persuaded to do this because simulators on osgrid will persist in inserting bad values for an unknown length of time, even after the original simulator bug which was inserting bad values is out in an osgrid distro This code can be removed at some point in the future, though I think there is an argument for having services police these values in open grids.
-rw-r--r--OpenSim/Services/AvatarService/AvatarService.cs28
1 files changed, 27 insertions, 1 deletions
diff --git a/OpenSim/Services/AvatarService/AvatarService.cs b/OpenSim/Services/AvatarService/AvatarService.cs
index 53ca7c8..c4c7cad 100644
--- a/OpenSim/Services/AvatarService/AvatarService.cs
+++ b/OpenSim/Services/AvatarService/AvatarService.cs
@@ -109,7 +109,33 @@ namespace OpenSim.Services.AvatarService
109 foreach (KeyValuePair<string,string> kvp in avatar.Data) 109 foreach (KeyValuePair<string,string> kvp in avatar.Data)
110 { 110 {
111 av.Data["Name"] = kvp.Key; 111 av.Data["Name"] = kvp.Key;
112 av.Data["Value"] = kvp.Value; 112
113 // justincc 20110730. Yes, this is a hack to get around the fact that a bug in OpenSim is causing
114 // various simulators on osgrid to inject bad values. Since these simulators might be around for a
115 // long time, we are going to manually police the value.
116 //
117 // It should be possible to remove this in half a year if we don't want to police values server side.
118 if (kvp.Key == "AvatarHeight")
119 {
120 float height;
121 if (!float.TryParse(kvp.Value, out height) || height < 0 || height > 10)
122 {
123 string rawHeight = kvp.Value.Replace(",", ".");
124
125 if (!float.TryParse(rawHeight, out height) || height < 0 || height > 10)
126 height = 1.771488f;
127
128 m_log.DebugFormat(
129 "[AVATAR SERVICE]: Rectifying height of avatar {0} from {1} to {2}",
130 principalID, kvp.Value, height);
131 }
132
133 av.Data["Value"] = height.ToString();
134 }
135 else
136 {
137 av.Data["Value"] = kvp.Value;
138 }
113 139
114 if (!m_Database.Store(av)) 140 if (!m_Database.Store(av))
115 { 141 {