mirror of
https://github.com/opensim/opensim.git
synced 2026-08-06 09:16:28 +08:00
Move Telehub tables and data from EstateSettings to RegionSettings.
This is damage control es EstateSettings is not the place this can be put. EstateSettings is nt unique to a region and therefore would introduce a hard limit of one telehub per estate, completely shutting off the option of having SL style telehubs, e.g. one per region. Whole estate teleport routing can still be implemented id desiresd, this way all options are open while the other way most options get closed off.
This commit is contained in:
@@ -157,7 +157,6 @@ namespace OpenSim.Data.MySQL
|
||||
DoCreate(es);
|
||||
|
||||
LoadBanList(es);
|
||||
LoadSpawnPoints(es);
|
||||
|
||||
es.EstateManagers = LoadUUIDList(es.EstateID, "estate_managers");
|
||||
es.EstateAccess = LoadUUIDList(es.EstateID, "estate_users");
|
||||
@@ -211,7 +210,6 @@ namespace OpenSim.Data.MySQL
|
||||
}
|
||||
|
||||
LoadBanList(es);
|
||||
LoadSpawnPoints(es);
|
||||
es.EstateManagers = LoadUUIDList(es.EstateID, "estate_managers");
|
||||
es.EstateAccess = LoadUUIDList(es.EstateID, "estate_users");
|
||||
es.EstateGroups = LoadUUIDList(es.EstateID, "estate_groups");
|
||||
@@ -298,74 +296,11 @@ namespace OpenSim.Data.MySQL
|
||||
}
|
||||
|
||||
SaveBanList(es);
|
||||
SaveSpawnPoints(es);
|
||||
SaveUUIDList(es.EstateID, "estate_managers", es.EstateManagers);
|
||||
SaveUUIDList(es.EstateID, "estate_users", es.EstateAccess);
|
||||
SaveUUIDList(es.EstateID, "estate_groups", es.EstateGroups);
|
||||
}
|
||||
|
||||
private void LoadSpawnPoints(EstateSettings es)
|
||||
{
|
||||
es.ClearSpawnPoints();
|
||||
|
||||
using (MySqlConnection dbcon = new MySqlConnection(m_connectionString))
|
||||
{
|
||||
dbcon.Open();
|
||||
|
||||
using (MySqlCommand cmd = dbcon.CreateCommand())
|
||||
{
|
||||
uint EstateID = es.EstateID;
|
||||
cmd.CommandText = "select PointX, PointY, PointZ from spawn_points where EstateID = ?EstateID";
|
||||
cmd.Parameters.AddWithValue("?EstateID", es.EstateID);
|
||||
|
||||
using (IDataReader r = cmd.ExecuteReader())
|
||||
{
|
||||
while (r.Read())
|
||||
{
|
||||
Vector3 point = new Vector3();
|
||||
|
||||
point.X = (float)r["PointX"];
|
||||
point.Y = (float)r["PointY"];
|
||||
point.Z = (float)r["PointZ"];
|
||||
|
||||
es.AddSpawnPoint(point);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void SaveSpawnPoints(EstateSettings es)
|
||||
{
|
||||
using (MySqlConnection dbcon = new MySqlConnection(m_connectionString))
|
||||
{
|
||||
dbcon.Open();
|
||||
|
||||
using (MySqlCommand cmd = dbcon.CreateCommand())
|
||||
{
|
||||
cmd.CommandText = "delete from spawn_points where EstateID = ?EstateID";
|
||||
cmd.Parameters.AddWithValue("?EstateID", es.EstateID.ToString());
|
||||
|
||||
cmd.ExecuteNonQuery();
|
||||
|
||||
cmd.Parameters.Clear();
|
||||
|
||||
cmd.CommandText = "insert into spawn_points (EstateID, PointX, PointY, PointZ) values ( ?EstateID, ?PointX, ?PointY,?PointZ)";
|
||||
|
||||
foreach (Vector3 p in es.SpawnPoints())
|
||||
{
|
||||
cmd.Parameters.AddWithValue("?EstateID", es.EstateID.ToString());
|
||||
cmd.Parameters.AddWithValue("?PointX", p.X);
|
||||
cmd.Parameters.AddWithValue("?PointY", p.Y);
|
||||
cmd.Parameters.AddWithValue("?PointZ", p.Z);
|
||||
|
||||
cmd.ExecuteNonQuery();
|
||||
cmd.Parameters.Clear();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void LoadBanList(EstateSettings es)
|
||||
{
|
||||
es.ClearBans();
|
||||
|
||||
@@ -846,6 +846,8 @@ namespace OpenSim.Data.MySQL
|
||||
}
|
||||
}
|
||||
|
||||
LoadSpawnPoints(rs);
|
||||
|
||||
return rs;
|
||||
}
|
||||
|
||||
@@ -1017,6 +1019,7 @@ namespace OpenSim.Data.MySQL
|
||||
}
|
||||
}
|
||||
}
|
||||
SaveSpawnPoints(rs);
|
||||
}
|
||||
|
||||
public List<LandData> LoadLandObjects(UUID regionUUID)
|
||||
@@ -1828,5 +1831,72 @@ namespace OpenSim.Data.MySQL
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void LoadSpawnPoints(RegionSettings rs)
|
||||
{
|
||||
rs.ClearSpawnPoints();
|
||||
|
||||
lock (m_dbLock)
|
||||
{
|
||||
using (MySqlConnection dbcon = new MySqlConnection(m_connectionString))
|
||||
{
|
||||
dbcon.Open();
|
||||
|
||||
using (MySqlCommand cmd = dbcon.CreateCommand())
|
||||
{
|
||||
cmd.CommandText = "select PointX, PointY, PointZ from spawn_points where RegionID = ?RegionID";
|
||||
cmd.Parameters.AddWithValue("?RegionID", rs.RegionUUID.ToString());
|
||||
|
||||
using (IDataReader r = cmd.ExecuteReader())
|
||||
{
|
||||
while (r.Read())
|
||||
{
|
||||
Vector3 point = new Vector3();
|
||||
|
||||
point.X = (float)r["PointX"];
|
||||
point.Y = (float)r["PointY"];
|
||||
point.Z = (float)r["PointZ"];
|
||||
|
||||
rs.AddSpawnPoint(point);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void SaveSpawnPoints(RegionSettings rs)
|
||||
{
|
||||
lock (m_dbLock)
|
||||
{
|
||||
using (MySqlConnection dbcon = new MySqlConnection(m_connectionString))
|
||||
{
|
||||
dbcon.Open();
|
||||
|
||||
using (MySqlCommand cmd = dbcon.CreateCommand())
|
||||
{
|
||||
cmd.CommandText = "delete from spawn_points where RegionID = ?RegionID";
|
||||
cmd.Parameters.AddWithValue("?RegionID", rs.RegionUUID.ToString());
|
||||
|
||||
cmd.ExecuteNonQuery();
|
||||
|
||||
cmd.Parameters.Clear();
|
||||
|
||||
cmd.CommandText = "insert into spawn_points (RegionID, PointX, PointY, PointZ) values ( ?EstateID, ?PointX, ?PointY,?PointZ)";
|
||||
|
||||
foreach (Vector3 p in rs.SpawnPoints())
|
||||
{
|
||||
cmd.Parameters.AddWithValue("?EstateID", rs.RegionUUID.ToString());
|
||||
cmd.Parameters.AddWithValue("?PointX", p.X);
|
||||
cmd.Parameters.AddWithValue("?PointY", p.Y);
|
||||
cmd.Parameters.AddWithValue("?PointZ", p.Z);
|
||||
|
||||
cmd.ExecuteNonQuery();
|
||||
cmd.Parameters.Clear();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -78,25 +78,4 @@ ALTER TABLE estate_settings AUTO_INCREMENT = 100;
|
||||
COMMIT;
|
||||
|
||||
|
||||
:VERSION 33 #--------------------- ( Supporting Telehubs
|
||||
|
||||
BEGIN;
|
||||
CREATE TABLE IF NOT EXISTS `spawn_points` (
|
||||
`EstateID` varchar(36) COLLATE utf8_unicode_ci NOT NULL,
|
||||
`PointX` float NOT NULL,
|
||||
`PointY` float NOT NULL,
|
||||
`PointZ` float NOT NULL,
|
||||
KEY `EstateID` (`EstateID`)
|
||||
) ENGINE=Innodb;
|
||||
|
||||
ALTER TABLE `estate_settings` ADD COLUMN `TelehubObject` varchar(36) NOT NULL;
|
||||
ALTER TABLE `estate_settings` ADD COLUMN `TelehubName` varchar(255) NOT NULL;
|
||||
ALTER TABLE `estate_settings` ADD COLUMN `TelehubEnabled` tinyint(4) NOT NULL;
|
||||
ALTER TABLE `estate_settings` ADD COLUMN `TelehubPosX` float NOT NULL;
|
||||
ALTER TABLE `estate_settings` ADD COLUMN `TelehubPosY` float NOT NULL;
|
||||
ALTER TABLE `estate_settings` ADD COLUMN `TelehubPosZ` float NOT NULL;
|
||||
ALTER TABLE `estate_settings` ADD COLUMN `TelehubRotX` float NOT NULL;
|
||||
ALTER TABLE `estate_settings` ADD COLUMN `TelehubRotY` float NOT NULL;
|
||||
ALTER TABLE `estate_settings` ADD COLUMN `TelehubRotZ` float NOT NULL;
|
||||
ALTER TABLE `estate_settings` ADD COLUMN `TelehubRotW` float NOT NULL;
|
||||
COMMIT;
|
||||
@@ -841,4 +841,28 @@ alter table regionban ENGINE = MyISAM;
|
||||
alter table regionsettings ENGINE = MyISAM;
|
||||
alter table terrain ENGINE = MyISAM;
|
||||
|
||||
COMMIT;
|
||||
COMMIT;
|
||||
|
||||
:VERSION 39 #--------------- Telehub support
|
||||
|
||||
BEGIN;
|
||||
CREATE TABLE IF NOT EXISTS `spawn_points` (
|
||||
`RegionID` varchar(36) COLLATE utf8_unicode_ci NOT NULL,
|
||||
`PointX` float NOT NULL,
|
||||
`PointY` float NOT NULL,
|
||||
`PointZ` float NOT NULL,
|
||||
KEY `EstateID` (`EstateID`)
|
||||
) ENGINE=Innodb;
|
||||
|
||||
ALTER TABLE `regionsettings` ADD COLUMN `TelehubObject` varchar(36) NOT NULL;
|
||||
ALTER TABLE `regionsettings` ADD COLUMN `TelehubName` varchar(255) NOT NULL;
|
||||
ALTER TABLE `regionsettings` ADD COLUMN `TelehubEnabled` tinyint(4) NOT NULL;
|
||||
ALTER TABLE `regionsettings` ADD COLUMN `TelehubPosX` float NOT NULL;
|
||||
ALTER TABLE `regionsettings` ADD COLUMN `TelehubPosY` float NOT NULL;
|
||||
ALTER TABLE `regionsettings` ADD COLUMN `TelehubPosZ` float NOT NULL;
|
||||
ALTER TABLE `regionsettings` ADD COLUMN `TelehubRotX` float NOT NULL;
|
||||
ALTER TABLE `regionsettings` ADD COLUMN `TelehubRotY` float NOT NULL;
|
||||
ALTER TABLE `regionsettings` ADD COLUMN `TelehubRotZ` float NOT NULL;
|
||||
ALTER TABLE `regionsettings` ADD COLUMN `TelehubRotW` float NOT NULL;
|
||||
COMMIT;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user