diff options
author | Teravus Ovares | 2007-12-21 16:55:03 +0000 |
---|---|---|
committer | Teravus Ovares | 2007-12-21 16:55:03 +0000 |
commit | a453672edb8169f9957e136ee8252e7391170721 (patch) | |
tree | 266e89502e0099dcadb0892b602e1afa397f837a /OpenSim/Region/ClientStack | |
parent | Fixed that we weren't actually loading in some of the Library assets. Thanks ... (diff) | |
download | opensim-SC_OLD-a453672edb8169f9957e136ee8252e7391170721.zip opensim-SC_OLD-a453672edb8169f9957e136ee8252e7391170721.tar.gz opensim-SC_OLD-a453672edb8169f9957e136ee8252e7391170721.tar.bz2 opensim-SC_OLD-a453672edb8169f9957e136ee8252e7391170721.tar.xz |
* Remapped the Connection shutdown path.
* This fixes a *bunch* of Mantis bugs related to the following
* -- Neighbouring simulators not appearing after relog
* -- Login to simulator only to be logged off by simulator.
* -- ThreadAbort
* -- Unable to shutdown circuitCode: x
Diffstat (limited to 'OpenSim/Region/ClientStack')
-rw-r--r-- | OpenSim/Region/ClientStack/ClientView.cs | 36 | ||||
-rw-r--r-- | OpenSim/Region/ClientStack/PacketServer.cs | 2 |
2 files changed, 28 insertions, 10 deletions
diff --git a/OpenSim/Region/ClientStack/ClientView.cs b/OpenSim/Region/ClientStack/ClientView.cs index 31e0e29..34186de 100644 --- a/OpenSim/Region/ClientStack/ClientView.cs +++ b/OpenSim/Region/ClientStack/ClientView.cs | |||
@@ -199,38 +199,56 @@ namespace OpenSim.Region.ClientStack | |||
199 | 199 | ||
200 | # region Client Methods | 200 | # region Client Methods |
201 | 201 | ||
202 | public void Close() | 202 | private void CloseCleanup() |
203 | { | 203 | { |
204 | // Pull Client out of Region | ||
205 | MainLog.Instance.Verbose("CLIENT", "Close has been called"); | ||
206 | 204 | ||
207 | m_scene.RemoveClient(AgentId); | 205 | m_scene.RemoveClient(AgentId); |
208 | |||
209 | // Send the STOP packet | 206 | // Send the STOP packet |
210 | DisableSimulatorPacket disable = new DisableSimulatorPacket(); | 207 | DisableSimulatorPacket disable = new DisableSimulatorPacket(); |
211 | OutPacket(disable, ThrottleOutPacketType.Task); | 208 | OutPacket(disable, ThrottleOutPacketType.Task); |
212 | 209 | ||
210 | |||
213 | // FLUSH Packets | 211 | // FLUSH Packets |
214 | m_packetQueue.Close(); | 212 | m_packetQueue.Close(); |
215 | m_packetQueue.Flush(); | 213 | m_packetQueue.Flush(); |
216 | 214 | ||
217 | Thread.Sleep(2000); | 215 | Thread.Sleep(2000); |
218 | 216 | ||
217 | |||
218 | |||
219 | |||
220 | |||
219 | // Shut down timers | 221 | // Shut down timers |
220 | m_ackTimer.Stop(); | 222 | m_ackTimer.Stop(); |
221 | m_clientPingTimer.Stop(); | 223 | m_clientPingTimer.Stop(); |
222 | 224 | ||
223 | // This is just to give the client a reasonable chance of | 225 | // This is just to give the client a reasonable chance of |
224 | // flushing out all it's packets. There should probably | 226 | // flushing out all it's packets. There should probably |
225 | // be a better mechanism here | 227 | // be a better mechanism here |
226 | 228 | ||
227 | // We can't reach into other scenes and close the connection | 229 | // We can't reach into other scenes and close the connection |
228 | // We need to do this over grid communications | 230 | // We need to do this over grid communications |
229 | m_scene.CloseAllAgents(CircuitCode); | 231 | //m_scene.CloseAllAgents(CircuitCode); |
230 | 232 | ||
231 | m_clientThread.Abort(); | 233 | m_clientThread.Abort(); |
232 | } | 234 | } |
233 | 235 | ||
236 | public void Close(bool ShutdownCircult) | ||
237 | { | ||
238 | |||
239 | // Pull Client out of Region | ||
240 | MainLog.Instance.Verbose("CLIENT", "Close has been called"); | ||
241 | |||
242 | //raiseevent on the packet server to Shutdown the circuit | ||
243 | if (ShutdownCircult) | ||
244 | OnConnectionClosed(this); | ||
245 | |||
246 | |||
247 | CloseCleanup(); | ||
248 | |||
249 | |||
250 | } | ||
251 | |||
234 | public void Kick(string message) | 252 | public void Kick(string message) |
235 | { | 253 | { |
236 | KickUserPacket kupack = new KickUserPacket(); | 254 | KickUserPacket kupack = new KickUserPacket(); |
@@ -2214,7 +2232,7 @@ namespace OpenSim.Region.ClientStack | |||
2214 | "ClientView.m_packetQueue.cs:ProcessOutPacket() - WARNING: Socket exception occurred on connection " + | 2232 | "ClientView.m_packetQueue.cs:ProcessOutPacket() - WARNING: Socket exception occurred on connection " + |
2215 | m_userEndPoint.ToString() + " - killing thread"); | 2233 | m_userEndPoint.ToString() + " - killing thread"); |
2216 | MainLog.Instance.Error(e.ToString()); | 2234 | MainLog.Instance.Error(e.ToString()); |
2217 | Close(); | 2235 | Close(true); |
2218 | } | 2236 | } |
2219 | } | 2237 | } |
2220 | 2238 | ||
diff --git a/OpenSim/Region/ClientStack/PacketServer.cs b/OpenSim/Region/ClientStack/PacketServer.cs index 308728e..a4c18d0 100644 --- a/OpenSim/Region/ClientStack/PacketServer.cs +++ b/OpenSim/Region/ClientStack/PacketServer.cs | |||
@@ -132,7 +132,7 @@ namespace OpenSim.Region.ClientStack | |||
132 | public virtual void CloseClient(IClientAPI client) | 132 | public virtual void CloseClient(IClientAPI client) |
133 | { | 133 | { |
134 | CloseCircuit(client.CircuitCode); | 134 | CloseCircuit(client.CircuitCode); |
135 | client.Close(); | 135 | client.Close(false); |
136 | } | 136 | } |
137 | } | 137 | } |
138 | } | 138 | } |