aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Services
diff options
context:
space:
mode:
authorMic Bowman2011-08-05 11:13:02 -0700
committerMic Bowman2011-08-05 11:13:02 -0700
commitc3f579046c4de7a5a65e71e4c02958425fd7998a (patch)
treeb725d9eaa66d5eb7cf1f87ddbb4fa0f4284f71f5 /OpenSim/Services
parentBulletSim: Parameters settable from ini file. Linksets. Physical property val... (diff)
parentremove the largely unused copy/pasted HandleAgentRequestSit() method (diff)
downloadopensim-SC-c3f579046c4de7a5a65e71e4c02958425fd7998a.zip
opensim-SC-c3f579046c4de7a5a65e71e4c02958425fd7998a.tar.gz
opensim-SC-c3f579046c4de7a5a65e71e4c02958425fd7998a.tar.bz2
opensim-SC-c3f579046c4de7a5a65e71e4c02958425fd7998a.tar.xz
Merge branch 'master' into bulletsim
Diffstat (limited to 'OpenSim/Services')
-rw-r--r--OpenSim/Services/AuthorizationService/AuthorizationService.cs5
-rw-r--r--OpenSim/Services/AvatarService/AvatarService.cs30
-rw-r--r--OpenSim/Services/Connectors/Avatar/AvatarServiceConnector.cs2
-rw-r--r--OpenSim/Services/Connectors/SimianGrid/SimianAvatarServiceConnector.cs4
-rw-r--r--OpenSim/Services/GridService/GridService.cs33
-rw-r--r--OpenSim/Services/Interfaces/IAuthorizationService.cs32
-rw-r--r--OpenSim/Services/Interfaces/IAvatarService.cs4
-rw-r--r--OpenSim/Services/Interfaces/IGridService.cs6
-rw-r--r--OpenSim/Services/InventoryService/LibraryService.cs9
-rw-r--r--OpenSim/Services/LLLoginService/LLLoginService.cs2
10 files changed, 93 insertions, 34 deletions
diff --git a/OpenSim/Services/AuthorizationService/AuthorizationService.cs b/OpenSim/Services/AuthorizationService/AuthorizationService.cs
index d658368..03da6e1 100644
--- a/OpenSim/Services/AuthorizationService/AuthorizationService.cs
+++ b/OpenSim/Services/AuthorizationService/AuthorizationService.cs
@@ -48,10 +48,11 @@ namespace OpenSim.Services.AuthorizationService
48 m_log.Info("[AUTHORIZATION CONNECTOR]: Local Authorization service enabled"); 48 m_log.Info("[AUTHORIZATION CONNECTOR]: Local Authorization service enabled");
49 } 49 }
50 50
51 public bool IsAuthorizedForRegion(string userID, string regionID, out string message) 51 public bool IsAuthorizedForRegion(
52 string userID, string firstName, string lastName, string regionID, out string message)
52 { 53 {
53 message = "Authorized"; 54 message = "Authorized";
54 return true; 55 return true;
55 } 56 }
56 } 57 }
57} 58} \ No newline at end of file
diff --git a/OpenSim/Services/AvatarService/AvatarService.cs b/OpenSim/Services/AvatarService/AvatarService.cs
index 53ca7c8..c59a9e0 100644
--- a/OpenSim/Services/AvatarService/AvatarService.cs
+++ b/OpenSim/Services/AvatarService/AvatarService.cs
@@ -54,7 +54,7 @@ namespace OpenSim.Services.AvatarService
54 public AvatarAppearance GetAppearance(UUID principalID) 54 public AvatarAppearance GetAppearance(UUID principalID)
55 { 55 {
56 AvatarData avatar = GetAvatar(principalID); 56 AvatarData avatar = GetAvatar(principalID);
57 return avatar.ToAvatarAppearance(principalID); 57 return avatar.ToAvatarAppearance();
58 } 58 }
59 59
60 public bool SetAppearance(UUID principalID, AvatarAppearance appearance) 60 public bool SetAppearance(UUID principalID, AvatarAppearance appearance)
@@ -109,7 +109,33 @@ namespace OpenSim.Services.AvatarService
109 foreach (KeyValuePair<string,string> kvp in avatar.Data) 109 foreach (KeyValuePair<string,string> kvp in avatar.Data)
110 { 110 {
111 av.Data["Name"] = kvp.Key; 111 av.Data["Name"] = kvp.Key;
112 av.Data["Value"] = kvp.Value; 112
113 // justincc 20110730. Yes, this is a hack to get around the fact that a bug in OpenSim is causing
114 // various simulators on osgrid to inject bad values. Since these simulators might be around for a
115 // long time, we are going to manually police the value.
116 //
117 // It should be possible to remove this in half a year if we don't want to police values server side.
118 if (kvp.Key == "AvatarHeight")
119 {
120 float height;
121 if (!float.TryParse(kvp.Value, out height) || height < 0 || height > 10)
122 {
123 string rawHeight = kvp.Value.Replace(",", ".");
124
125 if (!float.TryParse(rawHeight, out height) || height < 0 || height > 10)
126 height = 1.771488f;
127
128 m_log.DebugFormat(
129 "[AVATAR SERVICE]: Rectifying height of avatar {0} from {1} to {2}",
130 principalID, kvp.Value, height);
131 }
132
133 av.Data["Value"] = height.ToString();
134 }
135 else
136 {
137 av.Data["Value"] = kvp.Value;
138 }
113 139
114 if (!m_Database.Store(av)) 140 if (!m_Database.Store(av))
115 { 141 {
diff --git a/OpenSim/Services/Connectors/Avatar/AvatarServiceConnector.cs b/OpenSim/Services/Connectors/Avatar/AvatarServiceConnector.cs
index 1a93ae7..8fdb4d0 100644
--- a/OpenSim/Services/Connectors/Avatar/AvatarServiceConnector.cs
+++ b/OpenSim/Services/Connectors/Avatar/AvatarServiceConnector.cs
@@ -89,7 +89,7 @@ namespace OpenSim.Services.Connectors
89 public AvatarAppearance GetAppearance(UUID userID) 89 public AvatarAppearance GetAppearance(UUID userID)
90 { 90 {
91 AvatarData avatar = GetAvatar(userID); 91 AvatarData avatar = GetAvatar(userID);
92 return avatar.ToAvatarAppearance(userID); 92 return avatar.ToAvatarAppearance();
93 } 93 }
94 94
95 public bool SetAppearance(UUID userID, AvatarAppearance appearance) 95 public bool SetAppearance(UUID userID, AvatarAppearance appearance)
diff --git a/OpenSim/Services/Connectors/SimianGrid/SimianAvatarServiceConnector.cs b/OpenSim/Services/Connectors/SimianGrid/SimianAvatarServiceConnector.cs
index 810399c..360f0dd 100644
--- a/OpenSim/Services/Connectors/SimianGrid/SimianAvatarServiceConnector.cs
+++ b/OpenSim/Services/Connectors/SimianGrid/SimianAvatarServiceConnector.cs
@@ -213,7 +213,7 @@ namespace OpenSim.Services.Connectors.SimianGrid
213 wearables[11] = new AvatarWearable(map["UnderpantsItem"].AsUUID(), map["UnderpantsAsset"].AsUUID()); 213 wearables[11] = new AvatarWearable(map["UnderpantsItem"].AsUUID(), map["UnderpantsAsset"].AsUUID());
214 wearables[12] = new AvatarWearable(map["SkirtItem"].AsUUID(), map["SkirtAsset"].AsUUID()); 214 wearables[12] = new AvatarWearable(map["SkirtItem"].AsUUID(), map["SkirtAsset"].AsUUID());
215 215
216 AvatarAppearance appearance = new AvatarAppearance(userID); 216 AvatarAppearance appearance = new AvatarAppearance();
217 appearance.Wearables = wearables; 217 appearance.Wearables = wearables;
218 appearance.AvatarHeight = (float)map["Height"].AsReal(); 218 appearance.AvatarHeight = (float)map["Height"].AsReal();
219 219
@@ -257,7 +257,7 @@ namespace OpenSim.Services.Connectors.SimianGrid
257 257
258 if (avatar.AvatarType == 1) // LLAvatar 258 if (avatar.AvatarType == 1) // LLAvatar
259 { 259 {
260 AvatarAppearance appearance = avatar.ToAvatarAppearance(userID); 260 AvatarAppearance appearance = avatar.ToAvatarAppearance();
261 261
262 OSDMap map = new OSDMap(); 262 OSDMap map = new OSDMap();
263 263
diff --git a/OpenSim/Services/GridService/GridService.cs b/OpenSim/Services/GridService/GridService.cs
index 985d77b..f663dd6 100644
--- a/OpenSim/Services/GridService/GridService.cs
+++ b/OpenSim/Services/GridService/GridService.cs
@@ -320,18 +320,25 @@ namespace OpenSim.Services.GridService
320 return null; 320 return null;
321 } 321 }
322 322
323 public GridRegion GetRegionByName(UUID scopeID, string regionName) 323 public GridRegion GetRegionByName(UUID scopeID, string name)
324 { 324 {
325 List<RegionData> rdatas = m_Database.Get(regionName + "%", scopeID); 325 List<RegionData> rdatas = m_Database.Get(name, scopeID);
326 if ((rdatas != null) && (rdatas.Count > 0)) 326 if ((rdatas != null) && (rdatas.Count > 0))
327 return RegionData2RegionInfo(rdatas[0]); // get the first 327 return RegionData2RegionInfo(rdatas[0]); // get the first
328 328
329 if (m_AllowHypergridMapSearch)
330 {
331 GridRegion r = GetHypergridRegionByName(scopeID, name);
332 if (r != null)
333 return r;
334 }
335
329 return null; 336 return null;
330 } 337 }
331 338
332 public List<GridRegion> GetRegionsByName(UUID scopeID, string name, int maxNumber) 339 public List<GridRegion> GetRegionsByName(UUID scopeID, string name, int maxNumber)
333 { 340 {
334 m_log.DebugFormat("[GRID SERVICE]: GetRegionsByName {0}", name); 341// m_log.DebugFormat("[GRID SERVICE]: GetRegionsByName {0}", name);
335 342
336 List<RegionData> rdatas = m_Database.Get(name + "%", scopeID); 343 List<RegionData> rdatas = m_Database.Get(name + "%", scopeID);
337 344
@@ -340,7 +347,7 @@ namespace OpenSim.Services.GridService
340 347
341 if (rdatas != null) 348 if (rdatas != null)
342 { 349 {
343 m_log.DebugFormat("[GRID SERVICE]: Found {0} regions", rdatas.Count); 350// m_log.DebugFormat("[GRID SERVICE]: Found {0} regions", rdatas.Count);
344 foreach (RegionData rdata in rdatas) 351 foreach (RegionData rdata in rdatas)
345 { 352 {
346 if (count++ < maxNumber) 353 if (count++ < maxNumber)
@@ -348,9 +355,9 @@ namespace OpenSim.Services.GridService
348 } 355 }
349 } 356 }
350 357
351 if (m_AllowHypergridMapSearch && (rdatas == null || (rdatas != null && rdatas.Count == 0)) && name.Contains(".")) 358 if (m_AllowHypergridMapSearch && (rdatas == null || (rdatas != null && rdatas.Count == 0)))
352 { 359 {
353 GridRegion r = m_HypergridLinker.LinkRegion(scopeID, name); 360 GridRegion r = GetHypergridRegionByName(scopeID, name);
354 if (r != null) 361 if (r != null)
355 rinfos.Add(r); 362 rinfos.Add(r);
356 } 363 }
@@ -358,6 +365,20 @@ namespace OpenSim.Services.GridService
358 return rinfos; 365 return rinfos;
359 } 366 }
360 367
368 /// <summary>
369 /// Get a hypergrid region.
370 /// </summary>
371 /// <param name="scopeID"></param>
372 /// <param name="name"></param>
373 /// <returns>null if no hypergrid region could be found.</returns>
374 protected GridRegion GetHypergridRegionByName(UUID scopeID, string name)
375 {
376 if (name.Contains("."))
377 return m_HypergridLinker.LinkRegion(scopeID, name);
378 else
379 return null;
380 }
381
361 public List<GridRegion> GetRegionRange(UUID scopeID, int xmin, int xmax, int ymin, int ymax) 382 public List<GridRegion> GetRegionRange(UUID scopeID, int xmin, int xmax, int ymin, int ymax)
362 { 383 {
363 int xminSnap = (int)(xmin / Constants.RegionSize) * (int)Constants.RegionSize; 384 int xminSnap = (int)(xmin / Constants.RegionSize) * (int)Constants.RegionSize;
diff --git a/OpenSim/Services/Interfaces/IAuthorizationService.cs b/OpenSim/Services/Interfaces/IAuthorizationService.cs
index c5d577a..e5c68f6 100644
--- a/OpenSim/Services/Interfaces/IAuthorizationService.cs
+++ b/OpenSim/Services/Interfaces/IAuthorizationService.cs
@@ -34,14 +34,21 @@ namespace OpenSim.Services.Interfaces
34 34
35 public interface IAuthorizationService 35 public interface IAuthorizationService
36 { 36 {
37 ////////////////////////////////////////////////////// 37 /// <summary>
38 // Authorized 38 /// Check whether the user should be given access to the region.
39 // 39 /// </summary>
40 // This method returns a simple true false indicating 40 /// <remarks>
41 // whether or not a user has access to the region 41 /// We also supply user first name and last name for situations where the user does not have an account
42 // 42 /// on the region (e.g. they're a visitor via Hypergrid).
43 bool IsAuthorizedForRegion(string userID, string regionID, out string message); 43 /// </remarks>
44 44 /// <param name="userID"></param>
45 /// <param name="firstName">/param>
46 /// <param name="lastName"></param>
47 /// <param name="regionID"></param>
48 /// <param name="message"></param>
49 /// <returns></returns>
50 bool IsAuthorizedForRegion(
51 string userID, string firstName, string lastName, string regionID, out string message);
45 } 52 }
46 53
47 public class AuthorizationRequest 54 public class AuthorizationRequest
@@ -63,7 +70,8 @@ namespace OpenSim.Services.Interfaces
63 m_regionID = RegionID; 70 m_regionID = RegionID;
64 } 71 }
65 72
66 public AuthorizationRequest(string ID,string FirstName, string SurName, string Email, string RegionName, string RegionID) 73 public AuthorizationRequest(
74 string ID, string FirstName, string SurName, string Email, string RegionName, string RegionID)
67 { 75 {
68 m_userID = ID; 76 m_userID = ID;
69 m_firstname = FirstName; 77 m_firstname = FirstName;
@@ -108,9 +116,6 @@ namespace OpenSim.Services.Interfaces
108 get { return m_regionID; } 116 get { return m_regionID; }
109 set { m_regionID = value; } 117 set { m_regionID = value; }
110 } 118 }
111
112
113
114 } 119 }
115 120
116 public class AuthorizationResponse 121 public class AuthorizationResponse
@@ -126,7 +131,6 @@ namespace OpenSim.Services.Interfaces
126 { 131 {
127 m_isAuthorized = isAuthorized; 132 m_isAuthorized = isAuthorized;
128 m_message = message; 133 m_message = message;
129
130 } 134 }
131 135
132 public bool IsAuthorized 136 public bool IsAuthorized
@@ -141,4 +145,4 @@ namespace OpenSim.Services.Interfaces
141 set { m_message = value; } 145 set { m_message = value; }
142 } 146 }
143 } 147 }
144} 148} \ No newline at end of file
diff --git a/OpenSim/Services/Interfaces/IAvatarService.cs b/OpenSim/Services/Interfaces/IAvatarService.cs
index d7af562..0d5ab7d 100644
--- a/OpenSim/Services/Interfaces/IAvatarService.cs
+++ b/OpenSim/Services/Interfaces/IAvatarService.cs
@@ -180,9 +180,9 @@ namespace OpenSim.Services.Interfaces
180 } 180 }
181 } 181 }
182 182
183 public AvatarAppearance ToAvatarAppearance(UUID owner) 183 public AvatarAppearance ToAvatarAppearance()
184 { 184 {
185 AvatarAppearance appearance = new AvatarAppearance(owner); 185 AvatarAppearance appearance = new AvatarAppearance();
186 186
187 if (Data.Count == 0) 187 if (Data.Count == 0)
188 return appearance; 188 return appearance;
diff --git a/OpenSim/Services/Interfaces/IGridService.cs b/OpenSim/Services/Interfaces/IGridService.cs
index a34f0be..41dd20c 100644
--- a/OpenSim/Services/Interfaces/IGridService.cs
+++ b/OpenSim/Services/Interfaces/IGridService.cs
@@ -71,6 +71,12 @@ namespace OpenSim.Services.Interfaces
71 /// <returns></returns> 71 /// <returns></returns>
72 GridRegion GetRegionByPosition(UUID scopeID, int x, int y); 72 GridRegion GetRegionByPosition(UUID scopeID, int x, int y);
73 73
74 /// <summary>
75 /// Get information about a region which exactly matches the name given.
76 /// </summary>
77 /// <param name="scopeID"></param>
78 /// <param name="regionName"></param>
79 /// <returns>Returns the region information if the name matched. Null otherwise.</returns>
74 GridRegion GetRegionByName(UUID scopeID, string regionName); 80 GridRegion GetRegionByName(UUID scopeID, string regionName);
75 81
76 /// <summary> 82 /// <summary>
diff --git a/OpenSim/Services/InventoryService/LibraryService.cs b/OpenSim/Services/InventoryService/LibraryService.cs
index 383f311..f90895b 100644
--- a/OpenSim/Services/InventoryService/LibraryService.cs
+++ b/OpenSim/Services/InventoryService/LibraryService.cs
@@ -193,10 +193,11 @@ namespace OpenSim.Services.InventoryService
193 item.Description = config.GetString("description", item.Name); 193 item.Description = config.GetString("description", item.Name);
194 item.InvType = config.GetInt("inventoryType", 0); 194 item.InvType = config.GetInt("inventoryType", 0);
195 item.AssetType = config.GetInt("assetType", item.InvType); 195 item.AssetType = config.GetInt("assetType", item.InvType);
196 item.CurrentPermissions = (uint)config.GetLong("currentPermissions", 0x7FFFFFFF); 196 item.CurrentPermissions = (uint)config.GetLong("currentPermissions", (uint)PermissionMask.All);
197 item.NextPermissions = (uint)config.GetLong("nextPermissions", 0x7FFFFFFF); 197 item.NextPermissions = (uint)config.GetLong("nextPermissions", (uint)PermissionMask.All);
198 item.EveryOnePermissions = (uint)config.GetLong("everyonePermissions", 0x7FFFFFFF); 198 item.EveryOnePermissions
199 item.BasePermissions = (uint)config.GetLong("basePermissions", 0x7FFFFFFF); 199 = (uint)config.GetLong("everyonePermissions", (uint)PermissionMask.All - (uint)PermissionMask.Modify);
200 item.BasePermissions = (uint)config.GetLong("basePermissions", (uint)PermissionMask.All);
200 item.Flags = (uint)config.GetInt("flags", 0); 201 item.Flags = (uint)config.GetInt("flags", 0);
201 202
202 if (libraryFolders.ContainsKey(item.Folder)) 203 if (libraryFolders.ContainsKey(item.Folder))
diff --git a/OpenSim/Services/LLLoginService/LLLoginService.cs b/OpenSim/Services/LLLoginService/LLLoginService.cs
index 2b15896..00405a1 100644
--- a/OpenSim/Services/LLLoginService/LLLoginService.cs
+++ b/OpenSim/Services/LLLoginService/LLLoginService.cs
@@ -785,7 +785,7 @@ namespace OpenSim.Services.LLLoginService
785 if (avatar != null) 785 if (avatar != null)
786 aCircuit.Appearance = new AvatarAppearance(avatar); 786 aCircuit.Appearance = new AvatarAppearance(avatar);
787 else 787 else
788 aCircuit.Appearance = new AvatarAppearance(account.PrincipalID); 788 aCircuit.Appearance = new AvatarAppearance();
789 789
790 //aCircuit.BaseFolder = irrelevant 790 //aCircuit.BaseFolder = irrelevant
791 aCircuit.CapsPath = CapsUtil.GetRandomCapsObjectPath(); 791 aCircuit.CapsPath = CapsUtil.GetRandomCapsObjectPath();