aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorJeff Ames2007-11-08 07:14:46 +0000
committerJeff Ames2007-11-08 07:14:46 +0000
commitfc3e247956d11b9e28a1ec0654eb4a7e92d7c91b (patch)
treef632e29ecfcc938ca56e81b3b27fc0e1ebe418aa
parentconverted hard-coded chat type values to ChatTypeEnum (diff)
downloadopensim-SC-fc3e247956d11b9e28a1ec0654eb4a7e92d7c91b.zip
opensim-SC-fc3e247956d11b9e28a1ec0654eb4a7e92d7c91b.tar.gz
opensim-SC-fc3e247956d11b9e28a1ec0654eb4a7e92d7c91b.tar.bz2
opensim-SC-fc3e247956d11b9e28a1ec0654eb4a7e92d7c91b.tar.xz
fixed non-ASCII chat and IM
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/ClientStack/ClientView.API.cs3
-rw-r--r--OpenSim/Region/ClientStack/ClientView.ProcessPackets.cs6
-rw-r--r--OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs2
3 files changed, 6 insertions, 5 deletions
diff --git a/OpenSim/Region/ClientStack/ClientView.API.cs b/OpenSim/Region/ClientStack/ClientView.API.cs
index 14e1b39..c8213fc 100644
--- a/OpenSim/Region/ClientStack/ClientView.API.cs
+++ b/OpenSim/Region/ClientStack/ClientView.API.cs
@@ -251,6 +251,7 @@ namespace OpenSim.Region.ClientStack
251 LLUUID imSessionID, string fromName, byte dialog, uint timeStamp) 251 LLUUID imSessionID, string fromName, byte dialog, uint timeStamp)
252 { 252 {
253 Encoding enc = Encoding.ASCII; 253 Encoding enc = Encoding.ASCII;
254 Encoding encUTF8 = Encoding.UTF8;
254 ImprovedInstantMessagePacket msg = new ImprovedInstantMessagePacket(); 255 ImprovedInstantMessagePacket msg = new ImprovedInstantMessagePacket();
255 msg.AgentData.AgentID = fromAgent; 256 msg.AgentData.AgentID = fromAgent;
256 msg.AgentData.SessionID = fromAgentSession; 257 msg.AgentData.SessionID = fromAgentSession;
@@ -264,7 +265,7 @@ namespace OpenSim.Region.ClientStack
264 msg.MessageBlock.RegionID = LLUUID.Random(); 265 msg.MessageBlock.RegionID = LLUUID.Random();
265 msg.MessageBlock.Timestamp = timeStamp; 266 msg.MessageBlock.Timestamp = timeStamp;
266 msg.MessageBlock.ToAgentID = toAgent; 267 msg.MessageBlock.ToAgentID = toAgent;
267 msg.MessageBlock.Message = enc.GetBytes(message + "\0"); 268 msg.MessageBlock.Message = encUTF8.GetBytes(message + "\0");
268 msg.MessageBlock.BinaryBucket = new byte[0]; 269 msg.MessageBlock.BinaryBucket = new byte[0];
269 270
270 OutPacket(msg); 271 OutPacket(msg);
diff --git a/OpenSim/Region/ClientStack/ClientView.ProcessPackets.cs b/OpenSim/Region/ClientStack/ClientView.ProcessPackets.cs
index 7a778e8..d285d21 100644
--- a/OpenSim/Region/ClientStack/ClientView.ProcessPackets.cs
+++ b/OpenSim/Region/ClientStack/ClientView.ProcessPackets.cs
@@ -83,7 +83,7 @@ namespace OpenSim.Region.ClientStack
83 break; 83 break;
84 case PacketType.ChatFromViewer: 84 case PacketType.ChatFromViewer:
85 ChatFromViewerPacket inchatpack = (ChatFromViewerPacket) Pack; 85 ChatFromViewerPacket inchatpack = (ChatFromViewerPacket) Pack;
86 if (Util.FieldToString(inchatpack.ChatData.Message) == "") 86 if (Helpers.FieldToUTF8String(inchatpack.ChatData.Message) == "")
87 { 87 {
88 //empty message so don't bother with it 88 //empty message so don't bother with it
89 break; 89 break;
@@ -101,7 +101,7 @@ namespace OpenSim.Region.ClientStack
101 ChatFromViewerArgs args = new ChatFromViewerArgs(); 101 ChatFromViewerArgs args = new ChatFromViewerArgs();
102 args.Channel = channel; 102 args.Channel = channel;
103 args.From = fromName; 103 args.From = fromName;
104 args.Message = Util.FieldToString(message); 104 args.Message = Helpers.FieldToUTF8String(message);
105 args.Type = (ChatTypeEnum) type; 105 args.Type = (ChatTypeEnum) type;
106 args.Position = fromPos; 106 args.Position = fromPos;
107 107
@@ -114,7 +114,7 @@ namespace OpenSim.Region.ClientStack
114 case PacketType.ImprovedInstantMessage: 114 case PacketType.ImprovedInstantMessage:
115 ImprovedInstantMessagePacket msgpack = (ImprovedInstantMessagePacket) Pack; 115 ImprovedInstantMessagePacket msgpack = (ImprovedInstantMessagePacket) Pack;
116 string IMfromName = Util.FieldToString(msgpack.MessageBlock.FromAgentName); 116 string IMfromName = Util.FieldToString(msgpack.MessageBlock.FromAgentName);
117 string IMmessage = Util.FieldToString(msgpack.MessageBlock.Message); 117 string IMmessage = Helpers.FieldToUTF8String(msgpack.MessageBlock.Message);
118 if (OnInstantMessage != null) 118 if (OnInstantMessage != null)
119 { 119 {
120 OnInstantMessage(msgpack.AgentData.AgentID, msgpack.AgentData.SessionID, 120 OnInstantMessage(msgpack.AgentData.AgentID, msgpack.AgentData.SessionID,
diff --git a/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs b/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs
index a57041b..74e9a43 100644
--- a/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs
+++ b/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs
@@ -72,7 +72,7 @@ namespace OpenSim.Region.Environment.Scenes
72 { 72 {
73 ChatFromViewerArgs args = new ChatFromViewerArgs(); 73 ChatFromViewerArgs args = new ChatFromViewerArgs();
74 74
75 args.Message = Util.FieldToString(message); 75 args.Message = Helpers.FieldToUTF8String(message);
76 args.Channel = channel; 76 args.Channel = channel;
77 args.Type = type; 77 args.Type = type;
78 args.Position = fromPos; 78 args.Position = fromPos;