aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/RegionCommsListener.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Framework/RegionCommsListener.cs')
-rw-r--r--OpenSim/Framework/RegionCommsListener.cs112
1 files changed, 112 insertions, 0 deletions
diff --git a/OpenSim/Framework/RegionCommsListener.cs b/OpenSim/Framework/RegionCommsListener.cs
new file mode 100644
index 0000000..ee0d503
--- /dev/null
+++ b/OpenSim/Framework/RegionCommsListener.cs
@@ -0,0 +1,112 @@
1/*
2* Copyright (c) Contributors, http://opensimulator.org/
3* See CONTRIBUTORS.TXT for a full list of copyright holders.
4*
5* Redistribution and use in source and binary forms, with or without
6* modification, are permitted provided that the following conditions are met:
7* * Redistributions of source code must retain the above copyright
8* notice, this list of conditions and the following disclaimer.
9* * Redistributions in binary form must reproduce the above copyright
10* notice, this list of conditions and the following disclaimer in the
11* documentation and/or other materials provided with the distribution.
12* * Neither the name of the OpenSim Project nor the
13* names of its contributors may be used to endorse or promote products
14* derived from this software without specific prior written permission.
15*
16* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY
17* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
20* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26*
27*/
28
29using System.Collections.Generic;
30using libsecondlife;
31
32namespace OpenSim.Framework
33{
34 public class RegionCommsListener : IRegionCommsListener
35 {
36 public event ExpectUserDelegate OnExpectUser;
37 public event GenericCall2 OnExpectChildAgent;
38 public event AgentCrossing OnAvatarCrossingIntoRegion;
39 public event UpdateNeighbours OnNeighboursUpdate;
40 public event AcknowledgeAgentCross OnAcknowledgeAgentCrossed;
41
42 /// <summary>
43 ///
44 /// </summary>
45 /// <param name="agent"></param>
46 /// <returns></returns>
47 public virtual bool TriggerExpectUser(ulong regionHandle, AgentCircuitData agent)
48 {
49 if (OnExpectUser != null)
50 {
51 OnExpectUser(regionHandle, agent);
52 return true;
53 }
54
55 return false;
56 }
57
58 public virtual bool TriggerExpectAvatarCrossing(ulong regionHandle, LLUUID agentID, LLVector3 position,
59 bool isFlying)
60 {
61 if (OnAvatarCrossingIntoRegion != null)
62 {
63 OnAvatarCrossingIntoRegion(regionHandle, agentID, position, isFlying);
64 return true;
65 }
66 return false;
67 }
68
69 public virtual bool TriggerAcknowledgeAgentCrossed(ulong regionHandle, LLUUID agentID)
70 {
71 if (OnAcknowledgeAgentCrossed != null)
72 {
73 OnAcknowledgeAgentCrossed(regionHandle, agentID);
74 return true;
75 }
76 return false;
77 }
78
79 /// <summary>
80 ///
81 /// </summary>
82 /// <remarks>TODO: Doesnt take any args??</remarks>
83 /// <returns></returns>
84 public virtual bool TriggerExpectChildAgent()
85 {
86 if (OnExpectChildAgent != null)
87 {
88 OnExpectChildAgent();
89 return true;
90 }
91
92 return false;
93 }
94
95 /// <summary>
96 ///
97 /// </summary>
98 /// <remarks>Added to avoid a unused compiler warning on OnNeighboursUpdate, TODO: Check me</remarks>
99 /// <param name="neighbours"></param>
100 /// <returns></returns>
101 public virtual bool TriggerOnNeighboursUpdate(List<RegionInfo> neighbours)
102 {
103 if (OnNeighboursUpdate != null)
104 {
105 OnNeighboursUpdate(neighbours);
106 return true;
107 }
108
109 return false;
110 }
111 }
112} \ No newline at end of file