aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Services
diff options
context:
space:
mode:
authorUbitUmarov2015-10-27 18:39:33 +0000
committerUbitUmarov2015-10-27 18:39:33 +0000
commit8b1ae501b577e302313dd856fe18f0b88f62725d (patch)
tree0a8599f66769b9285271fb66fe350fc62d66ec42 /OpenSim/Services
parent set SOG.IsAttachment when doing a full check, so future gets see the right v... (diff)
downloadopensim-SC_OLD-8b1ae501b577e302313dd856fe18f0b88f62725d.zip
opensim-SC_OLD-8b1ae501b577e302313dd856fe18f0b88f62725d.tar.gz
opensim-SC_OLD-8b1ae501b577e302313dd856fe18f0b88f62725d.tar.bz2
opensim-SC_OLD-8b1ae501b577e302313dd856fe18f0b88f62725d.tar.xz
fix services handling of visualparameters, avoiding possible crashs (mantis 7732) partially appling code from avinationmerge
Diffstat (limited to 'OpenSim/Services')
-rw-r--r--OpenSim/Services/Interfaces/IAvatarService.cs25
1 files changed, 20 insertions, 5 deletions
diff --git a/OpenSim/Services/Interfaces/IAvatarService.cs b/OpenSim/Services/Interfaces/IAvatarService.cs
index 6ca0b15..892e0b4 100644
--- a/OpenSim/Services/Interfaces/IAvatarService.cs
+++ b/OpenSim/Services/Interfaces/IAvatarService.cs
@@ -162,10 +162,15 @@ namespace OpenSim.Services.Interfaces
162 } 162 }
163 163
164 // Visual Params 164 // Visual Params
165 string[] vps = new string[AvatarAppearance.VISUALPARAM_COUNT]; 165 //string[] vps = new string[AvatarAppearance.VISUALPARAM_COUNT];
166 //byte[] binary = appearance.VisualParams;
167
168 // for (int i = 0 ; i < AvatarAppearance.VISUALPARAM_COUNT ; i++)
169
166 byte[] binary = appearance.VisualParams; 170 byte[] binary = appearance.VisualParams;
171 string[] vps = new string[binary.Length];
167 172
168 for (int i = 0 ; i < AvatarAppearance.VISUALPARAM_COUNT ; i++) 173 for (int i = 0; i < binary.Length; i++)
169 { 174 {
170 vps[i] = binary[i].ToString(); 175 vps[i] = binary[i].ToString();
171 } 176 }
@@ -202,7 +207,13 @@ namespace OpenSim.Services.Interfaces
202 appearance.Serial = Int32.Parse(Data["Serial"]); 207 appearance.Serial = Int32.Parse(Data["Serial"]);
203 208
204 if (Data.ContainsKey("AvatarHeight")) 209 if (Data.ContainsKey("AvatarHeight"))
205 appearance.AvatarHeight = float.Parse(Data["AvatarHeight"]); 210 {
211 float h = float.Parse(Data["AvatarHeight"]);
212 if( h == 0f)
213 h = 1.9f;
214
215 appearance.AvatarHeight = h;
216 }
206 217
207 // Legacy Wearables 218 // Legacy Wearables
208 if (Data.ContainsKey("BodyItem")) 219 if (Data.ContainsKey("BodyItem"))
@@ -273,9 +284,13 @@ namespace OpenSim.Services.Interfaces
273 if (Data.ContainsKey("VisualParams")) 284 if (Data.ContainsKey("VisualParams"))
274 { 285 {
275 string[] vps = Data["VisualParams"].Split(new char[] {','}); 286 string[] vps = Data["VisualParams"].Split(new char[] {','});
276 byte[] binary = new byte[AvatarAppearance.VISUALPARAM_COUNT]; 287 //byte[] binary = new byte[AvatarAppearance.VISUALPARAM_COUNT];
288
289 //for (int i = 0 ; i < vps.Length && i < binary.Length ; i++)
290
291 byte[] binary = new byte[vps.Length];
277 292
278 for (int i = 0 ; i < vps.Length && i < binary.Length ; i++) 293 for (int i = 0; i < vps.Length; i++)
279 binary[i] = (byte)Convert.ToInt32(vps[i]); 294 binary[i] = (byte)Convert.ToInt32(vps[i]);
280 295
281 appearance.VisualParams = binary; 296 appearance.VisualParams = binary;