Compare commits

...

6 Commits

Author SHA1 Message Date
Fernando Oliveira
c01db95f48 Merge remote-tracking branch 'remotes/upstream/master' into myideas
Started to implement GetEmptyCoordinates
2012-03-15 01:33:41 -03:00
Fernando Oliveira
8bdc238ca4 Automatic empty coordinates attribution at sim creation 2012-02-09 21:56:24 -02:00
Fernando Oliveira
46dec8666c New methods to get empty coordinates from the server 2012-01-23 16:11:42 -02:00
Fernando Oliveira
352774d5bf Merge remote-tracking branch 'remotes/upstream/master' 2012-01-22 16:04:22 -02:00
Fernando Oliveira
34c0bd212a Moved the EstateName and EstateOwner to OpenSim.ini at EstateDefaults entry
To be used only on first time Estate Creation

Signed-off-by: Fernando Oliveira <fernando@oliveira.eti.br>
2012-01-22 02:04:10 -02:00
Fernando Oliveira
3032b49ec4 Changed to Auto Create a Sim at first time using the Regions.ini files Master Avatar and Estate keys 2012-01-21 19:08:04 -02:00
32 changed files with 170 additions and 105 deletions

View File

@@ -74,6 +74,8 @@ namespace OpenSim.Data
RegionData Get(int x, int y, UUID ScopeID);
List<RegionData> Get(int xStart, int yStart, int xEnd, int yEnd, UUID ScopeID);
RegionData GetEmptyCoordinates(UUID ScopeID, int desiredX, int desiredY);
bool Store(RegionData data);
bool SetDataItem(UUID principalID, string item, string value);

View File

@@ -342,5 +342,21 @@ namespace OpenSim.Data.MSSQL
return RunCommand(cmd);
}
}
/// <summary>
/// GetEmptyCoordinates - return one coordinate at grid based on desired X,Y
/// </summary>
/// <param name="ScopeID"></param>
/// <param name="desiredX"></param>
/// <param name="desiredY"></param>
/// <returns></returns>
public RegionData GetEmptyCoordinates(UUID ScopeID, int desiredX, int desiredY)
{
RegionData region = new RegionData() { posX = desiredX, posY = desiredY };
// TODO: Search a empty spot and reserve it for a while;
return region;
}
}
}

View File

@@ -324,5 +324,21 @@ namespace OpenSim.Data.MySQL
return RunCommand(cmd);
}
/// <summary>
/// GetEmptyCoordinates - return one coordinate at grid based on desired X,Y
/// </summary>
/// <param name="ScopeID"></param>
/// <param name="desiredX"></param>
/// <param name="desiredY"></param>
/// <returns></returns>
public RegionData GetEmptyCoordinates(UUID ScopeID, int desiredX, int desiredY)
{
RegionData region = new RegionData() { posX = desiredX, posY = desiredY };
// TODO: Search a empty spot and reserve it for a while;
return region;
}
}
}

View File

@@ -245,5 +245,21 @@ namespace OpenSim.Data.Null
return ret;
}
/// <summary>
/// GetEmptyCoordinates - return one coordinate at grid based on desired X,Y
/// </summary>
/// <param name="ScopeID"></param>
/// <param name="desiredX"></param>
/// <param name="desiredY"></param>
/// <returns></returns>
public RegionData GetEmptyCoordinates(UUID ScopeID, int desiredX, int desiredY)
{
RegionData region = new RegionData() { posX = desiredX, posY = desiredY };
// TODO: Search a empty spot and reserve it for a while;
return region;
}
}
}

View File

