From 8388fe0669f9d140028d1925284491b21a09a1bf Mon Sep 17 00:00:00 2001 From: lbsa71 Date: Mon, 8 Sep 2008 14:30:35 +0000 Subject: * some if inversions and added {}'s for readability --- ThirdParty/3Di/RegionProxy/RegionProxyPlugin.cs | 60 ++++++++++++------------- 1 file changed, 30 insertions(+), 30 deletions(-) (limited to 'ThirdParty/3Di/RegionProxy/RegionProxyPlugin.cs') diff --git a/ThirdParty/3Di/RegionProxy/RegionProxyPlugin.cs b/ThirdParty/3Di/RegionProxy/RegionProxyPlugin.cs index e65e7e5..a1476fa 100644 --- a/ThirdParty/3Di/RegionProxy/RegionProxyPlugin.cs +++ b/ThirdParty/3Di/RegionProxy/RegionProxyPlugin.cs @@ -396,36 +396,7 @@ namespace OpenSim.ApplicationPlugins.RegionProxy //m_log.ErrorFormat("[PROXY] Got message from {0} in thread {1}, size {2}", senderEP, sd.clientEP, numBytes); EndPoint client = proxy_map.GetClient(senderEP); - if (client != null) - { - try - { - client = ProxyCodec.DecodeProxyMessage(buffer, ref numBytes); - try - { - // This message comes from a region object, forward it to the its client - sd.server.SendTo(buffer, numBytes, SocketFlags.None, client); - //m_log.InfoFormat("[PROXY] Sending region message from {0} to {1}, size {2}", senderEP, client, numBytes); - } - catch (Exception e) - { - OpenPort(sd); // reopen the port just in case - m_log.ErrorFormat("[PROXY] Failed sending region message from {0} to {1}", senderEP, client); - m_log.Error("[PROXY]" + e.Message); - m_log.Error("[PROXY]" + e.StackTrace); - return; - } - } - catch (Exception e) - { - OpenPort(sd); // reopen the port just in case - m_log.ErrorFormat("[PROXY] Failed decoding region message from {0}", senderEP); - m_log.Error("[PROXY]" + e.Message); - m_log.Error("[PROXY]" + e.StackTrace); - return; - } - } - else + if (client == null) { // This message comes from a client object, forward it to the the region(s) ProxyCodec.EncodeProxyMessage(buffer, ref numBytes, senderEP); @@ -454,6 +425,35 @@ namespace OpenSim.ApplicationPlugins.RegionProxy } } } + else + { + try + { + client = ProxyCodec.DecodeProxyMessage(buffer, ref numBytes); + try + { + // This message comes from a region object, forward it to the its client + sd.server.SendTo(buffer, numBytes, SocketFlags.None, client); + //m_log.InfoFormat("[PROXY] Sending region message from {0} to {1}, size {2}", senderEP, client, numBytes); + } + catch (Exception e) + { + OpenPort(sd); // reopen the port just in case + m_log.ErrorFormat("[PROXY] Failed sending region message from {0} to {1}", senderEP, client); + m_log.Error("[PROXY]" + e.Message); + m_log.Error("[PROXY]" + e.StackTrace); + return; + } + } + catch (Exception e) + { + OpenPort(sd); // reopen the port just in case + m_log.ErrorFormat("[PROXY] Failed decoding region message from {0}", senderEP); + m_log.Error("[PROXY]" + e.Message); + m_log.Error("[PROXY]" + e.StackTrace); + return; + } + } } #region Nested type: ProxyMap -- cgit v1.1