diff options
author | Melanie | 2009-10-02 08:23:38 +0100 |
---|---|---|
committer | Melanie | 2009-10-02 08:23:38 +0100 |
commit | 31d8cec0f8cd47ff445edc7771e5e73825a57927 (patch) | |
tree | a2d60604317739fa530502c40ffc71bab2a5c494 /OpenSim/Data | |
parent | Restore the missing image handling to the image manager. The missing (diff) | |
parent | Merge branch 'master' of ssh://opensimulator.org/var/git/opensim (diff) | |
download | opensim-SC-31d8cec0f8cd47ff445edc7771e5e73825a57927.zip opensim-SC-31d8cec0f8cd47ff445edc7771e5e73825a57927.tar.gz opensim-SC-31d8cec0f8cd47ff445edc7771e5e73825a57927.tar.bz2 opensim-SC-31d8cec0f8cd47ff445edc7771e5e73825a57927.tar.xz |
Merge branch 'master' into diva-textures
Diffstat (limited to 'OpenSim/Data')
25 files changed, 103 insertions, 88 deletions
diff --git a/OpenSim/Data/IRegionData.cs b/OpenSim/Data/IRegionData.cs index 71dd525..7a607ab 100644 --- a/OpenSim/Data/IRegionData.cs +++ b/OpenSim/Data/IRegionData.cs | |||
@@ -39,13 +39,15 @@ namespace OpenSim.Data | |||
39 | public string RegionName; | 39 | public string RegionName; |
40 | public int posX; | 40 | public int posX; |
41 | public int posY; | 41 | public int posY; |
42 | public int sizeX; | ||
43 | public int sizeY; | ||
42 | public Dictionary<string, object> Data; | 44 | public Dictionary<string, object> Data; |
43 | } | 45 | } |
44 | 46 | ||
45 | /// <summary> | 47 | /// <summary> |
46 | /// An interface for connecting to the authentication datastore | 48 | /// An interface for connecting to the authentication datastore |
47 | /// </summary> | 49 | /// </summary> |
48 | public interface IRegionData | 50 | public interface IRegionData |
49 | { | 51 | { |
50 | RegionData Get(UUID regionID, UUID ScopeID); | 52 | RegionData Get(UUID regionID, UUID ScopeID); |
51 | List<RegionData> Get(string regionName, UUID ScopeID); | 53 | List<RegionData> Get(string regionName, UUID ScopeID); |
@@ -57,5 +59,6 @@ namespace OpenSim.Data | |||
57 | bool SetDataItem(UUID principalID, string item, string value); | 59 | bool SetDataItem(UUID principalID, string item, string value); |
58 | 60 | ||
59 | bool Delete(UUID regionID); | 61 | bool Delete(UUID regionID); |
62 | |||
60 | } | 63 | } |
61 | } | 64 | } |
diff --git a/OpenSim/Data/IUserData.cs b/OpenSim/Data/IUserData.cs index ee69366..e9a1e81 100644 --- a/OpenSim/Data/IUserData.cs +++ b/OpenSim/Data/IUserData.cs | |||
@@ -54,7 +54,7 @@ namespace OpenSim.Data | |||
54 | 54 | ||
55 | /// <summary> | 55 | /// <summary> |
56 | /// Get a user from a given uri. | 56 | /// Get a user from a given uri. |
57 | /// </summary> | 57 | /// </summary> |
58 | /// <param name="uri"></param> | 58 | /// <param name="uri"></param> |
59 | /// <returns>The user data profile. Null if no user is found.</returns> | 59 | /// <returns>The user data profile. Null if no user is found.</returns> |
60 | UserProfileData GetUserByUri(Uri uri); | 60 | UserProfileData GetUserByUri(Uri uri); |
diff --git a/OpenSim/Data/MSSQL/MSSQLAssetData.cs b/OpenSim/Data/MSSQL/MSSQLAssetData.cs index d193cf5..25f7cf0 100644 --- a/OpenSim/Data/MSSQL/MSSQLAssetData.cs +++ b/OpenSim/Data/MSSQL/MSSQLAssetData.cs | |||
@@ -175,7 +175,7 @@ namespace OpenSim.Data.MSSQL | |||
175 | (@id, @name, @description, @assetType, @local, | 175 | (@id, @name, @description, @assetType, @local, |
176 | @temporary, @create_time, @access_time, @data)"; | 176 | @temporary, @create_time, @access_time, @data)"; |
177 | 177 | ||
178 | string assetName = asset.Name; | 178 | string assetName = asset.Name; |
179 | if (asset.Name.Length > 64) | 179 | if (asset.Name.Length > 64) |
180 | { | 180 | { |
181 | assetName = asset.Name.Substring(0, 64); | 181 | assetName = asset.Name.Substring(0, 64); |
@@ -223,7 +223,7 @@ namespace OpenSim.Data.MSSQL | |||
223 | local = @local, temporary = @temporary, data = @data | 223 | local = @local, temporary = @temporary, data = @data |
224 | WHERE id = @keyId;"; | 224 | WHERE id = @keyId;"; |
225 | 225 | ||
226 | string assetName = asset.Name; | 226 | string assetName = asset.Name; |
227 | if (asset.Name.Length > 64) | 227 | if (asset.Name.Length > 64) |
228 | { | 228 | { |
229 | assetName = asset.Name.Substring(0, 64); | 229 | assetName = asset.Name.Substring(0, 64); |
diff --git a/OpenSim/Data/MSSQL/MSSQLAuthenticationData.cs b/OpenSim/Data/MSSQL/MSSQLAuthenticationData.cs index 78fc22c..099faea 100644 --- a/OpenSim/Data/MSSQL/MSSQLAuthenticationData.cs +++ b/OpenSim/Data/MSSQL/MSSQLAuthenticationData.cs | |||
@@ -135,7 +135,7 @@ namespace OpenSim.Data.MSSQL | |||
135 | 135 | ||
136 | insertBuilder.AppendFormat("insert into '{0}' ('UUID', '", m_Realm); | 136 | insertBuilder.AppendFormat("insert into '{0}' ('UUID', '", m_Realm); |
137 | insertBuilder.Append(String.Join("', '", fields)); | 137 | insertBuilder.Append(String.Join("', '", fields)); |
138 | insertBuilder.Append("') values ( @principalID, @"); | 138 | insertBuilder.Append("') values (@principalID, @"); |
139 | insertBuilder.Append(String.Join(", @", fields)); | 139 | insertBuilder.Append(String.Join(", @", fields)); |
140 | insertBuilder.Append(")"); | 140 | insertBuilder.Append(")"); |
141 | 141 | ||
diff --git a/OpenSim/Data/MSSQL/MSSQLInventoryData.cs b/OpenSim/Data/MSSQL/MSSQLInventoryData.cs index 27a4e70..1482184 100644 --- a/OpenSim/Data/MSSQL/MSSQLInventoryData.cs +++ b/OpenSim/Data/MSSQL/MSSQLInventoryData.cs | |||
@@ -428,7 +428,7 @@ namespace OpenSim.Data.MSSQL | |||
428 | @inventoryBasePermissions, @inventoryEveryOnePermissions, @inventoryGroupPermissions, @salePrice, @saleType, | 428 | @inventoryBasePermissions, @inventoryEveryOnePermissions, @inventoryGroupPermissions, @salePrice, @saleType, |
429 | @creationDate, @groupID, @groupOwned, @flags)"; | 429 | @creationDate, @groupID, @groupOwned, @flags)"; |
430 | 430 | ||
431 | string itemName = item.Name; | 431 | string itemName = item.Name; |
432 | if (item.Name.Length > 64) | 432 | if (item.Name.Length > 64) |
433 | { | 433 | { |
434 | itemName = item.Name.Substring(0, 64); | 434 | itemName = item.Name.Substring(0, 64); |
@@ -529,7 +529,7 @@ namespace OpenSim.Data.MSSQL | |||
529 | { | 529 | { |
530 | itemDesc = item.Description.Substring(0, 128); | 530 | itemDesc = item.Description.Substring(0, 128); |
531 | m_log.Warn("[INVENTORY DB]: Description field truncated from " + item.Description.Length.ToString() + " to " + itemDesc.Length.ToString() + " characters on update"); | 531 | m_log.Warn("[INVENTORY DB]: Description field truncated from " + item.Description.Length.ToString() + " to " + itemDesc.Length.ToString() + " characters on update"); |
532 | } | 532 | } |
533 | 533 | ||
534 | using (AutoClosingSqlCommand command = database.Query(sql)) | 534 | using (AutoClosingSqlCommand command = database.Query(sql)) |
535 | { | 535 | { |
diff --git a/OpenSim/Data/MSSQL/MSSQLRegionData.cs b/OpenSim/Data/MSSQL/MSSQLRegionData.cs index adedcce..e26a830 100644 --- a/OpenSim/Data/MSSQL/MSSQLRegionData.cs +++ b/OpenSim/Data/MSSQL/MSSQLRegionData.cs | |||
@@ -146,7 +146,7 @@ namespace OpenSim.Data.MSSQL | |||
146 | sceneObjectPart.Name, sceneObjectPart.UUID, sceneObjectPart.GroupPosition, groupID); | 146 | sceneObjectPart.Name, sceneObjectPart.UUID, sceneObjectPart.GroupPosition, groupID); |
147 | 147 | ||
148 | sceneObjectPart.UUID = groupID; | 148 | sceneObjectPart.UUID = groupID; |
149 | } | 149 | } |
150 | 150 | ||
151 | grp = new SceneObjectGroup(sceneObjectPart); | 151 | grp = new SceneObjectGroup(sceneObjectPart); |
152 | } | 152 | } |
diff --git a/OpenSim/Data/MSSQL/MSSQLUserAccountData.cs b/OpenSim/Data/MSSQL/MSSQLUserAccountData.cs index 1520888..38be9f4 100644 --- a/OpenSim/Data/MSSQL/MSSQLUserAccountData.cs +++ b/OpenSim/Data/MSSQL/MSSQLUserAccountData.cs | |||
@@ -52,7 +52,7 @@ namespace OpenSim.Data.MSSQL | |||
52 | conn.Open(); | 52 | conn.Open(); |
53 | Migration m = new Migration(conn, GetType().Assembly, "UserStore"); | 53 | Migration m = new Migration(conn, GetType().Assembly, "UserStore"); |
54 | m.Update(); | 54 | m.Update(); |
55 | } | 55 | } |
56 | } | 56 | } |
57 | 57 | ||
58 | public List<UserAccountData> Query(UUID principalID, UUID scopeID, string query) | 58 | public List<UserAccountData> Query(UUID principalID, UUID scopeID, string query) |
@@ -152,7 +152,7 @@ namespace OpenSim.Data.MSSQL | |||
152 | StringBuilder insertBuilder = new StringBuilder(); | 152 | StringBuilder insertBuilder = new StringBuilder(); |
153 | insertBuilder.AppendFormat("insert into '{0}' ('UUID', 'ScopeID', '", m_Realm); | 153 | insertBuilder.AppendFormat("insert into '{0}' ('UUID', 'ScopeID', '", m_Realm); |
154 | insertBuilder.Append(String.Join("', '", fields)); | 154 | insertBuilder.Append(String.Join("', '", fields)); |
155 | insertBuilder.Append("') values ( @principalID, @scopeID, @"); | 155 | insertBuilder.Append("') values (@principalID, @scopeID, @"); |
156 | insertBuilder.Append(String.Join(", @", fields)); | 156 | insertBuilder.Append(String.Join(", @", fields)); |
157 | insertBuilder.Append(")"); | 157 | insertBuilder.Append(")"); |
158 | 158 | ||
diff --git a/OpenSim/Data/MSSQL/MSSQLUserData.cs b/OpenSim/Data/MSSQL/MSSQLUserData.cs index 6efb89d..3ef1053 100644 --- a/OpenSim/Data/MSSQL/MSSQLUserData.cs +++ b/OpenSim/Data/MSSQL/MSSQLUserData.cs | |||
@@ -1146,7 +1146,7 @@ ELSE | |||
1146 | if (reader.IsDBNull(reader.GetOrdinal("homeRegionID"))) | 1146 | if (reader.IsDBNull(reader.GetOrdinal("homeRegionID"))) |
1147 | retval.HomeRegionID = UUID.Zero; | 1147 | retval.HomeRegionID = UUID.Zero; |
1148 | else | 1148 | else |
1149 | retval.HomeRegionID = new UUID((Guid)reader["homeRegionID"]); | 1149 | retval.HomeRegionID = new UUID((Guid)reader["homeRegionID"]); |
1150 | 1150 | ||
1151 | retval.Created = Convert.ToInt32(reader["created"].ToString()); | 1151 | retval.Created = Convert.ToInt32(reader["created"].ToString()); |
1152 | retval.LastLogin = Convert.ToInt32(reader["lastLogin"].ToString()); | 1152 | retval.LastLogin = Convert.ToInt32(reader["lastLogin"].ToString()); |
@@ -1200,7 +1200,7 @@ ELSE | |||
1200 | if (reader.IsDBNull(reader.GetOrdinal("partner"))) | 1200 | if (reader.IsDBNull(reader.GetOrdinal("partner"))) |
1201 | retval.Partner = UUID.Zero; | 1201 | retval.Partner = UUID.Zero; |
1202 | else | 1202 | else |
1203 | retval.Partner = new UUID((Guid)reader["partner"]); | 1203 | retval.Partner = new UUID((Guid)reader["partner"]); |
1204 | } | 1204 | } |
1205 | else | 1205 | else |
1206 | { | 1206 | { |
diff --git a/OpenSim/Data/MySQL/MySQLAssetData.cs b/OpenSim/Data/MySQL/MySQLAssetData.cs index 66c34fe..0502b2b 100644 --- a/OpenSim/Data/MySQL/MySQLAssetData.cs +++ b/OpenSim/Data/MySQL/MySQLAssetData.cs | |||
@@ -204,7 +204,7 @@ namespace OpenSim.Data.MySQL | |||
204 | "VALUES(?id, ?name, ?description, ?assetType, ?local, ?temporary, ?create_time, ?access_time, ?data)", | 204 | "VALUES(?id, ?name, ?description, ?assetType, ?local, ?temporary, ?create_time, ?access_time, ?data)", |
205 | _dbConnection.Connection); | 205 | _dbConnection.Connection); |
206 | 206 | ||
207 | string assetName = asset.Name; | 207 | string assetName = asset.Name; |
208 | if (asset.Name.Length > 64) | 208 | if (asset.Name.Length > 64) |
209 | { | 209 | { |
210 | assetName = asset.Name.Substring(0, 64); | 210 | assetName = asset.Name.Substring(0, 64); |
diff --git a/OpenSim/Data/MySQL/MySQLAuthenticationData.cs b/OpenSim/Data/MySQL/MySQLAuthenticationData.cs index afd59bd..e508b52 100644 --- a/OpenSim/Data/MySQL/MySQLAuthenticationData.cs +++ b/OpenSim/Data/MySQL/MySQLAuthenticationData.cs | |||
@@ -127,7 +127,7 @@ namespace OpenSim.Data.MySQL | |||
127 | { | 127 | { |
128 | string insert = "insert into `" + m_Realm + "` (`UUID`, `" + | 128 | string insert = "insert into `" + m_Realm + "` (`UUID`, `" + |
129 | String.Join("`, `", fields) + | 129 | String.Join("`, `", fields) + |
130 | "`) values ( ?principalID, ?" + String.Join(", ?", fields) + ")"; | 130 | "`) values (?principalID, ?" + String.Join(", ?", fields) + ")"; |
131 | 131 | ||
132 | cmd.CommandText = insert; | 132 | cmd.CommandText = insert; |
133 | 133 | ||
diff --git a/OpenSim/Data/MySQL/MySQLInventoryData.cs b/OpenSim/Data/MySQL/MySQLInventoryData.cs index 4521a0f..0eecf06 100644 --- a/OpenSim/Data/MySQL/MySQLInventoryData.cs +++ b/OpenSim/Data/MySQL/MySQLInventoryData.cs | |||
@@ -325,10 +325,10 @@ namespace OpenSim.Data.MySQL | |||
325 | UUID GroupID = UUID.Zero; | 325 | UUID GroupID = UUID.Zero; |
326 | UUID.TryParse((string)reader["avatarID"], out Owner); | 326 | UUID.TryParse((string)reader["avatarID"], out Owner); |
327 | UUID.TryParse((string)reader["groupID"], out GroupID); | 327 | UUID.TryParse((string)reader["groupID"], out GroupID); |
328 | item.Owner = Owner; | 328 | item.Owner = Owner; |
329 | item.GroupID = GroupID; | 329 | item.GroupID = GroupID; |
330 | 330 | ||
331 | // Rest of the parsing. If these UUID's fail, we're dead anyway | 331 | // Rest of the parsing. If these UUID's fail, we're dead anyway |
332 | item.ID = new UUID((string) reader["inventoryID"]); | 332 | item.ID = new UUID((string) reader["inventoryID"]); |
333 | item.AssetID = new UUID((string) reader["assetID"]); | 333 | item.AssetID = new UUID((string) reader["assetID"]); |
334 | item.AssetType = (int) reader["assetType"]; | 334 | item.AssetType = (int) reader["assetType"]; |
@@ -472,7 +472,7 @@ namespace OpenSim.Data.MySQL | |||
472 | + ", ?inventoryBasePermissions, ?inventoryEveryOnePermissions, ?inventoryGroupPermissions, ?salePrice, ?saleType, ?creationDate" | 472 | + ", ?inventoryBasePermissions, ?inventoryEveryOnePermissions, ?inventoryGroupPermissions, ?salePrice, ?saleType, ?creationDate" |
473 | + ", ?groupID, ?groupOwned, ?flags)"; | 473 | + ", ?groupID, ?groupOwned, ?flags)"; |
474 | 474 | ||
475 | string itemName = item.Name; | 475 | string itemName = item.Name; |
476 | if (item.Name.Length > 64) | 476 | if (item.Name.Length > 64) |
477 | { | 477 | { |
478 | itemName = item.Name.Substring(0, 64); | 478 | itemName = item.Name.Substring(0, 64); |
@@ -484,7 +484,7 @@ namespace OpenSim.Data.MySQL | |||
484 | { | 484 | { |
485 | itemDesc = item.Description.Substring(0, 128); | 485 | itemDesc = item.Description.Substring(0, 128); |
486 | m_log.Warn("[INVENTORY DB]: Description field truncated from " + item.Description.Length + " to " + itemDesc.Length + " characters on add item"); | 486 | m_log.Warn("[INVENTORY DB]: Description field truncated from " + item.Description.Length + " to " + itemDesc.Length + " characters on add item"); |
487 | } | 487 | } |
488 | 488 | ||
489 | try | 489 | try |
490 | { | 490 | { |
@@ -590,12 +590,12 @@ namespace OpenSim.Data.MySQL | |||
590 | "REPLACE INTO inventoryfolders (folderID, agentID, parentFolderID, folderName, type, version) VALUES "; | 590 | "REPLACE INTO inventoryfolders (folderID, agentID, parentFolderID, folderName, type, version) VALUES "; |
591 | sql += "(?folderID, ?agentID, ?parentFolderID, ?folderName, ?type, ?version)"; | 591 | sql += "(?folderID, ?agentID, ?parentFolderID, ?folderName, ?type, ?version)"; |
592 | 592 | ||
593 | string folderName = folder.Name; | 593 | string folderName = folder.Name; |
594 | if (folderName.Length > 64) | 594 | if (folderName.Length > 64) |
595 | { | 595 | { |
596 | folderName = folderName.Substring(0, 64); | 596 | folderName = folderName.Substring(0, 64); |
597 | m_log.Warn("[INVENTORY DB]: Name field truncated from " + folder.Name.Length + " to " + folderName.Length + " characters on add folder"); | 597 | m_log.Warn("[INVENTORY DB]: Name field truncated from " + folder.Name.Length + " to " + folderName.Length + " characters on add folder"); |
598 | } | 598 | } |
599 | 599 | ||
600 | database.CheckConnection(); | 600 | database.CheckConnection(); |
601 | 601 | ||
diff --git a/OpenSim/Data/MySQL/MySQLLegacyRegionData.cs b/OpenSim/Data/MySQL/MySQLLegacyRegionData.cs index 4a16a70..c2dd788 100644 --- a/OpenSim/Data/MySQL/MySQLLegacyRegionData.cs +++ b/OpenSim/Data/MySQL/MySQLLegacyRegionData.cs | |||
@@ -464,7 +464,7 @@ namespace OpenSim.Data.MySQL | |||
464 | prim.Name, prim.UUID, prim.GroupPosition, groupID); | 464 | prim.Name, prim.UUID, prim.GroupPosition, groupID); |
465 | 465 | ||
466 | prim.UUID = groupID; | 466 | prim.UUID = groupID; |
467 | } | 467 | } |
468 | 468 | ||
469 | grp = new SceneObjectGroup(prim); | 469 | grp = new SceneObjectGroup(prim); |
470 | } | 470 | } |
@@ -533,7 +533,7 @@ namespace OpenSim.Data.MySQL | |||
533 | /// <summary> | 533 | /// <summary> |
534 | /// Load in a prim's persisted inventory. | 534 | /// Load in a prim's persisted inventory. |
535 | /// </summary> | 535 | /// </summary> |
536 | /// <param name="prim">The prim</param> | 536 | /// <param name="prim">The prim</param> |
537 | private void LoadItems(SceneObjectPart prim) | 537 | private void LoadItems(SceneObjectPart prim) |
538 | { | 538 | { |
539 | lock (m_Connection) | 539 | lock (m_Connection) |
@@ -773,7 +773,7 @@ namespace OpenSim.Data.MySQL | |||
773 | "use_estate_sun, fixed_sun, sun_position, " + | 773 | "use_estate_sun, fixed_sun, sun_position, " + |
774 | "covenant, Sandbox, sunvectorx, sunvectory, " + | 774 | "covenant, Sandbox, sunvectorx, sunvectory, " + |
775 | "sunvectorz, loaded_creation_datetime, " + | 775 | "sunvectorz, loaded_creation_datetime, " + |
776 | "loaded_creation_id) values ( ?RegionUUID, ?BlockTerraform, " + | 776 | "loaded_creation_id) values (?RegionUUID, ?BlockTerraform, " + |
777 | "?BlockFly, ?AllowDamage, ?RestrictPushing, " + | 777 | "?BlockFly, ?AllowDamage, ?RestrictPushing, " + |
778 | "?AllowLandResell, ?AllowLandJoinDivide, " + | 778 | "?AllowLandResell, ?AllowLandJoinDivide, " + |
779 | "?BlockShowInSearch, ?AgentLimit, ?ObjectBonus, " + | 779 | "?BlockShowInSearch, ?AgentLimit, ?ObjectBonus, " + |
diff --git a/OpenSim/Data/MySQL/MySQLRegionData.cs b/OpenSim/Data/MySQL/MySQLRegionData.cs index ced26a4..06ef624 100644 --- a/OpenSim/Data/MySQL/MySQLRegionData.cs +++ b/OpenSim/Data/MySQL/MySQLRegionData.cs | |||
@@ -39,7 +39,7 @@ namespace OpenSim.Data.MySQL | |||
39 | { | 39 | { |
40 | private string m_Realm; | 40 | private string m_Realm; |
41 | private List<string> m_ColumnNames = null; | 41 | private List<string> m_ColumnNames = null; |
42 | private int m_LastExpire = 0; | 42 | // private int m_LastExpire = 0; |
43 | 43 | ||
44 | public MySqlRegionData(string connectionString, string realm) | 44 | public MySqlRegionData(string connectionString, string realm) |
45 | : base(connectionString) | 45 | : base(connectionString) |
@@ -77,7 +77,7 @@ namespace OpenSim.Data.MySQL | |||
77 | cmd.Parameters.AddWithValue("?scopeID", scopeID.ToString()); | 77 | cmd.Parameters.AddWithValue("?scopeID", scopeID.ToString()); |
78 | 78 | ||
79 | List<RegionData> ret = RunCommand(cmd); | 79 | List<RegionData> ret = RunCommand(cmd); |
80 | if (ret == null) | 80 | if (ret.Count == 0) |
81 | return null; | 81 | return null; |
82 | 82 | ||
83 | return ret[0]; | 83 | return ret[0]; |
@@ -95,7 +95,7 @@ namespace OpenSim.Data.MySQL | |||
95 | cmd.Parameters.AddWithValue("?scopeID", scopeID.ToString()); | 95 | cmd.Parameters.AddWithValue("?scopeID", scopeID.ToString()); |
96 | 96 | ||
97 | List<RegionData> ret = RunCommand(cmd); | 97 | List<RegionData> ret = RunCommand(cmd); |
98 | if (ret == null) | 98 | if (ret.Count == 0) |
99 | return null; | 99 | return null; |
100 | 100 | ||
101 | return ret[0]; | 101 | return ret[0]; |
@@ -138,6 +138,8 @@ namespace OpenSim.Data.MySQL | |||
138 | ret.RegionName = result["regionName"].ToString(); | 138 | ret.RegionName = result["regionName"].ToString(); |
139 | ret.posX = Convert.ToInt32(result["locX"]); | 139 | ret.posX = Convert.ToInt32(result["locX"]); |
140 | ret.posY = Convert.ToInt32(result["locY"]); | 140 | ret.posY = Convert.ToInt32(result["locY"]); |
141 | ret.sizeX = Convert.ToInt32(result["sizeX"]); | ||
142 | ret.sizeY = Convert.ToInt32(result["sizeY"]); | ||
141 | 143 | ||
142 | if (m_ColumnNames == null) | 144 | if (m_ColumnNames == null) |
143 | { | 145 | { |
@@ -170,10 +172,7 @@ namespace OpenSim.Data.MySQL | |||
170 | result.Close(); | 172 | result.Close(); |
171 | CloseReaderCommand(cmd); | 173 | CloseReaderCommand(cmd); |
172 | 174 | ||
173 | if (retList.Count > 0) | 175 | return retList; |
174 | return retList; | ||
175 | |||
176 | return null; | ||
177 | } | 176 | } |
178 | 177 | ||
179 | public bool Store(RegionData data) | 178 | public bool Store(RegionData data) |
@@ -188,21 +187,25 @@ namespace OpenSim.Data.MySQL | |||
188 | data.Data.Remove("posX"); | 187 | data.Data.Remove("posX"); |
189 | if (data.Data.ContainsKey("posY")) | 188 | if (data.Data.ContainsKey("posY")) |
190 | data.Data.Remove("posY"); | 189 | data.Data.Remove("posY"); |
190 | if (data.Data.ContainsKey("sizeX")) | ||
191 | data.Data.Remove("sizeX"); | ||
192 | if (data.Data.ContainsKey("sizeY")) | ||
193 | data.Data.Remove("sizeY"); | ||
194 | if (data.Data.ContainsKey("locX")) | ||
195 | data.Data.Remove("locX"); | ||
196 | if (data.Data.ContainsKey("locY")) | ||
197 | data.Data.Remove("locY"); | ||
191 | 198 | ||
192 | string[] fields = new List<string>(data.Data.Keys).ToArray(); | 199 | string[] fields = new List<string>(data.Data.Keys).ToArray(); |
193 | 200 | ||
194 | MySqlCommand cmd = new MySqlCommand(); | 201 | MySqlCommand cmd = new MySqlCommand(); |
195 | 202 | ||
196 | string update = "update `"+m_Realm+"` set "; | 203 | string update = "update `"+m_Realm+"` set locX=?posX, locY=?posY, sizeX=?sizeX, sizeY=?sizeY"; |
197 | bool first = true; | ||
198 | foreach (string field in fields) | 204 | foreach (string field in fields) |
199 | { | 205 | { |
200 | if (!first) | 206 | update += ", "; |
201 | update += ", "; | ||
202 | update += "`" + field + "` = ?"+field; | 207 | update += "`" + field + "` = ?"+field; |
203 | 208 | ||
204 | first = false; | ||
205 | |||
206 | cmd.Parameters.AddWithValue("?"+field, data.Data[field]); | 209 | cmd.Parameters.AddWithValue("?"+field, data.Data[field]); |
207 | } | 210 | } |
208 | 211 | ||
@@ -213,13 +216,18 @@ namespace OpenSim.Data.MySQL | |||
213 | 216 | ||
214 | cmd.CommandText = update; | 217 | cmd.CommandText = update; |
215 | cmd.Parameters.AddWithValue("?regionID", data.RegionID.ToString()); | 218 | cmd.Parameters.AddWithValue("?regionID", data.RegionID.ToString()); |
219 | cmd.Parameters.AddWithValue("?regionName", data.RegionName); | ||
216 | cmd.Parameters.AddWithValue("?scopeID", data.ScopeID.ToString()); | 220 | cmd.Parameters.AddWithValue("?scopeID", data.ScopeID.ToString()); |
221 | cmd.Parameters.AddWithValue("?posX", data.posX.ToString()); | ||
222 | cmd.Parameters.AddWithValue("?posY", data.posY.ToString()); | ||
223 | cmd.Parameters.AddWithValue("?sizeX", data.sizeX.ToString()); | ||
224 | cmd.Parameters.AddWithValue("?sizeY", data.sizeY.ToString()); | ||
217 | 225 | ||
218 | if (ExecuteNonQuery(cmd) < 1) | 226 | if (ExecuteNonQuery(cmd) < 1) |
219 | { | 227 | { |
220 | string insert = "insert into `" + m_Realm + "` (`uuid`, `ScopeID`, `" + | 228 | string insert = "insert into `" + m_Realm + "` (`uuid`, `ScopeID`, `locX`, `locY`, `sizeX`, `sizeY`, `regionName`, `" + |
221 | String.Join("`, `", fields) + | 229 | String.Join("`, `", fields) + |
222 | "`) values ( ?regionID, ?scopeID, ?" + String.Join(", ?", fields) + ")"; | 230 | "`) values ( ?regionID, ?scopeID, ?posX, ?posY, ?sizeX, ?sizeY, ?regionName, ?" + String.Join(", ?", fields) + ")"; |
223 | 231 | ||
224 | cmd.CommandText = insert; | 232 | cmd.CommandText = insert; |
225 | 233 | ||
diff --git a/OpenSim/Data/MySQL/MySQLUserAccountData.cs b/OpenSim/Data/MySQL/MySQLUserAccountData.cs index 39d60ca..d48144d 100644 --- a/OpenSim/Data/MySQL/MySQLUserAccountData.cs +++ b/OpenSim/Data/MySQL/MySQLUserAccountData.cs | |||
@@ -39,7 +39,7 @@ namespace OpenSim.Data.MySQL | |||
39 | { | 39 | { |
40 | private string m_Realm; | 40 | private string m_Realm; |
41 | private List<string> m_ColumnNames = null; | 41 | private List<string> m_ColumnNames = null; |
42 | private int m_LastExpire = 0; | 42 | // private int m_LastExpire = 0; |
43 | 43 | ||
44 | public MySqlUserAccountData(string connectionString, string realm) | 44 | public MySqlUserAccountData(string connectionString, string realm) |
45 | : base(connectionString) | 45 | : base(connectionString) |
@@ -146,7 +146,7 @@ namespace OpenSim.Data.MySQL | |||
146 | { | 146 | { |
147 | string insert = "insert into `" + m_Realm + "` (`UUID`, `ScopeID`, `" + | 147 | string insert = "insert into `" + m_Realm + "` (`UUID`, `ScopeID`, `" + |
148 | String.Join("`, `", fields) + | 148 | String.Join("`, `", fields) + |
149 | "`) values ( ?principalID, ?scopeID, ?" + String.Join(", ?", fields) + ")"; | 149 | "`) values (?principalID, ?scopeID, ?" + String.Join(", ?", fields) + ")"; |
150 | 150 | ||
151 | cmd.CommandText = insert; | 151 | cmd.CommandText = insert; |
152 | 152 | ||
diff --git a/OpenSim/Data/MySQL/MySQLUserData.cs b/OpenSim/Data/MySQL/MySQLUserData.cs index 537ef6c..04f872f 100644 --- a/OpenSim/Data/MySQL/MySQLUserData.cs +++ b/OpenSim/Data/MySQL/MySQLUserData.cs | |||
@@ -632,7 +632,7 @@ namespace OpenSim.Data.MySQL | |||
632 | UUID zero = UUID.Zero; | 632 | UUID zero = UUID.Zero; |
633 | if (user.ID == zero) | 633 | if (user.ID == zero) |
634 | { | 634 | { |
635 | return; | 635 | return; |
636 | } | 636 | } |
637 | MySQLSuperManager dbm = GetLockedConnection("AddNewUserProfile"); | 637 | MySQLSuperManager dbm = GetLockedConnection("AddNewUserProfile"); |
638 | 638 | ||
@@ -666,7 +666,7 @@ namespace OpenSim.Data.MySQL | |||
666 | { | 666 | { |
667 | UUID zero = UUID.Zero; | 667 | UUID zero = UUID.Zero; |
668 | if (agent.ProfileID == zero || agent.SessionID == zero) | 668 | if (agent.ProfileID == zero || agent.SessionID == zero) |
669 | return; | 669 | return; |
670 | 670 | ||
671 | MySQLSuperManager dbm = GetLockedConnection("AddNewUserAgent"); | 671 | MySQLSuperManager dbm = GetLockedConnection("AddNewUserAgent"); |
672 | try | 672 | try |
diff --git a/OpenSim/Data/MySQL/Resources/004_GridStore.sql b/OpenSim/Data/MySQL/Resources/004_GridStore.sql new file mode 100644 index 0000000..2238a88 --- /dev/null +++ b/OpenSim/Data/MySQL/Resources/004_GridStore.sql | |||
@@ -0,0 +1,6 @@ | |||
1 | BEGIN; | ||
2 | |||
3 | ALTER TABLE regions add column sizeX integer not null default 0; | ||
4 | ALTER TABLE regions add column sizeY integer not null default 0; | ||
5 | |||
6 | COMMIT; | ||
diff --git a/OpenSim/Data/NHibernate/NHibernateManager.cs b/OpenSim/Data/NHibernate/NHibernateManager.cs index 7c5cf33..2e7081e 100644 --- a/OpenSim/Data/NHibernate/NHibernateManager.cs +++ b/OpenSim/Data/NHibernate/NHibernateManager.cs | |||
@@ -155,7 +155,7 @@ namespace OpenSim.Data.NHibernate | |||
155 | m_log.ErrorFormat("[NHIBERNATE] {0} of id {1} loading threw exception: " + e.ToString(), type.Name, id); | 155 | m_log.ErrorFormat("[NHIBERNATE] {0} of id {1} loading threw exception: " + e.ToString(), type.Name, id); |
156 | } | 156 | } |
157 | return obj; | 157 | return obj; |
158 | } | 158 | } |
159 | } | 159 | } |
160 | 160 | ||
161 | /// <summary> | 161 | /// <summary> |
diff --git a/OpenSim/Data/NHibernate/NHibernateUserData.cs b/OpenSim/Data/NHibernate/NHibernateUserData.cs index 73b630f..1b0c4c9 100644 --- a/OpenSim/Data/NHibernate/NHibernateUserData.cs +++ b/OpenSim/Data/NHibernate/NHibernateUserData.cs | |||
@@ -86,7 +86,7 @@ namespace OpenSim.Data.NHibernate | |||
86 | m_log.InfoFormat("[NHIBERNATE] GetUserByUUID: {0} ", uuid); | 86 | m_log.InfoFormat("[NHIBERNATE] GetUserByUUID: {0} ", uuid); |
87 | 87 | ||
88 | user = (UserProfileData)manager.Get(typeof(UserProfileData), uuid); | 88 | user = (UserProfileData)manager.Get(typeof(UserProfileData), uuid); |
89 | if (user != null) | 89 | if (user != null) |
90 | { | 90 | { |
91 | UserAgentData agent = GetAgentByUUID(uuid); | 91 | UserAgentData agent = GetAgentByUUID(uuid); |
92 | if (agent != null) | 92 | if (agent != null) |
@@ -245,7 +245,7 @@ namespace OpenSim.Data.NHibernate | |||
245 | UserProfileData user=GetUserByUUID(agentID); | 245 | UserProfileData user=GetUserByUUID(agentID); |
246 | user.WebLoginKey = webLoginKey; | 246 | user.WebLoginKey = webLoginKey; |
247 | UpdateUserProfile(user); | 247 | UpdateUserProfile(user); |
248 | return; | 248 | return; |
249 | } | 249 | } |
250 | 250 | ||
251 | public override void AddNewUserFriend(UUID ownerId, UUID friendId, uint perms) | 251 | public override void AddNewUserFriend(UUID ownerId, UUID friendId, uint perms) |
@@ -258,7 +258,7 @@ namespace OpenSim.Data.NHibernate | |||
258 | { | 258 | { |
259 | manager.Insert(new UserFriend(UUID.Random(), friendId, ownerId, perms)); | 259 | manager.Insert(new UserFriend(UUID.Random(), friendId, ownerId, perms)); |
260 | } | 260 | } |
261 | return; | 261 | return; |
262 | } | 262 | } |
263 | 263 | ||
264 | private bool FriendRelationExists(UUID ownerId, UUID friendId) | 264 | private bool FriendRelationExists(UUID ownerId, UUID friendId) |
diff --git a/OpenSim/Data/Null/NullRegionData.cs b/OpenSim/Data/Null/NullRegionData.cs index 588b8ac..e8263ea 100644 --- a/OpenSim/Data/Null/NullRegionData.cs +++ b/OpenSim/Data/Null/NullRegionData.cs | |||
@@ -40,13 +40,14 @@ namespace OpenSim.Data.Null | |||
40 | 40 | ||
41 | public NullRegionData(string connectionString, string realm) | 41 | public NullRegionData(string connectionString, string realm) |
42 | { | 42 | { |
43 | //Console.WriteLine("[XXX] NullRegionData constructor"); | ||
43 | } | 44 | } |
44 | 45 | ||
45 | public List<RegionData> Get(string regionName, UUID scopeID) | 46 | public List<RegionData> Get(string regionName, UUID scopeID) |
46 | { | 47 | { |
47 | List<RegionData> ret = new List<RegionData>(); | 48 | List<RegionData> ret = new List<RegionData>(); |
48 | 49 | ||
49 | foreach(RegionData r in m_regionData.Values) | 50 | foreach (RegionData r in m_regionData.Values) |
50 | { | 51 | { |
51 | if (regionName.Contains("%")) | 52 | if (regionName.Contains("%")) |
52 | { | 53 | { |
@@ -70,7 +71,7 @@ namespace OpenSim.Data.Null | |||
70 | { | 71 | { |
71 | List<RegionData> ret = new List<RegionData>(); | 72 | List<RegionData> ret = new List<RegionData>(); |
72 | 73 | ||
73 | foreach(RegionData r in m_regionData.Values) | 74 | foreach (RegionData r in m_regionData.Values) |
74 | { | 75 | { |
75 | if (r.posX == posX && r.posY == posY) | 76 | if (r.posX == posX && r.posY == posY) |
76 | ret.Add(r); | 77 | ret.Add(r); |
@@ -94,16 +95,13 @@ namespace OpenSim.Data.Null | |||
94 | { | 95 | { |
95 | List<RegionData> ret = new List<RegionData>(); | 96 | List<RegionData> ret = new List<RegionData>(); |
96 | 97 | ||
97 | foreach(RegionData r in m_regionData.Values) | 98 | foreach (RegionData r in m_regionData.Values) |
98 | { | 99 | { |
99 | if (r.posX >= startX && r.posX <= endX && r.posY >= startY && r.posY <= endY) | 100 | if (r.posX >= startX && r.posX <= endX && r.posY >= startY && r.posY <= endY) |
100 | ret.Add(r); | 101 | ret.Add(r); |
101 | } | 102 | } |
102 | 103 | ||
103 | if (ret.Count > 0) | 104 | return ret; |
104 | return ret; | ||
105 | |||
106 | return null; | ||
107 | } | 105 | } |
108 | 106 | ||
109 | public bool Store(RegionData data) | 107 | public bool Store(RegionData data) |
diff --git a/OpenSim/Data/RegionProfileData.cs b/OpenSim/Data/RegionProfileData.cs index 1d96631..86d7f6b 100644 --- a/OpenSim/Data/RegionProfileData.cs +++ b/OpenSim/Data/RegionProfileData.cs | |||
@@ -137,7 +137,7 @@ namespace OpenSim.Data | |||
137 | public uint maturity; | 137 | public uint maturity; |
138 | 138 | ||
139 | 139 | ||
140 | //Data Wrappers | 140 | //Data Wrappers |
141 | public string RegionName | 141 | public string RegionName |
142 | { | 142 | { |
143 | get { return regionName; } | 143 | get { return regionName; } |
diff --git a/OpenSim/Data/SQLite/SQLiteAssetData.cs b/OpenSim/Data/SQLite/SQLiteAssetData.cs index 3831467..49275cb 100644 --- a/OpenSim/Data/SQLite/SQLiteAssetData.cs +++ b/OpenSim/Data/SQLite/SQLiteAssetData.cs | |||
@@ -124,7 +124,7 @@ namespace OpenSim.Data.SQLite | |||
124 | //m_log.Info("[ASSET DB]: Creating Asset " + asset.FullID.ToString()); | 124 | //m_log.Info("[ASSET DB]: Creating Asset " + asset.FullID.ToString()); |
125 | if (ExistsAsset(asset.FullID)) | 125 | if (ExistsAsset(asset.FullID)) |
126 | { | 126 | { |
127 | LogAssetLoad(asset); | 127 | //LogAssetLoad(asset); |
128 | 128 | ||
129 | lock (this) | 129 | lock (this) |
130 | { | 130 | { |
@@ -173,7 +173,7 @@ namespace OpenSim.Data.SQLite | |||
173 | 173 | ||
174 | int assetLength = (asset.Data != null) ? asset.Data.Length : 0; | 174 | int assetLength = (asset.Data != null) ? asset.Data.Length : 0; |
175 | 175 | ||
176 | m_log.Info("[ASSET DB]: " + | 176 | m_log.Debug("[ASSET DB]: " + |
177 | string.Format("Loaded {5} {4} Asset: [{0}][{3}] \"{1}\":{2} ({6} bytes)", | 177 | string.Format("Loaded {5} {4} Asset: [{0}][{3}] \"{1}\":{2} ({6} bytes)", |
178 | asset.FullID, asset.Name, asset.Description, asset.Type, | 178 | asset.FullID, asset.Name, asset.Description, asset.Type, |
179 | temporary, local, assetLength)); | 179 | temporary, local, assetLength)); |
diff --git a/OpenSim/Data/SQLite/SQLiteRegionData.cs b/OpenSim/Data/SQLite/SQLiteRegionData.cs index ea076fe..d22a3ec 100644 --- a/OpenSim/Data/SQLite/SQLiteRegionData.cs +++ b/OpenSim/Data/SQLite/SQLiteRegionData.cs | |||
@@ -496,7 +496,7 @@ namespace OpenSim.Data.SQLite | |||
496 | { | 496 | { |
497 | //m_log.DebugFormat("[DATASTORE]: Loading inventory for {0}, {1}", prim.Name, prim.UUID); | 497 | //m_log.DebugFormat("[DATASTORE]: Loading inventory for {0}, {1}", prim.Name, prim.UUID); |
498 | 498 | ||
499 | DataTable dbItems = ds.Tables["primitems"]; | 499 | DataTable dbItems = ds.Tables["primitems"]; |
500 | String sql = String.Format("primID = '{0}'", prim.UUID.ToString()); | 500 | String sql = String.Format("primID = '{0}'", prim.UUID.ToString()); |
501 | DataRow[] dbItemRows = dbItems.Select(sql); | 501 | DataRow[] dbItemRows = dbItems.Select(sql); |
502 | IList<TaskInventoryItem> inventory = new List<TaskInventoryItem>(); | 502 | IList<TaskInventoryItem> inventory = new List<TaskInventoryItem>(); |
diff --git a/OpenSim/Data/Tests/BasicRegionTest.cs b/OpenSim/Data/Tests/BasicRegionTest.cs index c66ab7c..97990e1 100644 --- a/OpenSim/Data/Tests/BasicRegionTest.cs +++ b/OpenSim/Data/Tests/BasicRegionTest.cs | |||
@@ -60,7 +60,7 @@ namespace OpenSim.Data.Tests | |||
60 | public UUID item2; | 60 | public UUID item2; |
61 | public UUID item3; | 61 | public UUID item3; |
62 | 62 | ||
63 | public static Random random; | 63 | public static Random random; |
64 | 64 | ||
65 | public string itemname1 = "item1"; | 65 | public string itemname1 = "item1"; |
66 | 66 | ||
@@ -173,7 +173,7 @@ namespace OpenSim.Data.Tests | |||
173 | UUID tmp0 = UUID.Random(); | 173 | UUID tmp0 = UUID.Random(); |
174 | UUID tmp1 = UUID.Random(); | 174 | UUID tmp1 = UUID.Random(); |
175 | UUID tmp2 = UUID.Random(); | 175 | UUID tmp2 = UUID.Random(); |
176 | UUID tmp3 = UUID.Random(); | 176 | UUID tmp3 = UUID.Random(); |
177 | UUID newregion = UUID.Random(); | 177 | UUID newregion = UUID.Random(); |
178 | SceneObjectPart p1 = NewSOP("SoP 1",tmp1); | 178 | SceneObjectPart p1 = NewSOP("SoP 1",tmp1); |
179 | SceneObjectPart p2 = NewSOP("SoP 2",tmp2); | 179 | SceneObjectPart p2 = NewSOP("SoP 2",tmp2); |
@@ -224,7 +224,7 @@ namespace OpenSim.Data.Tests | |||
224 | random.NextBytes(partsys); | 224 | random.NextBytes(partsys); |
225 | DateTime expires = new DateTime(2008, 12, 20); | 225 | DateTime expires = new DateTime(2008, 12, 20); |
226 | DateTime rezzed = new DateTime(2009, 07, 15); | 226 | DateTime rezzed = new DateTime(2009, 07, 15); |
227 | Vector3 groupos = new Vector3(random.Next(),random.Next(),random.Next()); | 227 | Vector3 groupos = new Vector3(random.Next(),random.Next(),random.Next()); |
228 | Vector3 offset = new Vector3(random.Next(),random.Next(),random.Next()); | 228 | Vector3 offset = new Vector3(random.Next(),random.Next(),random.Next()); |
229 | Quaternion rotoff = new Quaternion(random.Next(),random.Next(),random.Next(),random.Next()); | 229 | Quaternion rotoff = new Quaternion(random.Next(),random.Next(),random.Next(),random.Next()); |
230 | Vector3 velocity = new Vector3(random.Next(),random.Next(),random.Next()); | 230 | Vector3 velocity = new Vector3(random.Next(),random.Next(),random.Next()); |
@@ -261,7 +261,7 @@ namespace OpenSim.Data.Tests | |||
261 | sop.Shape = pbshap; | 261 | sop.Shape = pbshap; |
262 | sop.GroupPosition = groupos; | 262 | sop.GroupPosition = groupos; |
263 | sop.RotationOffset = rotoff; | 263 | sop.RotationOffset = rotoff; |
264 | sop.CreatorID = creator; | 264 | sop.CreatorID = creator; |
265 | sop.InventorySerial = iserial; | 265 | sop.InventorySerial = iserial; |
266 | sop.TaskInventory = dic; | 266 | sop.TaskInventory = dic; |
267 | sop.ObjectFlags = objf; | 267 | sop.ObjectFlags = objf; |
@@ -306,7 +306,7 @@ namespace OpenSim.Data.Tests | |||
306 | Assert.That(expires,Is.EqualTo(sop.Expires), "Assert.That(expires,Is.EqualTo(sop.Expires))"); | 306 | Assert.That(expires,Is.EqualTo(sop.Expires), "Assert.That(expires,Is.EqualTo(sop.Expires))"); |
307 | Assert.That(rezzed,Is.EqualTo(sop.Rezzed), "Assert.That(rezzed,Is.EqualTo(sop.Rezzed))"); | 307 | Assert.That(rezzed,Is.EqualTo(sop.Rezzed), "Assert.That(rezzed,Is.EqualTo(sop.Rezzed))"); |
308 | Assert.That(offset,Is.EqualTo(sop.OffsetPosition), "Assert.That(offset,Is.EqualTo(sop.OffsetPosition))"); | 308 | Assert.That(offset,Is.EqualTo(sop.OffsetPosition), "Assert.That(offset,Is.EqualTo(sop.OffsetPosition))"); |
309 | Assert.That(velocity,Is.EqualTo(sop.Velocity), "Assert.That(velocity,Is.EqualTo(sop.Velocity))"); | 309 | Assert.That(velocity,Is.EqualTo(sop.Velocity), "Assert.That(velocity,Is.EqualTo(sop.Velocity))"); |
310 | Assert.That(angvelo,Is.EqualTo(sop.AngularVelocity), "Assert.That(angvelo,Is.EqualTo(sop.AngularVelocity))"); | 310 | Assert.That(angvelo,Is.EqualTo(sop.AngularVelocity), "Assert.That(angvelo,Is.EqualTo(sop.AngularVelocity))"); |
311 | Assert.That(accel,Is.EqualTo(sop.Acceleration), "Assert.That(accel,Is.EqualTo(sop.Acceleration))"); | 311 | Assert.That(accel,Is.EqualTo(sop.Acceleration), "Assert.That(accel,Is.EqualTo(sop.Acceleration))"); |
312 | Assert.That(description,Is.EqualTo(sop.Description), "Assert.That(description,Is.EqualTo(sop.Description))"); | 312 | Assert.That(description,Is.EqualTo(sop.Description), "Assert.That(description,Is.EqualTo(sop.Description))"); |
@@ -319,7 +319,7 @@ namespace OpenSim.Data.Tests | |||
319 | Assert.That(scale,Is.EqualTo(sop.Scale), "Assert.That(scale,Is.EqualTo(sop.Scale))"); | 319 | Assert.That(scale,Is.EqualTo(sop.Scale), "Assert.That(scale,Is.EqualTo(sop.Scale))"); |
320 | Assert.That(updatef,Is.EqualTo(sop.UpdateFlag), "Assert.That(updatef,Is.EqualTo(sop.UpdateFlag))"); | 320 | Assert.That(updatef,Is.EqualTo(sop.UpdateFlag), "Assert.That(updatef,Is.EqualTo(sop.UpdateFlag))"); |
321 | 321 | ||
322 | // This is necessary or object will not be inserted in DB | 322 | // This is necessary or object will not be inserted in DB |
323 | sop.ObjectFlags = 0; | 323 | sop.ObjectFlags = 0; |
324 | 324 | ||
325 | SceneObjectGroup sog = new SceneObjectGroup(sop); | 325 | SceneObjectGroup sog = new SceneObjectGroup(sop); |
@@ -332,11 +332,11 @@ namespace OpenSim.Data.Tests | |||
332 | // Makes sure there are no double insertions: | 332 | // Makes sure there are no double insertions: |
333 | db.StoreObject(sog,region3); | 333 | db.StoreObject(sog,region3); |
334 | sogs = db.LoadObjects(region3); | 334 | sogs = db.LoadObjects(region3); |
335 | Assert.That(sogs.Count, Is.EqualTo(1), "Assert.That(sogs.Count, Is.EqualTo(1))"); | 335 | Assert.That(sogs.Count, Is.EqualTo(1), "Assert.That(sogs.Count, Is.EqualTo(1))"); |
336 | 336 | ||
337 | 337 | ||
338 | // Tests if the parameters were inserted correctly | 338 | // Tests if the parameters were inserted correctly |
339 | SceneObjectPart p = sogs[0].RootPart; | 339 | SceneObjectPart p = sogs[0].RootPart; |
340 | Assert.That(regionh,Is.EqualTo(p.RegionHandle), "Assert.That(regionh,Is.EqualTo(p.RegionHandle))"); | 340 | Assert.That(regionh,Is.EqualTo(p.RegionHandle), "Assert.That(regionh,Is.EqualTo(p.RegionHandle))"); |
341 | //Assert.That(localid,Is.EqualTo(p.LocalId), "Assert.That(localid,Is.EqualTo(p.LocalId))"); | 341 | //Assert.That(localid,Is.EqualTo(p.LocalId), "Assert.That(localid,Is.EqualTo(p.LocalId))"); |
342 | Assert.That(groupos,Is.EqualTo(p.GroupPosition), "Assert.That(groupos,Is.EqualTo(p.GroupPosition))"); | 342 | Assert.That(groupos,Is.EqualTo(p.GroupPosition), "Assert.That(groupos,Is.EqualTo(p.GroupPosition))"); |
@@ -402,7 +402,7 @@ namespace OpenSim.Data.Tests | |||
402 | random.NextBytes(partsys); | 402 | random.NextBytes(partsys); |
403 | DateTime expires = new DateTime(2010, 12, 20); | 403 | DateTime expires = new DateTime(2010, 12, 20); |
404 | DateTime rezzed = new DateTime(2005, 07, 15); | 404 | DateTime rezzed = new DateTime(2005, 07, 15); |
405 | Vector3 groupos = new Vector3(random.Next(),random.Next(),random.Next()); | 405 | Vector3 groupos = new Vector3(random.Next(),random.Next(),random.Next()); |
406 | Vector3 offset = new Vector3(random.Next(),random.Next(),random.Next()); | 406 | Vector3 offset = new Vector3(random.Next(),random.Next(),random.Next()); |
407 | Quaternion rotoff = new Quaternion(random.Next(),random.Next(),random.Next(),random.Next()); | 407 | Quaternion rotoff = new Quaternion(random.Next(),random.Next(),random.Next(),random.Next()); |
408 | Vector3 velocity = new Vector3(random.Next(),random.Next(),random.Next()); | 408 | Vector3 velocity = new Vector3(random.Next(),random.Next(),random.Next()); |
@@ -418,7 +418,7 @@ namespace OpenSim.Data.Tests | |||
418 | PrimitiveBaseShape pbshap = new PrimitiveBaseShape(); | 418 | PrimitiveBaseShape pbshap = new PrimitiveBaseShape(); |
419 | pbshap = PrimitiveBaseShape.Default; | 419 | pbshap = PrimitiveBaseShape.Default; |
420 | Vector3 scale = new Vector3(random.Next(),random.Next(),random.Next()); | 420 | Vector3 scale = new Vector3(random.Next(),random.Next(),random.Next()); |
421 | byte updatef = (byte) random.Next(127); | 421 | byte updatef = (byte) random.Next(127); |
422 | 422 | ||
423 | // Updates the region with new values | 423 | // Updates the region with new values |
424 | SceneObjectGroup sog2 = FindSOG("Adam West", region3); | 424 | SceneObjectGroup sog2 = FindSOG("Adam West", region3); |
@@ -427,7 +427,7 @@ namespace OpenSim.Data.Tests | |||
427 | sog2.RootPart.Shape = pbshap; | 427 | sog2.RootPart.Shape = pbshap; |
428 | sog2.RootPart.GroupPosition = groupos; | 428 | sog2.RootPart.GroupPosition = groupos; |
429 | sog2.RootPart.RotationOffset = rotoff; | 429 | sog2.RootPart.RotationOffset = rotoff; |
430 | sog2.RootPart.CreatorID = creator; | 430 | sog2.RootPart.CreatorID = creator; |
431 | sog2.RootPart.TaskInventory = dic; | 431 | sog2.RootPart.TaskInventory = dic; |
432 | sog2.RootPart.Name = name; | 432 | sog2.RootPart.Name = name; |
433 | sog2.RootPart.Material = material; | 433 | sog2.RootPart.Material = material; |
@@ -492,12 +492,12 @@ namespace OpenSim.Data.Tests | |||
492 | { | 492 | { |
493 | UUID tmp = UUID.Random(); | 493 | UUID tmp = UUID.Random(); |
494 | SceneObjectPart sop = NewSOP(("Test SOP " + i.ToString()),tmp); | 494 | SceneObjectPart sop = NewSOP(("Test SOP " + i.ToString()),tmp); |
495 | Vector3 groupos = new Vector3(random.Next(),random.Next(),random.Next()); | 495 | Vector3 groupos = new Vector3(random.Next(),random.Next(),random.Next()); |
496 | Vector3 offset = new Vector3(random.Next(),random.Next(),random.Next()); | 496 | Vector3 offset = new Vector3(random.Next(),random.Next(),random.Next()); |
497 | Quaternion rotoff = new Quaternion(random.Next(),random.Next(),random.Next(),random.Next()); | 497 | Quaternion rotoff = new Quaternion(random.Next(),random.Next(),random.Next(),random.Next()); |
498 | Vector3 velocity = new Vector3(random.Next(),random.Next(),random.Next()); | 498 | Vector3 velocity = new Vector3(random.Next(),random.Next(),random.Next()); |
499 | Vector3 angvelo = new Vector3(random.Next(),random.Next(),random.Next()); | 499 | Vector3 angvelo = new Vector3(random.Next(),random.Next(),random.Next()); |
500 | Vector3 accel = new Vector3(random.Next(),random.Next(),random.Next()); | 500 | Vector3 accel = new Vector3(random.Next(),random.Next(),random.Next()); |
501 | 501 | ||
502 | sop.GroupPosition = groupos; | 502 | sop.GroupPosition = groupos; |
503 | sop.RotationOffset = rotoff; | 503 | sop.RotationOffset = rotoff; |
@@ -648,7 +648,7 @@ namespace OpenSim.Data.Tests | |||
648 | { | 648 | { |
649 | InventoryItemBase i = new InventoryItemBase(); | 649 | InventoryItemBase i = new InventoryItemBase(); |
650 | UUID id = UUID.Random(); | 650 | UUID id = UUID.Random(); |
651 | i.ID = id; | 651 | i.ID = id; |
652 | UUID folder = UUID.Random(); | 652 | UUID folder = UUID.Random(); |
653 | i.Folder = folder; | 653 | i.Folder = folder; |
654 | UUID owner = UUID.Random(); | 654 | UUID owner = UUID.Random(); |
@@ -666,13 +666,13 @@ namespace OpenSim.Data.Tests | |||
666 | i.NextPermissions = nextperm; | 666 | i.NextPermissions = nextperm; |
667 | uint curperm = (uint) random.Next(); | 667 | uint curperm = (uint) random.Next(); |
668 | i.CurrentPermissions = curperm; | 668 | i.CurrentPermissions = curperm; |
669 | uint baseperm = (uint) random.Next(); | 669 | uint baseperm = (uint) random.Next(); |
670 | i.BasePermissions = baseperm; | 670 | i.BasePermissions = baseperm; |
671 | uint eoperm = (uint) random.Next(); | 671 | uint eoperm = (uint) random.Next(); |
672 | i.EveryOnePermissions = eoperm; | 672 | i.EveryOnePermissions = eoperm; |
673 | int assettype = random.Next(); | 673 | int assettype = random.Next(); |
674 | i.AssetType = assettype; | 674 | i.AssetType = assettype; |
675 | UUID groupid = UUID.Random(); | 675 | UUID groupid = UUID.Random(); |
676 | i.GroupID = groupid; | 676 | i.GroupID = groupid; |
677 | bool groupown = true; | 677 | bool groupown = true; |
678 | i.GroupOwned = groupown; | 678 | i.GroupOwned = groupown; |
@@ -1010,7 +1010,7 @@ namespace OpenSim.Data.Tests | |||
1010 | 1010 | ||
1011 | private SceneObjectPart NewSOP(string name, UUID uuid) | 1011 | private SceneObjectPart NewSOP(string name, UUID uuid) |
1012 | { | 1012 | { |
1013 | SceneObjectPart sop = new SceneObjectPart(); | 1013 | SceneObjectPart sop = new SceneObjectPart(); |
1014 | sop.Name = name; | 1014 | sop.Name = name; |
1015 | sop.Description = name; | 1015 | sop.Description = name; |
1016 | sop.Text = RandomName(); | 1016 | sop.Text = RandomName(); |
@@ -1042,12 +1042,12 @@ namespace OpenSim.Data.Tests | |||
1042 | int size = random.Next(5,12); | 1042 | int size = random.Next(5,12); |
1043 | char ch ; | 1043 | char ch ; |
1044 | for (int i=0; i<size; i++) | 1044 | for (int i=0; i<size; i++) |
1045 | { | 1045 | { |
1046 | ch = Convert.ToChar(Convert.ToInt32(Math.Floor(26 * random.NextDouble() + 65))) ; | 1046 | ch = Convert.ToChar(Convert.ToInt32(Math.Floor(26 * random.NextDouble() + 65))) ; |
1047 | name.Append(ch); | 1047 | name.Append(ch); |
1048 | } | 1048 | } |
1049 | return name.ToString(); | 1049 | return name.ToString(); |
1050 | } | 1050 | } |
1051 | // private InventoryFolderBase NewFolder(UUID id, UUID parent, UUID owner, string name) | 1051 | // private InventoryFolderBase NewFolder(UUID id, UUID parent, UUID owner, string name) |
1052 | // { | 1052 | // { |
1053 | // InventoryFolderBase f = new InventoryFolderBase(); | 1053 | // InventoryFolderBase f = new InventoryFolderBase(); |
diff --git a/OpenSim/Data/Tests/BasicUserTest.cs b/OpenSim/Data/Tests/BasicUserTest.cs index f9feb9b..1f472a5 100644 --- a/OpenSim/Data/Tests/BasicUserTest.cs +++ b/OpenSim/Data/Tests/BasicUserTest.cs | |||
@@ -152,7 +152,7 @@ namespace OpenSim.Data.Tests | |||
152 | u1.FirstName = "Ugly"; | 152 | u1.FirstName = "Ugly"; |
153 | 153 | ||
154 | db.UpdateUserProfile(u1); | 154 | db.UpdateUserProfile(u1); |
155 | Assert.That("Ugly",Is.EqualTo(u1.FirstName), "Assert.That(\"Ugly\",Is.EqualTo(u1.FirstName))"); | 155 | Assert.That("Ugly",Is.EqualTo(u1.FirstName), "Assert.That(\"Ugly\",Is.EqualTo(u1.FirstName))"); |
156 | } | 156 | } |
157 | 157 | ||
158 | [Test] | 158 | [Test] |
@@ -174,7 +174,7 @@ namespace OpenSim.Data.Tests | |||
174 | db.AddNewUserProfile(u4); | 174 | db.AddNewUserProfile(u4); |
175 | Assert.That(db.GetUserByUUID(zero),Is.Null); | 175 | Assert.That(db.GetUserByUUID(zero),Is.Null); |
176 | Assert.That(db.GetUserByUUID(user4),Is.Null); | 176 | Assert.That(db.GetUserByUUID(user4),Is.Null); |
177 | } | 177 | } |
178 | 178 | ||
179 | [Test] | 179 | [Test] |
180 | public void T015_UserPersistency() | 180 | public void T015_UserPersistency() |
@@ -218,7 +218,7 @@ namespace OpenSim.Data.Tests | |||
218 | 218 | ||
219 | //HomeRegionX and HomeRegionY must only use 24 bits | 219 | //HomeRegionX and HomeRegionY must only use 24 bits |
220 | homeregx = ((homeregx << 8) >> 8); | 220 | homeregx = ((homeregx << 8) >> 8); |
221 | homeregy = ((homeregy << 8) >> 8); | 221 | homeregy = ((homeregy << 8) >> 8); |
222 | 222 | ||
223 | u.ID = id; | 223 | u.ID = id; |
224 | u.WebLoginKey = webloginkey; | 224 | u.WebLoginKey = webloginkey; |
@@ -299,7 +299,7 @@ namespace OpenSim.Data.Tests | |||
299 | uint homeregx = (uint) random.Next(); | 299 | uint homeregx = (uint) random.Next(); |
300 | uint homeregy = (uint) random.Next(); | 300 | uint homeregy = (uint) random.Next(); |
301 | Vector3 homeloc = new Vector3((float)Math.Round(random.NextDouble(),5),(float)Math.Round(random.NextDouble(),5),(float)Math.Round(random.NextDouble(),5)); | 301 | Vector3 homeloc = new Vector3((float)Math.Round(random.NextDouble(),5),(float)Math.Round(random.NextDouble(),5),(float)Math.Round(random.NextDouble(),5)); |
302 | Vector3 homelookat = new Vector3((float)Math.Round(random.NextDouble(),5),(float)Math.Round(random.NextDouble(),5),(float)Math.Round(random.NextDouble(),5)); | 302 | Vector3 homelookat = new Vector3((float)Math.Round(random.NextDouble(),5),(float)Math.Round(random.NextDouble(),5),(float)Math.Round(random.NextDouble(),5)); |
303 | int created = random.Next(); | 303 | int created = random.Next(); |
304 | int lastlogin = random.Next(); | 304 | int lastlogin = random.Next(); |
305 | string userinvuri = RandomName(); | 305 | string userinvuri = RandomName(); |
@@ -359,7 +359,7 @@ namespace OpenSim.Data.Tests | |||
359 | Assert.That(email,Is.EqualTo(u1a.Email), "Assert.That(email,Is.EqualTo(u1a.Email))"); | 359 | Assert.That(email,Is.EqualTo(u1a.Email), "Assert.That(email,Is.EqualTo(u1a.Email))"); |
360 | Assert.That(passhash,Is.EqualTo(u1a.PasswordHash), "Assert.That(passhash,Is.EqualTo(u1a.PasswordHash))"); | 360 | Assert.That(passhash,Is.EqualTo(u1a.PasswordHash), "Assert.That(passhash,Is.EqualTo(u1a.PasswordHash))"); |
361 | Assert.That(passsalt,Is.EqualTo(u1a.PasswordSalt), "Assert.That(passsalt,Is.EqualTo(u1a.PasswordSalt))"); | 361 | Assert.That(passsalt,Is.EqualTo(u1a.PasswordSalt), "Assert.That(passsalt,Is.EqualTo(u1a.PasswordSalt))"); |
362 | Assert.That(homereg,Is.EqualTo(u1a.HomeRegion), "Assert.That(homereg,Is.EqualTo(u1a.HomeRegion))"); | 362 | Assert.That(homereg,Is.EqualTo(u1a.HomeRegion), "Assert.That(homereg,Is.EqualTo(u1a.HomeRegion))"); |
363 | Assert.That(homeregx,Is.EqualTo(u1a.HomeRegionX), "Assert.That(homeregx,Is.EqualTo(u1a.HomeRegionX))"); | 363 | Assert.That(homeregx,Is.EqualTo(u1a.HomeRegionX), "Assert.That(homeregx,Is.EqualTo(u1a.HomeRegionX))"); |
364 | Assert.That(homeregy,Is.EqualTo(u1a.HomeRegionY), "Assert.That(homeregy,Is.EqualTo(u1a.HomeRegionY))"); | 364 | Assert.That(homeregy,Is.EqualTo(u1a.HomeRegionY), "Assert.That(homeregy,Is.EqualTo(u1a.HomeRegionY))"); |
365 | Assert.That(homereg,Is.EqualTo(u1a.HomeRegion), "Assert.That(homereg,Is.EqualTo(u1a.HomeRegion))"); | 365 | Assert.That(homereg,Is.EqualTo(u1a.HomeRegion), "Assert.That(homereg,Is.EqualTo(u1a.HomeRegion))"); |
@@ -426,7 +426,7 @@ namespace OpenSim.Data.Tests | |||
426 | UserAgentData a2 = db.GetAgentByName(fname2,lname2); | 426 | UserAgentData a2 = db.GetAgentByName(fname2,lname2); |
427 | UserAgentData a3 = db.GetAgentByName(name3); | 427 | UserAgentData a3 = db.GetAgentByName(name3); |
428 | Assert.That(user2,Is.EqualTo(a2.ProfileID), "Assert.That(user2,Is.EqualTo(a2.ProfileID))"); | 428 | Assert.That(user2,Is.EqualTo(a2.ProfileID), "Assert.That(user2,Is.EqualTo(a2.ProfileID))"); |
429 | Assert.That(user3,Is.EqualTo(a3.ProfileID), "Assert.That(user3,Is.EqualTo(a3.ProfileID))"); | 429 | Assert.That(user3,Is.EqualTo(a3.ProfileID), "Assert.That(user3,Is.EqualTo(a3.ProfileID))"); |
430 | } | 430 | } |
431 | 431 | ||
432 | [Test] | 432 | [Test] |
@@ -501,11 +501,11 @@ namespace OpenSim.Data.Tests | |||
501 | db.AddNewUserFriend(user1,user3, 2); | 501 | db.AddNewUserFriend(user1,user3, 2); |
502 | db.AddNewUserFriend(user1,user2, 4); | 502 | db.AddNewUserFriend(user1,user2, 4); |
503 | List<FriendListItem> fl1 = db.GetUserFriendList(user1); | 503 | List<FriendListItem> fl1 = db.GetUserFriendList(user1); |
504 | Assert.That(fl1.Count,Is.EqualTo(2), "Assert.That(fl1.Count,Is.EqualTo(2))"); | 504 | Assert.That(fl1.Count,Is.EqualTo(2), "Assert.That(fl1.Count,Is.EqualTo(2))"); |
505 | perms.Add(user2,1); | 505 | perms.Add(user2,1); |
506 | perms.Add(user3,2); | 506 | perms.Add(user3,2); |
507 | for (int i = 0; i < fl1.Count; i++) | 507 | for (int i = 0; i < fl1.Count; i++) |
508 | { | 508 | { |
509 | Assert.That(user1,Is.EqualTo(fl1[i].FriendListOwner), "Assert.That(user1,Is.EqualTo(fl1[i].FriendListOwner))"); | 509 | Assert.That(user1,Is.EqualTo(fl1[i].FriendListOwner), "Assert.That(user1,Is.EqualTo(fl1[i].FriendListOwner))"); |
510 | friends.Add(fl1[i].Friend,1); | 510 | friends.Add(fl1[i].Friend,1); |
511 | temp = perms[fl1[i].Friend]; | 511 | temp = perms[fl1[i].Friend]; |
@@ -544,7 +544,7 @@ namespace OpenSim.Data.Tests | |||
544 | db.UpdateUserFriendPerms(user1, user3, 4); | 544 | db.UpdateUserFriendPerms(user1, user3, 4); |
545 | 545 | ||
546 | fl1 = db.GetUserFriendList(user1); | 546 | fl1 = db.GetUserFriendList(user1); |
547 | Assert.That(fl1[0].FriendPerms,Is.EqualTo(4), "Assert.That(fl1[0].FriendPerms,Is.EqualTo(4))"); | 547 | Assert.That(fl1[0].FriendPerms,Is.EqualTo(4), "Assert.That(fl1[0].FriendPerms,Is.EqualTo(4))"); |
548 | } | 548 | } |
549 | 549 | ||
550 | [Test] | 550 | [Test] |
@@ -560,7 +560,7 @@ namespace OpenSim.Data.Tests | |||
560 | [Test] | 560 | [Test] |
561 | public void T041_UserAppearancePersistency() | 561 | public void T041_UserAppearancePersistency() |
562 | { | 562 | { |
563 | AvatarAppearance appear = new AvatarAppearance(); | 563 | AvatarAppearance appear = new AvatarAppearance(); |
564 | UUID owner = UUID.Random(); | 564 | UUID owner = UUID.Random(); |
565 | int serial = random.Next(); | 565 | int serial = random.Next(); |
566 | byte[] visualp = new byte[218]; | 566 | byte[] visualp = new byte[218]; |
@@ -698,7 +698,7 @@ namespace OpenSim.Data.Tests | |||
698 | int size = random.Next(5,12); | 698 | int size = random.Next(5,12); |
699 | char ch ; | 699 | char ch ; |
700 | for (int i=0; i<size; i++) | 700 | for (int i=0; i<size; i++) |
701 | { | 701 | { |
702 | ch = Convert.ToChar(Convert.ToInt32(Math.Floor(26 * random.NextDouble() + 65))) ; | 702 | ch = Convert.ToChar(Convert.ToInt32(Math.Floor(26 * random.NextDouble() + 65))) ; |
703 | name.Append(ch); | 703 | name.Append(ch); |
704 | } | 704 | } |
diff --git a/OpenSim/Data/UserDataBase.cs b/OpenSim/Data/UserDataBase.cs index 84926f2..3d370da 100644 --- a/OpenSim/Data/UserDataBase.cs +++ b/OpenSim/Data/UserDataBase.cs | |||
@@ -43,7 +43,7 @@ namespace OpenSim.Data | |||
43 | public abstract UserAgentData GetAgentByUUID(UUID user); | 43 | public abstract UserAgentData GetAgentByUUID(UUID user); |
44 | public abstract UserAgentData GetAgentByName(string name); | 44 | public abstract UserAgentData GetAgentByName(string name); |
45 | public abstract UserAgentData GetAgentByName(string fname, string lname); | 45 | public abstract UserAgentData GetAgentByName(string fname, string lname); |
46 | public UserProfileData GetUserByUri(Uri uri) { return null; } | 46 | public UserProfileData GetUserByUri(Uri uri) { return null; } |
47 | public abstract void StoreWebLoginKey(UUID agentID, UUID webLoginKey); | 47 | public abstract void StoreWebLoginKey(UUID agentID, UUID webLoginKey); |
48 | public abstract void AddNewUserProfile(UserProfileData user); | 48 | public abstract void AddNewUserProfile(UserProfileData user); |
49 | 49 | ||