aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim.RegionServer/world/WorldPacketHandlers.cs
diff options
context:
space:
mode:
authorMW2007-04-25 18:12:06 +0000
committerMW2007-04-25 18:12:06 +0000
commit9ed0a8dbad121b64ca8baca78f28ca58602c47ca (patch)
tree5c0008e0be59cb7ccaaf8ff1b0ea2f272a0548e6 /OpenSim.RegionServer/world/WorldPacketHandlers.cs
parentCan now use the xml config file for setting up things like sandbox mode, logi... (diff)
downloadopensim-SC-9ed0a8dbad121b64ca8baca78f28ca58602c47ca.zip
opensim-SC-9ed0a8dbad121b64ca8baca78f28ca58602c47ca.tar.gz
opensim-SC-9ed0a8dbad121b64ca8baca78f28ca58602c47ca.tar.bz2
opensim-SC-9ed0a8dbad121b64ca8baca78f28ca58602c47ca.tar.xz
updated to use lastest version of libsl but is currently broke when using SL viewer 1.15.02, due to big changes in the message templates.
Diffstat (limited to 'OpenSim.RegionServer/world/WorldPacketHandlers.cs')
-rw-r--r--OpenSim.RegionServer/world/WorldPacketHandlers.cs31
1 files changed, 28 insertions, 3 deletions
diff --git a/OpenSim.RegionServer/world/WorldPacketHandlers.cs b/OpenSim.RegionServer/world/WorldPacketHandlers.cs
index 70cbc6b..f4213d0 100644
--- a/OpenSim.RegionServer/world/WorldPacketHandlers.cs
+++ b/OpenSim.RegionServer/world/WorldPacketHandlers.cs
@@ -8,6 +8,7 @@ using OpenSim.Framework.Interfaces;
8using OpenSim.Framework.Types; 8using OpenSim.Framework.Types;
9using OpenSim.Framework.Terrain; 9using OpenSim.Framework.Terrain;
10using OpenSim.Framework.Inventory; 10using OpenSim.Framework.Inventory;
11using OpenSim.Framework.Utilities;
11using OpenSim.Assets; 12using OpenSim.Assets;
12 13
13namespace OpenSim.world 14namespace OpenSim.world
@@ -44,7 +45,7 @@ namespace OpenSim.world
44 { 45 {
45 System.Text.Encoding enc = System.Text.Encoding.ASCII; 46 System.Text.Encoding enc = System.Text.Encoding.ASCII;
46 ChatFromViewerPacket inchatpack = (ChatFromViewerPacket)packet; 47 ChatFromViewerPacket inchatpack = (ChatFromViewerPacket)packet;
47 if (Helpers.FieldToString(inchatpack.ChatData.Message) == "") 48 if (Util.FieldToString(inchatpack.ChatData.Message) == "")
48 { 49 {
49 //empty message so don't bother with it 50 //empty message so don't bother with it
50 return true; 51 return true;
@@ -53,7 +54,7 @@ namespace OpenSim.world
53 libsecondlife.Packets.ChatFromSimulatorPacket reply = new ChatFromSimulatorPacket(); 54 libsecondlife.Packets.ChatFromSimulatorPacket reply = new ChatFromSimulatorPacket();
54 reply.ChatData.Audible = 1; 55 reply.ChatData.Audible = 1;
55 reply.ChatData.Message = inchatpack.ChatData.Message; 56 reply.ChatData.Message = inchatpack.ChatData.Message;
56 reply.ChatData.ChatType = 1; 57 reply.ChatData.ChatType = inchatpack.ChatData.Type;
57 reply.ChatData.SourceType = 1; 58 reply.ChatData.SourceType = 1;
58 reply.ChatData.Position = simClient.ClientAvatar.Pos; 59 reply.ChatData.Position = simClient.ClientAvatar.Pos;
59 reply.ChatData.FromName = enc.GetBytes(simClient.ClientAvatar.firstname + " " + simClient.ClientAvatar.lastname + "\0"); 60 reply.ChatData.FromName = enc.GetBytes(simClient.ClientAvatar.firstname + " " + simClient.ClientAvatar.lastname + "\0");
@@ -61,7 +62,31 @@ namespace OpenSim.world
61 reply.ChatData.SourceID = simClient.AgentID; 62 reply.ChatData.SourceID = simClient.AgentID;
62 foreach (SimClient client in m_clientThreads.Values) 63 foreach (SimClient client in m_clientThreads.Values)
63 { 64 {
64 client.OutPacket(reply); 65 switch (inchatpack.ChatData.Type)
66 {
67 case 0:
68 int dis = Util.fast_distance2d((int)(client.ClientAvatar.Pos.X - simClient.ClientAvatar.Pos.X),(int)( client.ClientAvatar.Pos.Y - simClient.ClientAvatar.Pos.Y));
69 if ((dis < 10) && (dis > -10))
70 {
71 client.OutPacket(reply);
72 }
73 break;
74 case 1:
75 dis = Util.fast_distance2d((int)(client.ClientAvatar.Pos.X - simClient.ClientAvatar.Pos.X), (int)(client.ClientAvatar.Pos.Y - simClient.ClientAvatar.Pos.Y));
76 if ((dis < 30) && (dis > -30))
77 {
78 client.OutPacket(reply);
79 }
80 break;
81 case 2:
82 dis = Util.fast_distance2d((int)(client.ClientAvatar.Pos.X - simClient.ClientAvatar.Pos.X),(int)( client.ClientAvatar.Pos.Y - simClient.ClientAvatar.Pos.Y));
83 if ((dis < 100) && (dis > -100))
84 {
85 client.OutPacket(reply);
86 }
87 break;
88 }
89
65 } 90 }
66 return true; 91 return true;
67 } 92 }