From cdaed113872f0615a0d2864cc54064a4432054c6 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Thu, 3 Sep 2015 18:39:08 +0100 Subject: at last we can login and see objects ( friends is dead and disable in scenepresence) --- OpenSim/Data/MySQL/MySQLFramework.cs | 29 +++--- OpenSim/Data/MySQL/MySQLSimulationData.cs | 101 ++++++++------------- OpenSim/Data/MySQL/MySQLUserAccountData.cs | 6 +- OpenSim/Data/MySQL/MySQLUserProfilesData.cs | 1 - .../Data/MySQL/Resources/RegionStore.migrations | 4 - .../Data/MySQL/Resources/UserProfiles.migrations | 3 - .../Data/PGSQL/Resources/UserProfiles.migrations | 3 - .../Data/SQLite/Resources/UserProfiles.migrations | 12 +++ 8 files changed, 66 insertions(+), 93 deletions(-) (limited to 'OpenSim/Data') diff --git a/OpenSim/Data/MySQL/MySQLFramework.cs b/OpenSim/Data/MySQL/MySQLFramework.cs index a522912..34791cf 100644 --- a/OpenSim/Data/MySQL/MySQLFramework.cs +++ b/OpenSim/Data/MySQL/MySQLFramework.cs @@ -60,32 +60,31 @@ namespace OpenSim.Data.MySQL protected int ExecuteNonQuery(MySqlCommand cmd) { lock (m_dbLock) - using (MySqlConnection dbcon = new MySqlConnection(m_connectionString)) { - dbcon.Open(); - cmd.Connection = dbcon; - - try + using (MySqlConnection dbcon = new MySqlConnection(m_connectionString)) { - dbcon.Open(); - cmd.Connection = dbcon; - try { - return cmd.ExecuteNonQuery(); + dbcon.Open(); + cmd.Connection = dbcon; + + try + { + return cmd.ExecuteNonQuery(); + } + catch (Exception e) + { + m_log.Error(e.Message, e); + m_log.Error(Environment.StackTrace.ToString()); + return 0; + } } catch (Exception e) { m_log.Error(e.Message, e); - m_log.Error(Environment.StackTrace.ToString()); return 0; } } - catch (Exception e) - { - m_log.Error(e.Message, e); - return 0; - } } } } diff --git a/OpenSim/Data/MySQL/MySQLSimulationData.cs b/OpenSim/Data/MySQL/MySQLSimulationData.cs index 549d129..a62d347 100644 --- a/OpenSim/Data/MySQL/MySQLSimulationData.cs +++ b/OpenSim/Data/MySQL/MySQLSimulationData.cs @@ -1089,42 +1089,43 @@ namespace OpenSim.Data.MySQL using (MySqlCommand cmd = dbcon.CreateCommand()) { cmd.CommandText = "replace into regionsettings (regionUUID, " + - "block_terraform, block_fly, allow_damage, " + - "restrict_pushing, allow_land_resell, " + - "allow_land_join_divide, block_show_in_search, " + - "agent_limit, object_bonus, maturity, " + - "disable_scripts, disable_collisions, " + - "disable_physics, terrain_texture_1, " + - "terrain_texture_2, terrain_texture_3, " + - "terrain_texture_4, elevation_1_nw, " + - "elevation_2_nw, elevation_1_ne, " + - "elevation_2_ne, elevation_1_se, " + - "elevation_2_se, elevation_1_sw, " + - "elevation_2_sw, water_height, " + - "terrain_raise_limit, terrain_lower_limit, " + - "use_estate_sun, fixed_sun, sun_position, " + - "covenant, covenant_datetime, Sandbox, sunvectorx, sunvectory, " + - "sunvectorz, loaded_creation_datetime, " + - "loaded_creation_id, map_tile_ID, block_search, casino, " + - "TelehubObject, parcel_tile_ID) " + - "values (?RegionUUID, ?BlockTerraform, " + - "?BlockFly, ?AllowDamage, ?RestrictPushing, " + - "?AllowLandResell, ?AllowLandJoinDivide, " + - "?BlockShowInSearch, ?AgentLimit, ?ObjectBonus, " + - "?Maturity, ?DisableScripts, ?DisableCollisions, " + - "?DisablePhysics, ?TerrainTexture1, " + - "?TerrainTexture2, ?TerrainTexture3, " + - "?TerrainTexture4, ?Elevation1NW, ?Elevation2NW, " + - "?Elevation1NE, ?Elevation2NE, ?Elevation1SE, " + - "?Elevation2SE, ?Elevation1SW, ?Elevation2SW, " + - "?WaterHeight, ?TerrainRaiseLimit, " + - "?TerrainLowerLimit, ?UseEstateSun, ?FixedSun, " + - "?SunPosition, ?Covenant, ?CovenantChangedDateTime, ?Sandbox, " + - "?SunVectorX, ?SunVectorY, ?SunVectorZ, " + - "?LoadedCreationDateTime, ?LoadedCreationID, " + - "?TerrainImageID, ?block_search, ?casino, " + - "?TelehubObject, ?ParcelImageID)"; - + "block_terraform, block_fly, allow_damage, " + + "restrict_pushing, allow_land_resell, " + + "allow_land_join_divide, block_show_in_search, " + + "agent_limit, object_bonus, maturity, " + + "disable_scripts, disable_collisions, " + + "disable_physics, terrain_texture_1, " + + "terrain_texture_2, terrain_texture_3, " + + "terrain_texture_4, elevation_1_nw, " + + "elevation_2_nw, elevation_1_ne, " + + "elevation_2_ne, elevation_1_se, " + + "elevation_2_se, elevation_1_sw, " + + "elevation_2_sw, water_height, " + + "terrain_raise_limit, terrain_lower_limit, " + + "use_estate_sun, fixed_sun, sun_position, " + + "covenant, covenant_datetime, Sandbox, sunvectorx, sunvectory, " + + "sunvectorz, loaded_creation_datetime, " + + "loaded_creation_id, map_tile_ID, block_search, casino, " + + "TelehubObject, parcel_tile_ID) " + + "values (?RegionUUID, ?BlockTerraform, " + + "?BlockFly, ?AllowDamage, ?RestrictPushing, " + + "?AllowLandResell, ?AllowLandJoinDivide, " + + "?BlockShowInSearch, ?AgentLimit, ?ObjectBonus, " + + "?Maturity, ?DisableScripts, ?DisableCollisions, " + + "?DisablePhysics, ?TerrainTexture1, " + + "?TerrainTexture2, ?TerrainTexture3, " + + "?TerrainTexture4, ?Elevation1NW, ?Elevation2NW, " + + "?Elevation1NE, ?Elevation2NE, ?Elevation1SE, " + + "?Elevation2SE, ?Elevation1SW, ?Elevation2SW, " + + "?WaterHeight, ?TerrainRaiseLimit, " + + "?TerrainLowerLimit, ?UseEstateSun, ?FixedSun, " + + "?SunPosition, ?Covenant, ?CovenantChangedDateTime, ?Sandbox, " + + "?SunVectorX, ?SunVectorY, ?SunVectorZ, " + + "?LoadedCreationDateTime, ?LoadedCreationID, " + + "?TerrainImageID, ?block_search, ?casino, " + + "?TelehubObject, ?ParcelImageID)"; + + FillRegionSettingsCommand(cmd, rs); ExecuteNonQuery(cmd); } @@ -1567,34 +1568,6 @@ namespace OpenSim.Data.MySQL } /// - /// - /// - /// - /// - private static Array SerializeTerrain(double[,] val, double[,] oldTerrain) - { - MemoryStream str = new MemoryStream(((int)Constants.RegionSize * (int)Constants.RegionSize) *sizeof (double)); - BinaryWriter bw = new BinaryWriter(str); - - // TODO: COMPATIBILITY - Add byte-order conversions - for (int x = 0; x < (int)Constants.RegionSize; x++) - for (int y = 0; y < (int)Constants.RegionSize; y++) - { - double height = 20.0; - if (oldTerrain != null) - height = oldTerrain[x, y]; - if (!double.IsNaN(val[x, y])) - height = val[x, y]; - if (height == 0.0) - height = double.Epsilon; - - bw.Write(height); - } - - return str.ToArray(); - } - - /// /// Fill the prim command with prim values /// /// diff --git a/OpenSim/Data/MySQL/MySQLUserAccountData.cs b/OpenSim/Data/MySQL/MySQLUserAccountData.cs index 4ff3175..59cfe70 100644 --- a/OpenSim/Data/MySQL/MySQLUserAccountData.cs +++ b/OpenSim/Data/MySQL/MySQLUserAccountData.cs @@ -71,14 +71,14 @@ namespace OpenSim.Data.MySQL if (words.Length == 1) { cmd.CommandText = String.Format("select * from {0} where (ScopeID=?ScopeID or ScopeID='00000000-0000-0000-0000-000000000000') and (FirstName like ?search or LastName like ?search) and active=1", m_Realm); - cmd.Parameters.AddWithValue("?search", words[0] + "%"); + cmd.Parameters.AddWithValue("?search", "%" + words[0] + "%"); cmd.Parameters.AddWithValue("?ScopeID", scopeID.ToString()); } else { cmd.CommandText = String.Format("select * from {0} where (ScopeID=?ScopeID or ScopeID='00000000-0000-0000-0000-000000000000') and (FirstName like ?searchFirst and LastName like ?searchLast) and active=1", m_Realm); - cmd.Parameters.AddWithValue("?searchFirst", words[0] + "%"); - cmd.Parameters.AddWithValue("?searchLast", words[1] + "%"); + cmd.Parameters.AddWithValue("?searchFirst", "%" + words[0] + "%"); + cmd.Parameters.AddWithValue("?searchLast", "%" + words[1] + "%"); cmd.Parameters.AddWithValue("?ScopeID", scopeID.ToString()); } diff --git a/OpenSim/Data/MySQL/MySQLUserProfilesData.cs b/OpenSim/Data/MySQL/MySQLUserProfilesData.cs index c241e90..295e131 100644 --- a/OpenSim/Data/MySQL/MySQLUserProfilesData.cs +++ b/OpenSim/Data/MySQL/MySQLUserProfilesData.cs @@ -914,7 +914,6 @@ namespace OpenSim.Data.MySQL using (MySqlCommand cmd = new MySqlCommand(query, dbcon)) { cmd.Parameters.AddWithValue("?Id", pref.UserId.ToString()); - using (MySqlDataReader reader = cmd.ExecuteReader()) { if (reader.HasRows) diff --git a/OpenSim/Data/MySQL/Resources/RegionStore.migrations b/OpenSim/Data/MySQL/Resources/RegionStore.migrations index 738f5c2..097271a 100644 --- a/OpenSim/Data/MySQL/Resources/RegionStore.migrations +++ b/OpenSim/Data/MySQL/Resources/RegionStore.migrations @@ -939,7 +939,6 @@ ALTER TABLE prims ADD COLUMN AttachedPosY double default 0; ALTER TABLE prims ADD COLUMN AttachedPosZ double default 0; ALTER TABLE primshapes ADD COLUMN LastAttachPoint int(4) not null default '0'; COMMIT; -<<<<<<< HEAD :VERSION 50 #---- Change LandFlags to unsigned @@ -948,6 +947,3 @@ BEGIN; ALTER TABLE land CHANGE COLUMN LandFlags LandFlags int unsigned default null; COMMIT; - -======= ->>>>>>> avn/ubitvar diff --git a/OpenSim/Data/MySQL/Resources/UserProfiles.migrations b/OpenSim/Data/MySQL/Resources/UserProfiles.migrations index 3df9b9b..87e99fa 100644 --- a/OpenSim/Data/MySQL/Resources/UserProfiles.migrations +++ b/OpenSim/Data/MySQL/Resources/UserProfiles.migrations @@ -81,7 +81,6 @@ CREATE TABLE IF NOT EXISTS `userdata` ( commit; -<<<<<<< HEAD :VERSION 3 # ------------------------------- begin; CREATE TABLE IF NOT EXISTS `usersettings` ( @@ -97,5 +96,3 @@ commit; begin; ALTER TABLE userpicks ADD COLUMN gatekeeper varchar(255); commit; -======= ->>>>>>> avn/ubitvar diff --git a/OpenSim/Data/PGSQL/Resources/UserProfiles.migrations b/OpenSim/Data/PGSQL/Resources/UserProfiles.migrations index a67107a..c1580b2 100644 --- a/OpenSim/Data/PGSQL/Resources/UserProfiles.migrations +++ b/OpenSim/Data/PGSQL/Resources/UserProfiles.migrations @@ -81,7 +81,6 @@ CREATE TABLE userdata ( commit; -<<<<<<< HEAD :VERSION 3 # ------------------------------- begin; CREATE TABLE usersettings ( @@ -154,5 +153,3 @@ BEGIN; ALTER TABLE usersettings ALTER COLUMN imviaemail SET DATA TYPE boolean USING CASE WHEN false THEN false ELSE true END; COMMIT; -======= ->>>>>>> avn/ubitvar diff --git a/OpenSim/Data/SQLite/Resources/UserProfiles.migrations b/OpenSim/Data/SQLite/Resources/UserProfiles.migrations index 16581f6..207dde0 100644 --- a/OpenSim/Data/SQLite/Resources/UserProfiles.migrations +++ b/OpenSim/Data/SQLite/Resources/UserProfiles.migrations @@ -88,3 +88,15 @@ CREATE TABLE IF NOT EXISTS userdata ( commit; + +:VERSION 3 # ------------------------------- + +begin; +CREATE TABLE IF NOT EXISTS usersettings ( + useruuid char(36) NOT NULL, + imviaemail binary(1) NOT NULL, + visible binary(1) NOT NULL, + email varchar(254) NOT NULL, + PRIMARY KEY (useruuid) +) +commit; -- cgit v1.1