diff options
-rw-r--r-- | OpenSim/Framework/Location.cs | 10 | ||||
-rw-r--r-- | OpenSim/Framework/Tests/LocationTest.cs | 16 | ||||
-rw-r--r-- | OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs | 4 |
3 files changed, 28 insertions, 2 deletions
diff --git a/OpenSim/Framework/Location.cs b/OpenSim/Framework/Location.cs index aed2b87..d0f01d0 100644 --- a/OpenSim/Framework/Location.cs +++ b/OpenSim/Framework/Location.cs | |||
@@ -86,6 +86,16 @@ namespace OpenSim.Framework | |||
86 | return X == x && y == Y; | 86 | return X == x && y == Y; |
87 | } | 87 | } |
88 | 88 | ||
89 | public static bool operator ==(Location o, object o2) | ||
90 | { | ||
91 | return o.Equals(o2); | ||
92 | } | ||
93 | |||
94 | public static bool operator !=(Location o, object o2) | ||
95 | { | ||
96 | return !o.Equals(o2); | ||
97 | } | ||
98 | |||
89 | public override int GetHashCode() | 99 | public override int GetHashCode() |
90 | { | 100 | { |
91 | return X.GetHashCode() * 29 + Y.GetHashCode(); | 101 | return X.GetHashCode() * 29 + Y.GetHashCode(); |
diff --git a/OpenSim/Framework/Tests/LocationTest.cs b/OpenSim/Framework/Tests/LocationTest.cs index 1c10a39..118ec94 100644 --- a/OpenSim/Framework/Tests/LocationTest.cs +++ b/OpenSim/Framework/Tests/LocationTest.cs | |||
@@ -45,6 +45,22 @@ namespace OpenSim.Framework.Tests | |||
45 | Location TestLocation1 = new Location(1099511628032000); | 45 | Location TestLocation1 = new Location(1099511628032000); |
46 | Location TestLocation2 = new Location(1099511628032000); | 46 | Location TestLocation2 = new Location(1099511628032000); |
47 | Assert.That(TestLocation1 == TestLocation2); | 47 | Assert.That(TestLocation1 == TestLocation2); |
48 | |||
49 | TestLocation1 = new Location(1099511628032001); | ||
50 | TestLocation2 = new Location(1099511628032000); | ||
51 | Assert.That(TestLocation1 != TestLocation2); | ||
52 | } | ||
53 | |||
54 | [Test] | ||
55 | public void locationXYRegionHandle() | ||
56 | { | ||
57 | Location TestLocation1 = new Location(256000,256000); | ||
58 | Location TestLocation2 = new Location(1099511628032000); | ||
59 | Assert.That(TestLocation1 == TestLocation2); | ||
60 | |||
61 | TestLocation1 = new Location(256001, 256001); | ||
62 | TestLocation2 = new Location(1099511628032000); | ||
63 | Assert.That(TestLocation1 != TestLocation2); | ||
48 | } | 64 | } |
49 | 65 | ||
50 | } | 66 | } |
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs b/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs index 8653b23..09b9ac9 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs | |||
@@ -106,8 +106,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
106 | 106 | ||
107 | public bool HandlesRegion(Location x) | 107 | public bool HandlesRegion(Location x) |
108 | { | 108 | { |
109 | return x.RegionHandle == m_location.RegionHandle; | 109 | //return x.RegionHandle == m_location.RegionHandle; |
110 | //return x == m_location; | 110 | return x == m_location; |
111 | } | 111 | } |
112 | 112 | ||
113 | public void AddScene(Scene x) | 113 | public void AddScene(Scene x) |