aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Communications
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Communications')
-rw-r--r--OpenSim/Region/Communications/Local/CommunicationsLocal.cs110
-rw-r--r--OpenSim/Region/Communications/Local/LocalBackEndServices.cs412
-rw-r--r--OpenSim/Region/Communications/Local/LocalUserServices.cs284
-rw-r--r--OpenSim/Region/Communications/Local/Properties/AssemblyInfo.cs66
-rw-r--r--OpenSim/Region/Communications/OGS1/CommunicationsOGS1.cs36
-rw-r--r--OpenSim/Region/Communications/OGS1/OGS1GridServices.cs862
-rw-r--r--OpenSim/Region/Communications/OGS1/OGS1InterSimComms.cs138
-rw-r--r--OpenSim/Region/Communications/OGS1/OGS1UserServices.cs202
-rw-r--r--OpenSim/Region/Communications/OGS1/Properties/AssemblyInfo.cs66
9 files changed, 1088 insertions, 1088 deletions
diff --git a/OpenSim/Region/Communications/Local/CommunicationsLocal.cs b/OpenSim/Region/Communications/Local/CommunicationsLocal.cs
index c47904d..3ce0cc5 100644
--- a/OpenSim/Region/Communications/Local/CommunicationsLocal.cs
+++ b/OpenSim/Region/Communications/Local/CommunicationsLocal.cs
@@ -1,55 +1,55 @@
1/* 1/*
2* Copyright (c) Contributors, http://www.openmetaverse.org/ 2* Copyright (c) Contributors, http://www.openmetaverse.org/
3* See CONTRIBUTORS.TXT for a full list of copyright holders. 3* See CONTRIBUTORS.TXT for a full list of copyright holders.
4* 4*
5* Redistribution and use in source and binary forms, with or without 5* Redistribution and use in source and binary forms, with or without
6* modification, are permitted provided that the following conditions are met: 6* modification, are permitted provided that the following conditions are met:
7* * Redistributions of source code must retain the above copyright 7* * Redistributions of source code must retain the above copyright
8* notice, this list of conditions and the following disclaimer. 8* notice, this list of conditions and the following disclaimer.
9* * Redistributions in binary form must reproduce the above copyright 9* * Redistributions in binary form must reproduce the above copyright
10* notice, this list of conditions and the following disclaimer in the 10* notice, this list of conditions and the following disclaimer in the
11* documentation and/or other materials provided with the distribution. 11* documentation and/or other materials provided with the distribution.
12* * Neither the name of the OpenSim Project nor the 12* * Neither the name of the OpenSim Project nor the
13* names of its contributors may be used to endorse or promote products 13* names of its contributors may be used to endorse or promote products
14* derived from this software without specific prior written permission. 14* derived from this software without specific prior written permission.
15* 15*
16* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY 16* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY
17* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 17* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 18* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY 19* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
20* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 20* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 21* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 22* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 24* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26* 26*
27*/ 27*/
28using OpenSim.Framework.Communications; 28using OpenSim.Framework.Communications;
29using OpenSim.Framework.Types; 29using OpenSim.Framework.Types;
30using OpenSim.Framework.Servers; 30using OpenSim.Framework.Servers;
31 31
32namespace OpenSim.Region.Communications.Local 32namespace OpenSim.Region.Communications.Local
33{ 33{
34 public class CommunicationsLocal : CommunicationsManager 34 public class CommunicationsLocal : CommunicationsManager
35 { 35 {
36 public LocalBackEndServices SandBoxServices = new LocalBackEndServices(); 36 public LocalBackEndServices SandBoxServices = new LocalBackEndServices();
37 public LocalUserServices UserServices; 37 public LocalUserServices UserServices;
38 38
39 public CommunicationsLocal(NetworkServersInfo serversInfo, BaseHttpServer httpServer ) 39 public CommunicationsLocal(NetworkServersInfo serversInfo, BaseHttpServer httpServer )
40 : base(serversInfo, httpServer) 40 : base(serversInfo, httpServer)
41 { 41 {
42 UserServices = new LocalUserServices(this, serversInfo); 42 UserServices = new LocalUserServices(this, serversInfo);
43 UserServices.AddPlugin("OpenSim.Framework.Data.DB4o.dll"); 43 UserServices.AddPlugin("OpenSim.Framework.Data.DB4o.dll");
44 UserServer = UserServices; 44 UserServer = UserServices;
45 GridServer = SandBoxServices; 45 GridServer = SandBoxServices;
46 InterRegion = SandBoxServices; 46 InterRegion = SandBoxServices;
47 httpServer.AddXmlRPCHandler("login_to_simulator", UserServices.XmlRpcLoginMethod); 47 httpServer.AddXmlRPCHandler("login_to_simulator", UserServices.XmlRpcLoginMethod);
48 } 48 }
49 49
50 internal void InformRegionOfLogin(ulong regionHandle, Login login) 50 internal void InformRegionOfLogin(ulong regionHandle, Login login)
51 { 51 {
52 this.SandBoxServices.AddNewSession(regionHandle, login); 52 this.SandBoxServices.AddNewSession(regionHandle, login);
53 } 53 }
54 } 54 }
55} 55}
diff --git a/OpenSim/Region/Communications/Local/LocalBackEndServices.cs b/OpenSim/Region/Communications/Local/LocalBackEndServices.cs
index d0cd991..9322f3b 100644
--- a/OpenSim/Region/Communications/Local/LocalBackEndServices.cs
+++ b/OpenSim/Region/Communications/Local/LocalBackEndServices.cs
@@ -1,206 +1,206 @@
1/* 1/*
2* Copyright (c) Contributors, http://www.openmetaverse.org/ 2* Copyright (c) Contributors, http://www.openmetaverse.org/
3* See CONTRIBUTORS.TXT for a full list of copyright holders. 3* See CONTRIBUTORS.TXT for a full list of copyright holders.
4* 4*
5* Redistribution and use in source and binary forms, with or without 5* Redistribution and use in source and binary forms, with or without
6* modification, are permitted provided that the following conditions are met: 6* modification, are permitted provided that the following conditions are met:
7* * Redistributions of source code must retain the above copyright 7* * Redistributions of source code must retain the above copyright
8* notice, this list of conditions and the following disclaimer. 8* notice, this list of conditions and the following disclaimer.
9* * Redistributions in binary form must reproduce the above copyright 9* * Redistributions in binary form must reproduce the above copyright
10* notice, this list of conditions and the following disclaimer in the 10* notice, this list of conditions and the following disclaimer in the
11* documentation and/or other materials provided with the distribution. 11* documentation and/or other materials provided with the distribution.
12* * Neither the name of the OpenSim Project nor the 12* * Neither the name of the OpenSim Project nor the
13* names of its contributors may be used to endorse or promote products 13* names of its contributors may be used to endorse or promote products
14* derived from this software without specific prior written permission. 14* derived from this software without specific prior written permission.
15* 15*
16* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY 16* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY
17* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 17* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 18* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY 19* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
20* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 20* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 21* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 22* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 24* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26* 26*
27*/ 27*/
28using System.Collections.Generic; 28using System.Collections.Generic;
29using libsecondlife; 29using libsecondlife;
30using OpenSim.Framework; 30using OpenSim.Framework;
31using OpenSim.Framework.Communications; 31using OpenSim.Framework.Communications;
32using OpenSim.Framework.Types; 32using OpenSim.Framework.Types;
33 33
34namespace OpenSim.Region.Communications.Local 34namespace OpenSim.Region.Communications.Local
35{ 35{
36 36
37 public class LocalBackEndServices : IGridServices, IInterRegionCommunications 37 public class LocalBackEndServices : IGridServices, IInterRegionCommunications
38 { 38 {
39 protected Dictionary<ulong, RegionInfo> regions = new Dictionary<ulong, RegionInfo>(); 39 protected Dictionary<ulong, RegionInfo> regions = new Dictionary<ulong, RegionInfo>();
40 protected Dictionary<ulong, RegionCommsListener> regionHosts = new Dictionary<ulong, RegionCommsListener>(); 40 protected Dictionary<ulong, RegionCommsListener> regionHosts = new Dictionary<ulong, RegionCommsListener>();
41 41
42 public LocalBackEndServices() 42 public LocalBackEndServices()
43 { 43 {
44 44
45 } 45 }
46 46
47 /// <summary> 47 /// <summary>
48 /// Register a region method with the BackEnd Services. 48 /// Register a region method with the BackEnd Services.
49 /// </summary> 49 /// </summary>
50 /// <param name="regionInfo"></param> 50 /// <param name="regionInfo"></param>
51 /// <returns></returns> 51 /// <returns></returns>
52 public RegionCommsListener RegisterRegion(RegionInfo regionInfo) 52 public RegionCommsListener RegisterRegion(RegionInfo regionInfo)
53 { 53 {
54 //Console.WriteLine("CommsManager - Region " + regionInfo.RegionHandle + " , " + regionInfo.RegionLocX + " , "+ regionInfo.RegionLocY +" is registering"); 54 //Console.WriteLine("CommsManager - Region " + regionInfo.RegionHandle + " , " + regionInfo.RegionLocX + " , "+ regionInfo.RegionLocY +" is registering");
55 if (!this.regions.ContainsKey((uint)regionInfo.RegionHandle)) 55 if (!this.regions.ContainsKey((uint)regionInfo.RegionHandle))
56 { 56 {
57 //Console.WriteLine("CommsManager - Adding Region " + regionInfo.RegionHandle ); 57 //Console.WriteLine("CommsManager - Adding Region " + regionInfo.RegionHandle );
58 this.regions.Add(regionInfo.RegionHandle, regionInfo); 58 this.regions.Add(regionInfo.RegionHandle, regionInfo);
59 RegionCommsListener regionHost = new RegionCommsListener(); 59 RegionCommsListener regionHost = new RegionCommsListener();
60 this.regionHosts.Add(regionInfo.RegionHandle, regionHost); 60 this.regionHosts.Add(regionInfo.RegionHandle, regionHost);
61 61
62 return regionHost; 62 return regionHost;
63 } 63 }
64 64
65 //already in our list of regions so for now lets return null 65 //already in our list of regions so for now lets return null
66 return null; 66 return null;
67 } 67 }
68 68
69 /// <summary> 69 /// <summary>
70 /// </summary> 70 /// </summary>
71 /// <param name="regionInfo"></param> 71 /// <param name="regionInfo"></param>
72 /// <returns></returns> 72 /// <returns></returns>
73 public List<RegionInfo> RequestNeighbours(RegionInfo regionInfo) 73 public List<RegionInfo> RequestNeighbours(RegionInfo regionInfo)
74 { 74 {
75 // Console.WriteLine("Finding Neighbours to " + regionInfo.RegionHandle); 75 // Console.WriteLine("Finding Neighbours to " + regionInfo.RegionHandle);
76 List<RegionInfo> neighbours = new List<RegionInfo>(); 76 List<RegionInfo> neighbours = new List<RegionInfo>();
77 77
78 foreach (RegionInfo reg in this.regions.Values) 78 foreach (RegionInfo reg in this.regions.Values)
79 { 79 {
80 // Console.WriteLine("CommsManager- RequestNeighbours() checking region " + reg.RegionLocX + " , "+ reg.RegionLocY); 80 // Console.WriteLine("CommsManager- RequestNeighbours() checking region " + reg.RegionLocX + " , "+ reg.RegionLocY);
81 if (reg.RegionHandle != regionInfo.RegionHandle) 81 if (reg.RegionHandle != regionInfo.RegionHandle)
82 { 82 {
83 //Console.WriteLine("CommsManager- RequestNeighbours() - found a different region in list, checking location"); 83 //Console.WriteLine("CommsManager- RequestNeighbours() - found a different region in list, checking location");
84 if ((reg.RegionLocX > (regionInfo.RegionLocX - 2)) && (reg.RegionLocX < (regionInfo.RegionLocX + 2))) 84 if ((reg.RegionLocX > (regionInfo.RegionLocX - 2)) && (reg.RegionLocX < (regionInfo.RegionLocX + 2)))
85 { 85 {
86 if ((reg.RegionLocY > (regionInfo.RegionLocY - 2)) && (reg.RegionLocY < (regionInfo.RegionLocY + 2))) 86 if ((reg.RegionLocY > (regionInfo.RegionLocY - 2)) && (reg.RegionLocY < (regionInfo.RegionLocY + 2)))
87 { 87 {
88 neighbours.Add(reg); 88 neighbours.Add(reg);
89 } 89 }
90 } 90 }
91 } 91 }
92 } 92 }
93 return neighbours; 93 return neighbours;
94 } 94 }
95 95
96 /// <summary> 96 /// <summary>
97 /// 97 ///
98 /// </summary> 98 /// </summary>
99 /// <param name="regionHandle"></param> 99 /// <param name="regionHandle"></param>
100 /// <returns></returns> 100 /// <returns></returns>
101 public RegionInfo RequestNeighbourInfo(ulong regionHandle) 101 public RegionInfo RequestNeighbourInfo(ulong regionHandle)
102 { 102 {
103 if (this.regions.ContainsKey(regionHandle)) 103 if (this.regions.ContainsKey(regionHandle))
104 { 104 {
105 return this.regions[regionHandle]; 105 return this.regions[regionHandle];
106 } 106 }
107 return null; 107 return null;
108 } 108 }
109 109
110 /// <summary> 110 /// <summary>
111 /// 111 ///
112 /// </summary> 112 /// </summary>
113 /// <param name="minX"></param> 113 /// <param name="minX"></param>
114 /// <param name="minY"></param> 114 /// <param name="minY"></param>
115 /// <param name="maxX"></param> 115 /// <param name="maxX"></param>
116 /// <param name="maxY"></param> 116 /// <param name="maxY"></param>
117 /// <returns></returns> 117 /// <returns></returns>
118 public List<MapBlockData> RequestNeighbourMapBlocks(int minX, int minY, int maxX, int maxY) 118 public List<MapBlockData> RequestNeighbourMapBlocks(int minX, int minY, int maxX, int maxY)
119 { 119 {
120 List<MapBlockData> mapBlocks = new List<MapBlockData>(); 120 List<MapBlockData> mapBlocks = new List<MapBlockData>();
121 foreach(RegionInfo regInfo in this.regions.Values) 121 foreach(RegionInfo regInfo in this.regions.Values)
122 { 122 {
123 if (((regInfo.RegionLocX >= minX) && (regInfo.RegionLocX <= maxX)) && ((regInfo.RegionLocY >= minY) && (regInfo.RegionLocY <= maxY))) 123 if (((regInfo.RegionLocX >= minX) && (regInfo.RegionLocX <= maxX)) && ((regInfo.RegionLocY >= minY) && (regInfo.RegionLocY <= maxY)))
124 { 124 {
125 MapBlockData map = new MapBlockData(); 125 MapBlockData map = new MapBlockData();
126 map.Name = regInfo.RegionName; 126 map.Name = regInfo.RegionName;
127 map.X = (ushort)regInfo.RegionLocX; 127 map.X = (ushort)regInfo.RegionLocX;
128 map.Y = (ushort)regInfo.RegionLocY; 128 map.Y = (ushort)regInfo.RegionLocY;
129 map.WaterHeight =(byte) regInfo.estateSettings.waterHeight; 129 map.WaterHeight =(byte) regInfo.estateSettings.waterHeight;
130 map.MapImageId = regInfo.estateSettings.terrainImageID; //new LLUUID("00000000-0000-0000-9999-000000000007"); 130 map.MapImageId = regInfo.estateSettings.terrainImageID; //new LLUUID("00000000-0000-0000-9999-000000000007");
131 map.Agents = 1; 131 map.Agents = 1;
132 map.RegionFlags = 72458694; 132 map.RegionFlags = 72458694;
133 map.Access = 13; 133 map.Access = 13;
134 mapBlocks.Add(map); 134 mapBlocks.Add(map);
135 } 135 }
136 } 136 }
137 return mapBlocks; 137 return mapBlocks;
138 } 138 }
139 139
140 /// <summary> 140 /// <summary>
141 /// </summary> 141 /// </summary>
142 /// <param name="regionHandle"></param> 142 /// <param name="regionHandle"></param>
143 /// <param name="agentData"></param> 143 /// <param name="agentData"></param>
144 /// <returns></returns> 144 /// <returns></returns>
145 public bool InformRegionOfChildAgent(ulong regionHandle, AgentCircuitData agentData) //should change from agentCircuitData 145 public bool InformRegionOfChildAgent(ulong regionHandle, AgentCircuitData agentData) //should change from agentCircuitData
146 { 146 {
147 //Console.WriteLine("CommsManager- Trying to Inform a region to expect child agent"); 147 //Console.WriteLine("CommsManager- Trying to Inform a region to expect child agent");
148 if (this.regionHosts.ContainsKey(regionHandle)) 148 if (this.regionHosts.ContainsKey(regionHandle))
149 { 149 {
150 // Console.WriteLine("CommsManager- Informing a region to expect child agent"); 150 // Console.WriteLine("CommsManager- Informing a region to expect child agent");
151 this.regionHosts[regionHandle].TriggerExpectUser(regionHandle, agentData); 151 this.regionHosts[regionHandle].TriggerExpectUser(regionHandle, agentData);
152 return true; 152 return true;
153 } 153 }
154 return false; 154 return false;
155 } 155 }
156 156
157 /// <summary> 157 /// <summary>
158 /// 158 ///
159 /// </summary> 159 /// </summary>
160 /// <param name="regionHandle"></param> 160 /// <param name="regionHandle"></param>
161 /// <param name="agentID"></param> 161 /// <param name="agentID"></param>
162 /// <param name="position"></param> 162 /// <param name="position"></param>
163 /// <returns></returns> 163 /// <returns></returns>
164 public bool ExpectAvatarCrossing(ulong regionHandle, LLUUID agentID, LLVector3 position) 164 public bool ExpectAvatarCrossing(ulong regionHandle, LLUUID agentID, LLVector3 position)
165 { 165 {
166 if (this.regionHosts.ContainsKey(regionHandle)) 166 if (this.regionHosts.ContainsKey(regionHandle))
167 { 167 {
168 // Console.WriteLine("CommsManager- Informing a region to expect avatar crossing"); 168 // Console.WriteLine("CommsManager- Informing a region to expect avatar crossing");
169 this.regionHosts[regionHandle].TriggerExpectAvatarCrossing(regionHandle, agentID, position); 169 this.regionHosts[regionHandle].TriggerExpectAvatarCrossing(regionHandle, agentID, position);
170 return true; 170 return true;
171 } 171 }
172 return false; 172 return false;
173 } 173 }
174 174
175 /// <summary> 175 /// <summary>
176 /// Is a Sandbox mode method, used by the local Login server to inform a region of a connection user/session 176 /// Is a Sandbox mode method, used by the local Login server to inform a region of a connection user/session
177 /// </summary> 177 /// </summary>
178 /// <param name="regionHandle"></param> 178 /// <param name="regionHandle"></param>
179 /// <param name="loginData"></param> 179 /// <param name="loginData"></param>
180 /// <returns></returns> 180 /// <returns></returns>
181 public bool AddNewSession(ulong regionHandle, Login loginData) 181 public bool AddNewSession(ulong regionHandle, Login loginData)
182 { 182 {
183 AgentCircuitData agent = new AgentCircuitData(); 183 AgentCircuitData agent = new AgentCircuitData();
184 agent.AgentID = loginData.Agent; 184 agent.AgentID = loginData.Agent;
185 agent.firstname = loginData.First; 185 agent.firstname = loginData.First;
186 agent.lastname = loginData.Last; 186 agent.lastname = loginData.Last;
187 agent.SessionID = loginData.Session; 187 agent.SessionID = loginData.Session;
188 agent.SecureSessionID = loginData.SecureSession; 188 agent.SecureSessionID = loginData.SecureSession;
189 agent.circuitcode = loginData.CircuitCode; 189 agent.circuitcode = loginData.CircuitCode;
190 agent.BaseFolder = loginData.BaseFolder; 190 agent.BaseFolder = loginData.BaseFolder;
191 agent.InventoryFolder = loginData.InventoryFolder; 191 agent.InventoryFolder = loginData.InventoryFolder;
192 agent.startpos = new LLVector3(128, 128, 70); 192 agent.startpos = new LLVector3(128, 128, 70);
193 agent.CapsPath = loginData.CapsPath; 193 agent.CapsPath = loginData.CapsPath;
194 194
195 if (this.regionHosts.ContainsKey(regionHandle)) 195 if (this.regionHosts.ContainsKey(regionHandle))
196 { 196 {
197 this.regionHosts[regionHandle].TriggerExpectUser(regionHandle, agent); 197 this.regionHosts[regionHandle].TriggerExpectUser(regionHandle, agent);
198 return true; 198 return true;
199 } 199 }
200 200
201 // region not found 201 // region not found
202 return false; 202 return false;
203 } 203 }
204 } 204 }
205} 205}
206 206
diff --git a/OpenSim/Region/Communications/Local/LocalUserServices.cs b/OpenSim/Region/Communications/Local/LocalUserServices.cs
index 592b36c..a4cefc4 100644
--- a/OpenSim/Region/Communications/Local/LocalUserServices.cs
+++ b/OpenSim/Region/Communications/Local/LocalUserServices.cs
@@ -1,142 +1,142 @@
1using System; 1using System;
2using libsecondlife; 2using libsecondlife;
3using OpenSim.Framework.Communications; 3using OpenSim.Framework.Communications;
4using OpenSim.Framework.Data; 4using OpenSim.Framework.Data;
5using OpenSim.Framework.Types; 5using OpenSim.Framework.Types;
6using OpenSim.Framework.UserManagement; 6using OpenSim.Framework.UserManagement;
7using OpenSim.Framework.Utilities; 7using OpenSim.Framework.Utilities;
8 8
9namespace OpenSim.Region.Communications.Local 9namespace OpenSim.Region.Communications.Local
10{ 10{
11 public class LocalUserServices : UserManagerBase, IUserServices 11 public class LocalUserServices : UserManagerBase, IUserServices
12 { 12 {
13 private CommunicationsLocal m_Parent; 13 private CommunicationsLocal m_Parent;
14 14
15 private NetworkServersInfo serversInfo; 15 private NetworkServersInfo serversInfo;
16 private uint defaultHomeX ; 16 private uint defaultHomeX ;
17 private uint defaultHomeY; 17 private uint defaultHomeY;
18 public LocalUserServices(CommunicationsLocal parent, NetworkServersInfo serversData) 18 public LocalUserServices(CommunicationsLocal parent, NetworkServersInfo serversData)
19 { 19 {
20 m_Parent = parent; 20 m_Parent = parent;
21 this.serversInfo = serversData; 21 this.serversInfo = serversData;
22 defaultHomeX = this.serversInfo.DefaultHomeLocX; 22 defaultHomeX = this.serversInfo.DefaultHomeLocX;
23 defaultHomeY = this.serversInfo.DefaultHomeLocY; 23 defaultHomeY = this.serversInfo.DefaultHomeLocY;
24 } 24 }
25 25
26 public UserProfileData GetUserProfile(string firstName, string lastName) 26 public UserProfileData GetUserProfile(string firstName, string lastName)
27 { 27 {
28 return GetUserProfile(firstName + " " + lastName); 28 return GetUserProfile(firstName + " " + lastName);
29 } 29 }
30 30
31 public UserProfileData GetUserProfile(string name) 31 public UserProfileData GetUserProfile(string name)
32 { 32 {
33 return this.getUserProfile(name); 33 return this.getUserProfile(name);
34 } 34 }
35 35
36 public UserProfileData GetUserProfile(LLUUID avatarID) 36 public UserProfileData GetUserProfile(LLUUID avatarID)
37 { 37 {
38 return this.getUserProfile(avatarID); 38 return this.getUserProfile(avatarID);
39 } 39 }
40 40
41 /// <summary> 41 /// <summary>
42 /// 42 ///
43 /// </summary> 43 /// </summary>
44 /// <returns></returns> 44 /// <returns></returns>
45 public override string GetMessage() 45 public override string GetMessage()
46 { 46 {
47 return "Welcome to OpenSim"; 47 return "Welcome to OpenSim";
48 } 48 }
49 49
50 public override UserProfileData GetTheUser(string firstname, string lastname) 50 public override UserProfileData GetTheUser(string firstname, string lastname)
51 { 51 {
52 UserProfileData profile = getUserProfile(firstname, lastname); 52 UserProfileData profile = getUserProfile(firstname, lastname);
53 if (profile != null) 53 if (profile != null)
54 { 54 {
55 55
56 return profile; 56 return profile;
57 } 57 }
58 58
59 //no current user account so make one 59 //no current user account so make one
60 Console.WriteLine("No User account found so creating a new one "); 60 Console.WriteLine("No User account found so creating a new one ");
61 this.AddUserProfile(firstname, lastname, "test", defaultHomeX, defaultHomeY); 61 this.AddUserProfile(firstname, lastname, "test", defaultHomeX, defaultHomeY);
62 62
63 profile = getUserProfile(firstname, lastname); 63 profile = getUserProfile(firstname, lastname);
64 64
65 return profile; 65 return profile;
66 } 66 }
67 67
68 public override bool AuthenticateUser(UserProfileData profile, string password) 68 public override bool AuthenticateUser(UserProfileData profile, string password)
69 { 69 {
70 //for now we will accept any password in sandbox mode 70 //for now we will accept any password in sandbox mode
71 Console.WriteLine("authorising user"); 71 Console.WriteLine("authorising user");
72 return true; 72 return true;
73 } 73 }
74 74
75 public override void CustomiseResponse(LoginResponse response, UserProfileData theUser) 75 public override void CustomiseResponse(LoginResponse response, UserProfileData theUser)
76 { 76 {
77 ulong currentRegion = theUser.currentAgent.currentHandle; 77 ulong currentRegion = theUser.currentAgent.currentHandle;
78 RegionInfo reg = m_Parent.GridServer.RequestNeighbourInfo(currentRegion); 78 RegionInfo reg = m_Parent.GridServer.RequestNeighbourInfo(currentRegion);
79 79
80 if (reg != null) 80 if (reg != null)
81 { 81 {
82 response.Home = "{'region_handle':[r" + (reg.RegionLocX * 256).ToString() + ",r" + (reg.RegionLocY * 256).ToString() + "], " + 82 response.Home = "{'region_handle':[r" + (reg.RegionLocX * 256).ToString() + ",r" + (reg.RegionLocY * 256).ToString() + "], " +
83 "'position':[r" + theUser.homeLocation.X.ToString() + ",r" + theUser.homeLocation.Y.ToString() + ",r" + theUser.homeLocation.Z.ToString() + "], " + 83 "'position':[r" + theUser.homeLocation.X.ToString() + ",r" + theUser.homeLocation.Y.ToString() + ",r" + theUser.homeLocation.Z.ToString() + "], " +
84 "'look_at':[r" + theUser.homeLocation.X.ToString() + ",r" + theUser.homeLocation.Y.ToString() + ",r" + theUser.homeLocation.Z.ToString() + "]}"; 84 "'look_at':[r" + theUser.homeLocation.X.ToString() + ",r" + theUser.homeLocation.Y.ToString() + ",r" + theUser.homeLocation.Z.ToString() + "]}";
85 string capsPath = Util.GetRandomCapsPath(); 85 string capsPath = Util.GetRandomCapsPath();
86 response.SimAddress = reg.ExternalEndPoint.Address.ToString(); 86 response.SimAddress = reg.ExternalEndPoint.Address.ToString();
87 response.SimPort = (Int32)reg.ExternalEndPoint.Port; 87 response.SimPort = (Int32)reg.ExternalEndPoint.Port;
88 response.RegionX = reg.RegionLocX ; 88 response.RegionX = reg.RegionLocX ;
89 response.RegionY = reg.RegionLocY ; 89 response.RegionY = reg.RegionLocY ;
90 90
91 //following port needs changing as we don't want a http listener for every region (or do we?) 91 //following port needs changing as we don't want a http listener for every region (or do we?)
92 response.SeedCapability = "http://" + reg.ExternalHostName + ":" + this.serversInfo.HttpListenerPort.ToString() + "/CAPS/" + capsPath + "0000/"; 92 response.SeedCapability = "http://" + reg.ExternalHostName + ":" + this.serversInfo.HttpListenerPort.ToString() + "/CAPS/" + capsPath + "0000/";
93 theUser.currentAgent.currentRegion = reg.SimUUID; 93 theUser.currentAgent.currentRegion = reg.SimUUID;
94 theUser.currentAgent.currentHandle = reg.RegionHandle; 94 theUser.currentAgent.currentHandle = reg.RegionHandle;
95 95
96 Login _login = new Login(); 96 Login _login = new Login();
97 //copy data to login object 97 //copy data to login object
98 _login.First = response.Firstname; 98 _login.First = response.Firstname;
99 _login.Last = response.Lastname; 99 _login.Last = response.Lastname;
100 _login.Agent = response.AgentID; 100 _login.Agent = response.AgentID;
101 _login.Session = response.SessionID; 101 _login.Session = response.SessionID;
102 _login.SecureSession = response.SecureSessionID; 102 _login.SecureSession = response.SecureSessionID;
103 _login.CircuitCode = (uint)response.CircuitCode; 103 _login.CircuitCode = (uint)response.CircuitCode;
104 _login.CapsPath = capsPath; 104 _login.CapsPath = capsPath;
105 105
106 m_Parent.InformRegionOfLogin(currentRegion, _login); 106 m_Parent.InformRegionOfLogin(currentRegion, _login);
107 } 107 }
108 else 108 else
109 { 109 {
110 Console.WriteLine("not found region " + currentRegion); 110 Console.WriteLine("not found region " + currentRegion);
111 } 111 }
112 112
113 } 113 }
114 114
115 public UserProfileData SetupMasterUser(string firstName, string lastName) 115 public UserProfileData SetupMasterUser(string firstName, string lastName)
116 { 116 {
117 return SetupMasterUser(firstName, lastName, ""); 117 return SetupMasterUser(firstName, lastName, "");
118 } 118 }
119 119
120 public UserProfileData SetupMasterUser(string firstName, string lastName, string password) 120 public UserProfileData SetupMasterUser(string firstName, string lastName, string password)
121 { 121 {
122 UserProfileData profile = getUserProfile(firstName, lastName); 122 UserProfileData profile = getUserProfile(firstName, lastName);
123 if (profile != null) 123 if (profile != null)
124 { 124 {
125 125
126 return profile; 126 return profile;
127 } 127 }
128 128
129 Console.WriteLine("Unknown Master User. Sandbox Mode: Creating Account"); 129 Console.WriteLine("Unknown Master User. Sandbox Mode: Creating Account");
130 this.AddUserProfile(firstName, lastName, password, defaultHomeX, defaultHomeY); 130 this.AddUserProfile(firstName, lastName, password, defaultHomeX, defaultHomeY);
131 131
132 profile = getUserProfile(firstName, lastName); 132 profile = getUserProfile(firstName, lastName);
133 133
134 if (profile == null) 134 if (profile == null)
135 { 135 {
136 Console.WriteLine("Unknown Master User after creation attempt. No clue what to do here."); 136 Console.WriteLine("Unknown Master User after creation attempt. No clue what to do here.");
137 } 137 }
138 138
139 return profile; 139 return profile;
140 } 140 }
141 } 141 }
142} 142}
diff --git a/OpenSim/Region/Communications/Local/Properties/AssemblyInfo.cs b/OpenSim/Region/Communications/Local/Properties/AssemblyInfo.cs
index 9afb75e..ca64319 100644
--- a/OpenSim/Region/Communications/Local/Properties/AssemblyInfo.cs
+++ b/OpenSim/Region/Communications/Local/Properties/AssemblyInfo.cs
@@ -1,33 +1,33 @@
1using System.Reflection; 1using System.Reflection;
2using System.Runtime.InteropServices; 2using System.Runtime.InteropServices;
3// General Information about an assembly is controlled through the following 3// General Information about an assembly is controlled through the following
4// set of attributes. Change these attribute values to modify the information 4// set of attributes. Change these attribute values to modify the information
5// associated with an assembly. 5// associated with an assembly.
6[assembly: AssemblyTitle("OpenSim.Region.Communications.Local")] 6[assembly: AssemblyTitle("OpenSim.Region.Communications.Local")]
7[assembly: AssemblyDescription("")] 7[assembly: AssemblyDescription("")]
8[assembly: AssemblyConfiguration("")] 8[assembly: AssemblyConfiguration("")]
9[assembly: AssemblyCompany("")] 9[assembly: AssemblyCompany("")]
10[assembly: AssemblyProduct("OpenSim.Region.Communications.Local")] 10[assembly: AssemblyProduct("OpenSim.Region.Communications.Local")]
11[assembly: AssemblyCopyright("Copyright © 2007")] 11[assembly: AssemblyCopyright("Copyright © 2007")]
12[assembly: AssemblyTrademark("")] 12[assembly: AssemblyTrademark("")]
13[assembly: AssemblyCulture("")] 13[assembly: AssemblyCulture("")]
14 14
15// Setting ComVisible to false makes the types in this assembly not visible 15// Setting ComVisible to false makes the types in this assembly not visible
16// to COM components. If you need to access a type in this assembly from 16// to COM components. If you need to access a type in this assembly from
17// COM, set the ComVisible attribute to true on that type. 17// COM, set the ComVisible attribute to true on that type.
18[assembly: ComVisible(false)] 18[assembly: ComVisible(false)]
19 19
20// The following GUID is for the ID of the typelib if this project is exposed to COM 20// The following GUID is for the ID of the typelib if this project is exposed to COM
21[assembly: Guid("fb173926-bd0a-4cd0-bb45-185b2f72ddfb")] 21[assembly: Guid("fb173926-bd0a-4cd0-bb45-185b2f72ddfb")]
22 22
23// Version information for an assembly consists of the following four values: 23// Version information for an assembly consists of the following four values:
24// 24//
25// Major Version 25// Major Version
26// Minor Version 26// Minor Version
27// Build Number 27// Build Number
28// Revision 28// Revision
29// 29//
30// You can specify all the values or you can default the Revision and Build Numbers 30// You can specify all the values or you can default the Revision and Build Numbers
31// by using the '*' as shown below: 31// by using the '*' as shown below:
32[assembly: AssemblyVersion("1.0.0.0")] 32[assembly: AssemblyVersion("1.0.0.0")]
33[assembly: AssemblyFileVersion("1.0.0.0")] 33[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/OpenSim/Region/Communications/OGS1/CommunicationsOGS1.cs b/OpenSim/Region/Communications/OGS1/CommunicationsOGS1.cs
index cc05845..9df0901 100644
--- a/OpenSim/Region/Communications/OGS1/CommunicationsOGS1.cs
+++ b/OpenSim/Region/Communications/OGS1/CommunicationsOGS1.cs
@@ -1,18 +1,18 @@
1using OpenSim.Framework.Communications; 1using OpenSim.Framework.Communications;
2using OpenSim.Framework.Types; 2using OpenSim.Framework.Types;
3using OpenSim.Framework.Servers; 3using OpenSim.Framework.Servers;
4 4
5namespace OpenSim.Region.Communications.OGS1 5namespace OpenSim.Region.Communications.OGS1
6{ 6{
7 public class CommunicationsOGS1 : CommunicationsManager 7 public class CommunicationsOGS1 : CommunicationsManager
8 { 8 {
9 9
10 public CommunicationsOGS1(NetworkServersInfo serversInfo, BaseHttpServer httpServer ) :base(serversInfo, httpServer) 10 public CommunicationsOGS1(NetworkServersInfo serversInfo, BaseHttpServer httpServer ) :base(serversInfo, httpServer)
11 { 11 {
12 OGS1GridServices gridInterComms = new OGS1GridServices(serversInfo, httpServer); 12 OGS1GridServices gridInterComms = new OGS1GridServices(serversInfo, httpServer);
13 GridServer = gridInterComms; 13 GridServer = gridInterComms;
14 InterRegion = gridInterComms; 14 InterRegion = gridInterComms;
15 UserServer = new OGS1UserServices(this); 15 UserServer = new OGS1UserServices(this);
16 } 16 }
17 } 17 }
18} 18}
diff --git a/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs b/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs
index e5a73fd..3cb2889 100644
--- a/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs
+++ b/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs
@@ -1,431 +1,431 @@
1using System; 1using System;
2using System.Collections; 2using System.Collections;
3using System.Collections.Generic; 3using System.Collections.Generic;
4using System.Net; 4using System.Net;
5using System.Runtime.Remoting; 5using System.Runtime.Remoting;
6using System.Runtime.Remoting.Channels; 6using System.Runtime.Remoting.Channels;
7using System.Runtime.Remoting.Channels.Tcp; 7using System.Runtime.Remoting.Channels.Tcp;
8using libsecondlife; 8using libsecondlife;
9using Nwc.XmlRpc; 9using Nwc.XmlRpc;
10using OpenSim.Framework; 10using OpenSim.Framework;
11using OpenSim.Framework.Communications; 11using OpenSim.Framework.Communications;
12using OpenSim.Framework.Console; 12using OpenSim.Framework.Console;
13using OpenSim.Framework.Servers; 13using OpenSim.Framework.Servers;
14using OpenSim.Framework.Types; 14using OpenSim.Framework.Types;
15 15
16namespace OpenSim.Region.Communications.OGS1 16namespace OpenSim.Region.Communications.OGS1
17{ 17{
18 public class OGS1GridServices : IGridServices, IInterRegionCommunications 18 public class OGS1GridServices : IGridServices, IInterRegionCommunications
19 { 19 {
20 public Dictionary<ulong, RegionCommsListener> listeners = new Dictionary<ulong, RegionCommsListener>(); 20 public Dictionary<ulong, RegionCommsListener> listeners = new Dictionary<ulong, RegionCommsListener>();
21 protected Dictionary<ulong, RegionInfo> regions = new Dictionary<ulong, RegionInfo>(); 21 protected Dictionary<ulong, RegionInfo> regions = new Dictionary<ulong, RegionInfo>();
22 22
23 public BaseHttpServer httpListener; 23 public BaseHttpServer httpListener;
24 public NetworkServersInfo serversInfo; 24 public NetworkServersInfo serversInfo;
25 public BaseHttpServer httpServer; 25 public BaseHttpServer httpServer;
26 26
27 /// <summary> 27 /// <summary>
28 /// 28 ///
29 /// </summary> 29 /// </summary>
30 /// <param name="servers_info"></param> 30 /// <param name="servers_info"></param>
31 /// <param name="httpServe"></param> 31 /// <param name="httpServe"></param>
32 public OGS1GridServices(NetworkServersInfo servers_info, BaseHttpServer httpServe) 32 public OGS1GridServices(NetworkServersInfo servers_info, BaseHttpServer httpServe)
33 { 33 {
34 serversInfo = servers_info; 34 serversInfo = servers_info;
35 httpServer = httpServe; 35 httpServer = httpServe;
36 httpServer.AddXmlRPCHandler("expect_user", this.ExpectUser); 36 httpServer.AddXmlRPCHandler("expect_user", this.ExpectUser);
37 this.StartRemoting(); 37 this.StartRemoting();
38 } 38 }
39 39
40 /// <summary> 40 /// <summary>
41 /// 41 ///
42 /// </summary> 42 /// </summary>
43 /// <param name="regionInfo"></param> 43 /// <param name="regionInfo"></param>
44 /// <returns></returns> 44 /// <returns></returns>
45 public RegionCommsListener RegisterRegion(RegionInfo regionInfo) 45 public RegionCommsListener RegisterRegion(RegionInfo regionInfo)
46 { 46 {
47 if (!this.regions.ContainsKey((uint)regionInfo.RegionHandle)) 47 if (!this.regions.ContainsKey((uint)regionInfo.RegionHandle))
48 { 48 {
49 this.regions.Add(regionInfo.RegionHandle, regionInfo); 49 this.regions.Add(regionInfo.RegionHandle, regionInfo);
50 } 50 }
51 51
52 Hashtable GridParams = new Hashtable(); 52 Hashtable GridParams = new Hashtable();
53 // Login / Authentication 53 // Login / Authentication
54 54
55 GridParams["authkey"] = serversInfo.GridSendKey; 55 GridParams["authkey"] = serversInfo.GridSendKey;
56 GridParams["UUID"] = regionInfo.SimUUID.ToStringHyphenated(); 56 GridParams["UUID"] = regionInfo.SimUUID.ToStringHyphenated();
57 GridParams["sim_ip"] = regionInfo.ExternalHostName; 57 GridParams["sim_ip"] = regionInfo.ExternalHostName;
58 GridParams["sim_port"] = regionInfo.InternalEndPoint.Port.ToString(); 58 GridParams["sim_port"] = regionInfo.InternalEndPoint.Port.ToString();
59 GridParams["region_locx"] = regionInfo.RegionLocX.ToString(); 59 GridParams["region_locx"] = regionInfo.RegionLocX.ToString();
60 GridParams["region_locy"] = regionInfo.RegionLocY.ToString(); 60 GridParams["region_locy"] = regionInfo.RegionLocY.ToString();
61 GridParams["sim_name"] = regionInfo.RegionName; 61 GridParams["sim_name"] = regionInfo.RegionName;
62 GridParams["http_port"] = serversInfo.HttpListenerPort.ToString(); 62 GridParams["http_port"] = serversInfo.HttpListenerPort.ToString();
63 GridParams["remoting_port"] = serversInfo.RemotingListenerPort.ToString(); 63 GridParams["remoting_port"] = serversInfo.RemotingListenerPort.ToString();
64 GridParams["map-image-id"] = regionInfo.estateSettings.terrainImageID.ToStringHyphenated(); 64 GridParams["map-image-id"] = regionInfo.estateSettings.terrainImageID.ToStringHyphenated();
65 65
66 // Package into an XMLRPC Request 66 // Package into an XMLRPC Request
67 ArrayList SendParams = new ArrayList(); 67 ArrayList SendParams = new ArrayList();
68 SendParams.Add(GridParams); 68 SendParams.Add(GridParams);
69 69
70 // Send Request 70 // Send Request
71 XmlRpcRequest GridReq = new XmlRpcRequest("simulator_login", SendParams); 71 XmlRpcRequest GridReq = new XmlRpcRequest("simulator_login", SendParams);
72 XmlRpcResponse GridResp = GridReq.Send(serversInfo.GridURL, 3000); 72 XmlRpcResponse GridResp = GridReq.Send(serversInfo.GridURL, 3000);
73 Hashtable GridRespData = (Hashtable)GridResp.Value; 73 Hashtable GridRespData = (Hashtable)GridResp.Value;
74 74
75 Hashtable griddatahash = GridRespData; 75 Hashtable griddatahash = GridRespData;
76 76
77 // Process Response 77 // Process Response
78 if (GridRespData.ContainsKey("error")) 78 if (GridRespData.ContainsKey("error"))
79 { 79 {
80 string errorstring = (string)GridRespData["error"]; 80 string errorstring = (string)GridRespData["error"];
81 MainLog.Instance.Error("Unable to connect to grid: " + errorstring); 81 MainLog.Instance.Error("Unable to connect to grid: " + errorstring);
82 return null; 82 return null;
83 } 83 }
84 84
85 // Initialise the background listeners 85 // Initialise the background listeners
86 RegionCommsListener regListener = new RegionCommsListener(); 86 RegionCommsListener regListener = new RegionCommsListener();
87 if (!this.listeners.ContainsKey(regionInfo.RegionHandle)) 87 if (!this.listeners.ContainsKey(regionInfo.RegionHandle))
88 { 88 {
89 this.listeners.Add(regionInfo.RegionHandle, regListener); 89 this.listeners.Add(regionInfo.RegionHandle, regListener);
90 } 90 }
91 else 91 else
92 { 92 {
93 listeners[regionInfo.RegionHandle] = regListener; 93 listeners[regionInfo.RegionHandle] = regListener;
94 } 94 }
95 95
96 return regListener; 96 return regListener;
97 } 97 }
98 98
99 /// <summary> 99 /// <summary>
100 /// 100 ///
101 /// </summary> 101 /// </summary>
102 /// <param name="regionInfo"></param> 102 /// <param name="regionInfo"></param>
103 /// <returns></returns> 103 /// <returns></returns>
104 public List<RegionInfo> RequestNeighbours(RegionInfo regionInfo) 104 public List<RegionInfo> RequestNeighbours(RegionInfo regionInfo)
105 { 105 {
106 106
107 Hashtable respData = MapBlockQuery((int)regionInfo.RegionLocX - 1, (int)regionInfo.RegionLocY - 1, (int)regionInfo.RegionLocX + 1, (int)regionInfo.RegionLocY + 1); 107 Hashtable respData = MapBlockQuery((int)regionInfo.RegionLocX - 1, (int)regionInfo.RegionLocY - 1, (int)regionInfo.RegionLocX + 1, (int)regionInfo.RegionLocY + 1);
108 108
109 List<RegionInfo> neighbours = new List<RegionInfo>(); 109 List<RegionInfo> neighbours = new List<RegionInfo>();
110 110
111 foreach (ArrayList a in respData.Values) 111 foreach (ArrayList a in respData.Values)
112 { 112 {
113 foreach (Hashtable n in a) 113 foreach (Hashtable n in a)
114 { 114 {
115 uint regX = Convert.ToUInt32(n["x"]); 115 uint regX = Convert.ToUInt32(n["x"]);
116 uint regY = Convert.ToUInt32(n["y"]); 116 uint regY = Convert.ToUInt32(n["y"]);
117 if ((regionInfo.RegionLocX != regX) || (regionInfo.RegionLocY != regY)) 117 if ((regionInfo.RegionLocX != regX) || (regionInfo.RegionLocY != regY))
118 { 118 {
119 string externalIpStr = (string)n["sim_ip"]; 119 string externalIpStr = (string)n["sim_ip"];
120 uint port = Convert.ToUInt32(n["sim_port"]); 120 uint port = Convert.ToUInt32(n["sim_port"]);
121 string externalUri = (string)n["sim_uri"]; 121 string externalUri = (string)n["sim_uri"];
122 122
123 IPEndPoint neighbourInternalEndPoint = new IPEndPoint(IPAddress.Parse(externalIpStr), (int)port); 123 IPEndPoint neighbourInternalEndPoint = new IPEndPoint(IPAddress.Parse(externalIpStr), (int)port);
124 string neighbourExternalUri = externalUri; 124 string neighbourExternalUri = externalUri;
125 RegionInfo neighbour = new RegionInfo(regX, regY, neighbourInternalEndPoint, externalIpStr); 125 RegionInfo neighbour = new RegionInfo(regX, regY, neighbourInternalEndPoint, externalIpStr);
126 126
127 //OGS1 127 //OGS1
128 //neighbour.RegionHandle = (ulong)n["regionhandle"]; is now calculated locally 128 //neighbour.RegionHandle = (ulong)n["regionhandle"]; is now calculated locally
129 129
130 neighbour.RegionName = (string)n["name"]; 130 neighbour.RegionName = (string)n["name"];
131 131
132 //OGS1+ 132 //OGS1+
133 neighbour.SimUUID = (string)n["uuid"]; 133 neighbour.SimUUID = (string)n["uuid"];
134 134
135 neighbours.Add(neighbour); 135 neighbours.Add(neighbour);
136 } 136 }
137 } 137 }
138 } 138 }
139 139
140 return neighbours; 140 return neighbours;
141 } 141 }
142 142
143 /// <summary> 143 /// <summary>
144 /// 144 ///
145 /// </summary> 145 /// </summary>
146 /// <param name="regionHandle"></param> 146 /// <param name="regionHandle"></param>
147 /// <returns></returns> 147 /// <returns></returns>
148 public RegionInfo RequestNeighbourInfo(ulong regionHandle) 148 public RegionInfo RequestNeighbourInfo(ulong regionHandle)
149 { 149 {
150 if (this.regions.ContainsKey(regionHandle)) 150 if (this.regions.ContainsKey(regionHandle))
151 { 151 {
152 return this.regions[regionHandle]; 152 return this.regions[regionHandle];
153 } 153 }
154 //TODO not a region in this instance so ask remote grid server 154 //TODO not a region in this instance so ask remote grid server
155 155
156 Hashtable requestData = new Hashtable(); 156 Hashtable requestData = new Hashtable();
157 requestData["region_handle"] = regionHandle.ToString(); 157 requestData["region_handle"] = regionHandle.ToString();
158 requestData["authkey"] = this.serversInfo.GridSendKey; 158 requestData["authkey"] = this.serversInfo.GridSendKey;
159 ArrayList SendParams = new ArrayList(); 159 ArrayList SendParams = new ArrayList();
160 SendParams.Add(requestData); 160 SendParams.Add(requestData);
161 XmlRpcRequest GridReq = new XmlRpcRequest("simulator_data_request", SendParams); 161 XmlRpcRequest GridReq = new XmlRpcRequest("simulator_data_request", SendParams);
162 XmlRpcResponse GridResp = GridReq.Send(this.serversInfo.GridURL, 3000); 162 XmlRpcResponse GridResp = GridReq.Send(this.serversInfo.GridURL, 3000);
163 163
164 Hashtable responseData = (Hashtable)GridResp.Value; 164 Hashtable responseData = (Hashtable)GridResp.Value;
165 165
166 if (responseData.ContainsKey("error")) 166 if (responseData.ContainsKey("error"))
167 { 167 {
168 Console.WriteLine("error received from grid server" + responseData["error"]); 168 Console.WriteLine("error received from grid server" + responseData["error"]);
169 return null; 169 return null;
170 } 170 }
171 171
172 uint regX = Convert.ToUInt32((string)responseData["region_locx"]); 172 uint regX = Convert.ToUInt32((string)responseData["region_locx"]);
173 uint regY = Convert.ToUInt32((string)responseData["region_locy"]); 173 uint regY = Convert.ToUInt32((string)responseData["region_locy"]);
174 string internalIpStr = (string)responseData["sim_ip"]; 174 string internalIpStr = (string)responseData["sim_ip"];
175 uint port = Convert.ToUInt32(responseData["sim_port"]); 175 uint port = Convert.ToUInt32(responseData["sim_port"]);
176 string externalUri = (string)responseData["sim_uri"]; 176 string externalUri = (string)responseData["sim_uri"];
177 177
178 IPEndPoint neighbourInternalEndPoint = new IPEndPoint(IPAddress.Parse(internalIpStr), (int)port); 178 IPEndPoint neighbourInternalEndPoint = new IPEndPoint(IPAddress.Parse(internalIpStr), (int)port);
179 string neighbourExternalUri = externalUri; 179 string neighbourExternalUri = externalUri;
180 RegionInfo regionInfo = new RegionInfo(regX, regY, neighbourInternalEndPoint, internalIpStr); 180 RegionInfo regionInfo = new RegionInfo(regX, regY, neighbourInternalEndPoint, internalIpStr);
181 181
182 regionInfo.RemotingPort = Convert.ToUInt32((string)responseData["remoting_port"]); 182 regionInfo.RemotingPort = Convert.ToUInt32((string)responseData["remoting_port"]);
183 regionInfo.RemotingAddress = internalIpStr; 183 regionInfo.RemotingAddress = internalIpStr;
184 184
185 regionInfo.SimUUID = new LLUUID((string)responseData["region_UUID"]); 185 regionInfo.SimUUID = new LLUUID((string)responseData["region_UUID"]);
186 regionInfo.RegionName = (string)responseData["region_name"]; 186 regionInfo.RegionName = (string)responseData["region_name"];
187 187
188 return regionInfo; 188 return regionInfo;
189 } 189 }
190 190
191 /// <summary> 191 /// <summary>
192 /// 192 ///
193 /// </summary> 193 /// </summary>
194 /// <param name="minX"></param> 194 /// <param name="minX"></param>
195 /// <param name="minY"></param> 195 /// <param name="minY"></param>
196 /// <param name="maxX"></param> 196 /// <param name="maxX"></param>
197 /// <param name="maxY"></param> 197 /// <param name="maxY"></param>
198 /// <returns></returns> 198 /// <returns></returns>
199 public List<MapBlockData> RequestNeighbourMapBlocks(int minX, int minY, int maxX, int maxY) 199 public List<MapBlockData> RequestNeighbourMapBlocks(int minX, int minY, int maxX, int maxY)
200 { 200 {
201 Hashtable respData = MapBlockQuery(minX, minY, maxX, maxY); 201 Hashtable respData = MapBlockQuery(minX, minY, maxX, maxY);
202 202
203 List<MapBlockData> neighbours = new List<MapBlockData>(); 203 List<MapBlockData> neighbours = new List<MapBlockData>();
204 204
205 foreach (ArrayList a in respData.Values) 205 foreach (ArrayList a in respData.Values)
206 { 206 {
207 foreach (Hashtable n in a) 207 foreach (Hashtable n in a)
208 { 208 {
209 MapBlockData neighbour = new MapBlockData(); 209 MapBlockData neighbour = new MapBlockData();
210 210
211 neighbour.X = Convert.ToUInt16(n["x"]); 211 neighbour.X = Convert.ToUInt16(n["x"]);
212 neighbour.Y = Convert.ToUInt16(n["y"]); 212 neighbour.Y = Convert.ToUInt16(n["y"]);
213 213
214 neighbour.Name = (string)n["name"]; 214 neighbour.Name = (string)n["name"];
215 neighbour.Access = Convert.ToByte(n["access"]); 215 neighbour.Access = Convert.ToByte(n["access"]);
216 neighbour.RegionFlags = Convert.ToUInt32(n["region-flags"]); 216 neighbour.RegionFlags = Convert.ToUInt32(n["region-flags"]);
217 neighbour.WaterHeight = Convert.ToByte(n["water-height"]); 217 neighbour.WaterHeight = Convert.ToByte(n["water-height"]);
218 neighbour.MapImageId = new LLUUID((string)n["map-image-id"]); 218 neighbour.MapImageId = new LLUUID((string)n["map-image-id"]);
219 219
220 neighbours.Add(neighbour); 220 neighbours.Add(neighbour);
221 } 221 }
222 } 222 }
223 223
224 return neighbours; 224 return neighbours;
225 } 225 }
226 226
227 /// <summary> 227 /// <summary>
228 /// Performs a XML-RPC query against the grid server returning mapblock information in the specified coordinates 228 /// Performs a XML-RPC query against the grid server returning mapblock information in the specified coordinates
229 /// </summary> 229 /// </summary>
230 /// <remarks>REDUNDANT - OGS1 is to be phased out in favour of OGS2</remarks> 230 /// <remarks>REDUNDANT - OGS1 is to be phased out in favour of OGS2</remarks>
231 /// <param name="minX">Minimum X value</param> 231 /// <param name="minX">Minimum X value</param>
232 /// <param name="minY">Minimum Y value</param> 232 /// <param name="minY">Minimum Y value</param>
233 /// <param name="maxX">Maximum X value</param> 233 /// <param name="maxX">Maximum X value</param>
234 /// <param name="maxY">Maximum Y value</param> 234 /// <param name="maxY">Maximum Y value</param>
235 /// <returns>Hashtable of hashtables containing map data elements</returns> 235 /// <returns>Hashtable of hashtables containing map data elements</returns>
236 private Hashtable MapBlockQuery(int minX, int minY, int maxX, int maxY) 236 private Hashtable MapBlockQuery(int minX, int minY, int maxX, int maxY)
237 { 237 {
238 Hashtable param = new Hashtable(); 238 Hashtable param = new Hashtable();
239 param["xmin"] = minX; 239 param["xmin"] = minX;
240 param["ymin"] = minY; 240 param["ymin"] = minY;
241 param["xmax"] = maxX; 241 param["xmax"] = maxX;
242 param["ymax"] = maxY; 242 param["ymax"] = maxY;
243 IList parameters = new ArrayList(); 243 IList parameters = new ArrayList();
244 parameters.Add(param); 244 parameters.Add(param);
245 XmlRpcRequest req = new XmlRpcRequest("map_block", parameters); 245 XmlRpcRequest req = new XmlRpcRequest("map_block", parameters);
246 XmlRpcResponse resp = req.Send(serversInfo.GridURL, 3000); 246 XmlRpcResponse resp = req.Send(serversInfo.GridURL, 3000);
247 Hashtable respData = (Hashtable)resp.Value; 247 Hashtable respData = (Hashtable)resp.Value;
248 return respData; 248 return respData;
249 } 249 }
250 250
251 // Grid Request Processing 251 // Grid Request Processing
252 /// <summary> 252 /// <summary>
253 /// 253 ///
254 /// </summary> 254 /// </summary>
255 /// <param name="request"></param> 255 /// <param name="request"></param>
256 /// <returns></returns> 256 /// <returns></returns>
257 public XmlRpcResponse ExpectUser(XmlRpcRequest request) 257 public XmlRpcResponse ExpectUser(XmlRpcRequest request)
258 { 258 {
259 Console.WriteLine("Expecting User..."); 259 Console.WriteLine("Expecting User...");
260 Hashtable requestData = (Hashtable)request.Params[0]; 260 Hashtable requestData = (Hashtable)request.Params[0];
261 AgentCircuitData agentData = new AgentCircuitData(); 261 AgentCircuitData agentData = new AgentCircuitData();
262 agentData.SessionID = new LLUUID((string)requestData["session_id"]); 262 agentData.SessionID = new LLUUID((string)requestData["session_id"]);
263 agentData.SecureSessionID = new LLUUID((string)requestData["secure_session_id"]); 263 agentData.SecureSessionID = new LLUUID((string)requestData["secure_session_id"]);
264 agentData.firstname = (string)requestData["firstname"]; 264 agentData.firstname = (string)requestData["firstname"];
265 agentData.lastname = (string)requestData["lastname"]; 265 agentData.lastname = (string)requestData["lastname"];
266 agentData.AgentID = new LLUUID((string)requestData["agent_id"]); 266 agentData.AgentID = new LLUUID((string)requestData["agent_id"]);
267 agentData.circuitcode = Convert.ToUInt32(requestData["circuit_code"]); 267 agentData.circuitcode = Convert.ToUInt32(requestData["circuit_code"]);
268 agentData.CapsPath = (string)requestData["caps_path"]; 268 agentData.CapsPath = (string)requestData["caps_path"];
269 269
270 if (requestData.ContainsKey("child_agent") && requestData["child_agent"].Equals("1")) 270 if (requestData.ContainsKey("child_agent") && requestData["child_agent"].Equals("1"))
271 { 271 {
272 agentData.child = true; 272 agentData.child = true;
273 } 273 }
274 else 274 else
275 { 275 {
276 agentData.startpos = new LLVector3(Convert.ToUInt32(requestData["startpos_x"]), Convert.ToUInt32(requestData["startpos_y"]), Convert.ToUInt32(requestData["startpos_z"])); 276 agentData.startpos = new LLVector3(Convert.ToUInt32(requestData["startpos_x"]), Convert.ToUInt32(requestData["startpos_y"]), Convert.ToUInt32(requestData["startpos_z"]));
277 agentData.child = false; 277 agentData.child = false;
278 278
279 } 279 }
280 280
281 if (listeners.ContainsKey(Convert.ToUInt64((string)requestData["regionhandle"]))) 281 if (listeners.ContainsKey(Convert.ToUInt64((string)requestData["regionhandle"])))
282 { 282 {
283 this.listeners[Convert.ToUInt64((string)requestData["regionhandle"])].TriggerExpectUser(Convert.ToUInt64((string)requestData["regionhandle"]), agentData); 283 this.listeners[Convert.ToUInt64((string)requestData["regionhandle"])].TriggerExpectUser(Convert.ToUInt64((string)requestData["regionhandle"]), agentData);
284 } 284 }
285 else 285 else
286 { 286 {
287 MainLog.Instance.Error("ExpectUser() - Unknown region " + ((ulong)requestData["regionhandle"]).ToString()); 287 MainLog.Instance.Error("ExpectUser() - Unknown region " + ((ulong)requestData["regionhandle"]).ToString());
288 } 288 }
289 289
290 MainLog.Instance.Verbose("ExpectUser() - Welcoming new user..."); 290 MainLog.Instance.Verbose("ExpectUser() - Welcoming new user...");
291 291
292 return new XmlRpcResponse(); 292 return new XmlRpcResponse();
293 } 293 }
294 294
295 #region InterRegion Comms 295 #region InterRegion Comms
296 /// <summary> 296 /// <summary>
297 /// 297 ///
298 /// </summary> 298 /// </summary>
299 private void StartRemoting() 299 private void StartRemoting()
300 { 300 {
301 TcpChannel ch = new TcpChannel(this.serversInfo.RemotingListenerPort); 301 TcpChannel ch = new TcpChannel(this.serversInfo.RemotingListenerPort);
302 ChannelServices.RegisterChannel(ch, true); 302 ChannelServices.RegisterChannel(ch, true);
303 303
304 WellKnownServiceTypeEntry wellType = new WellKnownServiceTypeEntry(typeof(OGS1InterRegionRemoting), "InterRegions", WellKnownObjectMode.Singleton); 304 WellKnownServiceTypeEntry wellType = new WellKnownServiceTypeEntry(typeof(OGS1InterRegionRemoting), "InterRegions", WellKnownObjectMode.Singleton);
305 RemotingConfiguration.RegisterWellKnownServiceType(wellType); 305 RemotingConfiguration.RegisterWellKnownServiceType(wellType);
306 InterRegionSingleton.Instance.OnArrival += this.IncomingArrival; 306 InterRegionSingleton.Instance.OnArrival += this.IncomingArrival;
307 InterRegionSingleton.Instance.OnChildAgent += this.IncomingChildAgent; 307 InterRegionSingleton.Instance.OnChildAgent += this.IncomingChildAgent;
308 } 308 }
309 309
310 #region Methods called by regions in this instance 310 #region Methods called by regions in this instance
311 /// <summary> 311 /// <summary>
312 /// 312 ///
313 /// </summary> 313 /// </summary>
314 /// <param name="regionHandle"></param> 314 /// <param name="regionHandle"></param>
315 /// <param name="agentData"></param> 315 /// <param name="agentData"></param>
316 /// <returns></returns> 316 /// <returns></returns>
317 public bool InformRegionOfChildAgent(ulong regionHandle, AgentCircuitData agentData) 317 public bool InformRegionOfChildAgent(ulong regionHandle, AgentCircuitData agentData)
318 { 318 {
319 if (this.listeners.ContainsKey(regionHandle)) 319 if (this.listeners.ContainsKey(regionHandle))
320 { 320 {
321 this.listeners[regionHandle].TriggerExpectUser(regionHandle, agentData); 321 this.listeners[regionHandle].TriggerExpectUser(regionHandle, agentData);
322 return true; 322 return true;
323 } 323 }
324 RegionInfo regInfo = this.RequestNeighbourInfo(regionHandle); 324 RegionInfo regInfo = this.RequestNeighbourInfo(regionHandle);
325 if (regInfo != null) 325 if (regInfo != null)
326 { 326 {
327 //don't want to be creating a new link to the remote instance every time like we are here 327 //don't want to be creating a new link to the remote instance every time like we are here
328 bool retValue = false; 328 bool retValue = false;
329 329
330 330
331 OGS1InterRegionRemoting remObject = (OGS1InterRegionRemoting)Activator.GetObject( 331 OGS1InterRegionRemoting remObject = (OGS1InterRegionRemoting)Activator.GetObject(
332 typeof(OGS1InterRegionRemoting), 332 typeof(OGS1InterRegionRemoting),
333 "tcp://"+ regInfo.RemotingAddress+":"+regInfo.RemotingPort+"/InterRegions"); 333 "tcp://"+ regInfo.RemotingAddress+":"+regInfo.RemotingPort+"/InterRegions");
334 if (remObject != null) 334 if (remObject != null)
335 { 335 {
336 336
337 retValue = remObject.InformRegionOfChildAgent(regionHandle, agentData); 337 retValue = remObject.InformRegionOfChildAgent(regionHandle, agentData);
338 } 338 }
339 else 339 else
340 { 340 {
341 Console.WriteLine("remoting object not found"); 341 Console.WriteLine("remoting object not found");
342 } 342 }
343 remObject = null; 343 remObject = null;
344 344
345 345
346 return retValue; 346 return retValue;
347 } 347 }
348 348
349 return false; 349 return false;
350 } 350 }
351 351
352 /// <summary> 352 /// <summary>
353 /// 353 ///
354 /// </summary> 354 /// </summary>
355 /// <param name="regionHandle"></param> 355 /// <param name="regionHandle"></param>
356 /// <param name="agentID"></param> 356 /// <param name="agentID"></param>
357 /// <param name="position"></param> 357 /// <param name="position"></param>
358 /// <returns></returns> 358 /// <returns></returns>
359 public bool ExpectAvatarCrossing(ulong regionHandle, LLUUID agentID, LLVector3 position) 359 public bool ExpectAvatarCrossing(ulong regionHandle, LLUUID agentID, LLVector3 position)
360 { 360 {
361 if (this.listeners.ContainsKey(regionHandle)) 361 if (this.listeners.ContainsKey(regionHandle))
362 { 362 {
363 this.listeners[regionHandle].TriggerExpectAvatarCrossing(regionHandle, agentID, position); 363 this.listeners[regionHandle].TriggerExpectAvatarCrossing(regionHandle, agentID, position);
364 return true; 364 return true;
365 } 365 }
366 RegionInfo regInfo = this.RequestNeighbourInfo(regionHandle); 366 RegionInfo regInfo = this.RequestNeighbourInfo(regionHandle);
367 if (regInfo != null) 367 if (regInfo != null)
368 { 368 {
369 bool retValue = false; 369 bool retValue = false;
370 370
371 371
372 OGS1InterRegionRemoting remObject = (OGS1InterRegionRemoting)Activator.GetObject( 372 OGS1InterRegionRemoting remObject = (OGS1InterRegionRemoting)Activator.GetObject(
373 typeof(OGS1InterRegionRemoting), 373 typeof(OGS1InterRegionRemoting),
374 "tcp://" + regInfo.RemotingAddress + ":" + regInfo.RemotingPort + "/InterRegions"); 374 "tcp://" + regInfo.RemotingAddress + ":" + regInfo.RemotingPort + "/InterRegions");
375 if (remObject != null) 375 if (remObject != null)
376 { 376 {
377 377
378 retValue = remObject.ExpectAvatarCrossing(regionHandle, agentID, position); 378 retValue = remObject.ExpectAvatarCrossing(regionHandle, agentID, position);
379 } 379 }
380 else 380 else
381 { 381 {
382 Console.WriteLine("remoting object not found"); 382 Console.WriteLine("remoting object not found");
383 } 383 }
384 remObject = null; 384 remObject = null;
385 385
386 386
387 return retValue; 387 return retValue;
388 } 388 }
389 //TODO need to see if we know about where this region is and use .net remoting 389 //TODO need to see if we know about where this region is and use .net remoting
390 // to inform it. 390 // to inform it.
391 return false; 391 return false;
392 } 392 }
393 #endregion 393 #endregion
394 394
395 #region Methods triggered by calls from external instances 395 #region Methods triggered by calls from external instances
396 /// <summary> 396 /// <summary>
397 /// 397 ///
398 /// </summary> 398 /// </summary>
399 /// <param name="regionHandle"></param> 399 /// <param name="regionHandle"></param>
400 /// <param name="agentData"></param> 400 /// <param name="agentData"></param>
401 /// <returns></returns> 401 /// <returns></returns>
402 public bool IncomingChildAgent(ulong regionHandle, AgentCircuitData agentData) 402 public bool IncomingChildAgent(ulong regionHandle, AgentCircuitData agentData)
403 { 403 {
404 if (this.listeners.ContainsKey(regionHandle)) 404 if (this.listeners.ContainsKey(regionHandle))
405 { 405 {
406 this.listeners[regionHandle].TriggerExpectUser(regionHandle, agentData); 406 this.listeners[regionHandle].TriggerExpectUser(regionHandle, agentData);
407 return true; 407 return true;
408 } 408 }
409 return false; 409 return false;
410 } 410 }
411 411
412 /// <summary> 412 /// <summary>
413 /// 413 ///
414 /// </summary> 414 /// </summary>
415 /// <param name="regionHandle"></param> 415 /// <param name="regionHandle"></param>
416 /// <param name="agentID"></param> 416 /// <param name="agentID"></param>
417 /// <param name="position"></param> 417 /// <param name="position"></param>
418 /// <returns></returns> 418 /// <returns></returns>
419 public bool IncomingArrival(ulong regionHandle, LLUUID agentID, LLVector3 position) 419 public bool IncomingArrival(ulong regionHandle, LLUUID agentID, LLVector3 position)
420 { 420 {
421 if (this.listeners.ContainsKey(regionHandle)) 421 if (this.listeners.ContainsKey(regionHandle))
422 { 422 {
423 this.listeners[regionHandle].TriggerExpectAvatarCrossing(regionHandle, agentID, position); 423 this.listeners[regionHandle].TriggerExpectAvatarCrossing(regionHandle, agentID, position);
424 return true; 424 return true;
425 } 425 }
426 return false; 426 return false;
427 } 427 }
428 #endregion 428 #endregion
429 #endregion 429 #endregion
430 } 430 }
431} 431}
diff --git a/OpenSim/Region/Communications/OGS1/OGS1InterSimComms.cs b/OpenSim/Region/Communications/OGS1/OGS1InterSimComms.cs
index f514a29..520c593 100644
--- a/OpenSim/Region/Communications/OGS1/OGS1InterSimComms.cs
+++ b/OpenSim/Region/Communications/OGS1/OGS1InterSimComms.cs
@@ -1,69 +1,69 @@
1using System; 1using System;
2using libsecondlife; 2using libsecondlife;
3using OpenSim.Framework.Types; 3using OpenSim.Framework.Types;
4 4
5namespace OpenSim.Region.Communications.OGS1 5namespace OpenSim.Region.Communications.OGS1
6{ 6{
7 public delegate bool InformRegionChild(ulong regionHandle, AgentCircuitData agentData); 7 public delegate bool InformRegionChild(ulong regionHandle, AgentCircuitData agentData);
8 public delegate bool ExpectArrival(ulong regionHandle, LLUUID agentID, LLVector3 position); 8 public delegate bool ExpectArrival(ulong regionHandle, LLUUID agentID, LLVector3 position);
9 9
10 public sealed class InterRegionSingleton 10 public sealed class InterRegionSingleton
11 { 11 {
12 static readonly InterRegionSingleton instance = new InterRegionSingleton(); 12 static readonly InterRegionSingleton instance = new InterRegionSingleton();
13 13
14 public event InformRegionChild OnChildAgent; 14 public event InformRegionChild OnChildAgent;
15 public event ExpectArrival OnArrival; 15 public event ExpectArrival OnArrival;
16 16
17 static InterRegionSingleton() 17 static InterRegionSingleton()
18 { 18 {
19 } 19 }
20 20
21 InterRegionSingleton() 21 InterRegionSingleton()
22 { 22 {
23 } 23 }
24 24
25 public static InterRegionSingleton Instance 25 public static InterRegionSingleton Instance
26 { 26 {
27 get 27 get
28 { 28 {
29 return instance; 29 return instance;
30 } 30 }
31 } 31 }
32 32
33 public bool InformRegionOfChildAgent(ulong regionHandle, AgentCircuitData agentData) 33 public bool InformRegionOfChildAgent(ulong regionHandle, AgentCircuitData agentData)
34 { 34 {
35 if (OnChildAgent != null) 35 if (OnChildAgent != null)
36 { 36 {
37 return OnChildAgent(regionHandle, agentData); 37 return OnChildAgent(regionHandle, agentData);
38 } 38 }
39 return false; 39 return false;
40 } 40 }
41 41
42 public bool ExpectAvatarCrossing(ulong regionHandle, LLUUID agentID, LLVector3 position) 42 public bool ExpectAvatarCrossing(ulong regionHandle, LLUUID agentID, LLVector3 position)
43 { 43 {
44 if (OnArrival != null) 44 if (OnArrival != null)
45 { 45 {
46 return OnArrival(regionHandle, agentID, position); 46 return OnArrival(regionHandle, agentID, position);
47 } 47 }
48 return false; 48 return false;
49 } 49 }
50 } 50 }
51 51
52 public class OGS1InterRegionRemoting : MarshalByRefObject 52 public class OGS1InterRegionRemoting : MarshalByRefObject
53 { 53 {
54 54
55 public OGS1InterRegionRemoting() 55 public OGS1InterRegionRemoting()
56 { 56 {
57 } 57 }
58 58
59 public bool InformRegionOfChildAgent(ulong regionHandle, AgentCircuitData agentData) 59 public bool InformRegionOfChildAgent(ulong regionHandle, AgentCircuitData agentData)
60 { 60 {
61 return InterRegionSingleton.Instance.InformRegionOfChildAgent(regionHandle, agentData); 61 return InterRegionSingleton.Instance.InformRegionOfChildAgent(regionHandle, agentData);
62 } 62 }
63 63
64 public bool ExpectAvatarCrossing(ulong regionHandle, LLUUID agentID, LLVector3 position) 64 public bool ExpectAvatarCrossing(ulong regionHandle, LLUUID agentID, LLVector3 position)
65 { 65 {
66 return InterRegionSingleton.Instance.ExpectAvatarCrossing(regionHandle, agentID, position); 66 return InterRegionSingleton.Instance.ExpectAvatarCrossing(regionHandle, agentID, position);
67 } 67 }
68 } 68 }
69} 69}
diff --git a/OpenSim/Region/Communications/OGS1/OGS1UserServices.cs b/OpenSim/Region/Communications/OGS1/OGS1UserServices.cs
index 46d71c4..0847148 100644
--- a/OpenSim/Region/Communications/OGS1/OGS1UserServices.cs
+++ b/OpenSim/Region/Communications/OGS1/OGS1UserServices.cs
@@ -1,101 +1,101 @@
1using System; 1using System;
2using System.Collections; 2using System.Collections;
3using libsecondlife; 3using libsecondlife;
4using Nwc.XmlRpc; 4using Nwc.XmlRpc;
5using OpenSim.Framework.Communications; 5using OpenSim.Framework.Communications;
6using OpenSim.Framework.Data; 6using OpenSim.Framework.Data;
7 7
8namespace OpenSim.Region.Communications.OGS1 8namespace OpenSim.Region.Communications.OGS1
9{ 9{
10 public class OGS1UserServices :IUserServices 10 public class OGS1UserServices :IUserServices
11 { 11 {
12 CommunicationsOGS1 m_parent; 12 CommunicationsOGS1 m_parent;
13 public OGS1UserServices(CommunicationsOGS1 parent) 13 public OGS1UserServices(CommunicationsOGS1 parent)
14 { 14 {
15 m_parent = parent; 15 m_parent = parent;
16 } 16 }
17 17
18 public UserProfileData ConvertXMLRPCDataToUserProfile(Hashtable data) 18 public UserProfileData ConvertXMLRPCDataToUserProfile(Hashtable data)
19 { 19 {
20 if (data.Contains("error_type")) 20 if (data.Contains("error_type"))
21 { 21 {
22 Console.WriteLine("Error sent by user server when trying to get user profile: (" + data["error_type"] + "): " + data["error_desc"]); 22 Console.WriteLine("Error sent by user server when trying to get user profile: (" + data["error_type"] + "): " + data["error_desc"]);
23 return null; 23 return null;
24 } 24 }
25 25
26 UserProfileData userData = new UserProfileData(); 26 UserProfileData userData = new UserProfileData();
27 userData.username = (string)data["firstname"]; 27 userData.username = (string)data["firstname"];
28 userData.surname = (string)data["lastname"]; 28 userData.surname = (string)data["lastname"];
29 userData.UUID = new LLUUID((string)data["uuid"]); 29 userData.UUID = new LLUUID((string)data["uuid"]);
30 userData.userInventoryURI = (string)data["server_inventory"]; 30 userData.userInventoryURI = (string)data["server_inventory"];
31 userData.userAssetURI = (string)data["server_asset"]; 31 userData.userAssetURI = (string)data["server_asset"];
32 userData.profileFirstText = (string)data["profile_firstlife_about"]; 32 userData.profileFirstText = (string)data["profile_firstlife_about"];
33 userData.profileFirstImage = new LLUUID((string)data["profile_firstlife_image"]); 33 userData.profileFirstImage = new LLUUID((string)data["profile_firstlife_image"]);
34 userData.profileCanDoMask = Convert.ToUInt32((string)data["profile_can_do"]); 34 userData.profileCanDoMask = Convert.ToUInt32((string)data["profile_can_do"]);
35 userData.profileWantDoMask = Convert.ToUInt32(data["profile_want_do"]); 35 userData.profileWantDoMask = Convert.ToUInt32(data["profile_want_do"]);
36 userData.profileImage = new LLUUID((string)data["profile_image"]); 36 userData.profileImage = new LLUUID((string)data["profile_image"]);
37 userData.lastLogin = Convert.ToInt32((string)data["profile_lastlogin"]); 37 userData.lastLogin = Convert.ToInt32((string)data["profile_lastlogin"]);
38 userData.homeRegion = Convert.ToUInt64((string)data["home_region"]); 38 userData.homeRegion = Convert.ToUInt64((string)data["home_region"]);
39 userData.homeLocation = new LLVector3((float)Convert.ToDecimal((string)data["home_coordinates_x"]), (float)Convert.ToDecimal((string)data["home_coordinates_y"]), (float)Convert.ToDecimal((string)data["home_coordinates_z"])); 39 userData.homeLocation = new LLVector3((float)Convert.ToDecimal((string)data["home_coordinates_x"]), (float)Convert.ToDecimal((string)data["home_coordinates_y"]), (float)Convert.ToDecimal((string)data["home_coordinates_z"]));
40 userData.homeLookAt = new LLVector3((float)Convert.ToDecimal((string)data["home_look_x"]), (float)Convert.ToDecimal((string)data["home_look_y"]), (float)Convert.ToDecimal((string)data["home_look_z"])); 40 userData.homeLookAt = new LLVector3((float)Convert.ToDecimal((string)data["home_look_x"]), (float)Convert.ToDecimal((string)data["home_look_y"]), (float)Convert.ToDecimal((string)data["home_look_z"]));
41 41
42 return userData; 42 return userData;
43 } 43 }
44 public UserProfileData GetUserProfile(string firstName, string lastName) 44 public UserProfileData GetUserProfile(string firstName, string lastName)
45 { 45 {
46 return GetUserProfile(firstName + " " + lastName); 46 return GetUserProfile(firstName + " " + lastName);
47 } 47 }
48 public UserProfileData GetUserProfile(string name) 48 public UserProfileData GetUserProfile(string name)
49 { 49 {
50 //try 50 //try
51 //{ 51 //{
52 Hashtable param = new Hashtable(); 52 Hashtable param = new Hashtable();
53 param["avatar_name"] = name; 53 param["avatar_name"] = name;
54 IList parameters = new ArrayList(); 54 IList parameters = new ArrayList();
55 parameters.Add(param); 55 parameters.Add(param);
56 XmlRpcRequest req = new XmlRpcRequest("get_user_by_name", parameters); 56 XmlRpcRequest req = new XmlRpcRequest("get_user_by_name", parameters);
57 XmlRpcResponse resp = req.Send(m_parent.ServersInfo.UserURL, 3000); 57 XmlRpcResponse resp = req.Send(m_parent.ServersInfo.UserURL, 3000);
58 Hashtable respData = (Hashtable)resp.Value; 58 Hashtable respData = (Hashtable)resp.Value;
59 59
60 return ConvertXMLRPCDataToUserProfile(respData); 60 return ConvertXMLRPCDataToUserProfile(respData);
61 //} 61 //}
62 //catch (Exception e) 62 //catch (Exception e)
63 //{ 63 //{
64 // Console.WriteLine("Error when trying to fetch profile data by name from remote user server: " + e.Message); 64 // Console.WriteLine("Error when trying to fetch profile data by name from remote user server: " + e.Message);
65 //} 65 //}
66 //return null; 66 //return null;
67 } 67 }
68 public UserProfileData GetUserProfile(LLUUID avatarID) 68 public UserProfileData GetUserProfile(LLUUID avatarID)
69 { 69 {
70 try 70 try
71 { 71 {
72 72
73 Hashtable param = new Hashtable(); 73 Hashtable param = new Hashtable();
74 param["avatar_uuid"] = avatarID.ToString(); 74 param["avatar_uuid"] = avatarID.ToString();
75 IList parameters = new ArrayList(); 75 IList parameters = new ArrayList();
76 parameters.Add(param); 76 parameters.Add(param);
77 XmlRpcRequest req = new XmlRpcRequest("get_user_by_uuid", parameters); 77 XmlRpcRequest req = new XmlRpcRequest("get_user_by_uuid", parameters);
78 XmlRpcResponse resp = req.Send(m_parent.ServersInfo.UserURL, 3000); 78 XmlRpcResponse resp = req.Send(m_parent.ServersInfo.UserURL, 3000);
79 Hashtable respData = (Hashtable)resp.Value; 79 Hashtable respData = (Hashtable)resp.Value;
80 80
81 return ConvertXMLRPCDataToUserProfile(respData); 81 return ConvertXMLRPCDataToUserProfile(respData);
82 } 82 }
83 catch (Exception e) 83 catch (Exception e)
84 { 84 {
85 Console.WriteLine("Error when trying to fetch profile data by uuid from remote user server: " + e.Message); 85 Console.WriteLine("Error when trying to fetch profile data by uuid from remote user server: " + e.Message);
86 } 86 }
87 return null; 87 return null;
88 } 88 }
89 89
90 public UserProfileData SetupMasterUser(string firstName, string lastName) 90 public UserProfileData SetupMasterUser(string firstName, string lastName)
91 { 91 {
92 return SetupMasterUser(firstName, lastName, ""); 92 return SetupMasterUser(firstName, lastName, "");
93 } 93 }
94 94
95 public UserProfileData SetupMasterUser(string firstName, string lastName, string password) 95 public UserProfileData SetupMasterUser(string firstName, string lastName, string password)
96 { 96 {
97 UserProfileData profile = GetUserProfile(firstName, lastName); 97 UserProfileData profile = GetUserProfile(firstName, lastName);
98 return profile; 98 return profile;
99 } 99 }
100 } 100 }
101} 101}
diff --git a/OpenSim/Region/Communications/OGS1/Properties/AssemblyInfo.cs b/OpenSim/Region/Communications/OGS1/Properties/AssemblyInfo.cs
index 41f811a..2bebf9f 100644
--- a/OpenSim/Region/Communications/OGS1/Properties/AssemblyInfo.cs
+++ b/OpenSim/Region/Communications/OGS1/Properties/AssemblyInfo.cs
@@ -1,33 +1,33 @@
1using System.Reflection; 1using System.Reflection;
2using System.Runtime.InteropServices; 2using System.Runtime.InteropServices;
3// General Information about an assembly is controlled through the following 3// General Information about an assembly is controlled through the following
4// set of attributes. Change these attribute values to modify the information 4// set of attributes. Change these attribute values to modify the information
5// associated with an assembly. 5// associated with an assembly.
6[assembly: AssemblyTitle("OpenGrid.Framework.Communications.OGS1")] 6[assembly: AssemblyTitle("OpenGrid.Framework.Communications.OGS1")]
7[assembly: AssemblyDescription("")] 7[assembly: AssemblyDescription("")]
8[assembly: AssemblyConfiguration("")] 8[assembly: AssemblyConfiguration("")]
9[assembly: AssemblyCompany("")] 9[assembly: AssemblyCompany("")]
10[assembly: AssemblyProduct("OpenGrid.Framework.Communications.OGS1")] 10[assembly: AssemblyProduct("OpenGrid.Framework.Communications.OGS1")]
11[assembly: AssemblyCopyright("Copyright © 2007")] 11[assembly: AssemblyCopyright("Copyright © 2007")]
12[assembly: AssemblyTrademark("")] 12[assembly: AssemblyTrademark("")]
13[assembly: AssemblyCulture("")] 13[assembly: AssemblyCulture("")]
14 14
15// Setting ComVisible to false makes the types in this assembly not visible 15// Setting ComVisible to false makes the types in this assembly not visible
16// to COM components. If you need to access a type in this assembly from 16// to COM components. If you need to access a type in this assembly from
17// COM, set the ComVisible attribute to true on that type. 17// COM, set the ComVisible attribute to true on that type.
18[assembly: ComVisible(false)] 18[assembly: ComVisible(false)]
19 19
20// The following GUID is for the ID of the typelib if this project is exposed to COM 20// The following GUID is for the ID of the typelib if this project is exposed to COM
21[assembly: Guid("a8b2b39b-c83b-41e2-b0b5-7ccfc1fddae7")] 21[assembly: Guid("a8b2b39b-c83b-41e2-b0b5-7ccfc1fddae7")]
22 22
23// Version information for an assembly consists of the following four values: 23// Version information for an assembly consists of the following four values:
24// 24//
25// Major Version 25// Major Version
26// Minor Version 26// Minor Version
27// Build Number 27// Build Number
28// Revision 28// Revision
29// 29//
30// You can specify all the values or you can default the Revision and Build Numbers 30// You can specify all the values or you can default the Revision and Build Numbers
31// by using the '*' as shown below: 31// by using the '*' as shown below:
32[assembly: AssemblyVersion("1.0.0.0")] 32[assembly: AssemblyVersion("1.0.0.0")]
33[assembly: AssemblyFileVersion("1.0.0.0")] 33[assembly: AssemblyFileVersion("1.0.0.0")]