Merge branch '0.7.3-post-fixes' of ssh://opensimulator.org/var/git/opensim into 0.7.3-post-fixes

0.7.3-post-fixes
Diva Canto 2012-02-19 16:48:09 -08:00
commit fdda57cf10
7 changed files with 171 additions and 11 deletions

View File

@ -541,4 +541,26 @@ CREATE TABLE regionwindlight (
cloud_scroll_y_lock INTEGER NOT NULL DEFAULT '0',
draw_classic_clouds INTEGER NOT NULL DEFAULT '1');
COMMIT;
COMMIT;
:VERSION 24
BEGIN;
CREATE TABLE IF NOT EXISTS `spawn_points` (
`RegionID` varchar(36) NOT NULL DEFAULT '000000-0000-0000-0000-000000000000',
`Yaw` float NOT NULL,
`Pitch` float NOT NULL,
`Distance` float NOT NULL
);
ALTER TABLE `regionsettings` ADD COLUMN `TelehubObject` varchar(36) NOT NULL DEFAULT '00000000-0000-0000-0000-000000000000';
COMMIT;
:VERSION 25
BEGIN;
ALTER TABLE `regionsettings` ADD COLUMN `parcel_tile_ID` char(36) NOT NULL DEFAULT '00000000-0000-0000-0000-000000000000';
COMMIT;

View File

