aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim.RegionServer/world/World.PacketHandlers.cs
diff options
context:
space:
mode:
authorlbsa712007-05-16 17:12:17 +0000
committerlbsa712007-05-16 17:12:17 +0000
commit6056247ac3002808c95d7a1c6671c388920ec2ed (patch)
treecc9c6aa96868ba71dab8cee92f904b51315156c9 /OpenSim.RegionServer/world/World.PacketHandlers.cs
parentYet more cleanup/refactoring (diff)
downloadopensim-SC_OLD-6056247ac3002808c95d7a1c6671c388920ec2ed.zip
opensim-SC_OLD-6056247ac3002808c95d7a1c6671c388920ec2ed.tar.gz
opensim-SC_OLD-6056247ac3002808c95d7a1c6671c388920ec2ed.tar.bz2
opensim-SC_OLD-6056247ac3002808c95d7a1c6671c388920ec2ed.tar.xz
* removed unused new-login.dat
* cleared up verbose/noverbose/disableOutput douple negation confusion in ConsoleBase * 2d chat radius is now 3d chat sphere * removed unused fast 2d radius calc * added chat type 0xFF : broadcast (no sphere checking) * OpenSimMain now exposes its LocalWorld
Diffstat (limited to 'OpenSim.RegionServer/world/World.PacketHandlers.cs')
-rw-r--r--OpenSim.RegionServer/world/World.PacketHandlers.cs39
1 files changed, 25 insertions, 14 deletions
diff --git a/OpenSim.RegionServer/world/World.PacketHandlers.cs b/OpenSim.RegionServer/world/World.PacketHandlers.cs
index 2036bc6..3c3548d 100644
--- a/OpenSim.RegionServer/world/World.PacketHandlers.cs
+++ b/OpenSim.RegionServer/world/World.PacketHandlers.cs
@@ -51,40 +51,51 @@ namespace OpenSim.world
51 return true; 51 return true;
52 } 52 }
53 53
54 string fromName = simClient.ClientAvatar.firstname + " " + simClient.ClientAvatar.lastname;
55 byte[] message = inchatpack.ChatData.Message;
56 byte type = inchatpack.ChatData.Type;
57 LLVector3 fromPos = simClient.ClientAvatar.Pos;
58 LLUUID fromAgentID = simClient.AgentID;
59
54 libsecondlife.Packets.ChatFromSimulatorPacket reply = new ChatFromSimulatorPacket(); 60 libsecondlife.Packets.ChatFromSimulatorPacket reply = new ChatFromSimulatorPacket();
55 reply.ChatData.Audible = 1; 61 reply.ChatData.Audible = 1;
56 reply.ChatData.Message = inchatpack.ChatData.Message; 62 reply.ChatData.Message = message;
57 reply.ChatData.ChatType = inchatpack.ChatData.Type; 63 reply.ChatData.ChatType = type;
58 reply.ChatData.SourceType = 1; 64 reply.ChatData.SourceType = 1;
59 reply.ChatData.Position = simClient.ClientAvatar.Pos; 65 reply.ChatData.Position = fromPos;
60 reply.ChatData.FromName = enc.GetBytes(simClient.ClientAvatar.firstname + " " + simClient.ClientAvatar.lastname + "\0"); 66 reply.ChatData.FromName = enc.GetBytes(fromName + "\0");
61 reply.ChatData.OwnerID = simClient.AgentID; 67 reply.ChatData.OwnerID = fromAgentID;
62 reply.ChatData.SourceID = simClient.AgentID; 68 reply.ChatData.SourceID = fromAgentID;
69
63 foreach (SimClient client in m_clientThreads.Values) 70 foreach (SimClient client in m_clientThreads.Values)
64 { 71 {
72 // int dis = Util.fast_distance2d((int)(client.ClientAvatar.Pos.X - simClient.ClientAvatar.Pos.X), (int)(client.ClientAvatar.Pos.Y - simClient.ClientAvatar.Pos.Y));
73 int dis = (int)client.ClientAvatar.Pos.GetDistanceTo(simClient.ClientAvatar.Pos);
74
65 switch (inchatpack.ChatData.Type) 75 switch (inchatpack.ChatData.Type)
66 { 76 {
67 case 0: 77 case 0: // Whisper
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)) 78 if ((dis < 10) && (dis > -10))
70 { 79 {
71 client.OutPacket(reply); 80 client.OutPacket(reply);
72 } 81 }
73 break; 82 break;
74 case 1: 83 case 1: // Say
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)) 84 if ((dis < 30) && (dis > -30))
77 { 85 {
78 client.OutPacket(reply); 86 client.OutPacket(reply);
79 } 87 }
80 break; 88 break;
81 case 2: 89 case 2: // Shout
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)) 90 if ((dis < 100) && (dis > -100))
84 { 91 {
85 client.OutPacket(reply); 92 client.OutPacket(reply);
86 } 93 }
87 break; 94 break;
95
96 case 0xff: // Broadcast
97 client.OutPacket(reply);
98 break;
88 } 99 }
89 100
90 } 101 }
@@ -147,7 +158,7 @@ namespace OpenSim.world
147 //Uncomment when prim/object UUIDs are random or such 158 //Uncomment when prim/object UUIDs are random or such
148 //2007-03-22 - Randomskk 159 //2007-03-22 - Randomskk
149 //this._primCount--; 160 //this._primCount--;
150 OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.VERBOSE,"Deleted UUID " + ent.uuid); 161 OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.VERBOSE, "Deleted UUID " + ent.uuid);
151 } 162 }
152 } 163 }
153 } 164 }
@@ -216,7 +227,7 @@ namespace OpenSim.world
216 mapReply.Data[0].MapImageID = new LLUUID("00000000-0000-0000-9999-000000000007"); 227 mapReply.Data[0].MapImageID = new LLUUID("00000000-0000-0000-9999-000000000007");
217 mapReply.Data[0].X = (ushort)m_regInfo.RegionLocX; 228 mapReply.Data[0].X = (ushort)m_regInfo.RegionLocX;
218 mapReply.Data[0].Y = (ushort)m_regInfo.RegionLocY; 229 mapReply.Data[0].Y = (ushort)m_regInfo.RegionLocY;
219 mapReply.Data[0].WaterHeight =(byte) m_regInfo.RegionWaterHeight; 230 mapReply.Data[0].WaterHeight = (byte)m_regInfo.RegionWaterHeight;
220 mapReply.Data[0].Name = _enc.GetBytes(this.m_regionName); 231 mapReply.Data[0].Name = _enc.GetBytes(this.m_regionName);
221 mapReply.Data[0].RegionFlags = 72458694; 232 mapReply.Data[0].RegionFlags = 72458694;
222 mapReply.Data[0].Access = 13; 233 mapReply.Data[0].Access = 13;