aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-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 {