@@ -35,7 +35,7 @@ using System.IO;
using System.IO.Compression;
using System.Net;
using System.Net.Sockets;
using System.Reflection;
using System.Reflection;
using System.Runtime.InteropServices;
using System.Runtime.Serialization;
using System.Runtime.Serialization.Formatters.Binary;
@@ -376,20 +376,20 @@ namespace OpenSim.Framework
}
return sb.ToString();
}
/// <summary>
/// Is the platform Windows?
/// </summary>
/// <returns>true if so, false otherwise</returns>
public static bool IsWindows()
{
PlatformID platformId = Environment.OSVersion.Platform;
return (platformId == PlatformID.Win32NT
|| platformId == PlatformID.Win32S
|| platformId == PlatformID.Win32Windows
|| platformId == PlatformID.WinCE);
}
/// <summary>
/// Is the platform Windows?
/// </summary>
/// <returns>true if so, false otherwise</returns>
public static bool IsWindows()
{
PlatformID platformId = Environment.OSVersion.Platform;
return (platformId == PlatformID.Win32NT
|| platformId == PlatformID.Win32S
|| platformId == PlatformID.Win32Windows
|| platformId == PlatformID.WinCE);
}
public static bool LoadArchSpecificWindowsDll(string libraryName)
@@ -1502,27 +1502,27 @@ namespace OpenSim.Framework
}
return data;
}
/// <summary>
/// Used to trigger an early library load on Windows systems.
/// </summary>
/// <remarks>
/// Required to get 32-bit and 64-bit processes to automatically use the
/// appropriate native library.
/// </remarks>
/// <param name="dllToLoad"></param>
/// <returns></returns>
[DllImport("kernel32.dll")]
public static extern IntPtr LoadLibrary(string dllToLoad);
/// <summary>
/// Determine whether the current process is 64 bit
/// </summary>
/// <returns>true if so, false if not</returns>
public static bool Is64BitProcess()
{
return IntPtr.Size == 8;
}
/// <summary>
/// Used to trigger an early library load on Windows systems.
/// </summary>
/// <remarks>
/// Required to get 32-bit and 64-bit processes to automatically use the
/// appropriate native library.
/// </remarks>
/// <param name="dllToLoad"></param>
/// <returns></returns>
[DllImport("kernel32.dll")]
public static extern IntPtr LoadLibrary(string dllToLoad);
/// <summary>
/// Determine whether the current process is 64 bit
/// </summary>
/// <returns>true if so, false if not</returns>
public static bool Is64BitProcess()
{
return IntPtr.Size == 8;
}
#region FireAndForget Threading Pattern

View File

@@ -166,6 +166,11 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid
return m_GridService.DeregisterRegion(regionID);
}
public GridRegion GetEmptyCoordinates(UUID scopeID, int desiredX, int desiredY)
{
return m_GridService.GetEmptyCoordinates(scopeID, desiredX, desiredY);
}
public List<GridRegion> GetNeighbours(UUID scopeID, UUID regionID)
{
return m_GridService.GetNeighbours(scopeID, regionID);
@@ -247,4 +252,4 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid
MainConsole.Instance.Output(caps.ToString());
}
}
}
}

View File

