Compare commits

...

26 Commits

Author SHA1 Message Date
Fernando Oliveira
b6e963c830 Merge branch 'master' of https://github.com/ffoliveira/opensimulator 2012-03-09 20:11:24 -03:00
Fernando Oliveira
8ea08cf4b4 merge changes from opensim 2012-03-09 20:11:02 -03:00
Fernando Oliveira
d92fc1dfb3 merge changes from opensim 2012-03-09 20:09:13 -03:00
Fernando Oliveira
83c018ebcd Merge remote-tracking branch 'upstream/master'
Conflicts:
	OpenSim/Region/Framework/Scenes/Scene.cs
2012-03-06 23:32:20 -03:00
Fernando Oliveira
cf763b8306 Merge remote-tracking branch 'upstream/master' 2012-02-29 23:09:00 -03:00
Fernando Oliveira
5cda6ab754 Merge remote-tracking branch 'upstream/master' 2012-02-25 00:48:11 -02:00
Fernando Oliveira
6f6e05d775 Optimizations on osSetDynamicTextureURL function to reduce memory leak 2012-02-24 01:29:18 -02:00
Fernando Oliveira
c07fdc6ac4 Merge remote-tracking branch 'upstream/master' 2012-02-23 13:21:14 -02:00
Fernando Oliveira
2e6f5f6bcd Changed the Estate first letter keys to uppercase 2012-02-23 13:16:47 -02:00
Fernando Oliveira
705b3fe414 Merge remote-tracking branch 'upstream/master' 2012-02-20 22:53:27 -02:00
Fernando Oliveira
55aaea8b91 Just added Maptile default to UUID.Zero 2012-02-20 22:53:22 -02:00
Fernando Oliveira
f4e32350ed Changed back to generate maptiles when there are no MaptileStaticUUID at regions.ini 2012-02-15 15:55:02 -02:00
Fernando Oliveira
58f5e4b47a Merge branch 'master' of https://github.com/ffoliveira/opensimulator 2012-02-15 02:04:58 -02:00
Fernando Oliveira
ddacc87617 Implemented different MapTile for each region in Regions.ini using MaptileStaticUUID key
OpenSim.ini MaptileStaticUUID still work for default regions

Signed-off-by: Fernando Oliveira <fernando@oliveira.eti.br>
2012-02-15 02:03:32 -02:00
Fernando Oliveira
c5d1d6c47b Implemented different MapTile for each region in Regions.ini using MaptileStaticUUID key
OpenSim.ini MaptileStaticUUID still work for default regions

Signed-off-by: Fernando Oliveira <fernando@oliveira.eti.br>
2012-02-15 01:35:49 -02:00
Fernando Oliveira
23ebe65add Merge remote-tracking branch 'upstream/master' 2012-02-15 00:28:22 -02:00
Fernando Oliveira
c611966828 try to configure maptile for each region 2012-02-15 00:27:10 -02:00
Fernando Oliveira
b9fa9a801e Added Log to Maptile from Regions.ini 2012-02-10 01:55:08 -02:00
Fernando Oliveira
ec38593674 Put MaptileStaticUUID also in Regions.Ini file - as an alternative to MapTile by region 2012-02-10 00:17:34 -02:00
Fernando Oliveira
f018047460 Merge branch 'master' of https://github.com/ffoliveira/opensimulator 2012-02-09 22:34:38 -02:00
Fernando Oliveira
60a0395837 sync and merge source code from nebadom repo 2012-02-09 22:05:59 -02:00
Fernando Oliveira
d27ed42897 Merge remote-tracking branch 'upstream/master' 2012-02-09 22:00:26 -02:00
root
6903b60a0f Merge remote-tracking branch 'upstream/master' 2012-02-02 13:19:56 -05: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
5 changed files with 179 additions and 77 deletions

3
.gitignore vendored
View File

@@ -87,3 +87,6 @@ OpenSim/Region/ScriptEngine/test-results/
OpenSim/Tests/Common/test-results/
OpenSim/Tests/test-results/
test-results/
/binteste
/ferland

View File

