mirror of
https://github.com/opensim/opensim.git
synced 2026-08-06 17:32:42 +08:00
Preliminary work on the new default region setting mechanism
This commit is contained in:
@@ -60,5 +60,16 @@ namespace OpenSim.Data
|
||||
|
||||
bool Delete(UUID regionID);
|
||||
|
||||
List<RegionData> GetDefaultRegions(UUID scopeID);
|
||||
List<RegionData> GetFallbackRegions(UUID scopeID, int x, int y);
|
||||
}
|
||||
|
||||
[Flags]
|
||||
public enum RegionFlags : int
|
||||
{
|
||||
DefaultRegion = 1, // Used for new Rez. Random if multiple defined
|
||||
FallbackRegion = 2, // Regions we redirect to when the destination is down
|
||||
RegionOnline = 4, // Set when a region comes online, unset when it unregisters and DeleteOnUnregister is false
|
||||
NoDirectLogin = 8 // Region unavailable for direct logins (by name)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -307,5 +307,15 @@ namespace OpenSim.Data.MSSQL
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public List<RegionData> GetDefaultRegions(UUID scopeID)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
public List<RegionData> GetFallbackRegions(UUID scopeID, int x, int y)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -274,5 +274,31 @@ namespace OpenSim.Data.MySQL
|
||||
|
||||
return false;
|
||||
}
|
||||
public List<RegionData> GetDefaultRegions(UUID scopeID)
|
||||
{
|
||||
string command = "select * from `"+m_Realm+"` where (flags & 1) <> 0";
|
||||
if (scopeID != UUID.Zero)
|
||||
command += " and ScopeID = ?scopeID";
|
||||
|
||||
MySqlCommand cmd = new MySqlCommand(command);
|
||||
|
||||
cmd.Parameters.AddWithValue("?scopeID", scopeID.ToString());
|
||||
|
||||
return RunCommand(cmd);
|
||||
}
|
||||
|
||||
public List<RegionData> GetFallbackRegions(UUID scopeID, int x, int y)
|
||||
{
|
||||
string command = "select * from `"+m_Realm+"` where (flags & 2) <> 0";
|
||||
if (scopeID != UUID.Zero)
|
||||
command += " and ScopeID = ?scopeID";
|
||||
|
||||
MySqlCommand cmd = new MySqlCommand(command);
|
||||
|
||||
cmd.Parameters.AddWithValue("?scopeID", scopeID.ToString());
|
||||
|
||||
// TODO: distance-sort results
|
||||
return RunCommand(cmd);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
6
OpenSim/Data/MySQL/Resources/005_GridStore.sql
Normal file
6
OpenSim/Data/MySQL/Resources/005_GridStore.sql
Normal file
@@ -0,0 +1,6 @@
|
||||
BEGIN;
|
||||
|
||||
ALTER TABLE `regions` ADD COLUMN `flags` integer NOT NULL DEFAULT 0;
|
||||
CREATE INDEX flags ON regions(flags);
|
||||
|
||||
COMMIT;
|
||||
@@ -130,5 +130,15 @@ namespace OpenSim.Data.Null
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public List<RegionData> GetDefaultRegions(UUID scopeID)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
public List<RegionData> GetFallbackRegions(UUID scopeID, int x, int y)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -136,7 +136,6 @@ namespace OpenSim.Data
|
||||
/// </summary>
|
||||
public uint maturity;
|
||||
|
||||
|
||||
//Data Wrappers
|
||||
public string RegionName
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user