mirror of
https://github.com/opensim/opensim.git
synced 2026-08-09 02:36:00 +08:00
Merge branch 'master' of ssh://justincc@opensimulator.org/var/git/opensim
This commit is contained in:
@@ -112,11 +112,8 @@ namespace OpenSim.Region.CoreModules.Agent.AssetTransaction
|
||||
bool storeLocal, bool tempFile)
|
||||
{
|
||||
ourClient = remoteClient;
|
||||
m_asset = new AssetBase();
|
||||
m_asset.FullID = assetID;
|
||||
m_asset.Type = type;
|
||||
m_asset = new AssetBase(assetID, "blank", type);
|
||||
m_asset.Data = data;
|
||||
m_asset.Name = "blank";
|
||||
m_asset.Description = "empty";
|
||||
m_asset.Local = storeLocal;
|
||||
m_asset.Temporary = tempFile;
|
||||
|
||||
@@ -238,12 +238,11 @@ namespace OpenSim.Region.CoreModules.Agent.TextureSender
|
||||
|
||||
if (m_cache != null)
|
||||
{
|
||||
AssetBase layerDecodeAsset = new AssetBase();
|
||||
layerDecodeAsset.ID = "j2kCache_" + AssetId.ToString();
|
||||
string assetID = "j2kCache_" + AssetId.ToString();
|
||||
|
||||
AssetBase layerDecodeAsset = new AssetBase(assetID, assetID, (sbyte)AssetType.Notecard);
|
||||
layerDecodeAsset.Local = true;
|
||||
layerDecodeAsset.Name = layerDecodeAsset.ID;
|
||||
layerDecodeAsset.Temporary = true;
|
||||
layerDecodeAsset.Type = (sbyte)AssetType.Notecard;
|
||||
|
||||
#region Serialize Layer Data
|
||||
|
||||
|
||||
@@ -386,11 +386,12 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
|
||||
{
|
||||
sbyte assetType = ArchiveConstants.EXTENSION_TO_ASSET_TYPE[extension];
|
||||
|
||||
if (assetType == (sbyte)AssetType.Unknown)
|
||||
m_log.WarnFormat("[INVENTORY ARCHIVER]: Importing {0} byte asset {1} with unknown type", data.Length, uuid);
|
||||
|
||||
//m_log.DebugFormat("[INVENTORY ARCHIVER]: Importing asset {0}, type {1}", uuid, assetType);
|
||||
|
||||
AssetBase asset = new AssetBase(new UUID(uuid), "RandomName");
|
||||
|
||||
asset.Type = assetType;
|
||||
AssetBase asset = new AssetBase(new UUID(uuid), "RandomName", assetType);
|
||||
asset.Data = data;
|
||||
|
||||
m_scene.AssetService.Store(asset);
|
||||
|
||||
@@ -122,8 +122,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
|
||||
}
|
||||
|
||||
UUID asset1Id = UUID.Parse("00000000-0000-0000-0000-000000000060");
|
||||
AssetBase asset1 = new AssetBase();
|
||||
asset1.FullID = asset1Id;
|
||||
AssetBase asset1 = new AssetBase(asset1Id, asset1Id.ToString(), (sbyte)AssetType.Object);
|
||||
asset1.Data = Encoding.ASCII.GetBytes(SceneObjectSerializer.ToXml2Format(object1));
|
||||
scene.AssetService.Store(asset1);
|
||||
|
||||
@@ -339,8 +338,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
|
||||
}
|
||||
|
||||
UUID asset1Id = UUID.Parse("00000000-0000-0000-0000-000000000060");
|
||||
AssetBase asset1 = new AssetBase();
|
||||
asset1.FullID = asset1Id;
|
||||
AssetBase asset1 = new AssetBase(asset1Id, String.Empty, (sbyte)AssetType.Object);
|
||||
asset1.Data = Encoding.ASCII.GetBytes(SceneObjectSerializer.ToXml2Format(object1));
|
||||
scene.AssetService.Store(asset1);
|
||||
|
||||
|
||||
@@ -311,11 +311,8 @@ namespace OpenSim.Region.CoreModules.Scripting.DynamicTexture
|
||||
}
|
||||
|
||||
// Create a new asset for user
|
||||
AssetBase asset = new AssetBase();
|
||||
asset.FullID = UUID.Random();
|
||||
AssetBase asset = new AssetBase(UUID.Random(), "DynamicImage" + Util.RandomClass.Next(1, 10000), (sbyte)AssetType.Texture);
|
||||
asset.Data = assetData;
|
||||
asset.Name = "DynamicImage" + Util.RandomClass.Next(1, 10000);
|
||||
asset.Type = 0;
|
||||
asset.Description = String.Format("URL image : {0}", Url);
|
||||
asset.Local = false;
|
||||
asset.Temporary = ((Disp & DISP_TEMP) != 0);
|
||||
|
||||
@@ -332,10 +332,12 @@ namespace OpenSim.Region.CoreModules.World.Archiver
|
||||
{
|
||||
sbyte assetType = ArchiveConstants.EXTENSION_TO_ASSET_TYPE[extension];
|
||||
|
||||
if (assetType == (sbyte)AssetType.Unknown)
|
||||
m_log.WarnFormat("[ARCHIVER]: Importing {0} byte asset {1} with unknown type", data.Length, uuid);
|
||||
|
||||
//m_log.DebugFormat("[ARCHIVER]: Importing asset {0}, type {1}", uuid, assetType);
|
||||
|
||||
AssetBase asset = new AssetBase(new UUID(uuid), String.Empty);
|
||||
asset.Type = assetType;
|
||||
AssetBase asset = new AssetBase(new UUID(uuid), String.Empty, assetType);
|
||||
asset.Data = data;
|
||||
|
||||
// We're relying on the asset service to do the sensible thing and not store the asset if it already
|
||||
|
||||
@@ -158,9 +158,8 @@ namespace OpenSim.Region.CoreModules.World.Archiver
|
||||
|
||||
m_log.DebugFormat("[ARCHIVER]: Importing asset {0}", filename);
|
||||
|
||||
AssetBase asset = new AssetBase(new UUID(filename), metadata.Name);
|
||||
AssetBase asset = new AssetBase(new UUID(filename), metadata.Name, metadata.AssetType);
|
||||
asset.Description = metadata.Description;
|
||||
asset.Type = metadata.AssetType;
|
||||
asset.Data = data;
|
||||
|
||||
m_cache.Store(asset);
|
||||
|
||||
@@ -52,16 +52,11 @@ namespace OpenSim.Region.CoreModules.World.Estate
|
||||
|
||||
public EstateTerrainXferHandler(IClientAPI pRemoteClient, string pClientFilename)
|
||||
{
|
||||
|
||||
m_asset = new AssetBase();
|
||||
m_asset.FullID = UUID.Zero;
|
||||
m_asset.Type = type;
|
||||
m_asset = new AssetBase(UUID.Zero, pClientFilename, type);
|
||||
m_asset.Data = new byte[0];
|
||||
m_asset.Name = pClientFilename;
|
||||
m_asset.Description = "empty";
|
||||
m_asset.Local = true;
|
||||
m_asset.Temporary = true;
|
||||
|
||||
}
|
||||
|
||||
public ulong XferID
|
||||
|
||||
@@ -1059,9 +1059,11 @@ namespace OpenSim.Region.CoreModules.World.Land
|
||||
if (m_scene.Permissions.IsGod(remote_client.AgentId))
|
||||
{
|
||||
land.LandData.OwnerID = ownerID;
|
||||
land.LandData.GroupID = UUID.Zero;
|
||||
land.LandData.IsGroupOwned = false;
|
||||
|
||||
m_scene.ForEachClient(SendParcelOverlay);
|
||||
land.SendLandUpdateToClient(remote_client);
|
||||
land.SendLandUpdateToClient(true, remote_client);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1082,8 +1084,10 @@ namespace OpenSim.Region.CoreModules.World.Land
|
||||
land.LandData.OwnerID = m_scene.RegionInfo.EstateSettings.EstateOwner;
|
||||
else
|
||||
land.LandData.OwnerID = m_scene.RegionInfo.MasterAvatarAssignedUUID;
|
||||
land.LandData.GroupID = UUID.Zero;
|
||||
land.LandData.IsGroupOwned = false;
|
||||
m_scene.ForEachClient(SendParcelOverlay);
|
||||
land.SendLandUpdateToClient(remote_client);
|
||||
land.SendLandUpdateToClient(true, remote_client);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1105,9 +1109,10 @@ namespace OpenSim.Region.CoreModules.World.Land
|
||||
else
|
||||
land.LandData.OwnerID = m_scene.RegionInfo.MasterAvatarAssignedUUID;
|
||||
land.LandData.ClaimDate = Util.UnixTimeSinceEpoch();
|
||||
land.LandData.GroupID = UUID.Zero;
|
||||
land.LandData.IsGroupOwned = false;
|
||||
m_scene.ForEachClient(SendParcelOverlay);
|
||||
land.SendLandUpdateToClient(remote_client);
|
||||
land.SendLandUpdateToClient(true, remote_client);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -49,6 +49,8 @@ namespace OpenSim.Region.CoreModules.World.Land
|
||||
#pragma warning restore 0429
|
||||
private bool[,] m_landBitmap = new bool[landArrayMax,landArrayMax];
|
||||
|
||||
private int m_lastSeqId = 0;
|
||||
|
||||
protected LandData m_landData = new LandData();
|
||||
protected Scene m_scene;
|
||||
protected List<SceneObjectGroup> primsOverMe = new List<SceneObjectGroup>();
|
||||
@@ -81,6 +83,10 @@ namespace OpenSim.Region.CoreModules.World.Land
|
||||
{
|
||||
m_scene = scene;
|
||||
LandData.OwnerID = owner_id;
|
||||
if (is_group_owned)
|
||||
LandData.GroupID = owner_id;
|
||||
else
|
||||
LandData.GroupID = UUID.Zero;
|
||||
LandData.IsGroupOwned = is_group_owned;
|
||||
}
|
||||
|
||||
@@ -172,7 +178,19 @@ namespace OpenSim.Region.CoreModules.World.Land
|
||||
// regionFlags |= (uint)RegionFlags.AllowLandmark;
|
||||
// if (landData.OwnerID == remote_client.AgentId)
|
||||
// regionFlags |= (uint)RegionFlags.AllowSetHome;
|
||||
remote_client.SendLandProperties(sequence_id,
|
||||
|
||||
int seq_id;
|
||||
if (snap_selection && (sequence_id == 0))
|
||||
{
|
||||
seq_id = m_lastSeqId;
|
||||
}
|
||||
else
|
||||
{
|
||||
seq_id = sequence_id;
|
||||
m_lastSeqId = seq_id;
|
||||
}
|
||||
|
||||
remote_client.SendLandProperties(seq_id,
|
||||
snap_selection, request_result, LandData,
|
||||
(float)m_scene.RegionInfo.RegionSettings.ObjectBonus,
|
||||
GetParcelMaxPrimCount(this),
|
||||
@@ -184,6 +202,7 @@ namespace OpenSim.Region.CoreModules.World.Land
|
||||
if (m_scene.Permissions.CanEditParcel(remote_client.AgentId,this))
|
||||
{
|
||||
//Needs later group support
|
||||
bool snap_selection = false;
|
||||
LandData newData = LandData.Copy();
|
||||
|
||||
if (args.AuthBuyerID != newData.AuthBuyerID || args.SalePrice != newData.SalePrice)
|
||||
@@ -192,6 +211,7 @@ namespace OpenSim.Region.CoreModules.World.Land
|
||||
{
|
||||
newData.AuthBuyerID = args.AuthBuyerID;
|
||||
newData.SalePrice = args.SalePrice;
|
||||
snap_selection = true;
|
||||
}
|
||||
}
|
||||
newData.Category = args.Category;
|
||||
@@ -212,7 +232,7 @@ namespace OpenSim.Region.CoreModules.World.Land
|
||||
|
||||
m_scene.LandChannel.UpdateLandObject(LandData.LocalID, newData);
|
||||
|
||||
SendLandUpdateToAvatarsOverMe();
|
||||
SendLandUpdateToAvatarsOverMe(snap_selection);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -230,7 +250,7 @@ namespace OpenSim.Region.CoreModules.World.Land
|
||||
newData.Flags &= ~(uint) (ParcelFlags.ForSale | ParcelFlags.ForSaleObjects | ParcelFlags.SellParcelObjects);
|
||||
m_scene.LandChannel.UpdateLandObject(LandData.LocalID, newData);
|
||||
|
||||
SendLandUpdateToAvatarsOverMe();
|
||||
SendLandUpdateToAvatarsOverMe(true);
|
||||
}
|
||||
|
||||
public void DeedToGroup(UUID groupID)
|
||||
@@ -242,7 +262,7 @@ namespace OpenSim.Region.CoreModules.World.Land
|
||||
|
||||
m_scene.LandChannel.UpdateLandObject(LandData.LocalID, newData);
|
||||
|
||||
SendLandUpdateToAvatarsOverMe();
|
||||
SendLandUpdateToAvatarsOverMe(true);
|
||||
}
|
||||
|
||||
public bool IsEitherBannedOrRestricted(UUID avatar)
|
||||
@@ -297,7 +317,17 @@ namespace OpenSim.Region.CoreModules.World.Land
|
||||
SendLandProperties(0, false, 0, remote_client);
|
||||
}
|
||||
|
||||
public void SendLandUpdateToClient(bool snap_selection, IClientAPI remote_client)
|
||||
{
|
||||
SendLandProperties(0, snap_selection, 0, remote_client);
|
||||
}
|
||||
|
||||
public void SendLandUpdateToAvatarsOverMe()
|
||||
{
|
||||
SendLandUpdateToAvatarsOverMe(false);
|
||||
}
|
||||
|
||||
public void SendLandUpdateToAvatarsOverMe(bool snap_selection)
|
||||
{
|
||||
List<ScenePresence> avatars = m_scene.GetAvatars();
|
||||
ILandObject over = null;
|
||||
@@ -325,7 +355,7 @@ namespace OpenSim.Region.CoreModules.World.Land
|
||||
else
|
||||
avatars[i].Invulnerable = true;
|
||||
|
||||
SendLandUpdateToClient(avatars[i].ControllingClient);
|
||||
SendLandUpdateToClient(snap_selection, avatars[i].ControllingClient);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1077,14 +1077,12 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
|
||||
|
||||
m_scene.RegionInfo.RegionSettings.TerrainImageID = TerrainImageUUID;
|
||||
|
||||
AssetBase asset = new AssetBase();
|
||||
asset.FullID = m_scene.RegionInfo.RegionSettings.TerrainImageID;
|
||||
AssetBase asset = new AssetBase(
|
||||
m_scene.RegionInfo.RegionSettings.TerrainImageID,
|
||||
"terrainImage_" + m_scene.RegionInfo.RegionID.ToString() + "_" + lastMapRefresh.ToString(),
|
||||
(sbyte)AssetType.Texture);
|
||||
asset.Data = data;
|
||||
asset.Name
|
||||
= "terrainImage_" + m_scene.RegionInfo.RegionID.ToString() + "_" + lastMapRefresh.ToString();
|
||||
asset.Description = m_scene.RegionInfo.RegionName;
|
||||
|
||||
asset.Type = 0;
|
||||
asset.Temporary = temporary;
|
||||
m_scene.AssetService.Store(asset);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user