diff options
Attempt to enable chat, but seems to be a problem with the distances
Diffstat (limited to 'OpenSim')
-rw-r--r-- | OpenSim/OpenSim.World/Avatar.cs | 1 | ||||
-rw-r--r-- | OpenSim/OpenSim.World/World.PacketHandlers.cs | 15 | ||||
-rw-r--r-- | OpenSim/OpenSim.World/World.cs | 1 |
3 files changed, 14 insertions, 3 deletions
diff --git a/OpenSim/OpenSim.World/Avatar.cs b/OpenSim/OpenSim.World/Avatar.cs index 247e194..1c22977 100644 --- a/OpenSim/OpenSim.World/Avatar.cs +++ b/OpenSim/OpenSim.World/Avatar.cs | |||
@@ -136,7 +136,6 @@ namespace OpenSim.world | |||
136 | //really really should be moved somewhere else (RegionInfo.cs ?) | 136 | //really really should be moved somewhere else (RegionInfo.cs ?) |
137 | public void SendRegionHandshake() | 137 | public void SendRegionHandshake() |
138 | { | 138 | { |
139 | Console.WriteLine("sending handshake"); | ||
140 | this.ControllingClient.SendRegionHandshake(this.regionData); | 139 | this.ControllingClient.SendRegionHandshake(this.regionData); |
141 | } | 140 | } |
142 | 141 | ||
diff --git a/OpenSim/OpenSim.World/World.PacketHandlers.cs b/OpenSim/OpenSim.World/World.PacketHandlers.cs index 3357536..9908525 100644 --- a/OpenSim/OpenSim.World/World.PacketHandlers.cs +++ b/OpenSim/OpenSim.World/World.PacketHandlers.cs | |||
@@ -33,11 +33,21 @@ namespace OpenSim.world | |||
33 | 33 | ||
34 | public void SimChat(byte[] message, byte type, LLVector3 fromPos, string fromName, LLUUID fromAgentID) | 34 | public void SimChat(byte[] message, byte type, LLVector3 fromPos, string fromName, LLUUID fromAgentID) |
35 | { | 35 | { |
36 | Console.WriteLine("chat message"); | ||
37 | Avatar avatar = null; | ||
36 | foreach (IClientAPI client in m_clientThreads.Values) | 38 | foreach (IClientAPI client in m_clientThreads.Values) |
37 | { | 39 | { |
38 | // int dis = Util.fast_distance2d((int)(client.ClientAvatar.Pos.X - simClient.ClientAvatar.Pos.X), (int)(client.ClientAvatar.Pos.Y - simClient.ClientAvatar.Pos.Y)); | 40 | int dis = -1000; |
39 | int dis = 0; // (int)client.ClientAvatar.Pos.GetDistanceTo(fromPos); | 41 | if (this.Avatars.ContainsKey(client.AgentId)) |
42 | { | ||
43 | |||
44 | avatar = this.Avatars[client.AgentId]; | ||
45 | // int dis = Util.fast_distance2d((int)(client.ClientAvatar.Pos.X - simClient.ClientAvatar.Pos.X), (int)(client.ClientAvatar.Pos.Y - simClient.ClientAvatar.Pos.Y)); | ||
46 | dis= (int)avatar.Pos.GetDistanceTo(fromPos); | ||
47 | Console.WriteLine("found avatar at " +dis); | ||
40 | 48 | ||
49 | } | ||
50 | |||
41 | switch (type) | 51 | switch (type) |
42 | { | 52 | { |
43 | case 0: // Whisper | 53 | case 0: // Whisper |
@@ -50,6 +60,7 @@ namespace OpenSim.world | |||
50 | case 1: // Say | 60 | case 1: // Say |
51 | if ((dis < 30) && (dis > -30)) | 61 | if ((dis < 30) && (dis > -30)) |
52 | { | 62 | { |
63 | Console.WriteLine("sending chat"); | ||
53 | client.SendChatMessage(message, type, fromPos, fromName, fromAgentID); | 64 | client.SendChatMessage(message, type, fromPos, fromName, fromAgentID); |
54 | } | 65 | } |
55 | break; | 66 | break; |
diff --git a/OpenSim/OpenSim.World/World.cs b/OpenSim/OpenSim.World/World.cs index 6a50aaa..29c75e8 100644 --- a/OpenSim/OpenSim.World/World.cs +++ b/OpenSim/OpenSim.World/World.cs | |||
@@ -505,6 +505,7 @@ namespace OpenSim.world | |||
505 | { | 505 | { |
506 | remoteClient.OnRegionHandShakeReply += new GenericCall(this.SendLayerData); | 506 | remoteClient.OnRegionHandShakeReply += new GenericCall(this.SendLayerData); |
507 | //remoteClient.OnRequestWearables += new GenericCall(this.GetInitialPrims); | 507 | //remoteClient.OnRequestWearables += new GenericCall(this.GetInitialPrims); |
508 | remoteClient.OnChatFromViewer += new ChatFromViewer(this.SimChat); | ||
508 | 509 | ||
509 | Avatar newAvatar = null; | 510 | Avatar newAvatar = null; |
510 | try | 511 | try |