diff options
author | John Hurliman | 2009-10-02 18:31:08 -0700 |
---|---|---|
committer | John Hurliman | 2009-10-02 18:31:08 -0700 |
commit | 387e9f7a7faeb412054383080afc3507a1522746 (patch) | |
tree | 522470dd28074f7e114547476968942c05e866aa /OpenSim/Region | |
parent | Merge branch 'diva-textures-osgrid' of ssh://opensimulator.org/var/git/opensi... (diff) | |
download | opensim-SC-387e9f7a7faeb412054383080afc3507a1522746.zip opensim-SC-387e9f7a7faeb412054383080afc3507a1522746.tar.gz opensim-SC-387e9f7a7faeb412054383080afc3507a1522746.tar.bz2 opensim-SC-387e9f7a7faeb412054383080afc3507a1522746.tar.xz |
* Creates Util.UTF8 and switches some references of Encoding.UTF8 to Util.UTF8 (not all references were switched since not all OpenSim libraries reference OpenSim.Framework)
* Shrinks the largest in-memory object, the LLRAW.HeightmapLookupValue struct (only used for exporting to LLRAW terrain files), to the minimum possible size. This seems to have the odd side effect of cutting the size of the two double[256,256] terrain objects in half. Possibly an alignment optimization?
Diffstat (limited to 'OpenSim/Region')
13 files changed, 24 insertions, 24 deletions
diff --git a/OpenSim/Region/Application/OpenSimBase.cs b/OpenSim/Region/Application/OpenSimBase.cs index 7bc0b77..6b6cb85 100644 --- a/OpenSim/Region/Application/OpenSimBase.cs +++ b/OpenSim/Region/Application/OpenSimBase.cs | |||
@@ -699,7 +699,7 @@ namespace OpenSim | |||
699 | public byte[] Handle(string path, Stream request, | 699 | public byte[] Handle(string path, Stream request, |
700 | OSHttpRequest httpRequest, OSHttpResponse httpResponse) | 700 | OSHttpRequest httpRequest, OSHttpResponse httpResponse) |
701 | { | 701 | { |
702 | return Encoding.UTF8.GetBytes("OK"); | 702 | return Util.UTF8.GetBytes("OK"); |
703 | } | 703 | } |
704 | 704 | ||
705 | public string ContentType | 705 | public string ContentType |
@@ -736,7 +736,7 @@ namespace OpenSim | |||
736 | public byte[] Handle(string path, Stream request, | 736 | public byte[] Handle(string path, Stream request, |
737 | OSHttpRequest httpRequest, OSHttpResponse httpResponse) | 737 | OSHttpRequest httpRequest, OSHttpResponse httpResponse) |
738 | { | 738 | { |
739 | return Encoding.UTF8.GetBytes(m_opensim.StatReport(httpRequest)); | 739 | return Util.UTF8.GetBytes(m_opensim.StatReport(httpRequest)); |
740 | } | 740 | } |
741 | 741 | ||
742 | public string ContentType | 742 | public string ContentType |
@@ -777,7 +777,7 @@ namespace OpenSim | |||
777 | public byte[] Handle(string path, Stream request, | 777 | public byte[] Handle(string path, Stream request, |
778 | OSHttpRequest httpRequest, OSHttpResponse httpResponse) | 778 | OSHttpRequest httpRequest, OSHttpResponse httpResponse) |
779 | { | 779 | { |
780 | return Encoding.UTF8.GetBytes(m_opensim.StatReport(httpRequest)); | 780 | return Util.UTF8.GetBytes(m_opensim.StatReport(httpRequest)); |
781 | } | 781 | } |
782 | 782 | ||
783 | public string ContentType | 783 | public string ContentType |
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs index 43d29fd..3f90004 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs | |||
@@ -4748,7 +4748,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
4748 | { | 4748 | { |
4749 | Hashtable mp = (Hashtable)simMapProfiles[iii]; | 4749 | Hashtable mp = (Hashtable)simMapProfiles[iii]; |
4750 | mbReply.Data[iii] = new MapBlockReplyPacket.DataBlock(); | 4750 | mbReply.Data[iii] = new MapBlockReplyPacket.DataBlock(); |
4751 | mbReply.Data[iii].Name = System.Text.Encoding.UTF8.GetBytes((string)mp["name"]); | 4751 | mbReply.Data[iii].Name = Util.UTF8.GetBytes((string)mp["name"]); |
4752 | mbReply.Data[iii].Access = System.Convert.ToByte(mp["access"]); | 4752 | mbReply.Data[iii].Access = System.Convert.ToByte(mp["access"]); |
4753 | mbReply.Data[iii].Agents = System.Convert.ToByte(mp["agents"]); | 4753 | mbReply.Data[iii].Agents = System.Convert.ToByte(mp["agents"]); |
4754 | mbReply.Data[iii].MapImageID = new UUID((string)mp["map-image-id"]); | 4754 | mbReply.Data[iii].MapImageID = new UUID((string)mp["map-image-id"]); |
@@ -7338,7 +7338,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
7338 | } | 7338 | } |
7339 | #endregion | 7339 | #endregion |
7340 | 7340 | ||
7341 | string mapName = Encoding.UTF8.GetString(map.NameData.Name, 0, | 7341 | string mapName = Util.UTF8.GetString(map.NameData.Name, 0, |
7342 | map.NameData.Name.Length - 1); | 7342 | map.NameData.Name.Length - 1); |
7343 | handlerMapNameRequest = OnMapNameRequest; | 7343 | handlerMapNameRequest = OnMapNameRequest; |
7344 | if (handlerMapNameRequest != null) | 7344 | if (handlerMapNameRequest != null) |
diff --git a/OpenSim/Region/CoreModules/Agent/TextureSender/J2KDecoderModule.cs b/OpenSim/Region/CoreModules/Agent/TextureSender/J2KDecoderModule.cs index a0f359b..7456e8c 100644 --- a/OpenSim/Region/CoreModules/Agent/TextureSender/J2KDecoderModule.cs +++ b/OpenSim/Region/CoreModules/Agent/TextureSender/J2KDecoderModule.cs | |||
@@ -257,7 +257,7 @@ namespace OpenSim.Region.CoreModules.Agent.TextureSender | |||
257 | stringResult.AppendFormat("{0}|{1}|{2}{3}", Layers[i].Start, Layers[i].End, Layers[i].End - Layers[i].Start, strEnd); | 257 | stringResult.AppendFormat("{0}|{1}|{2}{3}", Layers[i].Start, Layers[i].End, Layers[i].End - Layers[i].Start, strEnd); |
258 | } | 258 | } |
259 | 259 | ||
260 | layerDecodeAsset.Data = Encoding.UTF8.GetBytes(stringResult.ToString()); | 260 | layerDecodeAsset.Data = Util.UTF8.GetBytes(stringResult.ToString()); |
261 | 261 | ||
262 | #endregion Serialize Layer Data | 262 | #endregion Serialize Layer Data |
263 | 263 | ||
@@ -280,7 +280,7 @@ namespace OpenSim.Region.CoreModules.Agent.TextureSender | |||
280 | { | 280 | { |
281 | #region Deserialize Layer Data | 281 | #region Deserialize Layer Data |
282 | 282 | ||
283 | string readResult = Encoding.UTF8.GetString(layerDecodeAsset.Data); | 283 | string readResult = Util.UTF8.GetString(layerDecodeAsset.Data); |
284 | string[] lines = readResult.Split(new char[] { '\n' }, StringSplitOptions.RemoveEmptyEntries); | 284 | string[] lines = readResult.Split(new char[] { '\n' }, StringSplitOptions.RemoveEmptyEntries); |
285 | 285 | ||
286 | if (lines.Length == 0) | 286 | if (lines.Length == 0) |
diff --git a/OpenSim/Region/CoreModules/Scripting/HttpRequest/ScriptsHttpRequests.cs b/OpenSim/Region/CoreModules/Scripting/HttpRequest/ScriptsHttpRequests.cs index 50d7c97..45e724d 100644 --- a/OpenSim/Region/CoreModules/Scripting/HttpRequest/ScriptsHttpRequests.cs +++ b/OpenSim/Region/CoreModules/Scripting/HttpRequest/ScriptsHttpRequests.cs | |||
@@ -367,7 +367,7 @@ namespace OpenSim.Region.CoreModules.Scripting.HttpRequest | |||
367 | // Encode outbound data | 367 | // Encode outbound data |
368 | if (OutboundBody.Length > 0) | 368 | if (OutboundBody.Length > 0) |
369 | { | 369 | { |
370 | byte[] data = Encoding.UTF8.GetBytes(OutboundBody); | 370 | byte[] data = Util.UTF8.GetBytes(OutboundBody); |
371 | 371 | ||
372 | Request.ContentLength = data.Length; | 372 | Request.ContentLength = data.Length; |
373 | Stream bstream = Request.GetRequestStream(); | 373 | Stream bstream = Request.GetRequestStream(); |
@@ -390,7 +390,7 @@ namespace OpenSim.Region.CoreModules.Scripting.HttpRequest | |||
390 | if (count != 0) | 390 | if (count != 0) |
391 | { | 391 | { |
392 | // translate from bytes to ASCII text | 392 | // translate from bytes to ASCII text |
393 | tempString = Encoding.UTF8.GetString(buf, 0, count); | 393 | tempString = Util.UTF8.GetString(buf, 0, count); |
394 | 394 | ||
395 | // continue building the string | 395 | // continue building the string |
396 | sb.Append(tempString); | 396 | sb.Append(tempString); |
diff --git a/OpenSim/Region/CoreModules/World/Terrain/FileLoaders/LLRAW.cs b/OpenSim/Region/CoreModules/World/Terrain/FileLoaders/LLRAW.cs index 3eb7cd2..a70ef13 100644 --- a/OpenSim/Region/CoreModules/World/Terrain/FileLoaders/LLRAW.cs +++ b/OpenSim/Region/CoreModules/World/Terrain/FileLoaders/LLRAW.cs | |||
@@ -36,10 +36,10 @@ namespace OpenSim.Region.CoreModules.World.Terrain.FileLoaders | |||
36 | { | 36 | { |
37 | public struct HeightmapLookupValue : IComparable<HeightmapLookupValue> | 37 | public struct HeightmapLookupValue : IComparable<HeightmapLookupValue> |
38 | { | 38 | { |
39 | public int Index; | 39 | public ushort Index; |
40 | public double Value; | 40 | public float Value; |
41 | 41 | ||
42 | public HeightmapLookupValue(int index, double value) | 42 | public HeightmapLookupValue(ushort index, float value) |
43 | { | 43 | { |
44 | Index = index; | 44 | Index = index; |
45 | Value = value; | 45 | Value = value; |
@@ -62,7 +62,7 @@ namespace OpenSim.Region.CoreModules.World.Terrain.FileLoaders | |||
62 | { | 62 | { |
63 | for (int j = 0; j < 256; j++) | 63 | for (int j = 0; j < 256; j++) |
64 | { | 64 | { |
65 | LookupHeightTable[i + (j * 256)] = new HeightmapLookupValue(i + (j * 256), ((double)i * ((double)j / 128.0d))); | 65 | LookupHeightTable[i + (j * 256)] = new HeightmapLookupValue((ushort)(i + (j * 256)), (float)((double)i * ((double)j / 128.0d))); |
66 | } | 66 | } |
67 | } | 67 | } |
68 | Array.Sort<HeightmapLookupValue>(LookupHeightTable); | 68 | Array.Sort<HeightmapLookupValue>(LookupHeightTable); |
@@ -196,7 +196,7 @@ namespace OpenSim.Region.CoreModules.World.Terrain.FileLoaders | |||
196 | 196 | ||
197 | // The lookup table is pre-sorted, so we either find an exact match or | 197 | // The lookup table is pre-sorted, so we either find an exact match or |
198 | // the next closest (smaller) match with a binary search | 198 | // the next closest (smaller) match with a binary search |
199 | index = Array.BinarySearch<HeightmapLookupValue>(LookupHeightTable, new HeightmapLookupValue(0, t)); | 199 | index = Array.BinarySearch<HeightmapLookupValue>(LookupHeightTable, new HeightmapLookupValue(0, (float)t)); |
200 | if (index < 0) | 200 | if (index < 0) |
201 | index = ~index - 1; | 201 | index = ~index - 1; |
202 | 202 | ||
diff --git a/OpenSim/Region/DataSnapshot/DataSnapshotManager.cs b/OpenSim/Region/DataSnapshot/DataSnapshotManager.cs index 080bd5a..4df9094 100644 --- a/OpenSim/Region/DataSnapshot/DataSnapshotManager.cs +++ b/OpenSim/Region/DataSnapshot/DataSnapshotManager.cs | |||
@@ -352,7 +352,7 @@ namespace OpenSim.Region.DataSnapshot | |||
352 | m_log.WarnFormat("[DATASNAPSHOT]: Unable to decode reply from data service. Ignoring. {0}", e.StackTrace); | 352 | m_log.WarnFormat("[DATASNAPSHOT]: Unable to decode reply from data service. Ignoring. {0}", e.StackTrace); |
353 | } | 353 | } |
354 | // This is not quite working, so... | 354 | // This is not quite working, so... |
355 | // string responseStr = Encoding.UTF8.GetString(response); | 355 | // string responseStr = Util.UTF8.GetString(response); |
356 | m_log.Info("[DATASNAPSHOT]: data service notified: " + url); | 356 | m_log.Info("[DATASNAPSHOT]: data service notified: " + url); |
357 | } | 357 | } |
358 | 358 | ||
diff --git a/OpenSim/Region/Framework/Scenes/RegionStatsHandler.cs b/OpenSim/Region/Framework/Scenes/RegionStatsHandler.cs index 7c02f9a..6055384 100644 --- a/OpenSim/Region/Framework/Scenes/RegionStatsHandler.cs +++ b/OpenSim/Region/Framework/Scenes/RegionStatsHandler.cs | |||
@@ -73,7 +73,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
73 | 73 | ||
74 | public byte[] Handle(string path, Stream request, OSHttpRequest httpRequest, OSHttpResponse httpResponse) | 74 | public byte[] Handle(string path, Stream request, OSHttpRequest httpRequest, OSHttpResponse httpResponse) |
75 | { | 75 | { |
76 | return Encoding.UTF8.GetBytes(Report()); | 76 | return Util.UTF8.GetBytes(Report()); |
77 | } | 77 | } |
78 | 78 | ||
79 | public string ContentType | 79 | public string ContentType |
diff --git a/OpenSim/Region/Framework/Scenes/TerrainChannel.cs b/OpenSim/Region/Framework/Scenes/TerrainChannel.cs index 8209ff6..ca6210d 100644 --- a/OpenSim/Region/Framework/Scenes/TerrainChannel.cs +++ b/OpenSim/Region/Framework/Scenes/TerrainChannel.cs | |||
@@ -172,7 +172,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
172 | public string SaveToXmlString() | 172 | public string SaveToXmlString() |
173 | { | 173 | { |
174 | XmlWriterSettings settings = new XmlWriterSettings(); | 174 | XmlWriterSettings settings = new XmlWriterSettings(); |
175 | settings.Encoding = Encoding.UTF8; | 175 | settings.Encoding = Util.UTF8; |
176 | using (StringWriter sw = new StringWriter()) | 176 | using (StringWriter sw = new StringWriter()) |
177 | { | 177 | { |
178 | using (XmlWriter writer = XmlWriter.Create(sw, settings)) | 178 | using (XmlWriter writer = XmlWriter.Create(sw, settings)) |
diff --git a/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs b/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs index 57f5d29..a31cbae 100644 --- a/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs +++ b/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs | |||
@@ -81,7 +81,7 @@ namespace OpenSim.Region.OptionalModules.Agent.InternetRelayClientView.Server | |||
81 | { | 81 | { |
82 | m_log.Info("[IRCd] Sending >>> " + command); | 82 | m_log.Info("[IRCd] Sending >>> " + command); |
83 | 83 | ||
84 | byte[] buf = Encoding.UTF8.GetBytes(command + "\r\n"); | 84 | byte[] buf = Util.UTF8.GetBytes(command + "\r\n"); |
85 | 85 | ||
86 | m_client.GetStream().BeginWrite(buf, 0, buf.Length, SendComplete, null); | 86 | m_client.GetStream().BeginWrite(buf, 0, buf.Length, SendComplete, null); |
87 | } | 87 | } |
@@ -109,7 +109,7 @@ namespace OpenSim.Region.OptionalModules.Agent.InternetRelayClientView.Server | |||
109 | byte[] buf = new byte[8]; // RFC1459 defines max message size as 512. | 109 | byte[] buf = new byte[8]; // RFC1459 defines max message size as 512. |
110 | 110 | ||
111 | int count = m_client.GetStream().Read(buf, 0, buf.Length); | 111 | int count = m_client.GetStream().Read(buf, 0, buf.Length); |
112 | string line = Encoding.UTF8.GetString(buf, 0, count); | 112 | string line = Util.UTF8.GetString(buf, 0, count); |
113 | 113 | ||
114 | strbuf += line; | 114 | strbuf += line; |
115 | 115 | ||
diff --git a/OpenSim/Region/OptionalModules/Avatar/Voice/FreeSwitchVoice/FreeSwitchVoiceModule.cs b/OpenSim/Region/OptionalModules/Avatar/Voice/FreeSwitchVoice/FreeSwitchVoiceModule.cs index 65c5274..f9dfc0d 100644 --- a/OpenSim/Region/OptionalModules/Avatar/Voice/FreeSwitchVoice/FreeSwitchVoiceModule.cs +++ b/OpenSim/Region/OptionalModules/Avatar/Voice/FreeSwitchVoice/FreeSwitchVoiceModule.cs | |||
@@ -527,7 +527,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice | |||
527 | 527 | ||
528 | if (method == "POST") | 528 | if (method == "POST") |
529 | { | 529 | { |
530 | byte[] contentreq = Encoding.UTF8.GetBytes(body); | 530 | byte[] contentreq = Util.UTF8.GetBytes(body); |
531 | forwardreq.ContentLength = contentreq.Length; | 531 | forwardreq.ContentLength = contentreq.Length; |
532 | Stream reqStream = forwardreq.GetRequestStream(); | 532 | Stream reqStream = forwardreq.GetRequestStream(); |
533 | reqStream.Write(contentreq, 0, contentreq.Length); | 533 | reqStream.Write(contentreq, 0, contentreq.Length); |
@@ -535,7 +535,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice | |||
535 | } | 535 | } |
536 | 536 | ||
537 | HttpWebResponse fwdrsp = (HttpWebResponse)forwardreq.GetResponse(); | 537 | HttpWebResponse fwdrsp = (HttpWebResponse)forwardreq.GetResponse(); |
538 | Encoding encoding = Encoding.UTF8; | 538 | Encoding encoding = Util.UTF8; |
539 | StreamReader fwdresponsestream = new StreamReader(fwdrsp.GetResponseStream(), encoding); | 539 | StreamReader fwdresponsestream = new StreamReader(fwdrsp.GetResponseStream(), encoding); |
540 | fwdresponsestr = fwdresponsestream.ReadToEnd(); | 540 | fwdresponsestr = fwdresponsestream.ReadToEnd(); |
541 | fwdresponsecontenttype = fwdrsp.ContentType; | 541 | fwdresponsecontenttype = fwdrsp.ContentType; |
diff --git a/OpenSim/Region/OptionalModules/World/TreePopulator/TreePopulatorModule.cs b/OpenSim/Region/OptionalModules/World/TreePopulator/TreePopulatorModule.cs index d4bba10..b6021a9 100644 --- a/OpenSim/Region/OptionalModules/World/TreePopulator/TreePopulatorModule.cs +++ b/OpenSim/Region/OptionalModules/World/TreePopulator/TreePopulatorModule.cs | |||
@@ -539,7 +539,7 @@ namespace OpenSim.Region.OptionalModules.World.TreePopulator | |||
539 | { | 539 | { |
540 | XmlSerializer xs = new XmlSerializer(typeof(Copse)); | 540 | XmlSerializer xs = new XmlSerializer(typeof(Copse)); |
541 | 541 | ||
542 | using (XmlTextWriter writer = new XmlTextWriter(fileName, System.Text.Encoding.UTF8)) | 542 | using (XmlTextWriter writer = new XmlTextWriter(fileName, Util.UTF8)) |
543 | { | 543 | { |
544 | writer.Formatting = Formatting.Indented; | 544 | writer.Formatting = Formatting.Indented; |
545 | xs.Serialize(writer, obj); | 545 | xs.Serialize(writer, obj); |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index ba42678..264d585 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | |||
@@ -7064,7 +7064,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
7064 | try | 7064 | try |
7065 | { | 7065 | { |
7066 | byte[] encData_byte = new byte[str.Length]; | 7066 | byte[] encData_byte = new byte[str.Length]; |
7067 | encData_byte = Encoding.UTF8.GetBytes(str); | 7067 | encData_byte = Util.UTF8.GetBytes(str); |
7068 | string encodedData = Convert.ToBase64String(encData_byte); | 7068 | string encodedData = Convert.ToBase64String(encData_byte); |
7069 | return encodedData; | 7069 | return encodedData; |
7070 | } | 7070 | } |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs index 726b37a..f80dd51 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs | |||
@@ -1457,7 +1457,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
1457 | notecardData = "Linden text version 2\n{\nLLEmbeddedItems version 1\n{\ncount 0\n}\nText length " | 1457 | notecardData = "Linden text version 2\n{\nLLEmbeddedItems version 1\n{\ncount 0\n}\nText length " |
1458 | + textLength.ToString() + "\n" + notecardData + "}\n"; | 1458 | + textLength.ToString() + "\n" + notecardData + "}\n"; |
1459 | 1459 | ||
1460 | asset.Data = Encoding.UTF8.GetBytes(notecardData); | 1460 | asset.Data = Util.UTF8.GetBytes(notecardData); |
1461 | World.AssetService.Store(asset); | 1461 | World.AssetService.Store(asset); |
1462 | 1462 | ||
1463 | // Create Task Entry | 1463 | // Create Task Entry |