diff options
author | Teravus Ovares | 2008-02-22 21:18:08 +0000 |
---|---|---|
committer | Teravus Ovares | 2008-02-22 21:18:08 +0000 |
commit | 9b675a6888f3c68dacf8cd3b7310a955c1f3dbaf (patch) | |
tree | 6ab39fbdad1f04de5316afb5b80dda6f8b37a366 /OpenSim/Region/Communications | |
parent | * Downgrade texture exception to a warning. (diff) | |
download | opensim-SC_OLD-9b675a6888f3c68dacf8cd3b7310a955c1f3dbaf.zip opensim-SC_OLD-9b675a6888f3c68dacf8cd3b7310a955c1f3dbaf.tar.gz opensim-SC_OLD-9b675a6888f3c68dacf8cd3b7310a955c1f3dbaf.tar.bz2 opensim-SC_OLD-9b675a6888f3c68dacf8cd3b7310a955c1f3dbaf.tar.xz |
* Converted the last of the events to the private delegate instance method to avoid race conditions.
Diffstat (limited to 'OpenSim/Region/Communications')
-rw-r--r-- | OpenSim/Region/Communications/Local/LocalLoginService.cs | 7 | ||||
-rw-r--r-- | OpenSim/Region/Communications/OGS1/OGS1InterSimComms.cs | 43 |
2 files changed, 33 insertions, 17 deletions
diff --git a/OpenSim/Region/Communications/Local/LocalLoginService.cs b/OpenSim/Region/Communications/Local/LocalLoginService.cs index b480a1a..0e9b3d0 100644 --- a/OpenSim/Region/Communications/Local/LocalLoginService.cs +++ b/OpenSim/Region/Communications/Local/LocalLoginService.cs | |||
@@ -55,6 +55,8 @@ namespace OpenSim.Region.Communications.Local | |||
55 | 55 | ||
56 | public event LoginToRegionEvent OnLoginToRegion; | 56 | public event LoginToRegionEvent OnLoginToRegion; |
57 | 57 | ||
58 | private LoginToRegionEvent handler001 = null; // OnLoginToRegion; | ||
59 | |||
58 | public LocalLoginService(UserManagerBase userManager, string welcomeMess, | 60 | public LocalLoginService(UserManagerBase userManager, string welcomeMess, |
59 | CommunicationsLocal parent, NetworkServersInfo serversInfo, | 61 | CommunicationsLocal parent, NetworkServersInfo serversInfo, |
60 | bool authenticate) | 62 | bool authenticate) |
@@ -161,9 +163,10 @@ namespace OpenSim.Region.Communications.Local | |||
161 | _login.StartPos = new LLVector3(128, 128, 70); | 163 | _login.StartPos = new LLVector3(128, 128, 70); |
162 | _login.CapsPath = capsPath; | 164 | _login.CapsPath = capsPath; |
163 | 165 | ||
164 | if (OnLoginToRegion != null) | 166 | handler001 = OnLoginToRegion; |
167 | if (handler001 != null) | ||
165 | { | 168 | { |
166 | OnLoginToRegion(currentRegion, _login); | 169 | handler001(currentRegion, _login); |
167 | } | 170 | } |
168 | } | 171 | } |
169 | else | 172 | else |
diff --git a/OpenSim/Region/Communications/OGS1/OGS1InterSimComms.cs b/OpenSim/Region/Communications/OGS1/OGS1InterSimComms.cs index 3cde55c..d21852d 100644 --- a/OpenSim/Region/Communications/OGS1/OGS1InterSimComms.cs +++ b/OpenSim/Region/Communications/OGS1/OGS1InterSimComms.cs | |||
@@ -59,6 +59,13 @@ namespace OpenSim.Region.Communications.OGS1 | |||
59 | public event ChildAgentUpdate OnChildAgentUpdate; | 59 | public event ChildAgentUpdate OnChildAgentUpdate; |
60 | public event TellRegionToCloseChildConnection OnTellRegionToCloseChildConnection; | 60 | public event TellRegionToCloseChildConnection OnTellRegionToCloseChildConnection; |
61 | 61 | ||
62 | private InformRegionChild handler001 = null; // OnChildAgent; | ||
63 | private ExpectArrival handler002 = null; // OnArrival; | ||
64 | private InformRegionPrimGroup handler003 = null; // OnPrimGroupNear; | ||
65 | private PrimGroupArrival handler004 = null; // OnPrimGroupArrival; | ||
66 | private RegionUp handler005 = null; // OnRegionUp; | ||
67 | private ChildAgentUpdate handler006 = null; // OnChildAgentUpdate; | ||
68 | private TellRegionToCloseChildConnection handler007 = null; // OnTellRegionToCloseChildConnection; | ||
62 | 69 | ||
63 | 70 | ||
64 | static InterRegionSingleton() | 71 | static InterRegionSingleton() |
@@ -76,64 +83,70 @@ namespace OpenSim.Region.Communications.OGS1 | |||
76 | 83 | ||
77 | public bool InformRegionOfChildAgent(ulong regionHandle, AgentCircuitData agentData) | 84 | public bool InformRegionOfChildAgent(ulong regionHandle, AgentCircuitData agentData) |
78 | { | 85 | { |
79 | if (OnChildAgent != null) | 86 | handler001 = OnChildAgent; |
87 | if (handler001 != null) | ||
80 | { | 88 | { |
81 | return OnChildAgent(regionHandle, agentData); | 89 | return handler001(regionHandle, agentData); |
82 | } | 90 | } |
83 | return false; | 91 | return false; |
84 | } | 92 | } |
85 | 93 | ||
86 | public bool RegionUp(SearializableRegionInfo sregion, ulong regionhandle) | 94 | public bool RegionUp(SearializableRegionInfo sregion, ulong regionhandle) |
87 | { | 95 | { |
88 | if (OnRegionUp != null) | 96 | handler005 = OnRegionUp; |
97 | if (handler005 != null) | ||
89 | { | 98 | { |
90 | return OnRegionUp(sregion, regionhandle); | 99 | return handler005(sregion, regionhandle); |
91 | } | 100 | } |
92 | return false; | 101 | return false; |
93 | } | 102 | } |
94 | 103 | ||
95 | public bool ChildAgentUpdate(ulong regionHandle, ChildAgentDataUpdate cAgentUpdate) | 104 | public bool ChildAgentUpdate(ulong regionHandle, ChildAgentDataUpdate cAgentUpdate) |
96 | { | 105 | { |
97 | if (OnChildAgentUpdate != null) | 106 | handler006 = OnChildAgentUpdate; |
107 | if (handler006 != null) | ||
98 | { | 108 | { |
99 | return OnChildAgentUpdate(regionHandle, cAgentUpdate); | 109 | return handler006(regionHandle, cAgentUpdate); |
100 | } | 110 | } |
101 | return false; | 111 | return false; |
102 | } | 112 | } |
103 | 113 | ||
104 | public bool ExpectAvatarCrossing(ulong regionHandle, LLUUID agentID, LLVector3 position, bool isFlying) | 114 | public bool ExpectAvatarCrossing(ulong regionHandle, LLUUID agentID, LLVector3 position, bool isFlying) |
105 | { | 115 | { |
106 | if (OnArrival != null) | 116 | handler002 = OnArrival; |
117 | if (handler002 != null) | ||
107 | { | 118 | { |
108 | return OnArrival(regionHandle, agentID, position, isFlying); | 119 | return handler002(regionHandle, agentID, position, isFlying); |
109 | } | 120 | } |
110 | return false; | 121 | return false; |
111 | } | 122 | } |
112 | 123 | ||
113 | public bool InformRegionPrim(ulong regionHandle, LLUUID primID, LLVector3 position, bool isPhysical) | 124 | public bool InformRegionPrim(ulong regionHandle, LLUUID primID, LLVector3 position, bool isPhysical) |
114 | { | 125 | { |
115 | if (OnPrimGroupNear != null) | 126 | handler003 = OnPrimGroupNear; |
127 | if (handler003 != null) | ||
116 | { | 128 | { |
117 | return OnPrimGroupNear(regionHandle, primID, position, isPhysical); | 129 | return handler003(regionHandle, primID, position, isPhysical); |
118 | } | 130 | } |
119 | return false; | 131 | return false; |
120 | } | 132 | } |
121 | 133 | ||
122 | public bool ExpectPrimCrossing(ulong regionHandle, LLUUID primID, string objData) | 134 | public bool ExpectPrimCrossing(ulong regionHandle, LLUUID primID, string objData) |
123 | { | 135 | { |
124 | if (OnPrimGroupArrival != null) | 136 | handler004 = OnPrimGroupArrival; |
137 | if (handler004 != null) | ||
125 | { | 138 | { |
126 | return OnPrimGroupArrival(regionHandle, primID, objData); | 139 | return handler004(regionHandle, primID, objData); |
127 | } | 140 | } |
128 | return false; | 141 | return false; |
129 | } | 142 | } |
130 | 143 | ||
131 | public bool TellRegionToCloseChildConnection(ulong regionHandle, LLUUID agentID) | 144 | public bool TellRegionToCloseChildConnection(ulong regionHandle, LLUUID agentID) |
132 | { | 145 | { |
133 | if (OnTellRegionToCloseChildConnection != null) | 146 | handler007 = OnTellRegionToCloseChildConnection; |
147 | if (handler007 != null) | ||
134 | { | 148 | { |
135 | 149 | return handler007(regionHandle, agentID); | |
136 | return OnTellRegionToCloseChildConnection(regionHandle, agentID); | ||
137 | } | 150 | } |
138 | return false; | 151 | return false; |
139 | } | 152 | } |