@@ -67,6 +67,9 @@ namespace OpenSim
private const string PLUGIN_ASSET_CACHE = "/OpenSim/AssetCache";
private const string PLUGIN_ASSET_SERVER_CLIENT = "/OpenSim/AssetClient";
// OpenSim.ini Section name for ESTATES Settings
public const string ESTATE_SECTION_NAME = "Estates";
protected string proxyUrl;
protected int proxyOffset = 0;
@@ -443,10 +446,39 @@ namespace OpenSim
{
RegionInfo regionInfo = scene.RegionInfo;
string estateFirstName = "", estateLastName = "", estateOwnerEMail = "", estateOwnerPassword = "", estateOwnerUUID = "";
if (m_config.Source.Configs[ESTATE_SECTION_NAME] != null)
{
string defaultEstateOwnerName = m_config.Source.Configs[ESTATE_SECTION_NAME].GetString("DefaultEstateOwnerName", "").Trim();
string[] ownerNames = defaultEstateOwnerName.Split(' ');
if (ownerNames.Length == 2)
{
estateFirstName = ownerNames[0];
estateLastName = ownerNames[1];
}
// Info to be used only on Standalone Mode
estateOwnerUUID = m_config.Source.Configs[ESTATE_SECTION_NAME].GetString("DefaultEstateOwnerUUID", "");
estateOwnerEMail = m_config.Source.Configs[ESTATE_SECTION_NAME].GetString("DefaultEstateOwnerEMail", "");
estateOwnerPassword = m_config.Source.Configs[ESTATE_SECTION_NAME].GetString("DefaultEstateOwnerPassword", "");
}
MainConsole.Instance.OutputFormat("Estate {0} has no owner set.", regionInfo.EstateSettings.EstateName);
List<char> excluded = new List<char>(new char[1]{' '});
string first = MainConsole.Instance.CmdPrompt("Estate owner first name", "Test", excluded);
string last = MainConsole.Instance.CmdPrompt("Estate owner last name", "User", excluded);
string first, last;
if ((estateFirstName != "") && (estateLastName != ""))
{
first = estateFirstName;
last = estateLastName;
}
else
{
first = MainConsole.Instance.CmdPrompt("Estate owner first name", "Test", excluded);
last = MainConsole.Instance.CmdPrompt("Estate owner last name", "User", excluded);
}
UserAccount account = scene.UserAccountService.GetUserAccount(regionInfo.ScopeID, first, last);
@@ -467,10 +499,22 @@ namespace OpenSim
if (scene.UserAccountService is UserAccountService)
{
string password = MainConsole.Instance.PasswdPrompt("Password");
string email = MainConsole.Instance.CmdPrompt("Email", "");
string password = "", email = "", rawPrincipalId = "";
string rawPrincipalId = MainConsole.Instance.CmdPrompt("User ID", UUID.Random().ToString());
if (estateOwnerPassword != "")
password = estateOwnerPassword;
else
MainConsole.Instance.PasswdPrompt("Password");
if (estateOwnerEMail != "")
email = estateOwnerEMail;
else
email = MainConsole.Instance.CmdPrompt("Email", "");
if (estateOwnerUUID != "")
rawPrincipalId = estateOwnerUUID;
else
rawPrincipalId = MainConsole.Instance.CmdPrompt("User ID", UUID.Random().ToString());
UUID principalId = UUID.Zero;
if (!UUID.TryParse(rawPrincipalId, out principalId))
@@ -885,11 +929,20 @@ namespace OpenSim
/// <param name="regInfo"></param>
/// <param name="existingName">A list of estate names that already exist.</param>
/// <returns>true if the estate was created, false otherwise</returns>
public bool CreateEstate(RegionInfo regInfo, List<string> existingNames)
public bool CreateEstate(RegionInfo regInfo, List<string> existingNames, string estateName)
{
// Create a new estate
regInfo.EstateSettings = EstateDataService.LoadEstateSettings(regInfo.RegionID, true);
string newName = MainConsole.Instance.CmdPrompt("New estate name", regInfo.EstateSettings.EstateName);
string newName;
if (estateName != null && estateName != "")
{
newName = estateName;
}
else
{
newName = MainConsole.Instance.CmdPrompt("New estate name", regInfo.EstateSettings.EstateName);
}
if (existingNames.Contains(newName))
{
@@ -925,18 +978,30 @@ namespace OpenSim
List<EstateSettings> estates = EstateDataService.LoadEstateSettingsAll();
List<string> estateNames = new List<string>();
foreach (EstateSettings estate in estates)
estateNames.Add(estate.EstateName);
estateNames.Add(estate.EstateName);
string estateName = "";
string estateOwner = "";
if (m_config.Source.Configs[ESTATE_SECTION_NAME] != null)
{
estateName = m_config.Source.Configs[ESTATE_SECTION_NAME].GetString("DefaultEstateName", "");
estateOwner = m_config.Source.Configs[ESTATE_SECTION_NAME].GetString("DefaultEstateOwnerName", "");
}
while (true)
{
if (estates.Count == 0)
{
m_log.Info("[ESTATE] No existing estates found. You must create a new one.");
if (CreateEstate(regInfo, estateNames))
break;
if (CreateEstate(regInfo, estateNames, estateName))
break;
else
{
estateName = "";
continue;
}
}
else
{
@@ -949,10 +1014,13 @@ namespace OpenSim
if (response == "no")
{
if (CreateEstate(regInfo, estateNames))
if (CreateEstate(regInfo, estateNames, estateName))
break;
else
{
estateName = "";
continue;
}
}
else
{

View File

@@ -87,21 +87,26 @@ namespace OpenSim.Region.CoreModules.Scripting.DynamicTexture
{
if (RegisteredScenes.ContainsKey(updater.SimUUID))
{
Scene scene = RegisteredScenes[updater.SimUUID];
updater.DataReceived(data, scene);
updater.DataReceived(data, RegisteredScenes[updater.SimUUID]);
}
}
if (updater.UpdateTimer == 0)
{
lock (Updaters)
if (updater.UpdateTimer == 0)
{
if (!Updaters.ContainsKey(updater.UpdaterID))
lock (Updaters)
{
Updaters.Remove(updater.UpdaterID);
if (!Updaters.ContainsKey(updater.UpdaterID))
{
UUID idRemove = updater.UpdaterID;
Updaters[idRemove] = null;
updater = null;
Updaters.Remove(idRemove);
}
}
}
}
}
public UUID AddDynamicTextureURL(UUID simID, UUID primID, string contentType, string url,
@@ -124,18 +129,17 @@ namespace OpenSim.Region.CoreModules.Scripting.DynamicTexture
{
if (RenderPlugins.ContainsKey(contentType))
{
DynamicTextureUpdater updater = new DynamicTextureUpdater();
updater.SimUUID = simID;
updater.PrimID = primID;
updater.ContentType = contentType;
updater.Url = url;
updater.UpdateTimer = updateTimer;
updater.UpdaterID = UUID.Random();
updater.Params = extraParams;
updater.BlendWithOldTexture = SetBlending;
updater.FrontAlpha = AlphaValue;
updater.Face = face;
updater.Disp = disp;
DynamicTextureUpdater updater = new DynamicTextureUpdater() { SimUUID = simID,
PrimID = primID,
ContentType = contentType,
Url = url,
UpdateTimer = updateTimer,
UpdaterID = UUID.Random(),
Params = extraParams,
BlendWithOldTexture = SetBlending,
FrontAlpha = AlphaValue,
Face = face,
Disp = disp };
lock (Updaters)
{
@@ -169,19 +173,18 @@ namespace OpenSim.Region.CoreModules.Scripting.DynamicTexture
{
if (RenderPlugins.ContainsKey(contentType))
{
DynamicTextureUpdater updater = new DynamicTextureUpdater();
updater.SimUUID = simID;
updater.PrimID = primID;
updater.ContentType = contentType;
updater.BodyData = data;
updater.UpdateTimer = updateTimer;
updater.UpdaterID = UUID.Random();
updater.Params = extraParams;
updater.BlendWithOldTexture = SetBlending;
updater.FrontAlpha = AlphaValue;
updater.Face = face;
updater.Url = "Local image";
updater.Disp = disp;
DynamicTextureUpdater updater = new DynamicTextureUpdater() { SimUUID = simID,
PrimID = primID,
ContentType = contentType,
BodyData = data,
UpdateTimer = updateTimer,
UpdaterID = UUID.Random(),
Params = extraParams,
BlendWithOldTexture = SetBlending,
FrontAlpha = AlphaValue,
Face = face,
Url = "Local image",
Disp = disp };
lock (Updaters)
{
@@ -306,14 +309,10 @@ namespace OpenSim.Region.CoreModules.Scripting.DynamicTexture
}
// Create a new asset for user
AssetBase asset
= new AssetBase(
UUID.Random(), "DynamicImage" + Util.RandomClass.Next(1, 10000), (sbyte)AssetType.Texture,
scene.RegionInfo.RegionID.ToString());
asset.Data = assetData;
asset.Description = String.Format("URL image : {0}", Url);
asset.Local = false;
asset.Temporary = ((Disp & DISP_TEMP) != 0);
AssetBase asset = new AssetBase(UUID.Random(), "DynamicImage" + Util.RandomClass.Next(1, 10000), (sbyte)AssetType.Texture, scene.RegionInfo.RegionID.ToString()) { Data = assetData,
Description = String.Format("URL image : {0}", Url),
Local = false,
Temporary = ((Disp & DISP_TEMP) != 0) };
scene.AssetService.Store(asset);
IJ2KDecoder cacheLayerDecode = scene.RequestModuleInterface<IJ2KDecoder>();
@@ -387,22 +386,19 @@ namespace OpenSim.Region.CoreModules.Scripting.DynamicTexture
if (setNewAlpha)
SetAlpha(ref image1, newAlpha);
Bitmap joint = MergeBitMaps(image1, image2);
byte[] result = new byte[0];
try
using (Bitmap joint = MergeBitMaps(image1, image2))
{
result = OpenJPEG.EncodeFromImage(joint, true);
byte[] result = new byte[0];
try
{
result = OpenJPEG.EncodeFromImage(joint, true);
}
catch (Exception e)
{
m_log.ErrorFormat("[DYNAMICTEXTUREMODULE]: OpenJpeg Encode Failed. Exception {0}{1}", e.Message, e.StackTrace);
}
return result;
}
catch (Exception e)
{
m_log.ErrorFormat(
"[DYNAMICTEXTUREMODULE]: OpenJpeg Encode Failed. Exception {0}{1}",
e.Message, e.StackTrace);
}
return result;
}
}
@@ -411,14 +407,12 @@ namespace OpenSim.Region.CoreModules.Scripting.DynamicTexture
public Bitmap MergeBitMaps(Bitmap front, Bitmap back)
{
Bitmap joint;
Graphics jG;
joint = new Bitmap(back.Width, back.Height, PixelFormat.Format32bppArgb);
jG = Graphics.FromImage(joint);
jG.DrawImage(back, 0, 0, back.Width, back.Height);
jG.DrawImage(front, 0, 0, back.Width, back.Height);
Bitmap joint = new Bitmap(back.Width, back.Height, PixelFormat.Format32bppArgb);
using (Graphics jG = Graphics.FromImage(joint))
{
jG.DrawImage(back, 0, 0, back.Width, back.Height);
jG.DrawImage(front, 0, 0, back.Width, back.Height);
}
return joint;
}

View File

@@ -704,10 +704,41 @@ namespace OpenSim.Region.Framework.Scenes
string tile = startupConfig.GetString("MaptileStaticUUID", UUID.Zero.ToString());
UUID tileID;
m_log.Info(String.Format("[SCENE]: MaptileStaticUUID for {0} config -> {1}", RegionInfo.RegionName, RegionInfo.RegionFile));
IniConfigSource sourceRegion = new IniConfigSource(RegionInfo.RegionFile);
if (sourceRegion.Configs[RegionInfo.RegionName] != null)
{
if (sourceRegion.Configs[RegionInfo.RegionName].Contains("MaptileStaticUUID"))
{
tile = sourceRegion.Configs[RegionInfo.RegionName].GetString("MaptileStaticUUID", UUID.Zero.ToString());
m_log.Info("[SCENE]: MaptileStaticUUID " + tile);
}
}
if (UUID.TryParse(tile, out tileID))
{
RegionInfo.RegionSettings.TerrainImageID = tileID;
}
else
{
tileID = UUID.Zero;
}
if (tileID == UUID.Zero)
{
m_generateMaptiles = true;
int maptileRefresh = startupConfig.GetInt("MaptileRefresh", 0);
if (maptileRefresh != 0)
{
m_mapGenerationTimer.Interval = maptileRefresh * 1000;
m_mapGenerationTimer.Elapsed += RegenerateMaptileAndReregister;
m_mapGenerationTimer.AutoReset = true;
m_mapGenerationTimer.Start();
}
}
}
MinFrameTime = startupConfig.GetFloat( "MinFrameTime", MinFrameTime);

6
syncneb.bat Normal file
View File

@@ -0,0 +1,6 @@
rem git remote add upstream git://github.com/nebadon2025/opensimulator.git
git fetch upstream
git merge upstream/master