From 9ba5a7e190497be05a4e1f54ba3140366750277a Mon Sep 17 00:00:00 2001
From: Latif Khalifa
Date: Sun, 17 Nov 2013 13:43:05 +0100
Subject: Normalize viewer version string to accomodate new style version
reporting in the viewers
---
OpenSim/Framework/AgentCircuitData.cs | 25 ++++++++++++++++++++++++-
1 file changed, 24 insertions(+), 1 deletion(-)
(limited to 'OpenSim/Framework/AgentCircuitData.cs')
diff --git a/OpenSim/Framework/AgentCircuitData.cs b/OpenSim/Framework/AgentCircuitData.cs
index ffcc584..acf925a 100644
--- a/OpenSim/Framework/AgentCircuitData.cs
+++ b/OpenSim/Framework/AgentCircuitData.cs
@@ -128,7 +128,30 @@ namespace OpenSim.Framework
///
/// Viewer's version string as reported by the viewer at login
///
- public string Viewer;
+ private string ViewerInternal;
+
+ ///
+ /// Viewer's version string
+ ///
+ public string Viewer
+ {
+ set { ViewerInternal = value; }
+ // Try to return consistent viewer string taking into account
+ // that viewers have chaagned how version is reported
+ // See http://opensimulator.org/mantis/view.php?id=6851
+ get
+ {
+ // Old style version string contains viewer name followed by a space followed by a version number
+ if (ViewerInternal.Contains(" "))
+ {
+ return ViewerInternal;
+ }
+ else // New style version contains no spaces, just version number
+ {
+ return Channel + " " + ViewerInternal;
+ }
+ }
+ }
///
/// The channel strinf sent by the viewer at login
--
cgit v1.1
From b71952df49784167a4c2eed218424064b90bfd63 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Tue, 19 Nov 2013 23:36:44 +0000
Subject: Stop AgentCircuitData.Viewer.get() from throwing an error if no
Viewer has been set.
Continue to return null instead.
---
OpenSim/Framework/AgentCircuitData.cs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
(limited to 'OpenSim/Framework/AgentCircuitData.cs')
diff --git a/OpenSim/Framework/AgentCircuitData.cs b/OpenSim/Framework/AgentCircuitData.cs
index acf925a..51f0a1e 100644
--- a/OpenSim/Framework/AgentCircuitData.cs
+++ b/OpenSim/Framework/AgentCircuitData.cs
@@ -142,7 +142,7 @@ namespace OpenSim.Framework
get
{
// Old style version string contains viewer name followed by a space followed by a version number
- if (ViewerInternal.Contains(" "))
+ if (ViewerInternal == null || ViewerInternal.Contains(" "))
{
return ViewerInternal;
}
--
cgit v1.1
From f9984a9685ac92a34272f7231a0ec4097fc31a79 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Tue, 19 Nov 2013 23:39:52 +0000
Subject: rename private field ACD.ViewerInternal to m_viewerInternal in line
with conventions used elsewhere in code
---
OpenSim/Framework/AgentCircuitData.cs | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
(limited to 'OpenSim/Framework/AgentCircuitData.cs')
diff --git a/OpenSim/Framework/AgentCircuitData.cs b/OpenSim/Framework/AgentCircuitData.cs
index 51f0a1e..f2fe494 100644
--- a/OpenSim/Framework/AgentCircuitData.cs
+++ b/OpenSim/Framework/AgentCircuitData.cs
@@ -128,27 +128,28 @@ namespace OpenSim.Framework
///
/// Viewer's version string as reported by the viewer at login
///
- private string ViewerInternal;
+ private string m_viewerInternal;
///
/// Viewer's version string
///
public string Viewer
{
- set { ViewerInternal = value; }
+ set { m_viewerInternal = value; }
+
// Try to return consistent viewer string taking into account
// that viewers have chaagned how version is reported
// See http://opensimulator.org/mantis/view.php?id=6851
get
{
// Old style version string contains viewer name followed by a space followed by a version number
- if (ViewerInternal == null || ViewerInternal.Contains(" "))
+ if (m_viewerInternal == null || m_viewerInternal.Contains(" "))
{
- return ViewerInternal;
+ return m_viewerInternal;
}
else // New style version contains no spaces, just version number
{
- return Channel + " " + ViewerInternal;
+ return Channel + " " + m_viewerInternal;
}
}
}
--
cgit v1.1