@@ -164,6 +164,11 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid
return false;
}
public GridRegion GetEmptyCoordinates(UUID scopeID, int desiredX, int desiredY)
{
return m_RemoteGridService.GetEmptyCoordinates(scopeID, desiredX, desiredY);
}
public List<GridRegion> GetNeighbours(UUID scopeID, UUID regionID)
{
return m_RemoteGridService.GetNeighbours(scopeID, regionID);

View File

@@ -30,7 +30,7 @@ using System.Collections.Generic;
using System.IO;
using System.Reflection;
using Nini.Config;
using log4net;
using log4net;
using OpenSim.Framework;
namespace OpenSim.Region.Physics.Manager

View File

@@ -85,6 +85,9 @@ namespace OpenSim.Server.Handlers.Grid
case "deregister":
return Deregister(request);
case "get_empty_coordinates":
return GetEmptyCoordinates(request);
case "get_neighbours":
return GetNeighbours(request);
@@ -194,6 +197,41 @@ namespace OpenSim.Server.Handlers.Grid
}
byte[] GetEmptyCoordinates(Dictionary<string, object> request)
{
UUID scopeID = UUID.Zero;
if (request.ContainsKey("SCOPEID"))
UUID.TryParse(request["SCOPEID"].ToString(), out scopeID);
else
m_log.WarnFormat("[GRID HANDLER]: no scopeID in request to get empty coordinates");
Dictionary<string, object> result = new Dictionary<string, object>();
int desiredX = 7000; // put this at OpenSim.ini file
int desiredY = 7000; // this also
if (request.ContainsKey("X"))
int.TryParse( request["X"].ToString(), out desiredX);
if (request.ContainsKey("Y"))
int.TryParse(request["Y"].ToString(), out desiredY);
// TODO: Create the Method to get Empty Coordinates
GridRegion rinfo = m_GridService.GetEmptyCoordinates(scopeID, desiredX, desiredY);
if (rinfo == null)
result["coordinates"] = desiredX + "," + desiredY;
else
{
result["coordinates"] = rinfo.RegionCoordX.ToString() + "," + rinfo.RegionCoordY.ToString();
}
string xmlString = ServerUtils.BuildXmlResponse(result);
//m_log.DebugFormat("[GRID HANDLER]: resp string: {0}", xmlString);
UTF8Encoding encoding = new UTF8Encoding();
return encoding.GetBytes(xmlString);
}
byte[] GetNeighbours(Dictionary<string, object> request)
{
UUID scopeID = UUID.Zero;

View File

@@ -171,6 +171,15 @@ namespace OpenSim.Services.Connectors
return false;
}
public GridRegion GetEmptyCoordinates(UUID scopeID, int desiredX, int desiredY)
{
GridRegion rinfo = new GridRegion();
// TODO : Search empty spots on Grid to register a new SIM
return rinfo;
}
public List<GridRegion> GetNeighbours(UUID scopeID, UUID regionID)
{
Dictionary<string, object> sendData = new Dictionary<string, object>();

View File

@@ -154,6 +154,15 @@ namespace OpenSim.Services.Connectors.SimianGrid
return success;
}
public GridRegion GetEmptyCoordinates(UUID scopeID, int desiredX, int desiredY)
{
GridRegion rinfo = new GridRegion();
// TODO : Search empty spots on Grid to register a new SIM
return rinfo;
}
public List<GridRegion> GetNeighbours(UUID scopeID, UUID regionID)
{
const int NEIGHBOR_RADIUS = 128;

View File

@@ -275,6 +275,15 @@ namespace OpenSim.Services.GridService
return m_Database.Delete(regionID);
}
public GridRegion GetEmptyCoordinates(UUID scopeID, int desiredX, int desiredY)
{
GridRegion rinfo = new GridRegion();
// TODO : Search empty spots on Grid to register a new SIM
return rinfo;
}
public List<GridRegion> GetNeighbours(UUID scopeID, UUID regionID)
{
List<GridRegion> rinfos = new List<GridRegion>();

View File

@@ -52,6 +52,12 @@ namespace OpenSim.Services.Interfaces
/// <exception cref="System.Exception">Thrown if region deregistration failed</exception>
bool DeregisterRegion(UUID regionID);
/// <summary>
/// Get information about the empty spot to register a new Simulator.
/// </summary>
/// <returns></returns>
GridRegion GetEmptyCoordinates(UUID scopeID, int desiredX, int desiredY);
/// <summary>
/// Get information about the regions neighbouring the given co-ordinates (in meters).
/// </summary>
@@ -60,6 +66,7 @@ namespace OpenSim.Services.Interfaces
/// <returns></returns>
List<GridRegion> GetNeighbours(UUID scopeID, UUID regionID);
GridRegion GetRegionByUUID(UUID scopeID, UUID regionID);
/// <summary>

View File

@@ -1,33 +0,0 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
<section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler,log4net" />
</configSections>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="nunit.framework" publicKeyToken="96d09a1eb7f44a77" culture="Neutral" />
<bindingRedirect oldVersion="2.0.6.0" newVersion="2.4.6.0" />
<bindingRedirect oldVersion="2.1.4.0" newVersion="2.4.6.0" />
<bindingRedirect oldVersion="2.2.8.0" newVersion="2.4.6.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
<log4net>
<!-- A1 is set to be a ConsoleAppender -->
<appender name="A1" type="log4net.Appender.ConsoleAppender">
<!-- A1 uses PatternLayout -->
<layout type="log4net.Layout.PatternLayout">
<!-- Print the date in ISO 8601 format -->
<conversionPattern value="%date [%thread] %-5level %logger %ndc - %message%newline" />
</layout>
</appender>
<!-- Set root logger level to DEBUG and its only appender to A1 -->
<root>
<level value="DEBUG" />
<appender-ref ref="A1" />
</root>
</log4net>
</configuration>

View File

@@ -1,33 +0,0 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
<section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler,log4net" />
</configSections>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="nunit.framework" publicKeyToken="96d09a1eb7f44a77" culture="Neutral" />
<bindingRedirect oldVersion="2.0.6.0" newVersion="2.4.6.0" />
<bindingRedirect oldVersion="2.1.4.0" newVersion="2.4.6.0" />
<bindingRedirect oldVersion="2.2.8.0" newVersion="2.4.6.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
<log4net>
<!-- A1 is set to be a ConsoleAppender -->
<appender name="A1" type="log4net.Appender.ConsoleAppender">
<!-- A1 uses PatternLayout -->
<layout type="log4net.Layout.PatternLayout">
<!-- Print the date in ISO 8601 format -->
<conversionPattern value="%date [%thread] %-5level %logger %ndc - %message%newline" />
</layout>
</appender>
<!-- Set root logger level to DEBUG and its only appender to A1 -->
<root>
<level value="DEBUG" />
<appender-ref ref="A1" />
</root>
</log4net>
</configuration>

Binary file not shown.

Binary file not shown.

View File

@@ -1 +0,0 @@
libsqlite version: 3.7.5

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.