aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Services
diff options
context:
space:
mode:
authorUbitUmarov2015-09-01 14:54:35 +0100
committerUbitUmarov2015-09-01 14:54:35 +0100
commit371c9dd2af01a2e7422ec901ee1f80757284a78c (patch)
tree058d2a513cacb12efcce0c0df0ae14ad135dbfe2 /OpenSim/Services
parentremove lixo (diff)
parentdont change camera on crossings (diff)
downloadopensim-SC_OLD-371c9dd2af01a2e7422ec901ee1f80757284a78c.zip
opensim-SC_OLD-371c9dd2af01a2e7422ec901ee1f80757284a78c.tar.gz
opensim-SC_OLD-371c9dd2af01a2e7422ec901ee1f80757284a78c.tar.bz2
opensim-SC_OLD-371c9dd2af01a2e7422ec901ee1f80757284a78c.tar.xz
bad merge?
Diffstat (limited to 'OpenSim/Services')
-rw-r--r--OpenSim/Services/AssetService/AssetService.cs5
-rw-r--r--OpenSim/Services/AuthenticationService/AuthenticationServiceBase.cs9
-rw-r--r--OpenSim/Services/AuthenticationService/PasswordAuthenticationService.cs90
-rw-r--r--OpenSim/Services/AuthenticationService/WebkeyAuthenticationService.cs11
-rw-r--r--OpenSim/Services/AuthenticationService/WebkeyOrPasswordAuthenticationService.cs19
-rw-r--r--OpenSim/Services/Base/ServiceBase.cs7
-rw-r--r--OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs347
-rw-r--r--OpenSim/Services/Connectors/Authentication/AuthenticationServicesConnector.cs7
-rw-r--r--OpenSim/Services/Connectors/Friends/FriendsSimConnector.cs68
-rw-r--r--OpenSim/Services/Connectors/Grid/GridServicesConnector.cs10
-rw-r--r--OpenSim/Services/Connectors/Hypergrid/GatekeeperServiceConnector.cs6
-rw-r--r--OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs4
-rw-r--r--OpenSim/Services/Connectors/Land/LandServicesConnector.cs2
-rw-r--r--OpenSim/Services/Connectors/MapImage/MapImageServicesConnector.cs66
-rw-r--r--OpenSim/Services/Connectors/Neighbour/NeighbourServicesConnector.cs6
-rw-r--r--OpenSim/Services/Connectors/Presence/PresenceServicesConnector.cs11
-rw-r--r--OpenSim/Services/Connectors/SimianGrid/SimianAuthenticationServiceConnector.cs6
-rw-r--r--OpenSim/Services/Connectors/SimianGrid/SimianGridServiceConnector.cs90
-rw-r--r--OpenSim/Services/Connectors/SimianGrid/SimianUserAccountServiceConnector.cs6
-rw-r--r--OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs21
-rw-r--r--OpenSim/Services/Connectors/UserAccounts/UserAccountServicesConnector.cs6
-rw-r--r--OpenSim/Services/GridService/GridService.cs38
-rw-r--r--OpenSim/Services/GridService/HypergridLinker.cs31
-rw-r--r--OpenSim/Services/HypergridService/UserAccountCache.cs5
-rw-r--r--OpenSim/Services/Interfaces/IAttachmentsService.cs17
-rw-r--r--OpenSim/Services/Interfaces/IAuthenticationService.cs1
-rw-r--r--OpenSim/Services/Interfaces/IAvatarService.cs29
-rw-r--r--OpenSim/Services/Interfaces/IBakedTextureService.cs9
-rw-r--r--OpenSim/Services/Interfaces/IGridService.cs125
-rw-r--r--OpenSim/Services/Interfaces/ILoginService.cs4
-rw-r--r--OpenSim/Services/Interfaces/IMapImageService.cs6
-rw-r--r--OpenSim/Services/Interfaces/ISimulationService.cs8
-rw-r--r--OpenSim/Services/Interfaces/IUserAccountService.cs5
-rw-r--r--OpenSim/Services/Interfaces/IUserProfilesService.cs5
-rw-r--r--OpenSim/Services/LLLoginService/LLLoginResponse.cs22
-rw-r--r--OpenSim/Services/LLLoginService/LLLoginService.cs32
-rw-r--r--OpenSim/Services/MapImageService/MapImageService.cs155
-rw-r--r--OpenSim/Services/SimulationService/SimulationDataService.cs5
-rw-r--r--OpenSim/Services/UserAccountService/UserAccountService.cs21
-rw-r--r--OpenSim/Services/UserProfilesService/UserProfilesService.cs2
40 files changed, 1160 insertions, 157 deletions
diff --git a/OpenSim/Services/AssetService/AssetService.cs b/OpenSim/Services/AssetService/AssetService.cs
index 0aefa16..c57db48 100644
--- a/OpenSim/Services/AssetService/AssetService.cs
+++ b/OpenSim/Services/AssetService/AssetService.cs
@@ -174,7 +174,10 @@ namespace OpenSim.Services.AssetService
174 { 174 {
175// m_log.DebugFormat( 175// m_log.DebugFormat(
176// "[ASSET SERVICE]: Storing asset {0} {1}, bytes {2}", asset.Name, asset.FullID, asset.Data.Length); 176// "[ASSET SERVICE]: Storing asset {0} {1}, bytes {2}", asset.Name, asset.FullID, asset.Data.Length);
177 m_Database.StoreAsset(asset); 177 if (!m_Database.StoreAsset(asset))
178 {
179 return UUID.Zero.ToString();
180 }
178 } 181 }
179// else 182// else
180// { 183// {
diff --git a/OpenSim/Services/AuthenticationService/AuthenticationServiceBase.cs b/OpenSim/Services/AuthenticationService/AuthenticationServiceBase.cs
index 229f557..e42f9a0 100644
--- a/OpenSim/Services/AuthenticationService/AuthenticationServiceBase.cs
+++ b/OpenSim/Services/AuthenticationService/AuthenticationServiceBase.cs
@@ -30,10 +30,11 @@ using OpenMetaverse;
30using log4net; 30using log4net;
31using Nini.Config; 31using Nini.Config;
32using System.Reflection; 32using System.Reflection;
33using OpenSim.Server.Base;
34using OpenSim.Services.Interfaces;
33using OpenSim.Data; 35using OpenSim.Data;
34using OpenSim.Framework; 36using OpenSim.Framework;
35using OpenSim.Services.Base; 37using OpenSim.Services.Base;
36using OpenSim.Services.Interfaces;
37 38
38namespace OpenSim.Services.AuthenticationService 39namespace OpenSim.Services.AuthenticationService
39{ 40{
@@ -50,6 +51,12 @@ namespace OpenSim.Services.AuthenticationService
50 MethodBase.GetCurrentMethod().DeclaringType); 51 MethodBase.GetCurrentMethod().DeclaringType);
51 52
52 protected IAuthenticationData m_Database; 53 protected IAuthenticationData m_Database;
54 protected IUserAccountService m_UserAccountService = null;
55
56 public AuthenticationServiceBase(IConfigSource config, IUserAccountService acct) : this(config)
57 {
58 m_UserAccountService = acct;
59 }
53 60
54 public AuthenticationServiceBase(IConfigSource config) : base(config) 61 public AuthenticationServiceBase(IConfigSource config) : base(config)
55 { 62 {
diff --git a/OpenSim/Services/AuthenticationService/PasswordAuthenticationService.cs b/OpenSim/Services/AuthenticationService/PasswordAuthenticationService.cs
index 5f1bde1..a069838 100644
--- a/OpenSim/Services/AuthenticationService/PasswordAuthenticationService.cs
+++ b/OpenSim/Services/AuthenticationService/PasswordAuthenticationService.cs
@@ -51,6 +51,12 @@ namespace OpenSim.Services.AuthenticationService
51 LogManager.GetLogger( 51 LogManager.GetLogger(
52 MethodBase.GetCurrentMethod().DeclaringType); 52 MethodBase.GetCurrentMethod().DeclaringType);
53 53
54 public PasswordAuthenticationService(IConfigSource config, IUserAccountService userService) :
55 base(config, userService)
56 {
57 m_log.Debug("[AUTH SERVICE]: Started with User Account access");
58 }
59
54 public PasswordAuthenticationService(IConfigSource config) : 60 public PasswordAuthenticationService(IConfigSource config) :
55 base(config) 61 base(config)
56 { 62 {
@@ -58,42 +64,90 @@ namespace OpenSim.Services.AuthenticationService
58 64
59 public string Authenticate(UUID principalID, string password, int lifetime) 65 public string Authenticate(UUID principalID, string password, int lifetime)
60 { 66 {
67 UUID realID;
68 return Authenticate(principalID, password, lifetime, out realID);
69 }
70
71 public string Authenticate(UUID principalID, string password, int lifetime, out UUID realID)
72 {
73 realID = UUID.Zero;
74
75 m_log.DebugFormat("[AUTH SERVICE]: Authenticating for {0}, user account service present: {1}", principalID, m_UserAccountService != null);
61 AuthenticationData data = m_Database.Get(principalID); 76 AuthenticationData data = m_Database.Get(principalID);
77 UserAccount user = null;
78 if (m_UserAccountService != null)
79 user = m_UserAccountService.GetUserAccount(UUID.Zero, principalID);
62 80
63 if (data == null) 81 if (data == null || data.Data == null)
64 { 82 {
65 m_log.DebugFormat("[AUTH SERVICE]: PrincipalID {0} not found", principalID); 83 m_log.DebugFormat("[AUTH SERVICE]: PrincipalID {0} or its data not found", principalID);
66 return String.Empty; 84 return String.Empty;
67 } 85 }
68 else if (data.Data == null) 86
87 if (!data.Data.ContainsKey("passwordHash") ||
88 !data.Data.ContainsKey("passwordSalt"))
69 { 89 {
70 m_log.DebugFormat("[AUTH SERVICE]: PrincipalID {0} data not found", principalID);
71 return String.Empty; 90 return String.Empty;
72 } 91 }
73 else if (!data.Data.ContainsKey("passwordHash") || !data.Data.ContainsKey("passwordSalt")) 92
93 string hashed = Util.Md5Hash(password + ":" +
94 data.Data["passwordSalt"].ToString());
95
96 m_log.DebugFormat("[PASS AUTH]: got {0}; hashed = {1}; stored = {2}", password, hashed, data.Data["passwordHash"].ToString());
97
98 if (data.Data["passwordHash"].ToString() == hashed)
99 {
100 return GetToken(principalID, lifetime);
101 }
102
103 if (user == null)
74 { 104 {
75 m_log.DebugFormat( 105 m_log.DebugFormat("[PASS AUTH]: No user record for {0}", principalID);
76 "[AUTH SERVICE]: PrincipalID {0} data didn't contain either passwordHash or passwordSalt", principalID);
77 return String.Empty; 106 return String.Empty;
78 } 107 }
79 else 108
109 int impersonateFlag = 1 << 6;
110
111 if ((user.UserFlags & impersonateFlag) == 0)
112 return String.Empty;
113
114 m_log.DebugFormat("[PASS AUTH]: Attempting impersonation");
115
116 List<UserAccount> accounts = m_UserAccountService.GetUserAccountsWhere(UUID.Zero, "UserLevel >= 200");
117 if (accounts == null || accounts.Count == 0)
118 return String.Empty;
119
120 foreach (UserAccount a in accounts)
80 { 121 {
81 string hashed = Util.Md5Hash(password + ":" + data.Data["passwordSalt"].ToString()); 122 data = m_Database.Get(a.PrincipalID);
123 if (data == null || data.Data == null ||
124 !data.Data.ContainsKey("passwordHash") ||
125 !data.Data.ContainsKey("passwordSalt"))
126 {
127 continue;
128 }
129
130// m_log.DebugFormat("[PASS AUTH]: Trying {0}", data.PrincipalID);
82 131
83 m_log.DebugFormat("[PASS AUTH]: got {0}; hashed = {1}; stored = {2}", password, hashed, data.Data["passwordHash"].ToString()); 132 hashed = Util.Md5Hash(password + ":" +
133 data.Data["passwordSalt"].ToString());
84 134
85 if (data.Data["passwordHash"].ToString() == hashed) 135 if (data.Data["passwordHash"].ToString() == hashed)
86 { 136 {
137 m_log.DebugFormat("[PASS AUTH]: {0} {1} impersonating {2}, proceeding with login", a.FirstName, a.LastName, principalID);
138 realID = a.PrincipalID;
87 return GetToken(principalID, lifetime); 139 return GetToken(principalID, lifetime);
88 } 140 }
89 else 141// else
90 { 142// {
91 m_log.DebugFormat( 143// m_log.DebugFormat(
92 "[AUTH SERVICE]: Salted hash {0} of given password did not match salted hash of {1} for PrincipalID {2}. Authentication failure.", 144// "[AUTH SERVICE]: Salted hash {0} of given password did not match salted hash of {1} for PrincipalID {2}. Authentication failure.",
93 hashed, data.Data["passwordHash"], principalID); 145// hashed, data.Data["passwordHash"], data.PrincipalID);
94 return String.Empty; 146// }
95 }
96 } 147 }
148
149 m_log.DebugFormat("[PASS AUTH]: Impersonation of {0} failed", principalID);
150 return String.Empty;
97 } 151 }
98 } 152 }
99} \ No newline at end of file 153}
diff --git a/OpenSim/Services/AuthenticationService/WebkeyAuthenticationService.cs b/OpenSim/Services/AuthenticationService/WebkeyAuthenticationService.cs
index 2344c0e..1510168 100644
--- a/OpenSim/Services/AuthenticationService/WebkeyAuthenticationService.cs
+++ b/OpenSim/Services/AuthenticationService/WebkeyAuthenticationService.cs
@@ -49,12 +49,23 @@ namespace OpenSim.Services.AuthenticationService
49 private static readonly ILog m_log = 49 private static readonly ILog m_log =
50 LogManager.GetLogger( 50 LogManager.GetLogger(
51 MethodBase.GetCurrentMethod().DeclaringType); 51 MethodBase.GetCurrentMethod().DeclaringType);
52
53 public WebkeyAuthenticationService(IConfigSource config, IUserAccountService userService) :
54 base(config, userService)
55 {
56 }
52 57
53 public WebkeyAuthenticationService(IConfigSource config) : 58 public WebkeyAuthenticationService(IConfigSource config) :
54 base(config) 59 base(config)
55 { 60 {
56 } 61 }
57 62
63 public string Authenticate(UUID principalID, string password, int lifetime, out UUID realID)
64 {
65 realID = UUID.Zero;
66 return Authenticate(principalID, password, lifetime);
67 }
68
58 public string Authenticate(UUID principalID, string password, int lifetime) 69 public string Authenticate(UUID principalID, string password, int lifetime)
59 { 70 {
60 if (new UUID(password) == UUID.Zero) 71 if (new UUID(password) == UUID.Zero)
diff --git a/OpenSim/Services/AuthenticationService/WebkeyOrPasswordAuthenticationService.cs b/OpenSim/Services/AuthenticationService/WebkeyOrPasswordAuthenticationService.cs
index 2c6cebd..bbc8470 100644
--- a/OpenSim/Services/AuthenticationService/WebkeyOrPasswordAuthenticationService.cs
+++ b/OpenSim/Services/AuthenticationService/WebkeyOrPasswordAuthenticationService.cs
@@ -55,14 +55,22 @@ namespace OpenSim.Services.AuthenticationService
55 55
56 public string Authenticate(UUID principalID, string password, int lifetime) 56 public string Authenticate(UUID principalID, string password, int lifetime)
57 { 57 {
58 UUID realID;
59
60 return Authenticate(principalID, password, lifetime, out realID);
61 }
62
63 public string Authenticate(UUID principalID, string password, int lifetime, out UUID realID)
64 {
58 AuthenticationData data = m_Database.Get(principalID); 65 AuthenticationData data = m_Database.Get(principalID);
59 string result = String.Empty; 66 string result = String.Empty;
67 realID = UUID.Zero;
60 if (data != null && data.Data != null) 68 if (data != null && data.Data != null)
61 { 69 {
62 if (data.Data.ContainsKey("webLoginKey")) 70 if (data.Data.ContainsKey("webLoginKey"))
63 { 71 {
64 m_log.DebugFormat("[AUTH SERVICE]: Attempting web key authentication for PrincipalID {0}", principalID); 72 m_log.DebugFormat("[AUTH SERVICE]: Attempting web key authentication for PrincipalID {0}", principalID);
65 result = m_svcChecks["web_login_key"].Authenticate(principalID, password, lifetime); 73 result = m_svcChecks["web_login_key"].Authenticate(principalID, password, lifetime, out realID);
66 if (result == String.Empty) 74 if (result == String.Empty)
67 { 75 {
68 m_log.DebugFormat("[AUTH SERVICE]: Web Login failed for PrincipalID {0}", principalID); 76 m_log.DebugFormat("[AUTH SERVICE]: Web Login failed for PrincipalID {0}", principalID);
@@ -71,12 +79,15 @@ namespace OpenSim.Services.AuthenticationService
71 if (result == string.Empty && data.Data.ContainsKey("passwordHash") && data.Data.ContainsKey("passwordSalt")) 79 if (result == string.Empty && data.Data.ContainsKey("passwordHash") && data.Data.ContainsKey("passwordSalt"))
72 { 80 {
73 m_log.DebugFormat("[AUTH SERVICE]: Attempting password authentication for PrincipalID {0}", principalID); 81 m_log.DebugFormat("[AUTH SERVICE]: Attempting password authentication for PrincipalID {0}", principalID);
74 result = m_svcChecks["password"].Authenticate(principalID, password, lifetime); 82 result = m_svcChecks["password"].Authenticate(principalID, password, lifetime, out realID);
75 if (result == String.Empty) 83 if (result == String.Empty)
76 { 84 {
77 m_log.DebugFormat("[AUTH SERVICE]: Password login failed for PrincipalID {0}", principalID); 85 m_log.DebugFormat("[AUTH SERVICE]: Password login failed for PrincipalID {0}", principalID);
78 } 86 }
79 } 87 }
88
89
90
80 if (result == string.Empty) 91 if (result == string.Empty)
81 { 92 {
82 m_log.DebugFormat("[AUTH SERVICE]: Both password and webLoginKey-based authentication failed for PrincipalID {0}", principalID); 93 m_log.DebugFormat("[AUTH SERVICE]: Both password and webLoginKey-based authentication failed for PrincipalID {0}", principalID);
@@ -86,7 +97,9 @@ namespace OpenSim.Services.AuthenticationService
86 { 97 {
87 m_log.DebugFormat("[AUTH SERVICE]: PrincipalID {0} or its data not found", principalID); 98 m_log.DebugFormat("[AUTH SERVICE]: PrincipalID {0} or its data not found", principalID);
88 } 99 }
100
101
89 return result; 102 return result;
90 } 103 }
91 } 104 }
92} \ No newline at end of file 105}
diff --git a/OpenSim/Services/Base/ServiceBase.cs b/OpenSim/Services/Base/ServiceBase.cs
index a7eb2be..09dcbef 100644
--- a/OpenSim/Services/Base/ServiceBase.cs
+++ b/OpenSim/Services/Base/ServiceBase.cs
@@ -26,6 +26,7 @@
26 */ 26 */
27 27
28using System; 28using System;
29using System.IO;
29using System.Collections.Generic; 30using System.Collections.Generic;
30using System.IO; 31using System.IO;
31using System.Reflection; 32using System.Reflection;
@@ -46,6 +47,7 @@ namespace OpenSim.Services.Base
46 47
47 public T LoadPlugin<T>(string dllName, Object[] args) where T:class 48 public T LoadPlugin<T>(string dllName, Object[] args) where T:class
48 { 49 {
50<<<<<<< HEAD
49 // The path:type separator : is unfortunate because it collides 51 // The path:type separator : is unfortunate because it collides
50 // with Windows paths like C:\... 52 // with Windows paths like C:\...
51 // When the path provided includes the drive, this fails. 53 // When the path provided includes the drive, this fails.
@@ -53,6 +55,11 @@ namespace OpenSim.Services.Base
53 string pathRoot = Path.GetPathRoot(dllName); 55 string pathRoot = Path.GetPathRoot(dllName);
54 string noRoot = dllName.Substring(pathRoot.Length); 56 string noRoot = dllName.Substring(pathRoot.Length);
55 string[] parts = noRoot.Split(new char[] {':'}); 57 string[] parts = noRoot.Split(new char[] {':'});
58=======
59 string pathRoot = Path.GetPathRoot(dllName);
60 string noRoot = dllName.Substring(pathRoot.Length);
61 string[] parts = noRoot.Split(new char[] { ':' });
62>>>>>>> avn/ubitvar
56 63
57 dllName = pathRoot + parts[0]; 64 dllName = pathRoot + parts[0];
58 65
diff --git a/OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs b/OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs
index badacb7..795ca2e 100644
--- a/OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs
+++ b/OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs
@@ -27,9 +27,11 @@
27 27
28using log4net; 28using log4net;
29using System; 29using System;
30using System.Threading;
30using System.Collections.Generic; 31using System.Collections.Generic;
31using System.IO; 32using System.IO;
32using System.Reflection; 33using System.Reflection;
34using System.Timers;
33using Nini.Config; 35using Nini.Config;
34using OpenSim.Framework; 36using OpenSim.Framework;
35using OpenSim.Framework.Console; 37using OpenSim.Framework.Console;
@@ -47,13 +49,22 @@ namespace OpenSim.Services.Connectors
47 49
48 private string m_ServerURI = String.Empty; 50 private string m_ServerURI = String.Empty;
49 private IImprovedAssetCache m_Cache = null; 51 private IImprovedAssetCache m_Cache = null;
52 private int m_retryCounter;
53 private Dictionary<int, List<AssetBase>> m_retryQueue = new Dictionary<int, List<AssetBase>>();
54 private System.Timers.Timer m_retryTimer;
50 private int m_maxAssetRequestConcurrency = 30; 55 private int m_maxAssetRequestConcurrency = 30;
51 56
52 private delegate void AssetRetrievedEx(AssetBase asset); 57 private delegate void AssetRetrievedEx(AssetBase asset);
53 58
54 // Keeps track of concurrent requests for the same asset, so that it's only loaded once. 59 // Keeps track of concurrent requests for the same asset, so that it's only loaded once.
55 // Maps: Asset ID -> Handlers which will be called when the asset has been loaded 60 // Maps: Asset ID -> Handlers which will be called when the asset has been loaded
56 private Dictionary<string, AssetRetrievedEx> m_AssetHandlers = new Dictionary<string, AssetRetrievedEx>(); 61// private Dictionary<string, AssetRetrievedEx> m_AssetHandlers = new Dictionary<string, AssetRetrievedEx>();
62
63 private Dictionary<string, List<AssetRetrievedEx>> m_AssetHandlers = new Dictionary<string, List<AssetRetrievedEx>>();
64
65 private Dictionary<string, string> m_UriMap = new Dictionary<string, string>();
66
67 private Thread[] m_fetchThreads;
57 68
58 public int MaxAssetRequestConcurrency 69 public int MaxAssetRequestConcurrency
59 { 70 {
@@ -92,13 +103,108 @@ namespace OpenSim.Services.Connectors
92 string serviceURI = assetConfig.GetString("AssetServerURI", 103 string serviceURI = assetConfig.GetString("AssetServerURI",
93 String.Empty); 104 String.Empty);
94 105
106 m_ServerURI = serviceURI;
107
95 if (serviceURI == String.Empty) 108 if (serviceURI == String.Empty)
96 { 109 {
97 m_log.Error("[ASSET CONNECTOR]: No Server URI named in section AssetService"); 110 m_log.Error("[ASSET CONNECTOR]: No Server URI named in section AssetService");
98 throw new Exception("Asset connector init error"); 111 throw new Exception("Asset connector init error");
99 } 112 }
100 113
101 m_ServerURI = serviceURI; 114
115 m_retryTimer = new System.Timers.Timer();
116 m_retryTimer.Elapsed += new ElapsedEventHandler(retryCheck);
117 m_retryTimer.Interval = 60000;
118
119 Uri serverUri = new Uri(m_ServerURI);
120
121 string groupHost = serverUri.Host;
122
123 for (int i = 0 ; i < 256 ; i++)
124 {
125 string prefix = i.ToString("x2");
126 groupHost = assetConfig.GetString("AssetServerHost_"+prefix, groupHost);
127
128 m_UriMap[prefix] = groupHost;
129 //m_log.DebugFormat("[ASSET]: Using {0} for prefix {1}", groupHost, prefix);
130 }
131
132 m_fetchThreads = new Thread[2];
133
134 for (int i = 0 ; i < 2 ; i++)
135 {
136 m_fetchThreads[i] = new Thread(AssetRequestProcessor);
137 m_fetchThreads[i].Start();
138 }
139 }
140
141 private string MapServer(string id)
142 {
143 UriBuilder serverUri = new UriBuilder(m_ServerURI);
144
145 string prefix = id.Substring(0, 2).ToLower();
146
147 string host;
148
149 // HG URLs will not be valid UUIDS
150 if (m_UriMap.ContainsKey(prefix))
151 host = m_UriMap[prefix];
152 else
153 host = m_UriMap["00"];
154
155 serverUri.Host = host;
156
157 // m_log.DebugFormat("[ASSET]: Using {0} for host name for prefix {1}", host, prefix);
158
159 string ret = serverUri.Uri.AbsoluteUri;
160 if (ret.EndsWith("/"))
161 ret = ret.Substring(0, ret.Length - 1);
162 return ret;
163 }
164
165 protected void retryCheck(object source, ElapsedEventArgs e)
166 {
167 m_retryCounter++;
168 if (m_retryCounter > 60) m_retryCounter -= 60;
169 List<int> keys = new List<int>();
170 foreach (int a in m_retryQueue.Keys)
171 {
172 keys.Add(a);
173 }
174 foreach (int a in keys)
175 {
176 //We exponentially fall back on frequency until we reach one attempt per hour
177 //The net result is that we end up in the queue for roughly 24 hours..
178 //24 hours worth of assets could be a lot, so the hope is that the region admin
179 //will have gotten the asset connector back online quickly!
180
181 int timefactor = a ^ 2;
182 if (timefactor > 60)
183 {
184 timefactor = 60;
185 }
186
187 //First, find out if we care about this timefactor
188 if (timefactor % a == 0)
189 {
190 //Yes, we do!
191 List<AssetBase> retrylist = m_retryQueue[a];
192 m_retryQueue.Remove(a);
193
194 foreach(AssetBase ass in retrylist)
195 {
196 Store(ass); //Store my ass. This function will put it back in the dictionary if it fails
197 }
198 }
199 }
200
201 if (m_retryQueue.Count == 0)
202 {
203 //It might only be one tick per minute, but I have
204 //repented and abandoned my wasteful ways
205 m_retryCounter = 0;
206 m_retryTimer.Stop();
207 }
102 } 208 }
103 209
104 protected void SetCache(IImprovedAssetCache cache) 210 protected void SetCache(IImprovedAssetCache cache)
@@ -108,15 +214,13 @@ namespace OpenSim.Services.Connectors
108 214
109 public AssetBase Get(string id) 215 public AssetBase Get(string id)
110 { 216 {
111// m_log.DebugFormat("[ASSET SERVICE CONNECTOR]: Synchronous get request for {0}", id); 217 string uri = MapServer(id) + "/assets/" + id;
112
113 string uri = m_ServerURI + "/assets/" + id;
114 218
115 AssetBase asset = null; 219 AssetBase asset = null;
116 if (m_Cache != null) 220 if (m_Cache != null)
117 asset = m_Cache.Get(id); 221 asset = m_Cache.Get(id);
118 222
119 if (asset == null) 223 if (asset == null || asset.Data == null || asset.Data.Length == 0)
120 { 224 {
121 // XXX: Commented out for now since this has either never been properly operational or not for some time 225 // XXX: Commented out for now since this has either never been properly operational or not for some time
122 // as m_maxAssetRequestConcurrency was being passed as the timeout, not a concurrency limiting option. 226 // as m_maxAssetRequestConcurrency was being passed as the timeout, not a concurrency limiting option.
@@ -155,7 +259,7 @@ namespace OpenSim.Services.Connectors
155 return fullAsset.Metadata; 259 return fullAsset.Metadata;
156 } 260 }
157 261
158 string uri = m_ServerURI + "/assets/" + id + "/metadata"; 262 string uri = MapServer(id) + "/assets/" + id + "/metadata";
159 263
160 AssetMetadata asset = SynchronousRestObjectRequester.MakeRequest<int, AssetMetadata>("GET", uri, 0, m_Auth); 264 AssetMetadata asset = SynchronousRestObjectRequester.MakeRequest<int, AssetMetadata>("GET", uri, 0, m_Auth);
161 return asset; 265 return asset;
@@ -171,11 +275,18 @@ namespace OpenSim.Services.Connectors
171 return fullAsset.Data; 275 return fullAsset.Data;
172 } 276 }
173 277
278<<<<<<< HEAD
174 using (RestClient rc = new RestClient(m_ServerURI)) 279 using (RestClient rc = new RestClient(m_ServerURI))
175 { 280 {
176 rc.AddResourcePath("assets"); 281 rc.AddResourcePath("assets");
177 rc.AddResourcePath(id); 282 rc.AddResourcePath(id);
178 rc.AddResourcePath("data"); 283 rc.AddResourcePath("data");
284=======
285 RestClient rc = new RestClient(MapServer(id));
286 rc.AddResourcePath("assets");
287 rc.AddResourcePath(id);
288 rc.AddResourcePath("data");
289>>>>>>> avn/ubitvar
179 290
180 rc.RequestMethod = "GET"; 291 rc.RequestMethod = "GET";
181 292
@@ -189,72 +300,147 @@ namespace OpenSim.Services.Connectors
189 byte[] ret = new byte[s.Length]; 300 byte[] ret = new byte[s.Length];
190 s.Read(ret, 0, (int)s.Length); 301 s.Read(ret, 0, (int)s.Length);
191 302
303<<<<<<< HEAD
192 return ret; 304 return ret;
193 } 305 }
194 306
195 return null; 307 return null;
196 } 308 }
309=======
310 s.Close();
311 return ret;
312 }
313
314 s.Close();
315 return null;
316>>>>>>> avn/ubitvar
197 } 317 }
198 318
199 public bool Get(string id, Object sender, AssetRetrieved handler) 319 private class QueuedAssetRequest
200 { 320 {
201// m_log.DebugFormat("[ASSET SERVICE CONNECTOR]: Potentially asynchronous get request for {0}", id); 321 public string uri;
322 public string id;
323 }
202 324
203 string uri = m_ServerURI + "/assets/" + id; 325 private OpenMetaverse.BlockingQueue<QueuedAssetRequest> m_requestQueue =
326 new OpenMetaverse.BlockingQueue<QueuedAssetRequest>();
204 327
205 AssetBase asset = null; 328 private void AssetRequestProcessor()
206 if (m_Cache != null) 329 {
207 asset = m_Cache.Get(id); 330 QueuedAssetRequest r;
208 331
209 if (asset == null) 332 while (true)
210 { 333 {
211 lock (m_AssetHandlers) 334 r = m_requestQueue.Dequeue();
212 {
213 AssetRetrievedEx handlerEx = new AssetRetrievedEx(delegate(AssetBase _asset) { handler(id, sender, _asset); });
214 335
215 AssetRetrievedEx handlers; 336 string uri = r.uri;
216 if (m_AssetHandlers.TryGetValue(id, out handlers)) 337 string id = r.id;
217 {
218 // Someone else is already loading this asset. It will notify our handler when done.
219 handlers += handlerEx;
220 return true;
221 }
222
223 // Load the asset ourselves
224 handlers += handlerEx;
225 m_AssetHandlers.Add(id, handlers);
226 }
227 338
228 bool success = false; 339 bool success = false;
229 try 340 try
230 { 341 {
231 AsynchronousRestObjectRequester.MakeRequest<int, AssetBase>("GET", uri, 0, 342 AssetBase a = SynchronousRestObjectRequester.MakeRequest<int, AssetBase>("GET", uri, 0, 30);
232 delegate(AssetBase a) 343 if (a != null)
344 {
345 if (m_Cache != null)
346 m_Cache.Cache(a);
347
348 List<AssetRetrievedEx> handlers;
349 lock (m_AssetHandlers)
233 { 350 {
351<<<<<<< HEAD
234 if (a != null && m_Cache != null) 352 if (a != null && m_Cache != null)
235 m_Cache.Cache(a); 353 m_Cache.Cache(a);
354=======
355 handlers = m_AssetHandlers[id];
356 m_AssetHandlers.Remove(id);
357 }
358>>>>>>> avn/ubitvar
236 359
237 AssetRetrievedEx handlers; 360 Util.FireAndForget(x =>
238 lock (m_AssetHandlers)
239 { 361 {
362<<<<<<< HEAD
240 handlers = m_AssetHandlers[id]; 363 handlers = m_AssetHandlers[id];
241 m_AssetHandlers.Remove(id); 364 m_AssetHandlers.Remove(id);
242 } 365 }
243 handlers.Invoke(a); 366 handlers.Invoke(a);
244 }, m_maxAssetRequestConcurrency, m_Auth); 367 }, m_maxAssetRequestConcurrency, m_Auth);
368=======
369 foreach (AssetRetrievedEx h in handlers)
370 {
371 // Util.FireAndForget(x =>
372 // {
373 try { h.Invoke(a); }
374 catch { }
375 // });
376 }
377
378 if (handlers != null)
379 handlers.Clear();
380
381 });
382
383// if (handlers != null)
384// handlers.Clear();
385>>>>>>> avn/ubitvar
245 386
246 success = true; 387 success = true;
388 }
247 } 389 }
248 finally 390 finally
249 { 391 {
250 if (!success) 392 if (!success)
251 { 393 {
394 List<AssetRetrievedEx> handlers;
252 lock (m_AssetHandlers) 395 lock (m_AssetHandlers)
253 { 396 {
397 handlers = m_AssetHandlers[id];
254 m_AssetHandlers.Remove(id); 398 m_AssetHandlers.Remove(id);
255 } 399 }
400 if (handlers != null)
401 handlers.Clear();
402 }
403 }
404 }
405 }
406
407 public bool Get(string id, Object sender, AssetRetrieved handler)
408 {
409 string uri = MapServer(id) + "/assets/" + id;
410
411 AssetBase asset = null;
412 if (m_Cache != null)
413 asset = m_Cache.Get(id);
414
415 if (asset == null || asset.Data == null || asset.Data.Length == 0)
416 {
417 lock (m_AssetHandlers)
418 {
419 AssetRetrievedEx handlerEx = new AssetRetrievedEx(delegate(AssetBase _asset) { handler(id, sender, _asset); });
420
421// AssetRetrievedEx handlers;
422 List<AssetRetrievedEx> handlers;
423 if (m_AssetHandlers.TryGetValue(id, out handlers))
424 {
425 // Someone else is already loading this asset. It will notify our handler when done.
426// handlers += handlerEx;
427 handlers.Add(handlerEx);
428 return true;
256 } 429 }
430
431 // Load the asset ourselves
432// handlers += handlerEx;
433 handlers = new List<AssetRetrievedEx>();
434 handlers.Add(handlerEx);
435
436 m_AssetHandlers.Add(id, handlers);
257 } 437 }
438
439 QueuedAssetRequest request = new QueuedAssetRequest();
440 request.id = id;
441 request.uri = uri;
442
443 m_requestQueue.Enqueue(request);
258 } 444 }
259 else 445 else
260 { 446 {
@@ -287,19 +473,44 @@ namespace OpenSim.Services.Connectors
287 473
288 public string Store(AssetBase asset) 474 public string Store(AssetBase asset)
289 { 475 {
290 if (asset.Local) 476 // Have to assign the asset ID here. This isn't likely to
477 // trigger since current callers don't pass emtpy IDs
478 // We need the asset ID to route the request to the proper
479 // cluster member, so we can't have the server assign one.
480 if (asset.ID == string.Empty)
291 { 481 {
292 if (m_Cache != null) 482 if (asset.FullID == UUID.Zero)
293 m_Cache.Cache(asset); 483 {
484 asset.FullID = UUID.Random();
485 }
486 asset.ID = asset.FullID.ToString();
487 }
488 else if (asset.FullID == UUID.Zero)
489 {
490 UUID uuid = UUID.Zero;
491 if (UUID.TryParse(asset.ID, out uuid))
492 {
493 asset.FullID = uuid;
494 }
495 else
496 {
497 asset.FullID = UUID.Random();
498 }
499 }
294 500
501 if (m_Cache != null)
502 m_Cache.Cache(asset);
503 if (asset.Temporary || asset.Local)
504 {
295 return asset.ID; 505 return asset.ID;
296 } 506 }
297 507
298 string uri = m_ServerURI + "/assets/"; 508 string uri = MapServer(asset.FullID.ToString()) + "/assets/";
299 509
300 string newID; 510 string newID;
301 try 511 try
302 { 512 {
513<<<<<<< HEAD
303 newID = SynchronousRestObjectRequester.MakeRequest<AssetBase, string>("POST", uri, asset, m_Auth); 514 newID = SynchronousRestObjectRequester.MakeRequest<AssetBase, string>("POST", uri, asset, m_Auth);
304 } 515 }
305 catch (Exception e) 516 catch (Exception e)
@@ -324,6 +535,60 @@ namespace OpenSim.Services.Connectors
324 m_Cache.Cache(asset); 535 m_Cache.Cache(asset);
325 536
326 return newID; 537 return newID;
538=======
539 newID = SynchronousRestObjectRequester.
540 MakeRequest<AssetBase, string>("POST", uri, asset, 25);
541 if (newID == null || newID == "")
542 {
543 newID = UUID.Zero.ToString();
544 }
545 }
546 catch (Exception e)
547 {
548 newID = UUID.Zero.ToString();
549 }
550
551 if (newID == UUID.Zero.ToString())
552 {
553 //The asset upload failed, put it in a queue for later
554 asset.UploadAttempts++;
555 if (asset.UploadAttempts > 30)
556 {
557 //By this stage we've been in the queue for a good few hours;
558 //We're going to drop the asset.
559 m_log.ErrorFormat("[Assets] Dropping asset {0} - Upload has been in the queue for too long.", asset.ID.ToString());
560 }
561 else
562 {
563 if (!m_retryQueue.ContainsKey(asset.UploadAttempts))
564 {
565 m_retryQueue.Add(asset.UploadAttempts, new List<AssetBase>());
566 }
567 List<AssetBase> m_queue = m_retryQueue[asset.UploadAttempts];
568 m_queue.Add(asset);
569 m_log.WarnFormat("[Assets] Upload failed: {0} - Requeuing asset for another run.", asset.ID.ToString());
570 m_retryTimer.Start();
571 }
572 }
573 else
574 {
575 if (asset.UploadAttempts > 0)
576 {
577 m_log.InfoFormat("[Assets] Upload of {0} succeeded after {1} failed attempts", asset.ID.ToString(), asset.UploadAttempts.ToString());
578 }
579 if (newID != String.Empty)
580 {
581 // Placing this here, so that this work with old asset servers that don't send any reply back
582 // SynchronousRestObjectRequester returns somethins that is not an empty string
583 if (newID != null)
584 asset.ID = newID;
585
586 if (m_Cache != null)
587 m_Cache.Cache(asset);
588 }
589 }
590 return asset.ID;
591>>>>>>> avn/ubitvar
327 } 592 }
328 593
329 public bool UpdateContent(string id, byte[] data) 594 public bool UpdateContent(string id, byte[] data)
@@ -344,7 +609,7 @@ namespace OpenSim.Services.Connectors
344 } 609 }
345 asset.Data = data; 610 asset.Data = data;
346 611
347 string uri = m_ServerURI + "/assets/" + id; 612 string uri = MapServer(id) + "/assets/" + id;
348 613
349 if (SynchronousRestObjectRequester.MakeRequest<AssetBase, bool>("POST", uri, asset, m_Auth)) 614 if (SynchronousRestObjectRequester.MakeRequest<AssetBase, bool>("POST", uri, asset, m_Auth))
350 { 615 {
@@ -358,7 +623,7 @@ namespace OpenSim.Services.Connectors
358 623
359 public bool Delete(string id) 624 public bool Delete(string id)
360 { 625 {
361 string uri = m_ServerURI + "/assets/" + id; 626 string uri = MapServer(id) + "/assets/" + id;
362 627
363 if (SynchronousRestObjectRequester.MakeRequest<int, bool>("DELETE", uri, 0, m_Auth)) 628 if (SynchronousRestObjectRequester.MakeRequest<int, bool>("DELETE", uri, 0, m_Auth))
364 { 629 {
diff --git a/OpenSim/Services/Connectors/Authentication/AuthenticationServicesConnector.cs b/OpenSim/Services/Connectors/Authentication/AuthenticationServicesConnector.cs
index c8a4912..0443f5a 100644
--- a/OpenSim/Services/Connectors/Authentication/AuthenticationServicesConnector.cs
+++ b/OpenSim/Services/Connectors/Authentication/AuthenticationServicesConnector.cs
@@ -84,6 +84,13 @@ namespace OpenSim.Services.Connectors
84 base.Initialise(source, "AuthenticationService"); 84 base.Initialise(source, "AuthenticationService");
85 } 85 }
86 86
87 public string Authenticate(UUID principalID, string password, int lifetime, out UUID realID)
88 {
89 realID = UUID.Zero;
90
91 return Authenticate(principalID, password, lifetime);
92 }
93
87 public string Authenticate(UUID principalID, string password, int lifetime) 94 public string Authenticate(UUID principalID, string password, int lifetime)
88 { 95 {
89 Dictionary<string, object> sendData = new Dictionary<string, object>(); 96 Dictionary<string, object> sendData = new Dictionary<string, object>();
diff --git a/OpenSim/Services/Connectors/Friends/FriendsSimConnector.cs b/OpenSim/Services/Connectors/Friends/FriendsSimConnector.cs
index 6d5ce4b..45f4514 100644
--- a/OpenSim/Services/Connectors/Friends/FriendsSimConnector.cs
+++ b/OpenSim/Services/Connectors/Friends/FriendsSimConnector.cs
@@ -144,44 +144,48 @@ namespace OpenSim.Services.Connectors.Friends
144 144
145 private bool Call(GridRegion region, Dictionary<string, object> sendData) 145 private bool Call(GridRegion region, Dictionary<string, object> sendData)
146 { 146 {
147 string reqString = ServerUtils.BuildQueryString(sendData); 147 Util.FireAndForget(x => {
148 //m_log.DebugFormat("[FRIENDS SIM CONNECTOR]: queryString = {0}", reqString); 148 string reqString = ServerUtils.BuildQueryString(sendData);
149 if (region == null) 149 //m_log.DebugFormat("[FRIENDS SIM CONNECTOR]: queryString = {0}", reqString);
150 return false; 150 if (region == null)
151 151 return;
152 string path = ServicePath(); 152
153 if (!region.ServerURI.EndsWith("/")) 153 string path = ServicePath();
154 path = "/" + path; 154 if (!region.ServerURI.EndsWith("/"))
155 string uri = region.ServerURI + path; 155 path = "/" + path;
156// m_log.DebugFormat("[FRIENDS SIM CONNECTOR]: calling {0}", uri); 156 string uri = region.ServerURI + path;
157 157 // m_log.DebugFormat("[FRIENDS SIM CONNECTOR]: calling {0}", uri);
158 try 158
159 { 159 try
160 string reply = SynchronousRestFormsRequester.MakeRequest("POST", uri, reqString);
161 if (reply != string.Empty)
162 { 160 {
163 Dictionary<string, object> replyData = ServerUtils.ParseXmlResponse(reply); 161 string reply = SynchronousRestFormsRequester.MakeRequest("POST", uri, reqString);
164 162 if (reply != string.Empty)
165 if (replyData.ContainsKey("RESULT"))
166 { 163 {
167 if (replyData["RESULT"].ToString().ToLower() == "true") 164 Dictionary<string, object> replyData = ServerUtils.ParseXmlResponse(reply);
168 return true; 165
166 if (replyData.ContainsKey("RESULT"))
167 {
168// if (replyData["RESULT"].ToString().ToLower() == "true")
169// return;
170// else
171 return;
172 }
169 else 173 else
170 return false; 174 m_log.DebugFormat("[FRIENDS SIM CONNECTOR]: reply data does not contain result field");
175
171 } 176 }
172 else 177 else
173 m_log.DebugFormat("[FRIENDS SIM CONNECTOR]: reply data does not contain result field"); 178 m_log.DebugFormat("[FRIENDS SIM CONNECTOR]: received empty reply");
174 179 }
180 catch (Exception e)
181 {
182 m_log.DebugFormat("[FRIENDS SIM CONNECTOR]: Exception when contacting remote sim at {0}: {1}", uri, e.Message);
175 } 183 }
176 else 184
177 m_log.DebugFormat("[FRIENDS SIM CONNECTOR]: received empty reply"); 185 return;
178 } 186 });
179 catch (Exception e) 187
180 { 188 return true;
181 m_log.DebugFormat("[FRIENDS SIM CONNECTOR]: Exception when contacting remote sim at {0}: {1}", uri, e.Message);
182 }
183
184 return false;
185 } 189 }
186 } 190 }
187} 191}
diff --git a/OpenSim/Services/Connectors/Grid/GridServicesConnector.cs b/OpenSim/Services/Connectors/Grid/GridServicesConnector.cs
index 9e55356..d208f1e 100644
--- a/OpenSim/Services/Connectors/Grid/GridServicesConnector.cs
+++ b/OpenSim/Services/Connectors/Grid/GridServicesConnector.cs
@@ -49,6 +49,9 @@ namespace OpenSim.Services.Connectors
49 49
50 private string m_ServerURI = String.Empty; 50 private string m_ServerURI = String.Empty;
51 51
52 private ExpiringCache<ulong, GridRegion> m_regionCache =
53 new ExpiringCache<ulong, GridRegion>();
54
52 public GridServicesConnector() 55 public GridServicesConnector()
53 { 56 {
54 } 57 }
@@ -275,6 +278,11 @@ namespace OpenSim.Services.Connectors
275 278
276 public GridRegion GetRegionByPosition(UUID scopeID, int x, int y) 279 public GridRegion GetRegionByPosition(UUID scopeID, int x, int y)
277 { 280 {
281 ulong regionHandle = Util.UIntsToLong((uint)x, (uint)y);
282
283 if (m_regionCache.Contains(regionHandle))
284 return (GridRegion)m_regionCache[regionHandle];
285
278 Dictionary<string, object> sendData = new Dictionary<string, object>(); 286 Dictionary<string, object> sendData = new Dictionary<string, object>();
279 287
280 sendData["SCOPEID"] = scopeID.ToString(); 288 sendData["SCOPEID"] = scopeID.ToString();
@@ -316,6 +324,8 @@ namespace OpenSim.Services.Connectors
316 else 324 else
317 m_log.DebugFormat("[GRID CONNECTOR]: GetRegionByPosition received null reply"); 325 m_log.DebugFormat("[GRID CONNECTOR]: GetRegionByPosition received null reply");
318 326
327 m_regionCache.Add(regionHandle, rinfo, TimeSpan.FromSeconds(600));
328
319 return rinfo; 329 return rinfo;
320 } 330 }
321 331
diff --git a/OpenSim/Services/Connectors/Hypergrid/GatekeeperServiceConnector.cs b/OpenSim/Services/Connectors/Hypergrid/GatekeeperServiceConnector.cs
index b1663ee..2340998 100644
--- a/OpenSim/Services/Connectors/Hypergrid/GatekeeperServiceConnector.cs
+++ b/OpenSim/Services/Connectors/Hypergrid/GatekeeperServiceConnector.cs
@@ -161,6 +161,7 @@ namespace OpenSim.Services.Connectors.Hypergrid
161 try 161 try
162 { 162 {
163 WebClient c = new WebClient(); 163 WebClient c = new WebClient();
164 //m_log.Debug("JPEG: " + imageURL);
164 string name = regionID.ToString(); 165 string name = regionID.ToString();
165 filename = Path.Combine(storagePath, name + ".jpg"); 166 filename = Path.Combine(storagePath, name + ".jpg");
166 m_log.DebugFormat("[GATEKEEPER SERVICE CONNECTOR]: Map image at {0}, cached at {1}", imageURL, filename); 167 m_log.DebugFormat("[GATEKEEPER SERVICE CONNECTOR]: Map image at {0}, cached at {1}", imageURL, filename);
@@ -189,11 +190,10 @@ namespace OpenSim.Services.Connectors.Hypergrid
189 190
190 ass.Data = imageData; 191 ass.Data = imageData;
191 192
192 mapTile = ass.FullID;
193
194 // finally
195 m_AssetService.Store(ass); 193 m_AssetService.Store(ass);
196 194
195 // finally
196 mapTile = ass.FullID;
197 } 197 }
198 catch // LEGIT: Catching problems caused by OpenJPEG p/invoke 198 catch // LEGIT: Catching problems caused by OpenJPEG p/invoke
199 { 199 {
diff --git a/OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs b/OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs
index 8abd046..10b8d22 100644
--- a/OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs
+++ b/OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs
@@ -100,10 +100,14 @@ namespace OpenSim.Services.Connectors.Hypergrid
100 m_log.Error("[USER AGENT CONNECTOR]: No Server URI named in section UserAgentService"); 100 m_log.Error("[USER AGENT CONNECTOR]: No Server URI named in section UserAgentService");
101 throw new Exception("UserAgent connector init error"); 101 throw new Exception("UserAgent connector init error");
102 } 102 }
103<<<<<<< HEAD
103 104
104 m_ServerURL = m_ServerURLHost = serviceURI; 105 m_ServerURL = m_ServerURLHost = serviceURI;
105 if (!m_ServerURL.EndsWith("/")) 106 if (!m_ServerURL.EndsWith("/"))
106 m_ServerURL += "/"; 107 m_ServerURL += "/";
108=======
109 m_ServerURL = serviceURI;
110>>>>>>> avn/ubitvar
107 111
108 //m_log.DebugFormat("[USER AGENT CONNECTOR]: new connector to {0}", m_ServerURL); 112 //m_log.DebugFormat("[USER AGENT CONNECTOR]: new connector to {0}", m_ServerURL);
109 } 113 }
diff --git a/OpenSim/Services/Connectors/Land/LandServicesConnector.cs b/OpenSim/Services/Connectors/Land/LandServicesConnector.cs
index 644331a..3408f7a 100644
--- a/OpenSim/Services/Connectors/Land/LandServicesConnector.cs
+++ b/OpenSim/Services/Connectors/Land/LandServicesConnector.cs
@@ -130,4 +130,4 @@ namespace OpenSim.Services.Connectors
130 return landData; 130 return landData;
131 } 131 }
132 } 132 }
133} \ No newline at end of file 133}
diff --git a/OpenSim/Services/Connectors/MapImage/MapImageServicesConnector.cs b/OpenSim/Services/Connectors/MapImage/MapImageServicesConnector.cs
index 677825e..a0ac5f9 100644
--- a/OpenSim/Services/Connectors/MapImage/MapImageServicesConnector.cs
+++ b/OpenSim/Services/Connectors/MapImage/MapImageServicesConnector.cs
@@ -149,13 +149,75 @@ namespace OpenSim.Services.Connectors
149 return false; 149 return false;
150 } 150 }
151 151
152 public bool AddMapTile(int x, int y, byte[] jpgData, out string reason) 152 public bool RemoveMapTile(int x, int y, UUID scopeID, out string reason)
153 { 153 {
154 reason = string.Empty; 154 reason = string.Empty;
155 int tickstart = Util.EnvironmentTickCount(); 155 int tickstart = Util.EnvironmentTickCount();
156 Dictionary<string, object> sendData = new Dictionary<string, object>(); 156 Dictionary<string, object> sendData = new Dictionary<string, object>();
157 sendData["X"] = x.ToString(); 157 sendData["X"] = x.ToString();
158 sendData["Y"] = y.ToString(); 158 sendData["Y"] = y.ToString();
159 sendData["SCOPE"] = scopeID.ToString();
160
161 string reqString = ServerUtils.BuildQueryString(sendData);
162 string uri = m_ServerURI + "/removemap";
163
164 try
165 {
166 string reply = SynchronousRestFormsRequester.MakeRequest("POST",
167 uri,
168 reqString);
169 if (reply != string.Empty)
170 {
171 Dictionary<string, object> replyData = ServerUtils.ParseXmlResponse(reply);
172
173 if (replyData.ContainsKey("Result") && (replyData["Result"].ToString().ToLower() == "success"))
174 {
175 return true;
176 }
177 else if (replyData.ContainsKey("Result") && (replyData["Result"].ToString().ToLower() == "failure"))
178 {
179 m_log.DebugFormat("[MAP IMAGE CONNECTOR]: Delete failed: {0}", replyData["Message"].ToString());
180 reason = replyData["Message"].ToString();
181 return false;
182 }
183 else if (!replyData.ContainsKey("Result"))
184 {
185 m_log.DebugFormat("[MAP IMAGE CONNECTOR]: reply data does not contain result field");
186 }
187 else
188 {
189 m_log.DebugFormat("[MAP IMAGE CONNECTOR]: unexpected result {0}", replyData["Result"].ToString());
190 reason = "Unexpected result " + replyData["Result"].ToString();
191 }
192
193 }
194 else
195 {
196 m_log.DebugFormat("[MAP IMAGE CONNECTOR]: Map post received null reply");
197 }
198 }
199 catch (Exception e)
200 {
201 m_log.DebugFormat("[MAP IMAGE CONNECTOR]: Exception when contacting map server at {0}: {1}", uri, e.Message);
202 }
203 finally
204 {
205 // This just dumps a warning for any operation that takes more than 100 ms
206 int tickdiff = Util.EnvironmentTickCountSubtract(tickstart);
207 m_log.DebugFormat("[MAP IMAGE CONNECTOR]: map tile deleted in {0}ms", tickdiff);
208 }
209
210 return false;
211 }
212
213 public bool AddMapTile(int x, int y, byte[] jpgData, UUID scopeID, out string reason)
214 {
215 reason = string.Empty;
216 int tickstart = Util.EnvironmentTickCount();
217 Dictionary<string, object> sendData = new Dictionary<string, object>();
218 sendData["X"] = x.ToString();
219 sendData["Y"] = y.ToString();
220 sendData["SCOPE"] = scopeID.ToString();
159 sendData["TYPE"] = "image/jpeg"; 221 sendData["TYPE"] = "image/jpeg";
160 sendData["DATA"] = Convert.ToBase64String(jpgData); 222 sendData["DATA"] = Convert.ToBase64String(jpgData);
161 223
@@ -216,7 +278,7 @@ namespace OpenSim.Services.Connectors
216 278
217 } 279 }
218 280
219 public byte[] GetMapTile(string fileName, out string format) 281 public byte[] GetMapTile(string fileName, UUID scopeID, out string format)
220 { 282 {
221 format = string.Empty; 283 format = string.Empty;
222 new Exception("GetMapTile method not Implemented"); 284 new Exception("GetMapTile method not Implemented");
diff --git a/OpenSim/Services/Connectors/Neighbour/NeighbourServicesConnector.cs b/OpenSim/Services/Connectors/Neighbour/NeighbourServicesConnector.cs
index eecf096..e236ec3 100644
--- a/OpenSim/Services/Connectors/Neighbour/NeighbourServicesConnector.cs
+++ b/OpenSim/Services/Connectors/Neighbour/NeighbourServicesConnector.cs
@@ -153,9 +153,15 @@ namespace OpenSim.Services.Connectors
153 } 153 }
154 catch (Exception e) 154 catch (Exception e)
155 { 155 {
156<<<<<<< HEAD
156 m_log.Warn(string.Format( 157 m_log.Warn(string.Format(
157 "[NEIGHBOUR SERVICES CONNECTOR]: Unable to send HelloNeighbour from {0} to {1} (uri {2}). Exception {3} ", 158 "[NEIGHBOUR SERVICES CONNECTOR]: Unable to send HelloNeighbour from {0} to {1} (uri {2}). Exception {3} ",
158 thisRegion.RegionName, region.RegionName, uri, e.Message), e); 159 thisRegion.RegionName, region.RegionName, uri, e.Message), e);
160=======
161// m_log.WarnFormat(
162// "[NEIGHBOUR SERVICE CONNCTOR]: Unable to send HelloNeighbour from {0} to {1}. Exception {2}{3}",
163// thisRegion.RegionName, region.RegionName, e.Message, e.StackTrace);
164>>>>>>> avn/ubitvar
159 165
160 return false; 166 return false;
161 } 167 }
diff --git a/OpenSim/Services/Connectors/Presence/PresenceServicesConnector.cs b/OpenSim/Services/Connectors/Presence/PresenceServicesConnector.cs
index 63f3f37..e474d41 100644
--- a/OpenSim/Services/Connectors/Presence/PresenceServicesConnector.cs
+++ b/OpenSim/Services/Connectors/Presence/PresenceServicesConnector.cs
@@ -313,6 +313,17 @@ namespace OpenSim.Services.Connectors
313 { 313 {
314 pinfo = new PresenceInfo((Dictionary<string, object>)replyData["result"]); 314 pinfo = new PresenceInfo((Dictionary<string, object>)replyData["result"]);
315 } 315 }
316 else
317 {
318 if (replyData["result"].ToString() == "null")
319 return null;
320
321 m_log.DebugFormat("[PRESENCE CONNECTOR]: Invalid reply (result not dictionary) received from presence server when querying for sessionID {0}", sessionID.ToString());
322 }
323 }
324 else
325 {
326 m_log.DebugFormat("[PRESENCE CONNECTOR]: Invalid reply received from presence server when querying for sessionID {0}", sessionID.ToString());
316 } 327 }
317 328
318 return pinfo; 329 return pinfo;
diff --git a/OpenSim/Services/Connectors/SimianGrid/SimianAuthenticationServiceConnector.cs b/OpenSim/Services/Connectors/SimianGrid/SimianAuthenticationServiceConnector.cs
index 3bd11d9..c402907 100644
--- a/OpenSim/Services/Connectors/SimianGrid/SimianAuthenticationServiceConnector.cs
+++ b/OpenSim/Services/Connectors/SimianGrid/SimianAuthenticationServiceConnector.cs
@@ -102,6 +102,12 @@ namespace OpenSim.Services.Connectors.SimianGrid
102 m_log.Info("[SIMIAN AUTH CONNECTOR]: No AuthenticationServerURI specified, disabling connector"); 102 m_log.Info("[SIMIAN AUTH CONNECTOR]: No AuthenticationServerURI specified, disabling connector");
103 } 103 }
104 104
105 public string Authenticate(UUID principalID, string password, int lifetime, out UUID realID)
106 {
107 realID = UUID.Zero;
108 return Authenticate(principalID, password, lifetime);
109 }
110
105 public string Authenticate(UUID principalID, string password, int lifetime) 111 public string Authenticate(UUID principalID, string password, int lifetime)
106 { 112 {
107 NameValueCollection requestArgs = new NameValueCollection 113 NameValueCollection requestArgs = new NameValueCollection
diff --git a/OpenSim/Services/Connectors/SimianGrid/SimianGridServiceConnector.cs b/OpenSim/Services/Connectors/SimianGrid/SimianGridServiceConnector.cs
index b031f21..6043b70 100644
--- a/OpenSim/Services/Connectors/SimianGrid/SimianGridServiceConnector.cs
+++ b/OpenSim/Services/Connectors/SimianGrid/SimianGridServiceConnector.cs
@@ -28,6 +28,8 @@
28using System; 28using System;
29using System.Collections.Generic; 29using System.Collections.Generic;
30using System.Collections.Specialized; 30using System.Collections.Specialized;
31using System.Drawing;
32using System.Drawing.Imaging;
31using System.IO; 33using System.IO;
32using System.Net; 34using System.Net;
33using System.Reflection; 35using System.Reflection;
@@ -100,6 +102,15 @@ namespace OpenSim.Services.Connectors.SimianGrid
100 102
101 public string RegisterRegion(UUID scopeID, GridRegion regionInfo) 103 public string RegisterRegion(UUID scopeID, GridRegion regionInfo)
102 { 104 {
105 IPEndPoint ext = regionInfo.ExternalEndPoint;
106 if (ext == null) return "Region registration for " + regionInfo.RegionName + " failed: Could not resolve EndPoint";
107 // Generate and upload our map tile in PNG format to the SimianGrid AddMapTile service
108// Scene scene;
109// if (m_scenes.TryGetValue(regionInfo.RegionID, out scene))
110// UploadMapTile(scene);
111// else
112// m_log.Warn("Registering region " + regionInfo.RegionName + " (" + regionInfo.RegionID + ") that we are not tracking");
113
103 Vector3d minPosition = new Vector3d(regionInfo.RegionLocX, regionInfo.RegionLocY, 0.0); 114 Vector3d minPosition = new Vector3d(regionInfo.RegionLocX, regionInfo.RegionLocY, 0.0);
104 Vector3d maxPosition = minPosition + new Vector3d(regionInfo.RegionSizeX, regionInfo.RegionSizeY, Constants.RegionHeight); 115 Vector3d maxPosition = minPosition + new Vector3d(regionInfo.RegionSizeX, regionInfo.RegionSizeY, Constants.RegionHeight);
105 116
@@ -108,7 +119,7 @@ namespace OpenSim.Services.Connectors.SimianGrid
108 { "ServerURI", OSD.FromString(regionInfo.ServerURI) }, 119 { "ServerURI", OSD.FromString(regionInfo.ServerURI) },
109 { "InternalAddress", OSD.FromString(regionInfo.InternalEndPoint.Address.ToString()) }, 120 { "InternalAddress", OSD.FromString(regionInfo.InternalEndPoint.Address.ToString()) },
110 { "InternalPort", OSD.FromInteger(regionInfo.InternalEndPoint.Port) }, 121 { "InternalPort", OSD.FromInteger(regionInfo.InternalEndPoint.Port) },
111 { "ExternalAddress", OSD.FromString(regionInfo.ExternalEndPoint.Address.ToString()) }, 122 { "ExternalAddress", OSD.FromString(ext.Address.ToString()) },
112 { "ExternalPort", OSD.FromInteger(regionInfo.ExternalEndPoint.Port) }, 123 { "ExternalPort", OSD.FromInteger(regionInfo.ExternalEndPoint.Port) },
113 { "MapTexture", OSD.FromUUID(regionInfo.TerrainImage) }, 124 { "MapTexture", OSD.FromUUID(regionInfo.TerrainImage) },
114 { "Access", OSD.FromInteger(regionInfo.Access) }, 125 { "Access", OSD.FromInteger(regionInfo.Access) },
@@ -412,6 +423,83 @@ namespace OpenSim.Services.Connectors.SimianGrid
412 423
413 #endregion IGridService 424 #endregion IGridService
414 425
426 private void UploadMapTile(IScene scene)
427 {
428 string errorMessage = null;
429
430 // Create a PNG map tile and upload it to the AddMapTile API
431 byte[] pngData = Utils.EmptyBytes;
432 IMapImageGenerator tileGenerator = scene.RequestModuleInterface<IMapImageGenerator>();
433 if (tileGenerator == null)
434 {
435 m_log.Warn("[SIMIAN GRID CONNECTOR]: Cannot upload PNG map tile without an IMapImageGenerator");
436 return;
437 }
438
439 using (Image mapTile = tileGenerator.CreateMapTile())
440 {
441 using (MemoryStream stream = new MemoryStream())
442 {
443 mapTile.Save(stream, ImageFormat.Png);
444 pngData = stream.ToArray();
445 }
446 }
447
448 List<MultipartForm.Element> postParameters = new List<MultipartForm.Element>()
449 {
450 new MultipartForm.Parameter("X", scene.RegionInfo.RegionLocX.ToString()),
451 new MultipartForm.Parameter("Y", scene.RegionInfo.RegionLocY.ToString()),
452 new MultipartForm.File("Tile", "tile.png", "image/png", pngData)
453 };
454
455 // Make the remote storage request
456 try
457 {
458 HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create(m_ServerURI);
459
460 HttpWebResponse response = MultipartForm.Post(request, postParameters);
461 using (Stream responseStream = response.GetResponseStream())
462 {
463 string responseStr = null;
464
465 try
466 {
467 responseStr = responseStream.GetStreamString();
468 OSD responseOSD = OSDParser.Deserialize(responseStr);
469 if (responseOSD.Type == OSDType.Map)
470 {
471 OSDMap responseMap = (OSDMap)responseOSD;
472 if (responseMap["Success"].AsBoolean())
473 m_log.Info("[SIMIAN GRID CONNECTOR]: Uploaded " + pngData.Length + " byte PNG map tile to AddMapTile");
474 else
475 errorMessage = "Upload failed: " + responseMap["Message"].AsString();
476 }
477 else
478 {
479 errorMessage = "Response format was invalid:\n" + responseStr;
480 }
481 }
482 catch (Exception ex)
483 {
484 if (!String.IsNullOrEmpty(responseStr))
485 errorMessage = "Failed to parse the response:\n" + responseStr;
486 else
487 errorMessage = "Failed to retrieve the response: " + ex.Message;
488 }
489 }
490 }
491 catch (WebException ex)
492 {
493 errorMessage = ex.Message;
494 }
495
496 if (!String.IsNullOrEmpty(errorMessage))
497 {
498 m_log.WarnFormat("[SIMIAN GRID CONNECTOR]: Failed to store {0} byte PNG map tile for {1}: {2}",
499 pngData.Length, scene.RegionInfo.RegionName, errorMessage.Replace('\n', ' '));
500 }
501 }
502
415 private GridRegion GetNearestRegion(Vector3d position, bool onlyEnabled) 503 private GridRegion GetNearestRegion(Vector3d position, bool onlyEnabled)
416 { 504 {
417 NameValueCollection requestArgs = new NameValueCollection 505 NameValueCollection requestArgs = new NameValueCollection
diff --git a/OpenSim/Services/Connectors/SimianGrid/SimianUserAccountServiceConnector.cs b/OpenSim/Services/Connectors/SimianGrid/SimianUserAccountServiceConnector.cs
index 698c4c0..08c5c50 100644
--- a/OpenSim/Services/Connectors/SimianGrid/SimianUserAccountServiceConnector.cs
+++ b/OpenSim/Services/Connectors/SimianGrid/SimianUserAccountServiceConnector.cs
@@ -191,9 +191,15 @@ namespace OpenSim.Services.Connectors.SimianGrid
191 return accounts; 191 return accounts;
192 } 192 }
193 193
194<<<<<<< HEAD
194 public void InvalidateCache(UUID userID) 195 public void InvalidateCache(UUID userID)
195 { 196 {
196 m_accountCache.Remove(userID); 197 m_accountCache.Remove(userID);
198=======
199 public List<UserAccount> GetUserAccountsWhere(UUID scopeID, string query)
200 {
201 return null;
202>>>>>>> avn/ubitvar
197 } 203 }
198 204
199 public bool StoreUserAccount(UserAccount data) 205 public bool StoreUserAccount(UserAccount data)
diff --git a/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs b/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs
index 1eedbef..28b6de7 100644
--- a/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs
+++ b/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs
@@ -112,6 +112,7 @@ namespace OpenSim.Services.Connectors.Simulation
112 112
113 if (destination == null) 113 if (destination == null)
114 { 114 {
115 reason = "Destination not found";
115 m_log.Debug("[REMOTE SIMULATION CONNECTOR]: Given destination is null"); 116 m_log.Debug("[REMOTE SIMULATION CONNECTOR]: Given destination is null");
116 return false; 117 return false;
117 } 118 }
@@ -282,7 +283,13 @@ namespace OpenSim.Services.Connectors.Simulation
282 } 283 }
283 284
284 285
286<<<<<<< HEAD
285 public bool QueryAccess(GridRegion destination, UUID agentID, string agentHomeURI, bool viaTeleport, Vector3 position, string myversion, List<UUID> featuresAvailable, out string version, out string reason) 287 public bool QueryAccess(GridRegion destination, UUID agentID, string agentHomeURI, bool viaTeleport, Vector3 position, string myversion, List<UUID> featuresAvailable, out string version, out string reason)
288=======
289 /// <summary>
290 /// </summary>
291 public bool QueryAccess(GridRegion destination, UUID agentID, string agentHomeURI, bool viaTeleport, Vector3 position, string myversion, out string version, out string reason)
292>>>>>>> avn/ubitvar
286 { 293 {
287 reason = "Failed to contact destination"; 294 reason = "Failed to contact destination";
288 version = "Unknown"; 295 version = "Unknown";
@@ -299,6 +306,7 @@ namespace OpenSim.Services.Connectors.Simulation
299 request.Add("viaTeleport", OSD.FromBoolean(viaTeleport)); 306 request.Add("viaTeleport", OSD.FromBoolean(viaTeleport));
300 request.Add("position", OSD.FromString(position.ToString())); 307 request.Add("position", OSD.FromString(position.ToString()));
301 request.Add("my_version", OSD.FromString(myversion)); 308 request.Add("my_version", OSD.FromString(myversion));
309<<<<<<< HEAD
302 310
303 OSDArray features = new OSDArray(); 311 OSDArray features = new OSDArray();
304 foreach (UUID feature in featuresAvailable) 312 foreach (UUID feature in featuresAvailable)
@@ -306,6 +314,8 @@ namespace OpenSim.Services.Connectors.Simulation
306 314
307 request.Add("features", features); 315 request.Add("features", features);
308 316
317=======
318>>>>>>> avn/ubitvar
309 if (agentHomeURI != null) 319 if (agentHomeURI != null)
310 request.Add("agent_home_uri", OSD.FromString(agentHomeURI)); 320 request.Add("agent_home_uri", OSD.FromString(agentHomeURI));
311 321
@@ -356,6 +366,7 @@ namespace OpenSim.Services.Connectors.Simulation
356 return false; 366 return false;
357 } 367 }
358 368
369<<<<<<< HEAD
359 370
360 featuresAvailable.Clear(); 371 featuresAvailable.Clear();
361 372
@@ -366,6 +377,11 @@ namespace OpenSim.Services.Connectors.Simulation
366 foreach (OSD o in array) 377 foreach (OSD o in array)
367 featuresAvailable.Add(new UUID(o.AsString())); 378 featuresAvailable.Add(new UUID(o.AsString()));
368 } 379 }
380=======
381 OSDMap resp = (OSDMap)result["_Result"];
382 success = resp["success"].AsBoolean();
383 reason = resp["reason"].AsString();
384>>>>>>> avn/ubitvar
369 385
370 return success; 386 return success;
371 } 387 }
@@ -451,12 +467,17 @@ namespace OpenSim.Services.Connectors.Simulation
451 args["destination_name"] = OSD.FromString(destination.RegionName); 467 args["destination_name"] = OSD.FromString(destination.RegionName);
452 args["destination_uuid"] = OSD.FromString(destination.RegionID.ToString()); 468 args["destination_uuid"] = OSD.FromString(destination.RegionID.ToString());
453 469
470<<<<<<< HEAD
454 OSDMap result = WebUtil.PostToService(uri, args, 40000, false); 471 OSDMap result = WebUtil.PostToService(uri, args, 40000, false);
455 472
456 if (result == null) 473 if (result == null)
457 return false; 474 return false;
458 bool success = result["success"].AsBoolean(); 475 bool success = result["success"].AsBoolean();
459 if (!success) 476 if (!success)
477=======
478 OSDMap response = WebUtil.PostToService(uri, args, 40000);
479 if (response["Success"] == "False")
480>>>>>>> avn/ubitvar
460 return false; 481 return false;
461 } 482 }
462 catch (Exception e) 483 catch (Exception e)
diff --git a/OpenSim/Services/Connectors/UserAccounts/UserAccountServicesConnector.cs b/OpenSim/Services/Connectors/UserAccounts/UserAccountServicesConnector.cs
index 560e6c4..e5fb5a8 100644
--- a/OpenSim/Services/Connectors/UserAccounts/UserAccountServicesConnector.cs
+++ b/OpenSim/Services/Connectors/UserAccounts/UserAccountServicesConnector.cs
@@ -191,8 +191,14 @@ namespace OpenSim.Services.Connectors
191 return accounts; 191 return accounts;
192 } 192 }
193 193
194<<<<<<< HEAD
194 public void InvalidateCache(UUID userID) 195 public void InvalidateCache(UUID userID)
195 { 196 {
197=======
198 public List<UserAccount> GetUserAccountsWhere(UUID scopeID, string where)
199 {
200 return null; // Not implemented for regions
201>>>>>>> avn/ubitvar
196 } 202 }
197 203
198 public virtual bool StoreUserAccount(UserAccount data) 204 public virtual bool StoreUserAccount(UserAccount data)
diff --git a/OpenSim/Services/GridService/GridService.cs b/OpenSim/Services/GridService/GridService.cs
index 8807397..8293c18 100644
--- a/OpenSim/Services/GridService/GridService.cs
+++ b/OpenSim/Services/GridService/GridService.cs
@@ -57,9 +57,13 @@ namespace OpenSim.Services.GridService
57 protected bool m_AllowDuplicateNames = false; 57 protected bool m_AllowDuplicateNames = false;
58 protected bool m_AllowHypergridMapSearch = false; 58 protected bool m_AllowHypergridMapSearch = false;
59 59
60<<<<<<< HEAD
60 protected bool m_SuppressVarregionOverlapCheckOnRegistration = false; 61 protected bool m_SuppressVarregionOverlapCheckOnRegistration = false;
61 62
62 private static Dictionary<string,object> m_ExtraFeatures = new Dictionary<string, object>(); 63 private static Dictionary<string,object> m_ExtraFeatures = new Dictionary<string, object>();
64=======
65 private static Dictionary<string, object> m_ExtraFeatures = new Dictionary<string, object>();
66>>>>>>> avn/ubitvar
63 67
64 public GridService(IConfigSource config) 68 public GridService(IConfigSource config)
65 : base(config) 69 : base(config)
@@ -155,9 +159,15 @@ namespace OpenSim.Services.GridService
155 159
156 if (loginConfig == null || gridConfig == null) 160 if (loginConfig == null || gridConfig == null)
157 return; 161 return;
162<<<<<<< HEAD
158 163
159 string configVal; 164 string configVal;
160 165
166=======
167
168 string configVal;
169
170>>>>>>> avn/ubitvar
161 configVal = loginConfig.GetString("SearchURL", string.Empty); 171 configVal = loginConfig.GetString("SearchURL", string.Empty);
162 if (!string.IsNullOrEmpty(configVal)) 172 if (!string.IsNullOrEmpty(configVal))
163 m_ExtraFeatures["search-server-url"] = configVal; 173 m_ExtraFeatures["search-server-url"] = configVal;
@@ -201,6 +211,7 @@ namespace OpenSim.Services.GridService
201 if (regionInfos.RegionID == UUID.Zero) 211 if (regionInfos.RegionID == UUID.Zero)
202 return "Invalid RegionID - cannot be zero UUID"; 212 return "Invalid RegionID - cannot be zero UUID";
203 213
214<<<<<<< HEAD
204 String reason = "Region overlaps another region"; 215 String reason = "Region overlaps another region";
205 RegionData region = FindAnyConflictingRegion(regionInfos, scopeID, out reason); 216 RegionData region = FindAnyConflictingRegion(regionInfos, scopeID, out reason);
206 // If there is a conflicting region, if it has the same ID and same coordinates 217 // If there is a conflicting region, if it has the same ID and same coordinates
@@ -210,6 +221,12 @@ namespace OpenSim.Services.GridService
210 || (region.coordY != regionInfos.RegionCoordY) 221 || (region.coordY != regionInfos.RegionCoordY)
211 || (region.RegionID != regionInfos.RegionID) ) 222 || (region.RegionID != regionInfos.RegionID) )
212 ) 223 )
224=======
225 // we should not need to check for overlaps
226
227 RegionData region = m_Database.Get(regionInfos.RegionLocX, regionInfos.RegionLocY, scopeID);
228 if ((region != null) && (region.RegionID != regionInfos.RegionID))
229>>>>>>> avn/ubitvar
213 { 230 {
214 // If not same ID and same coordinates, this new region has conflicts and can't be registered. 231 // If not same ID and same coordinates, this new region has conflicts and can't be registered.
215 m_log.WarnFormat("{0} Register region conflict in scope {1}. {2}", LogHeader, scopeID, reason); 232 m_log.WarnFormat("{0} Register region conflict in scope {1}. {2}", LogHeader, scopeID, reason);
@@ -463,7 +480,7 @@ namespace OpenSim.Services.GridService
463 480
464 int flags = Convert.ToInt32(region.Data["flags"]); 481 int flags = Convert.ToInt32(region.Data["flags"]);
465 482
466 if (!m_DeleteOnUnregister || (flags & (int)OpenSim.Framework.RegionFlags.Persistent) != 0) 483 if ((!m_DeleteOnUnregister) || ((flags & (int)OpenSim.Framework.RegionFlags.Persistent) != 0))
467 { 484 {
468 flags &= ~(int)OpenSim.Framework.RegionFlags.RegionOnline; 485 flags &= ~(int)OpenSim.Framework.RegionFlags.RegionOnline;
469 region.Data["flags"] = flags.ToString(); 486 region.Data["flags"] = flags.ToString();
@@ -478,7 +495,6 @@ namespace OpenSim.Services.GridService
478 } 495 }
479 496
480 return true; 497 return true;
481
482 } 498 }
483 499
484 return m_Database.Delete(regionID); 500 return m_Database.Delete(regionID);
@@ -492,10 +508,19 @@ namespace OpenSim.Services.GridService
492 if (region != null) 508 if (region != null)
493 { 509 {
494 // Not really? Maybe? 510 // Not really? Maybe?
511<<<<<<< HEAD
495 // The adjacent regions are presumed to be the same size as the current region 512 // The adjacent regions are presumed to be the same size as the current region
513=======
514/* this fails wiht var regions. My_sql db should now handle var regions
515>>>>>>> avn/ubitvar
496 List<RegionData> rdatas = m_Database.Get( 516 List<RegionData> rdatas = m_Database.Get(
497 region.posX - region.sizeX - 1, region.posY - region.sizeY - 1, 517 region.posX - region.sizeX - 1, region.posY - region.sizeY - 1,
498 region.posX + region.sizeX + 1, region.posY + region.sizeY + 1, scopeID); 518 region.posX + region.sizeX + 1, region.posY + region.sizeY + 1, scopeID);
519*/
520 // so send normal search area
521 List<RegionData> rdatas = m_Database.Get(
522 region.posX - 1, region.posY - 1,
523 region.posX + region.sizeX + 1, region.posY + region.sizeY + 1, scopeID);
499 524
500 foreach (RegionData rdata in rdatas) 525 foreach (RegionData rdata in rdatas)
501 { 526 {
@@ -537,6 +562,7 @@ namespace OpenSim.Services.GridService
537 // be the base coordinate of the region. 562 // be the base coordinate of the region.
538 // The snapping is technically unnecessary but is harmless because regions are always 563 // The snapping is technically unnecessary but is harmless because regions are always
539 // multiples of the legacy region size (256). 564 // multiples of the legacy region size (256).
565
540 public GridRegion GetRegionByPosition(UUID scopeID, int x, int y) 566 public GridRegion GetRegionByPosition(UUID scopeID, int x, int y)
541 { 567 {
542 uint regionX = Util.WorldToRegionLoc((uint)x); 568 uint regionX = Util.WorldToRegionLoc((uint)x);
@@ -872,7 +898,11 @@ namespace OpenSim.Services.GridService
872 return; 898 return;
873 } 899 }
874 900
901<<<<<<< HEAD
875 RegionData region = m_Database.Get((int)Util.RegionToWorldLoc(x), (int)Util.RegionToWorldLoc(y), UUID.Zero); 902 RegionData region = m_Database.Get((int)Util.RegionToWorldLoc(x), (int)Util.RegionToWorldLoc(y), UUID.Zero);
903=======
904 RegionData region = m_Database.Get((int)Util.RegionToWorldLoc((uint)x), (int)Util.RegionToWorldLoc((uint)y), UUID.Zero);
905>>>>>>> avn/ubitvar
876 if (region == null) 906 if (region == null)
877 { 907 {
878 MainConsole.Instance.OutputFormat("No region found at {0},{1}", x, y); 908 MainConsole.Instance.OutputFormat("No region found at {0},{1}", x, y);
@@ -889,7 +919,11 @@ namespace OpenSim.Services.GridService
889 ConsoleDisplayList dispList = new ConsoleDisplayList(); 919 ConsoleDisplayList dispList = new ConsoleDisplayList();
890 dispList.AddRow("Region Name", r.RegionName); 920 dispList.AddRow("Region Name", r.RegionName);
891 dispList.AddRow("Region ID", r.RegionID); 921 dispList.AddRow("Region ID", r.RegionID);
922<<<<<<< HEAD
892 dispList.AddRow("Position", string.Format("{0},{1}", r.coordX, r.coordY)); 923 dispList.AddRow("Position", string.Format("{0},{1}", r.coordX, r.coordY));
924=======
925 dispList.AddRow("Location", string.Format("{0},{1}", r.coordX, r.coordY));
926>>>>>>> avn/ubitvar
893 dispList.AddRow("Size", string.Format("{0}x{1}", r.sizeX, r.sizeY)); 927 dispList.AddRow("Size", string.Format("{0}x{1}", r.sizeX, r.sizeY));
894 dispList.AddRow("URI", r.Data["serverURI"]); 928 dispList.AddRow("URI", r.Data["serverURI"]);
895 dispList.AddRow("Owner ID", r.Data["owner_uuid"]); 929 dispList.AddRow("Owner ID", r.Data["owner_uuid"]);
diff --git a/OpenSim/Services/GridService/HypergridLinker.cs b/OpenSim/Services/GridService/HypergridLinker.cs
index 9d016fc..b4577b0 100644
--- a/OpenSim/Services/GridService/HypergridLinker.cs
+++ b/OpenSim/Services/GridService/HypergridLinker.cs
@@ -343,7 +343,11 @@ namespace OpenSim.Services.GridService
343 GridRegion region = m_GridService.GetRegionByPosition(regInfo.ScopeID, regInfo.RegionLocX, regInfo.RegionLocY); 343 GridRegion region = m_GridService.GetRegionByPosition(regInfo.ScopeID, regInfo.RegionLocX, regInfo.RegionLocY);
344 if (region != null) 344 if (region != null)
345 { 345 {
346<<<<<<< HEAD
346 m_log.WarnFormat("[HYPERGRID LINKER]: Coordinates <{0},{1}> are already occupied by region {2} with uuid {3}", 347 m_log.WarnFormat("[HYPERGRID LINKER]: Coordinates <{0},{1}> are already occupied by region {2} with uuid {3}",
348=======
349 m_log.WarnFormat("[HYPERGRID LINKER]: Coordinates {0}-{1} are already occupied by region {2} with uuid {3}",
350>>>>>>> avn/ubitvar
347 Util.WorldToRegionLoc((uint)regInfo.RegionLocX), Util.WorldToRegionLoc((uint)regInfo.RegionLocY), 351 Util.WorldToRegionLoc((uint)regInfo.RegionLocX), Util.WorldToRegionLoc((uint)regInfo.RegionLocY),
348 region.RegionName, region.RegionID); 352 region.RegionName, region.RegionID);
349 reason = "Coordinates are already in use"; 353 reason = "Coordinates are already in use";
@@ -379,8 +383,13 @@ namespace OpenSim.Services.GridService
379 region = m_GridService.GetRegionByUUID(scopeID, regionID); 383 region = m_GridService.GetRegionByUUID(scopeID, regionID);
380 if (region != null) 384 if (region != null)
381 { 385 {
386<<<<<<< HEAD
382 m_log.DebugFormat("[HYPERGRID LINKER]: Region already exists in coordinates <{0},{1}>", 387 m_log.DebugFormat("[HYPERGRID LINKER]: Region already exists in coordinates <{0},{1}>",
383 Util.WorldToRegionLoc((uint)region.RegionLocX), Util.WorldToRegionLoc((uint)region.RegionLocY)); 388 Util.WorldToRegionLoc((uint)region.RegionLocX), Util.WorldToRegionLoc((uint)region.RegionLocY));
389=======
390 m_log.DebugFormat("[HYPERGRID LINKER]: Region already exists in coordinates {0} {1}",
391 Util.WorldToRegionLoc((uint)regInfo.RegionLocX), Util.WorldToRegionLoc((uint)regInfo.RegionLocY));
392>>>>>>> avn/ubitvar
384 regInfo = region; 393 regInfo = region;
385 return true; 394 return true;
386 } 395 }
@@ -536,6 +545,7 @@ namespace OpenSim.Services.GridService
536 MainConsole.Instance.Output(new string('-', 72)); 545 MainConsole.Instance.Output(new string('-', 72));
537 foreach (RegionData r in regions) 546 foreach (RegionData r in regions)
538 { 547 {
548<<<<<<< HEAD
539 MainConsole.Instance.Output( 549 MainConsole.Instance.Output(
540 String.Format("{0}\n{2,-32} {1}\n", 550 String.Format("{0}\n{2,-32} {1}\n",
541 r.RegionName, r.RegionID, 551 r.RegionName, r.RegionID,
@@ -544,6 +554,12 @@ namespace OpenSim.Services.GridService
544 ) 554 )
545 ) 555 )
546 ); 556 );
557=======
558 MainConsole.Instance.Output(String.Format("{0}\n{2,-32} {1}\n",
559 r.RegionName, r.RegionID,
560 String.Format("{0},{1} ({2},{3})", r.posX, r.posY,
561 Util.WorldToRegionLoc((uint)r.posX), Util.WorldToRegionLoc((uint)r.posY))) );
562>>>>>>> avn/ubitvar
547 } 563 }
548 return; 564 return;
549 } 565 }
@@ -645,8 +661,13 @@ namespace OpenSim.Services.GridService
645 string externalHostName; 661 string externalHostName;
646 try 662 try
647 { 663 {
664<<<<<<< HEAD
648 xloc = Convert.ToUInt32(cmdparams[0]); 665 xloc = Convert.ToUInt32(cmdparams[0]);
649 yloc = Convert.ToUInt32(cmdparams[1]); 666 yloc = Convert.ToUInt32(cmdparams[1]);
667=======
668 xloc = (uint)Convert.ToInt32(cmdparams[0]);
669 yloc = (uint)Convert.ToInt32(cmdparams[1]);
670>>>>>>> avn/ubitvar
650 externalPort = Convert.ToUInt32(cmdparams[3]); 671 externalPort = Convert.ToUInt32(cmdparams[3]);
651 externalHostName = cmdparams[2]; 672 externalHostName = cmdparams[2];
652 //internalPort = Convert.ToUInt32(cmdparams[4]); 673 //internalPort = Convert.ToUInt32(cmdparams[4]);
@@ -749,8 +770,13 @@ namespace OpenSim.Services.GridService
749 string externalHostName; 770 string externalHostName;
750 uint realXLoc, realYLoc; 771 uint realXLoc, realYLoc;
751 772
773<<<<<<< HEAD
752 xloc = Convert.ToUInt32(config.GetString("xloc", "0")); 774 xloc = Convert.ToUInt32(config.GetString("xloc", "0"));
753 yloc = Convert.ToUInt32(config.GetString("yloc", "0")); 775 yloc = Convert.ToUInt32(config.GetString("yloc", "0"));
776=======
777 xloc = (uint)Convert.ToInt32(config.GetString("xloc", "0"));
778 yloc = (uint)Convert.ToInt32(config.GetString("yloc", "0"));
779>>>>>>> avn/ubitvar
754 externalPort = Convert.ToUInt32(config.GetString("externalPort", "0")); 780 externalPort = Convert.ToUInt32(config.GetString("externalPort", "0"));
755 externalHostName = config.GetString("externalHostName", ""); 781 externalHostName = config.GetString("externalHostName", "");
756 realXLoc = Convert.ToUInt32(config.GetString("real-xloc", "0")); 782 realXLoc = Convert.ToUInt32(config.GetString("real-xloc", "0"));
@@ -758,8 +784,13 @@ namespace OpenSim.Services.GridService
758 784
759 if (m_enableAutoMapping) 785 if (m_enableAutoMapping)
760 { 786 {
787<<<<<<< HEAD
761 xloc = (xloc % 100) + m_autoMappingX; 788 xloc = (xloc % 100) + m_autoMappingX;
762 yloc = (yloc % 100) + m_autoMappingY; 789 yloc = (yloc % 100) + m_autoMappingY;
790=======
791 xloc = (uint)((xloc % 100) + m_autoMappingX);
792 yloc = (uint)((yloc % 100) + m_autoMappingY);
793>>>>>>> avn/ubitvar
763 } 794 }
764 795
765 if (((realXLoc == 0) && (realYLoc == 0)) || 796 if (((realXLoc == 0) && (realYLoc == 0)) ||
diff --git a/OpenSim/Services/HypergridService/UserAccountCache.cs b/OpenSim/Services/HypergridService/UserAccountCache.cs
index fa7dd0b..6c3c655 100644
--- a/OpenSim/Services/HypergridService/UserAccountCache.cs
+++ b/OpenSim/Services/HypergridService/UserAccountCache.cs
@@ -90,6 +90,11 @@ namespace OpenSim.Services.HypergridService
90 return null; 90 return null;
91 } 91 }
92 92
93 public List<UserAccount> GetUserAccountsWhere(UUID scopeID, string query)
94 {
95 return null;
96 }
97
93 public List<UserAccount> GetUserAccounts(UUID scopeID, string query) 98 public List<UserAccount> GetUserAccounts(UUID scopeID, string query)
94 { 99 {
95 return null; 100 return null;
diff --git a/OpenSim/Services/Interfaces/IAttachmentsService.cs b/OpenSim/Services/Interfaces/IAttachmentsService.cs
new file mode 100644
index 0000000..bdde369
--- /dev/null
+++ b/OpenSim/Services/Interfaces/IAttachmentsService.cs
@@ -0,0 +1,17 @@
1////////////////////////////////////////////////////////////////
2//
3// (c) 2009, 2010 Careminster Limited and Melanie Thielker
4//
5// All rights reserved
6//
7using System;
8using Nini.Config;
9
10namespace OpenSim.Services.Interfaces
11{
12 public interface IAttachmentsService
13 {
14 string Get(string id);
15 void Store(string id, string data);
16 }
17}
diff --git a/OpenSim/Services/Interfaces/IAuthenticationService.cs b/OpenSim/Services/Interfaces/IAuthenticationService.cs
index cee8bc0..cdcfad9 100644
--- a/OpenSim/Services/Interfaces/IAuthenticationService.cs
+++ b/OpenSim/Services/Interfaces/IAuthenticationService.cs
@@ -67,6 +67,7 @@ namespace OpenSim.Services.Interfaces
67 // various services. 67 // various services.
68 // 68 //
69 string Authenticate(UUID principalID, string password, int lifetime); 69 string Authenticate(UUID principalID, string password, int lifetime);
70 string Authenticate(UUID principalID, string password, int lifetime, out UUID realID);
70 71
71 ////////////////////////////////////////////////////// 72 //////////////////////////////////////////////////////
72 // Verification 73 // Verification
diff --git a/OpenSim/Services/Interfaces/IAvatarService.cs b/OpenSim/Services/Interfaces/IAvatarService.cs
index 6ca0b15..3663a7a 100644
--- a/OpenSim/Services/Interfaces/IAvatarService.cs
+++ b/OpenSim/Services/Interfaces/IAvatarService.cs
@@ -162,10 +162,16 @@ namespace OpenSim.Services.Interfaces
162 } 162 }
163 163
164 // Visual Params 164 // Visual Params
165 string[] vps = new string[AvatarAppearance.VISUALPARAM_COUNT]; 165 // string[] vps = new string[AvatarAppearance.VISUALPARAM_COUNT];
166 // byte[] binary = appearance.VisualParams;
167
168 // for (int i = 0 ; i < AvatarAppearance.VISUALPARAM_COUNT ; i++)
169
170
166 byte[] binary = appearance.VisualParams; 171 byte[] binary = appearance.VisualParams;
172 string[] vps = new string[binary.Length];
167 173
168 for (int i = 0 ; i < AvatarAppearance.VISUALPARAM_COUNT ; i++) 174 for (int i = 0; i < binary.Length; i++)
169 { 175 {
170 vps[i] = binary[i].ToString(); 176 vps[i] = binary[i].ToString();
171 } 177 }
@@ -202,7 +208,13 @@ namespace OpenSim.Services.Interfaces
202 appearance.Serial = Int32.Parse(Data["Serial"]); 208 appearance.Serial = Int32.Parse(Data["Serial"]);
203 209
204 if (Data.ContainsKey("AvatarHeight")) 210 if (Data.ContainsKey("AvatarHeight"))
205 appearance.AvatarHeight = float.Parse(Data["AvatarHeight"]); 211 {
212 float h = float.Parse(Data["AvatarHeight"]);
213 if( h == 0f)
214 h = 1.9f;
215 appearance.SetSize(new Vector3(0.45f, 0.6f, h ));
216// appearance.AvatarHeight = float.Parse(Data["AvatarHeight"]);
217 }
206 218
207 // Legacy Wearables 219 // Legacy Wearables
208 if (Data.ContainsKey("BodyItem")) 220 if (Data.ContainsKey("BodyItem"))
@@ -273,10 +285,14 @@ namespace OpenSim.Services.Interfaces
273 if (Data.ContainsKey("VisualParams")) 285 if (Data.ContainsKey("VisualParams"))
274 { 286 {
275 string[] vps = Data["VisualParams"].Split(new char[] {','}); 287 string[] vps = Data["VisualParams"].Split(new char[] {','});
276 byte[] binary = new byte[AvatarAppearance.VISUALPARAM_COUNT]; 288 // byte[] binary = new byte[AvatarAppearance.VISUALPARAM_COUNT];
289
290 // for (int i = 0 ; i < vps.Length && i < binary.Length ; i++)
291 byte[] binary = new byte[vps.Length];
277 292
278 for (int i = 0 ; i < vps.Length && i < binary.Length ; i++) 293 for (int i = 0; i < vps.Length; i++)
279 binary[i] = (byte)Convert.ToInt32(vps[i]); 294
295 binary[i] = (byte)Convert.ToInt32(vps[i]);
280 296
281 appearance.VisualParams = binary; 297 appearance.VisualParams = binary;
282 } 298 }
@@ -342,6 +358,7 @@ namespace OpenSim.Services.Interfaces
342 appearance.Wearables[AvatarWearable.EYES].Wear( 358 appearance.Wearables[AvatarWearable.EYES].Wear(
343 AvatarWearable.DefaultWearables[ 359 AvatarWearable.DefaultWearables[
344 AvatarWearable.EYES][0]); 360 AvatarWearable.EYES][0]);
361
345 } 362 }
346 catch 363 catch
347 { 364 {
diff --git a/OpenSim/Services/Interfaces/IBakedTextureService.cs b/OpenSim/Services/Interfaces/IBakedTextureService.cs
index 69df4a0..ab88695 100644
--- a/OpenSim/Services/Interfaces/IBakedTextureService.cs
+++ b/OpenSim/Services/Interfaces/IBakedTextureService.cs
@@ -1,3 +1,4 @@
1<<<<<<< HEAD
1/* 2/*
2 * Copyright (c) Contributors, http://opensimulator.org/ 3 * Copyright (c) Contributors, http://opensimulator.org/
3 * See CONTRIBUTORS.TXT for a full list of copyright holders. 4 * See CONTRIBUTORS.TXT for a full list of copyright holders.
@@ -25,6 +26,14 @@
25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */ 27 */
27 28
29=======
30////////////////////////////////////////////////////////////////
31//
32// (c) 2009, 2010 Careminster Limited and Melanie Thielker
33//
34// All rights reserved
35//
36>>>>>>> avn/ubitvar
28using System; 37using System;
29using Nini.Config; 38using Nini.Config;
30 39
diff --git a/OpenSim/Services/Interfaces/IGridService.cs b/OpenSim/Services/Interfaces/IGridService.cs
index f5f1f75..7e5597b 100644
--- a/OpenSim/Services/Interfaces/IGridService.cs
+++ b/OpenSim/Services/Interfaces/IGridService.cs
@@ -159,7 +159,17 @@ namespace OpenSim.Services.Interfaces
159 } 159 }
160 } 160 }
161 set { 161 set {
162<<<<<<< HEAD
162 if (value.EndsWith("/")) { 163 if (value.EndsWith("/")) {
164=======
165 if ( value == null)
166 {
167 m_serverURI = String.Empty;
168 return;
169 }
170
171 if ( value.EndsWith("/") ) {
172>>>>>>> avn/ubitvar
163 m_serverURI = value; 173 m_serverURI = value;
164 } else { 174 } else {
165 m_serverURI = value + '/'; 175 m_serverURI = value + '/';
@@ -500,9 +510,13 @@ namespace OpenSim.Services.Interfaces
500 } 510 }
501 catch (SocketException e) 511 catch (SocketException e)
502 { 512 {
503 throw new Exception( 513 /*throw new Exception(
504 "Unable to resolve local hostname " + m_externalHostName + " innerException of type '" + 514 "Unable to resolve local hostname " + m_externalHostName + " innerException of type '" +
505 e + "' attached to this exception", e); 515 e + "' attached to this exception", e);*/
516 // Don't throw a fatal exception here, instead, return Null and handle it in the caller.
517 // Reason is, on systems such as OSgrid it has occured that known hostnames stop
518 // resolving and thus make surrounding regions crash out with this exception.
519 return null;
506 } 520 }
507 521
508 return new IPEndPoint(ia, m_internalEndPoint.Port); 522 return new IPEndPoint(ia, m_internalEndPoint.Port);
@@ -525,5 +539,110 @@ namespace OpenSim.Services.Interfaces
525 { 539 {
526 get { return Util.UIntsToLong((uint)RegionLocX, (uint)RegionLocY); } 540 get { return Util.UIntsToLong((uint)RegionLocX, (uint)RegionLocY); }
527 } 541 }
542<<<<<<< HEAD
543=======
544
545 public Dictionary<string, object> ToKeyValuePairs()
546 {
547 Dictionary<string, object> kvp = new Dictionary<string, object>();
548 kvp["uuid"] = RegionID.ToString();
549 kvp["locX"] = RegionLocX.ToString();
550 kvp["locY"] = RegionLocY.ToString();
551 kvp["sizeX"] = RegionSizeX.ToString();
552 kvp["sizeY"] = RegionSizeY.ToString();
553 kvp["regionName"] = RegionName;
554 kvp["serverIP"] = ExternalHostName; //ExternalEndPoint.Address.ToString();
555 kvp["serverHttpPort"] = HttpPort.ToString();
556 kvp["serverURI"] = ServerURI;
557 kvp["serverPort"] = InternalEndPoint.Port.ToString();
558 kvp["regionMapTexture"] = TerrainImage.ToString();
559 kvp["parcelMapTexture"] = ParcelImage.ToString();
560 kvp["access"] = Access.ToString();
561 kvp["regionSecret"] = RegionSecret;
562 kvp["owner_uuid"] = EstateOwner.ToString();
563 kvp["Token"] = Token.ToString();
564 // Maturity doesn't seem to exist in the DB
565 return kvp;
566 }
567
568 public GridRegion(Dictionary<string, object> kvp)
569 {
570 if (kvp.ContainsKey("uuid"))
571 RegionID = new UUID((string)kvp["uuid"]);
572
573 if (kvp.ContainsKey("locX"))
574 RegionLocX = Convert.ToInt32((string)kvp["locX"]);
575
576 if (kvp.ContainsKey("locY"))
577 RegionLocY = Convert.ToInt32((string)kvp["locY"]);
578
579 if (kvp.ContainsKey("sizeX"))
580 RegionSizeX = Convert.ToInt32((string)kvp["sizeX"]);
581 else
582 RegionSizeX = (int)Constants.RegionSize;
583
584 if (kvp.ContainsKey("sizeY"))
585 RegionSizeY = Convert.ToInt32((string)kvp["sizeY"]);
586 else
587 RegionSizeY = (int)Constants.RegionSize;
588
589 if (kvp.ContainsKey("regionName"))
590 RegionName = (string)kvp["regionName"];
591
592 if (kvp.ContainsKey("access"))
593 {
594 byte access = Convert.ToByte((string)kvp["access"]);
595 Maturity = (int)Util.ConvertAccessLevelToMaturity(access);
596 }
597
598 if (kvp.ContainsKey("serverIP"))
599 {
600 //int port = 0;
601 //Int32.TryParse((string)kvp["serverPort"], out port);
602 //IPEndPoint ep = new IPEndPoint(IPAddress.Parse((string)kvp["serverIP"]), port);
603 ExternalHostName = (string)kvp["serverIP"];
604 }
605 else
606 ExternalHostName = "127.0.0.1";
607
608 if (kvp.ContainsKey("serverPort"))
609 {
610 Int32 port = 0;
611 Int32.TryParse((string)kvp["serverPort"], out port);
612 InternalEndPoint = new IPEndPoint(IPAddress.Parse("0.0.0.0"), port);
613 }
614
615 if (kvp.ContainsKey("serverHttpPort"))
616 {
617 UInt32 port = 0;
618 UInt32.TryParse((string)kvp["serverHttpPort"], out port);
619 HttpPort = port;
620 }
621
622 if (kvp.ContainsKey("serverURI"))
623 ServerURI = (string)kvp["serverURI"];
624
625 if (kvp.ContainsKey("regionMapTexture"))
626 UUID.TryParse((string)kvp["regionMapTexture"], out TerrainImage);
627
628 if (kvp.ContainsKey("parcelMapTexture"))
629 UUID.TryParse((string)kvp["parcelMapTexture"], out ParcelImage);
630
631 if (kvp.ContainsKey("access"))
632 Access = Byte.Parse((string)kvp["access"]);
633
634 if (kvp.ContainsKey("regionSecret"))
635 RegionSecret =(string)kvp["regionSecret"];
636
637 if (kvp.ContainsKey("owner_uuid"))
638 EstateOwner = new UUID(kvp["owner_uuid"].ToString());
639
640 if (kvp.ContainsKey("Token"))
641 Token = kvp["Token"].ToString();
642
643 // m_log.DebugFormat("{0} New GridRegion. id={1}, loc=<{2},{3}>, size=<{4},{5}>",
644 // LogHeader, RegionID, RegionLocX, RegionLocY, RegionSizeX, RegionSizeY);
645 }
646>>>>>>> avn/ubitvar
528 } 647 }
529} \ No newline at end of file 648}
diff --git a/OpenSim/Services/Interfaces/ILoginService.cs b/OpenSim/Services/Interfaces/ILoginService.cs
index ee9b0b1..7c44cd8 100644
--- a/OpenSim/Services/Interfaces/ILoginService.cs
+++ b/OpenSim/Services/Interfaces/ILoginService.cs
@@ -47,8 +47,8 @@ namespace OpenSim.Services.Interfaces
47 47
48 public interface ILoginService 48 public interface ILoginService
49 { 49 {
50 LoginResponse Login(string firstName, string lastName, string passwd, string startLocation, UUID scopeID, 50 LoginResponse Login(string firstName, string lastName, string passwd, string startLocation, UUID scopeID,
51 string clientVersion, string channel, string mac, string id0, IPEndPoint clientIP); 51 string clientVersion, string channel, string mac, string id0, IPEndPoint clientIP, bool LibOMVclient);
52 Hashtable SetLevel(string firstName, string lastName, string passwd, int level, IPEndPoint clientIP); 52 Hashtable SetLevel(string firstName, string lastName, string passwd, int level, IPEndPoint clientIP);
53 } 53 }
54 54
diff --git a/OpenSim/Services/Interfaces/IMapImageService.cs b/OpenSim/Services/Interfaces/IMapImageService.cs
index 78daa5f..0d1458e 100644
--- a/OpenSim/Services/Interfaces/IMapImageService.cs
+++ b/OpenSim/Services/Interfaces/IMapImageService.cs
@@ -34,8 +34,14 @@ namespace OpenSim.Services.Interfaces
34 public interface IMapImageService 34 public interface IMapImageService
35 { 35 {
36 //List<MapBlockData> GetMapBlocks(UUID scopeID, int minX, int minY, int maxX, int maxY); 36 //List<MapBlockData> GetMapBlocks(UUID scopeID, int minX, int minY, int maxX, int maxY);
37<<<<<<< HEAD
37 bool AddMapTile(int x, int y, byte[] imageData, out string reason); 38 bool AddMapTile(int x, int y, byte[] imageData, out string reason);
38 bool RemoveMapTile(int x, int y, out string reason); 39 bool RemoveMapTile(int x, int y, out string reason);
39 byte[] GetMapTile(string fileName, out string format); 40 byte[] GetMapTile(string fileName, out string format);
41=======
42 bool AddMapTile(int x, int y, byte[] imageData, UUID scopeID, out string reason);
43 bool RemoveMapTile(int x, int y, UUID scopeID, out string reason);
44 byte[] GetMapTile(string fileName, UUID scopeID, out string format);
45>>>>>>> avn/ubitvar
40 } 46 }
41} 47}
diff --git a/OpenSim/Services/Interfaces/ISimulationService.cs b/OpenSim/Services/Interfaces/ISimulationService.cs
index 42c414d..ee1e294 100644
--- a/OpenSim/Services/Interfaces/ISimulationService.cs
+++ b/OpenSim/Services/Interfaces/ISimulationService.cs
@@ -86,6 +86,7 @@ namespace OpenSim.Services.Interfaces
86 /// <param name="agentHomeURI">The visitor's Home URI. Will be missing (null) in older OpenSims.</param> 86 /// <param name="agentHomeURI">The visitor's Home URI. Will be missing (null) in older OpenSims.</param>
87 /// <param name="viaTeleport">True: via teleport; False: via cross (walking)</param> 87 /// <param name="viaTeleport">True: via teleport; False: via cross (walking)</param>
88 /// <param name="position">Position in the region</param> 88 /// <param name="position">Position in the region</param>
89<<<<<<< HEAD
89 /// <param name="sversion"> 90 /// <param name="sversion">
90 /// Version that the requesting simulator is runing. If null then no version check is carried out. 91 /// Version that the requesting simulator is runing. If null then no version check is carried out.
91 /// </param> 92 /// </param>
@@ -93,6 +94,13 @@ namespace OpenSim.Services.Interfaces
93 /// <param name="reason">[out] Optional error message</param> 94 /// <param name="reason">[out] Optional error message</param>
94 /// <returns>True: ok; False: not allowed</returns> 95 /// <returns>True: ok; False: not allowed</returns>
95 bool QueryAccess(GridRegion destination, UUID agentID, string agentHomeURI, bool viaTeleport, Vector3 position, string sversion, List<UUID> features, out string version, out string reason); 96 bool QueryAccess(GridRegion destination, UUID agentID, string agentHomeURI, bool viaTeleport, Vector3 position, string sversion, List<UUID> features, out string version, out string reason);
97=======
98 /// <param name="sversion">version that the requesting simulator is runing</param>
99 /// <param name="version">version that the target simulator is running</param>
100 /// <param name="reason">[out] Optional error message</param>
101 /// <returns>True: ok; False: not allowed</returns>
102 bool QueryAccess(GridRegion destination, UUID agentID, string agentHomeURI, bool viaTeleport, Vector3 position, string sversion, out string version, out string reason);
103>>>>>>> avn/ubitvar
96 104
97 /// <summary> 105 /// <summary>
98 /// Message from receiving region to departing region, telling it got contacted by the client. 106 /// Message from receiving region to departing region, telling it got contacted by the client.
diff --git a/OpenSim/Services/Interfaces/IUserAccountService.cs b/OpenSim/Services/Interfaces/IUserAccountService.cs
index 2f7702c..1814699 100644
--- a/OpenSim/Services/Interfaces/IUserAccountService.cs
+++ b/OpenSim/Services/Interfaces/IUserAccountService.cs
@@ -91,6 +91,7 @@ namespace OpenSim.Services.Interfaces
91 public int UserLevel; 91 public int UserLevel;
92 public int UserFlags; 92 public int UserFlags;
93 public string UserTitle; 93 public string UserTitle;
94 public string UserCountry;
94 public Boolean LocalToGrid = true; 95 public Boolean LocalToGrid = true;
95 96
96 public Dictionary<string, object> ServiceURLs; 97 public Dictionary<string, object> ServiceURLs;
@@ -120,6 +121,8 @@ namespace OpenSim.Services.Interfaces
120 UserFlags = Convert.ToInt32(kvp["UserFlags"].ToString()); 121 UserFlags = Convert.ToInt32(kvp["UserFlags"].ToString());
121 if (kvp.ContainsKey("UserTitle")) 122 if (kvp.ContainsKey("UserTitle"))
122 UserTitle = kvp["UserTitle"].ToString(); 123 UserTitle = kvp["UserTitle"].ToString();
124 if (kvp.ContainsKey("UserCountry"))
125 UserCountry = kvp["UserCountry"].ToString();
123 if (kvp.ContainsKey("LocalToGrid")) 126 if (kvp.ContainsKey("LocalToGrid"))
124 Boolean.TryParse(kvp["LocalToGrid"].ToString(), out LocalToGrid); 127 Boolean.TryParse(kvp["LocalToGrid"].ToString(), out LocalToGrid);
125 128
@@ -155,6 +158,7 @@ namespace OpenSim.Services.Interfaces
155 result["UserLevel"] = UserLevel.ToString(); 158 result["UserLevel"] = UserLevel.ToString();
156 result["UserFlags"] = UserFlags.ToString(); 159 result["UserFlags"] = UserFlags.ToString();
157 result["UserTitle"] = UserTitle; 160 result["UserTitle"] = UserTitle;
161 result["UserCountry"] = UserCountry;
158 result["LocalToGrid"] = LocalToGrid.ToString(); 162 result["LocalToGrid"] = LocalToGrid.ToString();
159 163
160 string str = string.Empty; 164 string str = string.Empty;
@@ -182,6 +186,7 @@ namespace OpenSim.Services.Interfaces
182 /// <param name="query"></param> 186 /// <param name="query"></param>
183 /// <returns></returns> 187 /// <returns></returns>
184 List<UserAccount> GetUserAccounts(UUID scopeID, string query); 188 List<UserAccount> GetUserAccounts(UUID scopeID, string query);
189 List<UserAccount> GetUserAccountsWhere(UUID scopeID, string where);
185 190
186 /// <summary> 191 /// <summary>
187 /// Store the data given, wich replaces the stored data, therefore must be complete. 192 /// Store the data given, wich replaces the stored data, therefore must be complete.
diff --git a/OpenSim/Services/Interfaces/IUserProfilesService.cs b/OpenSim/Services/Interfaces/IUserProfilesService.cs
index 121baa8..319d307 100644
--- a/OpenSim/Services/Interfaces/IUserProfilesService.cs
+++ b/OpenSim/Services/Interfaces/IUserProfilesService.cs
@@ -57,11 +57,6 @@ namespace OpenSim.Services.Interfaces
57 bool AvatarPropertiesRequest(ref UserProfileProperties prop, ref string result); 57 bool AvatarPropertiesRequest(ref UserProfileProperties prop, ref string result);
58 bool AvatarPropertiesUpdate(ref UserProfileProperties prop, ref string result); 58 bool AvatarPropertiesUpdate(ref UserProfileProperties prop, ref string result);
59 #endregion Profile Properties 59 #endregion Profile Properties
60
61 #region User Preferences
62 bool UserPreferencesRequest(ref UserPreferences pref, ref string result);
63 bool UserPreferencesUpdate(ref UserPreferences pref, ref string result);
64 #endregion User Preferences
65 60
66 #region Interests 61 #region Interests
67 bool AvatarInterestsUpdate(UserProfileProperties prop, ref string result); 62 bool AvatarInterestsUpdate(UserProfileProperties prop, ref string result);
diff --git a/OpenSim/Services/LLLoginService/LLLoginResponse.cs b/OpenSim/Services/LLLoginService/LLLoginResponse.cs
index c3756d0..92d93ee 100644
--- a/OpenSim/Services/LLLoginService/LLLoginResponse.cs
+++ b/OpenSim/Services/LLLoginService/LLLoginResponse.cs
@@ -55,6 +55,7 @@ namespace OpenSim.Services.LLLoginService
55 public static LLFailedLoginResponse InventoryProblem; 55 public static LLFailedLoginResponse InventoryProblem;
56 public static LLFailedLoginResponse DeadRegionProblem; 56 public static LLFailedLoginResponse DeadRegionProblem;
57 public static LLFailedLoginResponse LoginBlockedProblem; 57 public static LLFailedLoginResponse LoginBlockedProblem;
58 public static LLFailedLoginResponse UnverifiedAccountProblem;
58 public static LLFailedLoginResponse AlreadyLoggedInProblem; 59 public static LLFailedLoginResponse AlreadyLoggedInProblem;
59 public static LLFailedLoginResponse InternalError; 60 public static LLFailedLoginResponse InternalError;
60 61
@@ -75,6 +76,10 @@ namespace OpenSim.Services.LLLoginService
75 LoginBlockedProblem = new LLFailedLoginResponse("presence", 76 LoginBlockedProblem = new LLFailedLoginResponse("presence",
76 "Logins are currently restricted. Please try again later.", 77 "Logins are currently restricted. Please try again later.",
77 "false"); 78 "false");
79 UnverifiedAccountProblem = new LLFailedLoginResponse("presence",
80 "Your account has not yet been verified. Please check " +
81 "your email and click the provided link.",
82 "false");
78 AlreadyLoggedInProblem = new LLFailedLoginResponse("presence", 83 AlreadyLoggedInProblem = new LLFailedLoginResponse("presence",
79 "You appear to be already logged in. " + 84 "You appear to be already logged in. " +
80 "If this is not the case please wait for your session to timeout. " + 85 "If this is not the case please wait for your session to timeout. " +
@@ -145,6 +150,7 @@ namespace OpenSim.Services.LLLoginService
145 private UUID agentID; 150 private UUID agentID;
146 private UUID sessionID; 151 private UUID sessionID;
147 private UUID secureSessionID; 152 private UUID secureSessionID;
153 private UUID realID;
148 154
149 // Login Flags 155 // Login Flags
150 private string dst; 156 private string dst;
@@ -228,8 +234,13 @@ namespace OpenSim.Services.LLLoginService
228 public LLLoginResponse(UserAccount account, AgentCircuitData aCircuit, GridUserInfo pinfo, 234 public LLLoginResponse(UserAccount account, AgentCircuitData aCircuit, GridUserInfo pinfo,
229 GridRegion destination, List<InventoryFolderBase> invSkel, FriendInfo[] friendsList, ILibraryService libService, 235 GridRegion destination, List<InventoryFolderBase> invSkel, FriendInfo[] friendsList, ILibraryService libService,
230 string where, string startlocation, Vector3 position, Vector3 lookAt, List<InventoryItemBase> gestures, string message, 236 string where, string startlocation, Vector3 position, Vector3 lookAt, List<InventoryItemBase> gestures, string message,
237<<<<<<< HEAD
231 GridRegion home, IPEndPoint clientIP, string mapTileURL, string searchURL, string currency, 238 GridRegion home, IPEndPoint clientIP, string mapTileURL, string searchURL, string currency,
232 string DSTZone, string destinationsURL, string avatarsURL, string classifiedFee, int maxAgentGroups) 239 string DSTZone, string destinationsURL, string avatarsURL, string classifiedFee, int maxAgentGroups)
240=======
241 GridRegion home, IPEndPoint clientIP, string mapTileURL, string profileURL, string openIDURL, string searchURL, string currency,
242 string DSTZone, string destinationsURL, string avatarsURL, UUID realID, string classifiedFee)
243>>>>>>> avn/ubitvar
233 : this() 244 : this()
234 { 245 {
235 FillOutInventoryData(invSkel, libService); 246 FillOutInventoryData(invSkel, libService);
@@ -242,6 +253,7 @@ namespace OpenSim.Services.LLLoginService
242 AgentID = account.PrincipalID; 253 AgentID = account.PrincipalID;
243 SessionID = aCircuit.SessionID; 254 SessionID = aCircuit.SessionID;
244 SecureSessionID = aCircuit.SecureSessionID; 255 SecureSessionID = aCircuit.SecureSessionID;
256 RealID = realID;
245 Message = message; 257 Message = message;
246 BuddList = ConvertFriendListItem(friendsList); 258 BuddList = ConvertFriendListItem(friendsList);
247 StartLocation = where; 259 StartLocation = where;
@@ -383,6 +395,7 @@ namespace OpenSim.Services.LLLoginService
383 private void FillOutRegionData(GridRegion destination) 395 private void FillOutRegionData(GridRegion destination)
384 { 396 {
385 IPEndPoint endPoint = destination.ExternalEndPoint; 397 IPEndPoint endPoint = destination.ExternalEndPoint;
398 if (endPoint == null) return;
386 SimAddress = endPoint.Address.ToString(); 399 SimAddress = endPoint.Address.ToString();
387 SimPort = (uint)endPoint.Port; 400 SimPort = (uint)endPoint.Port;
388 RegionX = (uint)destination.RegionLocX; 401 RegionX = (uint)destination.RegionLocX;
@@ -473,6 +486,7 @@ namespace OpenSim.Services.LLLoginService
473 SessionID = UUID.Random(); 486 SessionID = UUID.Random();
474 SecureSessionID = UUID.Random(); 487 SecureSessionID = UUID.Random();
475 AgentID = UUID.Random(); 488 AgentID = UUID.Random();
489 RealID = UUID.Zero;
476 490
477 Hashtable InitialOutfitHash = new Hashtable(); 491 Hashtable InitialOutfitHash = new Hashtable();
478 InitialOutfitHash["folder_name"] = "Nightclub Female"; 492 InitialOutfitHash["folder_name"] = "Nightclub Female";
@@ -518,6 +532,7 @@ namespace OpenSim.Services.LLLoginService
518 responseData["http_port"] = (Int32)SimHttpPort; 532 responseData["http_port"] = (Int32)SimHttpPort;
519 533
520 responseData["agent_id"] = AgentID.ToString(); 534 responseData["agent_id"] = AgentID.ToString();
535 responseData["real_id"] = RealID.ToString();
521 responseData["session_id"] = SessionID.ToString(); 536 responseData["session_id"] = SessionID.ToString();
522 responseData["secure_session_id"] = SecureSessionID.ToString(); 537 responseData["secure_session_id"] = SecureSessionID.ToString();
523 responseData["circuit_code"] = CircuitCode; 538 responseData["circuit_code"] = CircuitCode;
@@ -613,6 +628,7 @@ namespace OpenSim.Services.LLLoginService
613 map["sim_ip"] = OSD.FromString(SimAddress); 628 map["sim_ip"] = OSD.FromString(SimAddress);
614 629
615 map["agent_id"] = OSD.FromUUID(AgentID); 630 map["agent_id"] = OSD.FromUUID(AgentID);
631 map["real_id"] = OSD.FromUUID(RealID);
616 map["session_id"] = OSD.FromUUID(SessionID); 632 map["session_id"] = OSD.FromUUID(SessionID);
617 map["secure_session_id"] = OSD.FromUUID(SecureSessionID); 633 map["secure_session_id"] = OSD.FromUUID(SecureSessionID);
618 map["circuit_code"] = OSD.FromInteger(CircuitCode); 634 map["circuit_code"] = OSD.FromInteger(CircuitCode);
@@ -924,6 +940,12 @@ namespace OpenSim.Services.LLLoginService
924 set { secureSessionID = value; } 940 set { secureSessionID = value; }
925 } 941 }
926 942
943 public UUID RealID
944 {
945 get { return realID; }
946 set { realID = value; }
947 }
948
927 public Int32 CircuitCode 949 public Int32 CircuitCode
928 { 950 {
929 get { return circuitCode; } 951 get { return circuitCode; }
diff --git a/OpenSim/Services/LLLoginService/LLLoginService.cs b/OpenSim/Services/LLLoginService/LLLoginService.cs
index d67bc4d..ba69e95 100644
--- a/OpenSim/Services/LLLoginService/LLLoginService.cs
+++ b/OpenSim/Services/LLLoginService/LLLoginService.cs
@@ -151,7 +151,8 @@ namespace OpenSim.Services.LLLoginService
151 Object[] args = new Object[] { config }; 151 Object[] args = new Object[] { config };
152 m_UserAccountService = ServerUtils.LoadPlugin<IUserAccountService>(accountService, args); 152 m_UserAccountService = ServerUtils.LoadPlugin<IUserAccountService>(accountService, args);
153 m_GridUserService = ServerUtils.LoadPlugin<IGridUserService>(gridUserService, args); 153 m_GridUserService = ServerUtils.LoadPlugin<IGridUserService>(gridUserService, args);
154 m_AuthenticationService = ServerUtils.LoadPlugin<IAuthenticationService>(authService, args); 154 Object[] authArgs = new Object[] { config, m_UserAccountService };
155 m_AuthenticationService = ServerUtils.LoadPlugin<IAuthenticationService>(authService, authArgs);
155 m_InventoryService = ServerUtils.LoadPlugin<IInventoryService>(invService, args); 156 m_InventoryService = ServerUtils.LoadPlugin<IInventoryService>(invService, args);
156 157
157 if (gridService != string.Empty) 158 if (gridService != string.Empty)
@@ -257,14 +258,20 @@ namespace OpenSim.Services.LLLoginService
257 } 258 }
258 259
259 public LoginResponse Login(string firstName, string lastName, string passwd, string startLocation, UUID scopeID, 260 public LoginResponse Login(string firstName, string lastName, string passwd, string startLocation, UUID scopeID,
260 string clientVersion, string channel, string mac, string id0, IPEndPoint clientIP) 261 string clientVersion, string channel, string mac, string id0, IPEndPoint clientIP, bool LibOMVclient)
261 { 262 {
262 bool success = false; 263 bool success = false;
263 UUID session = UUID.Random(); 264 UUID session = UUID.Random();
265<<<<<<< HEAD
264 string processedMessage; 266 string processedMessage;
267=======
268 if (clientVersion.Contains("Radegast"))
269 LibOMVclient = false;
270>>>>>>> avn/ubitvar
265 271
266 m_log.InfoFormat("[LLOGIN SERVICE]: Login request for {0} {1} at {2} using viewer {3}, channel {4}, IP {5}, Mac {6}, Id0 {7}", 272
267 firstName, lastName, startLocation, clientVersion, channel, clientIP.Address.ToString(), mac, id0); 273 m_log.InfoFormat("[LLOGIN SERVICE]: Login request for {0} {1} at {2} using viewer {3}, channel {4}, IP {5}, Mac {6}, Id0 {7}, Possible LibOMVGridProxy: {8} ",
274 firstName, lastName, startLocation, clientVersion, channel, clientIP.Address.ToString(), mac, id0, LibOMVclient.ToString());
268 275
269 try 276 try
270 { 277 {
@@ -310,6 +317,12 @@ namespace OpenSim.Services.LLLoginService
310 return LLFailedLoginResponse.UserProblem; 317 return LLFailedLoginResponse.UserProblem;
311 } 318 }
312 319
320 if (account.UserLevel < 0)
321 {
322 m_log.InfoFormat("[LLOGIN SERVICE]: Login failed, reason: Unverified account");
323 return LLFailedLoginResponse.UnverifiedAccountProblem;
324 }
325
313 if (account.UserLevel < m_MinLoginLevel) 326 if (account.UserLevel < m_MinLoginLevel)
314 { 327 {
315 m_log.InfoFormat( 328 m_log.InfoFormat(
@@ -341,7 +354,8 @@ namespace OpenSim.Services.LLLoginService
341 if (!passwd.StartsWith("$1$")) 354 if (!passwd.StartsWith("$1$"))
342 passwd = "$1$" + Util.Md5Hash(passwd); 355 passwd = "$1$" + Util.Md5Hash(passwd);
343 passwd = passwd.Remove(0, 3); //remove $1$ 356 passwd = passwd.Remove(0, 3); //remove $1$
344 string token = m_AuthenticationService.Authenticate(account.PrincipalID, passwd, 30); 357 UUID realID;
358 string token = m_AuthenticationService.Authenticate(account.PrincipalID, passwd, 30, out realID);
345 UUID secureSession = UUID.Zero; 359 UUID secureSession = UUID.Zero;
346 if ((token == string.Empty) || (token != string.Empty && !UUID.TryParse(token, out secureSession))) 360 if ((token == string.Empty) || (token != string.Empty && !UUID.TryParse(token, out secureSession)))
347 { 361 {
@@ -508,11 +522,19 @@ namespace OpenSim.Services.LLLoginService
508 processedMessage = processedMessage.Replace("\\n", "\n").Replace("<USERNAME>", firstName + " " + lastName); 522 processedMessage = processedMessage.Replace("\\n", "\n").Replace("<USERNAME>", firstName + " " + lastName);
509 523
510 LLLoginResponse response 524 LLLoginResponse response
525<<<<<<< HEAD
511 = new LLLoginResponse( 526 = new LLLoginResponse(
512 account, aCircuit, guinfo, destination, inventorySkel, friendsList, m_LibraryService, 527 account, aCircuit, guinfo, destination, inventorySkel, friendsList, m_LibraryService,
513 where, startLocation, position, lookAt, gestures, processedMessage, home, clientIP, 528 where, startLocation, position, lookAt, gestures, processedMessage, home, clientIP,
514 m_MapTileURL, m_SearchURL, m_Currency, m_DSTZone, 529 m_MapTileURL, m_SearchURL, m_Currency, m_DSTZone,
515 m_DestinationGuide, m_AvatarPicker, m_ClassifiedFee, m_MaxAgentGroups); 530 m_DestinationGuide, m_AvatarPicker, m_ClassifiedFee, m_MaxAgentGroups);
531=======
532 = new LLLoginResponse(
533 account, aCircuit, guinfo, destination, inventorySkel, friendsList, m_LibraryService,
534 where, startLocation, position, lookAt, gestures, m_WelcomeMessage, home, clientIP,
535 m_MapTileURL, m_ProfileURL, m_OpenIDURL, m_SearchURL, m_Currency, m_DSTZone,
536 m_DestinationGuide, m_AvatarPicker, realID, m_ClassifiedFee);
537>>>>>>> avn/ubitvar
516 538
517 m_log.DebugFormat("[LLOGIN SERVICE]: All clear. Sending login response to {0} {1}", firstName, lastName); 539 m_log.DebugFormat("[LLOGIN SERVICE]: All clear. Sending login response to {0} {1}", firstName, lastName);
518 540
diff --git a/OpenSim/Services/MapImageService/MapImageService.cs b/OpenSim/Services/MapImageService/MapImageService.cs
index a816411..fcace3a 100644
--- a/OpenSim/Services/MapImageService/MapImageService.cs
+++ b/OpenSim/Services/MapImageService/MapImageService.cs
@@ -69,6 +69,8 @@ namespace OpenSim.Services.MapImageService
69 private static bool m_Initialized = false; 69 private static bool m_Initialized = false;
70 private static string m_WaterTileFile = string.Empty; 70 private static string m_WaterTileFile = string.Empty;
71 private static Color m_Watercolor = Color.FromArgb(29, 71, 95); 71 private static Color m_Watercolor = Color.FromArgb(29, 71, 95);
72 private static Bitmap m_WaterBitmap = null;
73 private static byte[] m_WaterBytes = null;
72 74
73 public MapImageService(IConfigSource config) 75 public MapImageService(IConfigSource config)
74 { 76 {
@@ -91,6 +93,18 @@ namespace OpenSim.Services.MapImageService
91 Bitmap waterTile = new Bitmap(IMAGE_WIDTH, IMAGE_WIDTH); 93 Bitmap waterTile = new Bitmap(IMAGE_WIDTH, IMAGE_WIDTH);
92 FillImage(waterTile, m_Watercolor); 94 FillImage(waterTile, m_Watercolor);
93 waterTile.Save(m_WaterTileFile, ImageFormat.Jpeg); 95 waterTile.Save(m_WaterTileFile, ImageFormat.Jpeg);
96 m_WaterBitmap = waterTile;
97 }
98
99 if (File.Exists(m_WaterTileFile))
100 {
101 m_WaterBitmap = new Bitmap(m_WaterTileFile);
102 using (MemoryStream ms = new MemoryStream())
103 {
104 m_WaterBitmap.Save(ms,ImageFormat.Jpeg);
105 ms.Seek(0, SeekOrigin.Begin);
106 m_WaterBytes = ms.ToArray();
107 }
94 } 108 }
95 } 109 }
96 } 110 }
@@ -98,10 +112,10 @@ namespace OpenSim.Services.MapImageService
98 112
99 #region IMapImageService 113 #region IMapImageService
100 114
101 public bool AddMapTile(int x, int y, byte[] imageData, out string reason) 115 public bool AddMapTile(int x, int y, byte[] imageData, UUID scopeID, out string reason)
102 { 116 {
103 reason = string.Empty; 117 reason = string.Empty;
104 string fileName = GetFileName(1, x, y); 118 string fileName = GetFileName(1, x, y, scopeID);
105 119
106 lock (m_Sync) 120 lock (m_Sync)
107 { 121 {
@@ -117,6 +131,7 @@ namespace OpenSim.Services.MapImageService
117 return false; 131 return false;
118 } 132 }
119 } 133 }
134<<<<<<< HEAD
120 135
121 return UpdateMultiResolutionFilesAsync(x, y, out reason); 136 return UpdateMultiResolutionFilesAsync(x, y, out reason);
122 } 137 }
@@ -125,24 +140,49 @@ namespace OpenSim.Services.MapImageService
125 { 140 {
126 reason = String.Empty; 141 reason = String.Empty;
127 string fileName = GetFileName(1, x, y); 142 string fileName = GetFileName(1, x, y);
143=======
144
145 return UpdateMultiResolutionFiles(x, y, scopeID, out reason);
146 }
147
148 public bool RemoveMapTile(int x, int y, UUID scopeID, out string reason)
149 {
150 reason = String.Empty;
151 string fileName = GetFileName(1, x, y, scopeID);
152>>>>>>> avn/ubitvar
128 153
129 lock (m_Sync) 154 lock (m_Sync)
130 { 155 {
131 try 156 try
157<<<<<<< HEAD
132 { 158 {
133 File.Delete(fileName); 159 File.Delete(fileName);
134 } 160 }
135 catch (Exception e) 161 catch (Exception e)
136 { 162 {
163=======
164 {
165 File.Delete(fileName);
166 }
167 catch (Exception e)
168 {
169>>>>>>> avn/ubitvar
137 m_log.WarnFormat("[MAP IMAGE SERVICE]: Unable to save delete file {0}: {1}", fileName, e); 170 m_log.WarnFormat("[MAP IMAGE SERVICE]: Unable to save delete file {0}: {1}", fileName, e);
138 reason = e.Message; 171 reason = e.Message;
139 return false; 172 return false;
140 } 173 }
141 } 174 }
175<<<<<<< HEAD
142 176
143 return UpdateMultiResolutionFilesAsync(x, y, out reason); 177 return UpdateMultiResolutionFilesAsync(x, y, out reason);
144 } 178 }
145 179
180=======
181
182 return UpdateMultiResolutionFiles(x, y, scopeID, out reason);
183 }
184
185>>>>>>> avn/ubitvar
146 // When large varregions start up, they can send piles of new map tiles. This causes 186 // When large varregions start up, they can send piles of new map tiles. This causes
147 // this multi-resolution routine to be called a zillion times an causes much CPU 187 // this multi-resolution routine to be called a zillion times an causes much CPU
148 // time to be spent creating multi-resolution tiles that will be replaced when 188 // time to be spent creating multi-resolution tiles that will be replaced when
@@ -151,6 +191,7 @@ namespace OpenSim.Services.MapImageService
151 { 191 {
152 public int xx; 192 public int xx;
153 public int yy; 193 public int yy;
194<<<<<<< HEAD
154 public mapToMultiRez(int pX, int pY) 195 public mapToMultiRez(int pX, int pY)
155 { 196 {
156 xx = pX; 197 xx = pX;
@@ -168,6 +209,29 @@ namespace OpenSim.Services.MapImageService
168 if (multiRezToBuild.Count == 1) 209 if (multiRezToBuild.Count == 1)
169 Util.FireAndForget( 210 Util.FireAndForget(
170 DoUpdateMultiResolutionFilesAsync, null, "MapImageService.DoUpdateMultiResolutionFilesAsync"); 211 DoUpdateMultiResolutionFilesAsync, null, "MapImageService.DoUpdateMultiResolutionFilesAsync");
212=======
213 public UUID scopeID;
214 public mapToMultiRez(int pX, int pY, UUID pscopeID)
215 {
216 xx = pX;
217 yy = pY;
218 scopeID = pscopeID;
219 }
220 };
221 private Queue<mapToMultiRez> multiRezToBuild = new Queue<mapToMultiRez>();
222
223 private bool UpdateMultiResolutionFiles(int x, int y, UUID scopeID, out string reason)
224 {
225 reason = String.Empty;
226
227 lock (multiRezToBuild)
228 {
229 // m_log.DebugFormat("{0} UpdateMultiResolutionFilesAsync: scheduling update for <{1},{2}>", LogHeader, x, y);
230 multiRezToBuild.Enqueue(new mapToMultiRez(x, y, scopeID));
231 if (multiRezToBuild.Count == 1)
232 Util.FireAndForget(
233 DoUpdateMultiResolutionFilesAsync);
234>>>>>>> avn/ubitvar
171 } 235 }
172 236
173 return true; 237 return true;
@@ -175,10 +239,15 @@ namespace OpenSim.Services.MapImageService
175 239
176 private void DoUpdateMultiResolutionFilesAsync(object o) 240 private void DoUpdateMultiResolutionFilesAsync(object o)
177 { 241 {
242<<<<<<< HEAD
178 // This sleep causes the FireAndForget thread to be different than the invocation thread. 243 // This sleep causes the FireAndForget thread to be different than the invocation thread.
179 // It also allows other tiles to be uploaded so the multi-rez images are more likely 244 // It also allows other tiles to be uploaded so the multi-rez images are more likely
180 // to be correct. 245 // to be correct.
181 Thread.Sleep(1 * 1000); 246 Thread.Sleep(1 * 1000);
247=======
248 // let acumulate large region tiles
249 Thread.Sleep(60 * 1000); // large regions take time to upload tiles
250>>>>>>> avn/ubitvar
182 251
183 while (multiRezToBuild.Count > 0) 252 while (multiRezToBuild.Count > 0)
184 { 253 {
@@ -192,20 +261,35 @@ namespace OpenSim.Services.MapImageService
192 { 261 {
193 int x = toMultiRez.xx; 262 int x = toMultiRez.xx;
194 int y = toMultiRez.yy; 263 int y = toMultiRez.yy;
264<<<<<<< HEAD
265 // m_log.DebugFormat("{0} DoUpdateMultiResolutionFilesAsync: doing build for <{1},{2}>", LogHeader, x, y);
266
267=======
268 UUID scopeID = toMultiRez.scopeID;
195 // m_log.DebugFormat("{0} DoUpdateMultiResolutionFilesAsync: doing build for <{1},{2}>", LogHeader, x, y); 269 // m_log.DebugFormat("{0} DoUpdateMultiResolutionFilesAsync: doing build for <{1},{2}>", LogHeader, x, y);
196 270
271 int width = 1;
272>>>>>>> avn/ubitvar
197 // Stitch seven more aggregate tiles together 273 // Stitch seven more aggregate tiles together
198 for (uint zoomLevel = 2; zoomLevel <= ZOOM_LEVELS; zoomLevel++) 274 for (uint zoomLevel = 2; zoomLevel <= ZOOM_LEVELS; zoomLevel++)
199 { 275 {
200 // Calculate the width (in full resolution tiles) and bottom-left 276 // Calculate the width (in full resolution tiles) and bottom-left
201 // corner of the current zoom level 277 // corner of the current zoom level
278<<<<<<< HEAD
202 int width = (int)Math.Pow(2, (double)(zoomLevel - 1)); 279 int width = (int)Math.Pow(2, (double)(zoomLevel - 1));
280=======
281 width *= 2;
282>>>>>>> avn/ubitvar
203 int x1 = x - (x % width); 283 int x1 = x - (x % width);
204 int y1 = y - (y % width); 284 int y1 = y - (y % width);
205 285
206 lock (m_Sync) // must lock the reading and writing of the maptile files 286 lock (m_Sync) // must lock the reading and writing of the maptile files
207 { 287 {
288<<<<<<< HEAD
208 if (!CreateTile(zoomLevel, x1, y1)) 289 if (!CreateTile(zoomLevel, x1, y1))
290=======
291 if (!CreateTile(zoomLevel, x1, y1, scopeID))
292>>>>>>> avn/ubitvar
209 { 293 {
210 m_log.WarnFormat("[MAP IMAGE SERVICE]: Unable to create tile for {0},{1} at zoom level {1}", x, y, zoomLevel); 294 m_log.WarnFormat("[MAP IMAGE SERVICE]: Unable to create tile for {0},{1} at zoom level {1}", x, y, zoomLevel);
211 return; 295 return;
@@ -214,25 +298,29 @@ namespace OpenSim.Services.MapImageService
214 } 298 }
215 } 299 }
216 } 300 }
301<<<<<<< HEAD
217 302
303=======
304>>>>>>> avn/ubitvar
218 return; 305 return;
219 } 306 }
220 307
221 public byte[] GetMapTile(string fileName, out string format) 308 public byte[] GetMapTile(string fileName, UUID scopeID, out string format)
222 { 309 {
223// m_log.DebugFormat("[MAP IMAGE SERVICE]: Getting map tile {0}", fileName); 310// m_log.DebugFormat("[MAP IMAGE SERVICE]: Getting map tile {0}", fileName);
224 311
225 format = ".jpg"; 312 format = ".jpg";
226 string fullName = Path.Combine(m_TilesStoragePath, fileName); 313 string fullName = Path.Combine(m_TilesStoragePath, scopeID.ToString());
314 fullName = Path.Combine(fullName, fileName);
227 if (File.Exists(fullName)) 315 if (File.Exists(fullName))
228 { 316 {
229 format = Path.GetExtension(fileName).ToLower(); 317 format = Path.GetExtension(fileName).ToLower();
230 //m_log.DebugFormat("[MAP IMAGE SERVICE]: Found file {0}, extension {1}", fileName, format); 318 //m_log.DebugFormat("[MAP IMAGE SERVICE]: Found file {0}, extension {1}", fileName, format);
231 return File.ReadAllBytes(fullName); 319 return File.ReadAllBytes(fullName);
232 } 320 }
233 else if (File.Exists(m_WaterTileFile)) 321 else if (m_WaterBytes != null)
234 { 322 {
235 return File.ReadAllBytes(m_WaterTileFile); 323 return (byte[])m_WaterBytes.Clone();
236 } 324 }
237 else 325 else
238 { 326 {
@@ -244,10 +332,12 @@ namespace OpenSim.Services.MapImageService
244 #endregion 332 #endregion
245 333
246 334
247 private string GetFileName(uint zoomLevel, int x, int y) 335 private string GetFileName(uint zoomLevel, int x, int y, UUID scopeID)
248 { 336 {
249 string extension = "jpg"; 337 string extension = "jpg";
250 return Path.Combine(m_TilesStoragePath, string.Format("map-{0}-{1}-{2}-objects.{3}", zoomLevel, x, y, extension)); 338 string path = Path.Combine(m_TilesStoragePath, scopeID.ToString());
339 Directory.CreateDirectory(path);
340 return Path.Combine(path, string.Format("map-{0}-{1}-{2}-objects.{3}", zoomLevel, x, y, extension));
251 } 341 }
252 342
253 private Bitmap GetInputTileImage(string fileName) 343 private Bitmap GetInputTileImage(string fileName)
@@ -276,7 +366,7 @@ namespace OpenSim.Services.MapImageService
276 { 366 {
277 // Create a new output tile with a transparent background 367 // Create a new output tile with a transparent background
278 Bitmap bm = new Bitmap(IMAGE_WIDTH, IMAGE_WIDTH, PixelFormat.Format24bppRgb); 368 Bitmap bm = new Bitmap(IMAGE_WIDTH, IMAGE_WIDTH, PixelFormat.Format24bppRgb);
279 bm.MakeTransparent(); 369 //bm.MakeTransparent(); // 24bpp does not have transparency, this whould make it 32bpp
280 return bm; 370 return bm;
281 } 371 }
282 } 372 }
@@ -288,7 +378,7 @@ namespace OpenSim.Services.MapImageService
288 return null; 378 return null;
289 } 379 }
290 380
291 private bool CreateTile(uint zoomLevel, int x, int y) 381 private bool CreateTile(uint zoomLevel, int x, int y, UUID scopeID)
292 { 382 {
293// m_log.DebugFormat("[MAP IMAGE SERVICE]: Create tile for {0} {1}, zoom {2}", x, y, zoomLevel); 383// m_log.DebugFormat("[MAP IMAGE SERVICE]: Create tile for {0} {1}, zoom {2}", x, y, zoomLevel);
294 int prevWidth = (int)Math.Pow(2, (double)zoomLevel - 2); 384 int prevWidth = (int)Math.Pow(2, (double)zoomLevel - 2);
@@ -303,55 +393,60 @@ namespace OpenSim.Services.MapImageService
303 int yOut = y - (y % thisWidth); 393 int yOut = y - (y % thisWidth);
304 394
305 // Try to open the four input tiles from the previous zoom level 395 // Try to open the four input tiles from the previous zoom level
306 Bitmap inputBL = GetInputTileImage(GetFileName(zoomLevel - 1, xIn, yIn)); 396 Bitmap inputBL = GetInputTileImage(GetFileName(zoomLevel - 1, xIn, yIn, scopeID));
307 Bitmap inputBR = GetInputTileImage(GetFileName(zoomLevel - 1, xIn + prevWidth, yIn)); 397 Bitmap inputBR = GetInputTileImage(GetFileName(zoomLevel - 1, xIn + prevWidth, yIn, scopeID));
308 Bitmap inputTL = GetInputTileImage(GetFileName(zoomLevel - 1, xIn, yIn + prevWidth)); 398 Bitmap inputTL = GetInputTileImage(GetFileName(zoomLevel - 1, xIn, yIn + prevWidth, scopeID));
309 Bitmap inputTR = GetInputTileImage(GetFileName(zoomLevel - 1, xIn + prevWidth, yIn + prevWidth)); 399 Bitmap inputTR = GetInputTileImage(GetFileName(zoomLevel - 1, xIn + prevWidth, yIn + prevWidth, scopeID));
310 400
311 // Open the output tile (current zoom level) 401 // Open the output tile (current zoom level)
312 string outputFile = GetFileName(zoomLevel, xOut, yOut); 402 string outputFile = GetFileName(zoomLevel, xOut, yOut, scopeID);
313 Bitmap output = GetOutputTileImage(outputFile); 403
314 if (output == null) 404 int ntiles = 0;
315 return false; 405 Bitmap output = (Bitmap)m_WaterBitmap.Clone();
316 FillImage(output, m_Watercolor);
317 406
318 if (inputBL != null) 407 if (inputBL != null)
319 { 408 {
320 ImageCopyResampled(output, inputBL, 0, HALF_WIDTH, 0, 0); 409 ImageCopyResampled(output, inputBL, 0, HALF_WIDTH, 0, 0);
321 inputBL.Dispose(); 410 inputBL.Dispose();
411 ntiles++;
322 } 412 }
323 if (inputBR != null) 413 if (inputBR != null)
324 { 414 {
325 ImageCopyResampled(output, inputBR, HALF_WIDTH, HALF_WIDTH, 0, 0); 415 ImageCopyResampled(output, inputBR, HALF_WIDTH, HALF_WIDTH, 0, 0);
326 inputBR.Dispose(); 416 inputBR.Dispose();
417 ntiles++;
327 } 418 }
328 if (inputTL != null) 419 if (inputTL != null)
329 { 420 {
330 ImageCopyResampled(output, inputTL, 0, 0, 0, 0); 421 ImageCopyResampled(output, inputTL, 0, 0, 0, 0);
331 inputTL.Dispose(); 422 inputTL.Dispose();
423 ntiles++;
332 } 424 }
333 if (inputTR != null) 425 if (inputTR != null)
334 { 426 {
335 ImageCopyResampled(output, inputTR, HALF_WIDTH, 0, 0, 0); 427 ImageCopyResampled(output, inputTR, HALF_WIDTH, 0, 0, 0);
336 inputTR.Dispose(); 428 inputTR.Dispose();
429 ntiles++;
337 } 430 }
338 431
339 // Write the modified output 432 // Write the modified output
340 try 433 if (ntiles == 0)
434 File.Delete(outputFile);
435
436 else
341 { 437 {
342 using (Bitmap final = new Bitmap(output)) 438
439 try
343 { 440 {
344 output.Dispose(); 441 output.Save(outputFile, ImageFormat.Jpeg);
345 final.Save(outputFile, ImageFormat.Jpeg);
346 } 442 }
347 } 443 catch (Exception e)
348 catch (Exception e) 444 {
349 { 445 m_log.WarnFormat("[MAP IMAGE SERVICE]: Oops on saving {0} {1}", outputFile, e);
350 m_log.WarnFormat("[MAP IMAGE SERVICE]: Oops on saving {0} {1}", outputFile, e); 446 }
351 } 447 } // Save also as png?
352
353 // Save also as png?
354 448
449 output.Dispose();
355 return true; 450 return true;
356 } 451 }
357 452
diff --git a/OpenSim/Services/SimulationService/SimulationDataService.cs b/OpenSim/Services/SimulationService/SimulationDataService.cs
index d9684c4..7a544fa 100644
--- a/OpenSim/Services/SimulationService/SimulationDataService.cs
+++ b/OpenSim/Services/SimulationService/SimulationDataService.cs
@@ -173,6 +173,11 @@ namespace OpenSim.Services.SimulationService
173 m_database.RemoveRegionEnvironmentSettings(regionUUID); 173 m_database.RemoveRegionEnvironmentSettings(regionUUID);
174 } 174 }
175 175
176 public UUID[] GetObjectIDs(UUID regionID)
177 {
178 return m_database.GetObjectIDs(regionID);
179 }
180
176 public void SaveExtra(UUID regionID, string name, string val) 181 public void SaveExtra(UUID regionID, string name, string val)
177 { 182 {
178 m_database.SaveExtra(regionID, name, val); 183 m_database.SaveExtra(regionID, name, val);
diff --git a/OpenSim/Services/UserAccountService/UserAccountService.cs b/OpenSim/Services/UserAccountService/UserAccountService.cs
index 2e19ece..987a07d 100644
--- a/OpenSim/Services/UserAccountService/UserAccountService.cs
+++ b/OpenSim/Services/UserAccountService/UserAccountService.cs
@@ -176,6 +176,10 @@ namespace OpenSim.Services.UserAccountService
176 Int32.TryParse(d.Data["UserLevel"], out u.UserLevel); 176 Int32.TryParse(d.Data["UserLevel"], out u.UserLevel);
177 if (d.Data.ContainsKey("UserFlags") && d.Data["UserFlags"] != null) 177 if (d.Data.ContainsKey("UserFlags") && d.Data["UserFlags"] != null)
178 Int32.TryParse(d.Data["UserFlags"], out u.UserFlags); 178 Int32.TryParse(d.Data["UserFlags"], out u.UserFlags);
179 if (d.Data.ContainsKey("UserCountry") && d.Data["UserCountry"] != null)
180 u.UserCountry = d.Data["UserCountry"].ToString();
181 else
182 u.UserTitle = string.Empty;
179 183
180 if (d.Data.ContainsKey("ServiceURLs") && d.Data["ServiceURLs"] != null) 184 if (d.Data.ContainsKey("ServiceURLs") && d.Data["ServiceURLs"] != null)
181 { 185 {
@@ -301,7 +305,22 @@ namespace OpenSim.Services.UserAccountService
301 305
302 public List<UserAccount> GetUserAccounts(UUID scopeID, string query) 306 public List<UserAccount> GetUserAccounts(UUID scopeID, string query)
303 { 307 {
304 UserAccountData[] d = m_Database.GetUsers(scopeID, query); 308 UserAccountData[] d = m_Database.GetUsers(scopeID, query.Trim());
309
310 if (d == null)
311 return new List<UserAccount>();
312
313 List<UserAccount> ret = new List<UserAccount>();
314
315 foreach (UserAccountData data in d)
316 ret.Add(MakeUserAccount(data));
317
318 return ret;
319 }
320
321 public List<UserAccount> GetUserAccountsWhere(UUID scopeID, string where)
322 {
323 UserAccountData[] d = m_Database.GetUsersWhere(scopeID, where);
305 324
306 if (d == null) 325 if (d == null)
307 return new List<UserAccount>(); 326 return new List<UserAccount>();
diff --git a/OpenSim/Services/UserProfilesService/UserProfilesService.cs b/OpenSim/Services/UserProfilesService/UserProfilesService.cs
index 96c13c0..35fe31b 100644
--- a/OpenSim/Services/UserProfilesService/UserProfilesService.cs
+++ b/OpenSim/Services/UserProfilesService/UserProfilesService.cs
@@ -159,6 +159,7 @@ namespace OpenSim.Services.ProfilesService
159 } 159 }
160 #endregion Interests 160 #endregion Interests
161 161
162 /*
162 #region User Preferences 163 #region User Preferences
163 public bool UserPreferencesUpdate(ref UserPreferences pref, ref string result) 164 public bool UserPreferencesUpdate(ref UserPreferences pref, ref string result)
164 { 165 {
@@ -238,6 +239,7 @@ namespace OpenSim.Services.ProfilesService
238 return true; 239 return true;
239 } 240 }
240 #endregion User Preferences 241 #endregion User Preferences
242 */
241 243
242 #region Utility 244 #region Utility
243 public OSD AvatarImageAssetsRequest(UUID avatarId) 245 public OSD AvatarImageAssetsRequest(UUID avatarId)