@ -61,6 +61,7 @@ namespace OpenSim.Data.SQLite
private const string regionbanListSelect = "select * from regionban";
private const string regionSettingsSelect = "select * from regionsettings";
private const string regionWindlightSelect = "select * from regionwindlight";
private const string regionSpawnPointsSelect = "select * from spawn_points";
private DataSet ds;
private SqliteDataAdapter primDa;
@ -71,6 +72,7 @@ namespace OpenSim.Data.SQLite
private SqliteDataAdapter landAccessListDa;
private SqliteDataAdapter regionSettingsDa;
private SqliteDataAdapter regionWindlightDa;
private SqliteDataAdapter regionSpawnPointsDa;
private SqliteConnection m_conn;
private String m_connectionString;
@ -140,6 +142,10 @@ namespace OpenSim.Data.SQLite
SqliteCommand regionWindlightSelectCmd = new SqliteCommand(regionWindlightSelect, m_conn);
regionWindlightDa = new SqliteDataAdapter(regionWindlightSelectCmd);
SqliteCommand regionSpawnPointsSelectCmd = new SqliteCommand(regionSpawnPointsSelect, m_conn);
regionSpawnPointsDa = new SqliteDataAdapter(regionSpawnPointsSelectCmd);
// This actually does the roll forward assembly stuff
Migration m = new Migration(m_conn, Assembly, "RegionStore");
m.Update();
@ -170,6 +176,9 @@ namespace OpenSim.Data.SQLite
ds.Tables.Add(createRegionWindlightTable());
setupRegionWindlightCommands(regionWindlightDa, m_conn);
ds.Tables.Add(createRegionSpawnPointsTable());
setupRegionSpawnPointsCommands(regionSpawnPointsDa, m_conn);
// WORKAROUND: This is a work around for sqlite on
// windows, which gets really unhappy with blob columns
// that have no sample data in them. At some point we
@ -246,6 +255,15 @@ namespace OpenSim.Data.SQLite
m_log.ErrorFormat("[SQLITE REGION DB]: Caught fill error on regionwindlight table :{0}", e.Message);
}
try
{
regionSpawnPointsDa.Fill(ds.Tables["spawn_points"]);
}
catch (Exception e)
{
m_log.ErrorFormat("[SQLITE REGION DB]: Caught fill error on spawn_points table :{0}", e.Message);
}
// We have to create a data set mapping for every table, otherwise the IDataAdaptor.Update() will not populate rows with values!
// Not sure exactly why this is - this kind of thing was not necessary before - justincc 20100409
// Possibly because we manually set up our own DataTables before connecting to the database
@ -257,6 +275,7 @@ namespace OpenSim.Data.SQLite
CreateDataSetMapping(landAccessListDa, "landaccesslist");
CreateDataSetMapping(regionSettingsDa, "regionsettings");
CreateDataSetMapping(regionWindlightDa, "regionwindlight");
CreateDataSetMapping(regionSpawnPointsDa, "spawn_points");
}
}
catch (Exception e)
@ -319,6 +338,11 @@ namespace OpenSim.Data.SQLite
regionWindlightDa.Dispose();
regionWindlightDa = null;
}
if (regionSpawnPointsDa != null)
{
regionSpawnPointsDa.Dispose();
regionWindlightDa = null;
}
}
public void StoreRegionSettings(RegionSettings rs)
@ -339,8 +363,43 @@ namespace OpenSim.Data.SQLite
fillRegionSettingsRow(settingsRow, rs);
}
StoreSpawnPoints(rs);
Commit();
}
}
public void StoreSpawnPoints(RegionSettings rs)
{
lock (ds)
{
// DataTable spawnpoints = ds.Tables["spawn_points"];
// remove region's spawnpoints
using (
SqliteCommand cmd =
new SqliteCommand("delete from spawn_points where RegionID=:RegionID",
m_conn))
{
cmd.Parameters.Add(new SqliteParameter(":RegionID", rs.RegionUUID.ToString()));
cmd.ExecuteNonQuery();
}
}
foreach (SpawnPoint sp in rs.SpawnPoints())
{
using (SqliteCommand cmd = new SqliteCommand("insert into spawn_points(RegionID, Yaw, Pitch, Distance)" +
"values ( :RegionID, :Yaw, :Pitch, :Distance)", m_conn))
{
cmd.Parameters.Add(new SqliteParameter(":RegionID", rs.RegionUUID.ToString()));
cmd.Parameters.Add(new SqliteParameter(":Yaw", sp.Yaw));
cmd.Parameters.Add(new SqliteParameter(":Pitch", sp.Pitch));
cmd.Parameters.Add(new SqliteParameter(":Distance", sp.Distance));
cmd.ExecuteNonQuery();
}
}
}
/// <summary>
@ -435,10 +494,31 @@ namespace OpenSim.Data.SQLite
RegionSettings newSettings = buildRegionSettings(row);
newSettings.OnSave += StoreRegionSettings;
LoadSpawnPoints(newSettings);
return newSettings;
}
}
private void LoadSpawnPoints(RegionSettings rs)
{
rs.ClearSpawnPoints();
DataTable spawnpoints = ds.Tables["spawn_points"];
string byRegion = "RegionID = '" + rs.RegionUUID + "'";
DataRow[] spForRegion = spawnpoints.Select(byRegion);
foreach (DataRow spRow in spForRegion)
{
SpawnPoint sp = new SpawnPoint();
sp.Pitch = (float)spRow["Pitch"];
sp.Yaw = (float)spRow["Yaw"];
sp.Distance = (float)spRow["Distance"];
rs.AddSpawnPoint(sp);
}
}
/// <summary>
/// Adds an object into region storage
/// </summary>
@ -1265,6 +1345,8 @@ namespace OpenSim.Data.SQLite
createCol(regionsettings, "covenant", typeof(String));
createCol(regionsettings, "covenant_datetime", typeof(Int32));
createCol(regionsettings, "map_tile_ID", typeof(String));
createCol(regionsettings, "TelehubObject", typeof(String));
createCol(regionsettings, "parcel_tile_ID", typeof(String));
regionsettings.PrimaryKey = new DataColumn[] { regionsettings.Columns["regionUUID"] };
return regionsettings;
}
@ -1345,6 +1427,17 @@ namespace OpenSim.Data.SQLite
return regionwindlight;
}
private static DataTable createRegionSpawnPointsTable()
{
DataTable spawn_points = new DataTable("spawn_points");
createCol(spawn_points, "regionID", typeof(String));
createCol(spawn_points, "Yaw", typeof(float));
createCol(spawn_points, "Pitch", typeof(float));
createCol(spawn_points, "Distance", typeof(float));
return spawn_points;
}
/***********************************************************************
*
* Convert between ADO.NET <=> OpenSim Objects
@ -1666,6 +1759,8 @@ namespace OpenSim.Data.SQLite
newSettings.Covenant = new UUID((String)row["covenant"]);
newSettings.CovenantChangedDateTime = Convert.ToInt32(row["covenant_datetime"]);
newSettings.TerrainImageID = new UUID((String)row["map_tile_ID"]);
newSettings.TelehubObject = new UUID((String)row["TelehubObject"]);
newSettings.ParcelImageID = new UUID((String)row["parcel_tile_ID"]);
return newSettings;
}
@ -2068,6 +2163,8 @@ namespace OpenSim.Data.SQLite
row["covenant"] = settings.Covenant.ToString();
row["covenant_datetime"] = settings.CovenantChangedDateTime;
row["map_tile_ID"] = settings.TerrainImageID.ToString();
row["TelehubObject"] = settings.TelehubObject.ToString();
row["parcel_tile_ID"] = settings.ParcelImageID.ToString();
}
/// <summary>
@ -2591,6 +2688,14 @@ namespace OpenSim.Data.SQLite
da.UpdateCommand.Connection = conn;
}
private void setupRegionSpawnPointsCommands(SqliteDataAdapter da, SqliteConnection conn)
{
da.InsertCommand = createInsertCommand("spawn_points", ds.Tables["spawn_points"]);
da.InsertCommand.Connection = conn;
da.UpdateCommand = createUpdateCommand("spawn_points", "RegionID=:RegionID", ds.Tables["spawn_points"]);
da.UpdateCommand.Connection = conn;
}
/// <summary>
///
/// </summary>

View File

@ -272,7 +272,8 @@ namespace OpenSim.Region.CoreModules.World.Land
ParcelFlags.AllowGroupScripts |
ParcelFlags.CreateGroupObjects |
ParcelFlags.AllowAPrimitiveEntry |
ParcelFlags.AllowGroupObjectEntry);
ParcelFlags.AllowGroupObjectEntry |
ParcelFlags.AllowFly);
}
if (m_scene.Permissions.CanEditParcelProperties(remote_client.AgentId, this, GroupPowers.LandSetSale))

View File

@ -3259,8 +3259,11 @@ namespace OpenSim.Region.Framework.Scenes
/// also return a reason.</returns>
public bool NewUserConnection(AgentCircuitData agent, uint teleportFlags, out string reason, bool requirePresenceLookup)
{
bool vialogin = ((teleportFlags & (uint)Constants.TeleportFlags.ViaLogin) != 0 ||
(teleportFlags & (uint)Constants.TeleportFlags.ViaHGLogin) != 0);
bool vialogin = ((teleportFlags & (uint)TPFlags.ViaLogin) != 0 ||
(teleportFlags & (uint)TPFlags.ViaHGLogin) != 0);
bool viahome = ((teleportFlags & (uint)TPFlags.ViaHome) != 0);
bool godlike = ((teleportFlags & (uint)TPFlags.Godlike) != 0);
reason = String.Empty;
//Teleport flags:
@ -3272,9 +3275,9 @@ namespace OpenSim.Region.Framework.Scenes
// Don't disable this log message - it's too helpful
m_log.DebugFormat(
"[SCENE]: Region {0} told of incoming {1} agent {2} {3} {4} (circuit code {5}, IP {6}, viewer {7}, teleportflags {8}, position {9})",
"[SCENE]: Region {0} told of incoming {1} agent {2} {3} {4} (circuit code {5}, IP {6}, viewer {7}, teleportflags ({8}), position {9})",
RegionInfo.RegionName, (agent.child ? "child" : "root"),agent.firstname, agent.lastname,
agent.AgentID, agent.circuitcode, agent.IPAddress, agent.Viewer, teleportFlags, agent.startpos);
agent.AgentID, agent.circuitcode, agent.IPAddress, agent.Viewer, ((TPFlags)teleportFlags).ToString(), agent.startpos);
if (LoginsDisabled)
{
@ -3427,6 +3430,29 @@ namespace OpenSim.Region.Framework.Scenes
agent.startpos.Z = 720;
}
}
// Honor Estate teleport routing via Telehubs excluding ViaHome and GodLike TeleportFlags
if (RegionInfo.RegionSettings.TelehubObject != UUID.Zero &&
RegionInfo.EstateSettings.AllowDirectTeleport == false &&
!viahome && !godlike)
{
SceneObjectGroup telehub = GetSceneObjectGroup(RegionInfo.RegionSettings.TelehubObject);
// Can have multiple SpawnPoints
List<SpawnPoint> spawnpoints = RegionInfo.RegionSettings.SpawnPoints();
if ( spawnpoints.Count > 1)
{
// We have multiple SpawnPoints, Route the agent to a random one
agent.startpos = spawnpoints[Util.RandomClass.Next(spawnpoints.Count)].GetLocation(telehub.AbsolutePosition, telehub.GroupRotation);
}
else
{
// We have a single SpawnPoint and will route the agent to it
agent.startpos = spawnpoints[0].GetLocation(telehub.AbsolutePosition, telehub.GroupRotation);
}
return true;
}
// Honor parcel landing type and position.
if (land != null)
{

View File

@ -1556,9 +1556,9 @@ namespace OpenSim.Region.Framework.Scenes
dupe.GroupPosition = GroupPosition;
dupe.OffsetPosition = OffsetPosition;
dupe.RotationOffset = RotationOffset;
dupe.Velocity = new Vector3(0, 0, 0);
dupe.Acceleration = new Vector3(0, 0, 0);
dupe.AngularVelocity = new Vector3(0, 0, 0);
dupe.Velocity = Velocity;
dupe.Acceleration = Acceleration;
dupe.AngularVelocity = AngularVelocity;
dupe.Flags = Flags;
dupe.OwnershipCost = OwnershipCost;

View File

@ -188,9 +188,9 @@ namespace OpenSim.Services.HypergridService
string authURL = string.Empty;
if (aCircuit.ServiceURLs.ContainsKey("HomeURI"))
authURL = aCircuit.ServiceURLs["HomeURI"].ToString();
m_log.InfoFormat("[GATEKEEPER SERVICE]: Login request for {0} {1} @ {2} ({3}) at {4} using viewer {5}, channel {6}, IP {7}, Mac {8}, Id0 {9}",
m_log.InfoFormat("[GATEKEEPER SERVICE]: Login request for {0} {1} @ {2} ({3}) at {4} using viewer {5}, channel {6}, IP {7}, Mac {8}, Id0 {9} Teleport Flags {10}",
aCircuit.firstname, aCircuit.lastname, authURL, aCircuit.AgentID, destination.RegionName,
aCircuit.Viewer, aCircuit.Channel, aCircuit.IPAddress, aCircuit.Mac, aCircuit.Id0);
aCircuit.Viewer, aCircuit.Channel, aCircuit.IPAddress, aCircuit.Mac, aCircuit.Id0, aCircuit.teleportFlags.ToString());
//
// Check client
@ -315,6 +315,10 @@ namespace OpenSim.Services.HypergridService
// Finally launch the agent at the destination
//
Constants.TeleportFlags loginFlag = isFirstLogin ? Constants.TeleportFlags.ViaLogin : Constants.TeleportFlags.ViaHGLogin;
// Preserve our TeleportFlags we have gathered so-far
loginFlag |= (Constants.TeleportFlags) aCircuit.teleportFlags;
m_log.DebugFormat("[GATEKEEPER SERVICE]: launching agent {0}", loginFlag);
return m_SimulationService.CreateAgent(destination, aCircuit, (uint)loginFlag, out reason);
}

View File

@ -465,6 +465,7 @@ namespace OpenSim.Services.LLLoginService
position = pinfo.HomePosition;
lookAt = pinfo.HomeLookAt;
flags |= TeleportFlags.ViaHome;
}
if (tryDefaults)
@ -753,6 +754,7 @@ namespace OpenSim.Services.LLLoginService
{
circuitCode = (uint)Util.RandomClass.Next(); ;
aCircuit = MakeAgent(destination, account, avatar, session, secureSession, circuitCode, position, clientIP.Address.ToString(), viewer, channel, mac, id0);
aCircuit.teleportFlags |= (uint)flags;
success = LaunchAgentIndirectly(gatekeeper, destination, aCircuit, clientIP, out reason);
if (!success && m_GridService != null)
{