* Patch from JHurliman

* Updates to libomv r2243, 
* Remove lots of unnecessary typecasts
* Improves SendWindData()
Thanks jhurliman. 
* Will update OpenSim-libs in 10 minutes..
This commit is contained in:
Teravus Ovares
2008-09-26 17:25:22 +00:00
parent 34cfd710ce
commit 16b6738cda
42 changed files with 233 additions and 292 deletions

View File

@@ -109,7 +109,7 @@ namespace OpenSim.Region.Environment.Modules.Agent.AssetDownload
/// <param name="transferRequest"></param>
public void AddAssetRequest(IClientAPI userInfo, TransferRequestPacket transferRequest)
{
UUID requestID = null;
UUID requestID = UUID.Zero;
byte source = 2;
if (transferRequest.TransferInfo.SourceType == 2)
{

View File

@@ -33,6 +33,7 @@ using Nini.Config;
using OpenSim.Framework;
using OpenSim.Region.Environment.Interfaces;
using OpenSim.Region.Environment.Scenes;
using BlockingQueue = OpenSim.Framework.BlockingQueue<OpenSim.Region.Environment.Interfaces.ITextureSender>;
namespace OpenSim.Region.Environment.Modules.Agent.TextureDownload
{
@@ -44,8 +45,8 @@ namespace OpenSim.Region.Environment.Modules.Agent.TextureDownload
/// <summary>
/// There is one queue for all textures waiting to be sent, regardless of the requesting user.
/// </summary>
private readonly BlockingQueue<ITextureSender> m_queueSenders
= new BlockingQueue<ITextureSender>();
private readonly OpenSim.Framework.BlockingQueue<ITextureSender> m_queueSenders
= new OpenSim.Framework.BlockingQueue<ITextureSender>();
/// <summary>
/// Each user has their own texture download service.

View File

@@ -35,6 +35,7 @@ using OpenSim.Framework.Statistics;
using OpenSim.Region.Environment.Interfaces;
using OpenSim.Region.Environment.Scenes;
namespace OpenSim.Region.Environment.Modules.Agent.TextureDownload
{
/// <summary>
@@ -75,7 +76,7 @@ namespace OpenSim.Region.Environment.Modules.Agent.TextureDownload
/// Texture Senders are placed in this queue once they have received their texture from the asset
/// cache. Another module actually invokes the send.
/// </summary>
private readonly BlockingQueue<ITextureSender> m_sharedSendersQueue;
private readonly OpenSim.Framework.BlockingQueue<ITextureSender> m_sharedSendersQueue;
/// <summary>
/// Holds texture senders before they have received the appropriate texture from the asset cache.
@@ -91,7 +92,7 @@ namespace OpenSim.Region.Environment.Modules.Agent.TextureDownload
= new RepeatLimitStrategy<UUID>(MAX_ALLOWED_TEXTURE_REQUESTS);
public UserTextureDownloadService(
IClientAPI client, Scene scene, BlockingQueue<ITextureSender> sharedQueue)
IClientAPI client, Scene scene, OpenSim.Framework.BlockingQueue<ITextureSender> sharedQueue)
{
m_client = client;
m_scene = scene;

View File

@@ -298,7 +298,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney
int funds = 0;
Hashtable hbinfo =
GetBalanceForUserFromMoneyServer(client.AgentId, client.SecureSessionId, s.RegionInfo.originRegionID.ToString(),
GetBalanceForUserFromMoneyServer(client.AgentId, client.SecureSessionId, s.RegionInfo.originRegionID,
s.RegionInfo.regionSecret);
if ((bool) hbinfo["success"] == true)
{
@@ -722,7 +722,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney
if (m_MoneyAddress.Length > 0)
{
Hashtable hbinfo =
GetBalanceForUserFromMoneyServer(aClient.AgentId, aClient.SecureSessionId, s.RegionInfo.originRegionID.ToString(),
GetBalanceForUserFromMoneyServer(aClient.AgentId, aClient.SecureSessionId, s.RegionInfo.originRegionID,
s.RegionInfo.regionSecret);
if ((bool) hbinfo["success"] == true)
{

View File

@@ -67,7 +67,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Groups
OpenSimulatorGroup.ActiveGroupTitle = "OpenSimulator Tester";
OpenSimulatorGroup.GroupID = opensimulatorGroupID;
OpenSimulatorGroup.groupName = "OpenSimulator Testing";
OpenSimulatorGroup.ActiveGroupPowers = GroupPowers.LandAllowSetHome;
OpenSimulatorGroup.ActiveGroupPowers = GroupPowers.AllowSetHome;
OpenSimulatorGroup.GroupTitles.Add("OpenSimulator Tester");
if (!m_groupUUIDGroup.ContainsKey(opensimulatorGroupID))
m_groupUUIDGroup.Add(opensimulatorGroupID, OpenSimulatorGroup);

View File

@@ -787,7 +787,7 @@ namespace OpenSim.Region.Environment.Modules.InterGrid
UUID userUUID = UUID.Zero;
if (UUID.TryParse(uuidString, out userUUID))
{
UUID RemoteID = uuidString;
UUID RemoteID = (UUID)uuidString;
UUID LocalID = RemoteID;
// FIXME: TODO: Routine to map RemoteUUIDs to LocalUUIds
// would be done already.. but the client connects with the Aditi UUID

View File

@@ -732,40 +732,40 @@ namespace OpenSim.Region.Environment.Modules.World.Estate
public uint GetRegionFlags()
{
Simulator.RegionFlags flags = Simulator.RegionFlags.None;
RegionFlags flags = RegionFlags.None;
// Fully implemented
//
if (m_scene.RegionInfo.RegionSettings.AllowDamage)
flags |= Simulator.RegionFlags.AllowDamage;
flags |= RegionFlags.AllowDamage;
if (m_scene.RegionInfo.RegionSettings.BlockTerraform)
flags |= Simulator.RegionFlags.BlockTerraform;
flags |= RegionFlags.BlockTerraform;
if (!m_scene.RegionInfo.RegionSettings.AllowLandResell)
flags |= Simulator.RegionFlags.BlockLandResell;
flags |= RegionFlags.BlockLandResell;
if (m_scene.RegionInfo.RegionSettings.DisableCollisions)
flags |= Simulator.RegionFlags.SkipCollisions;
flags |= RegionFlags.SkipCollisions;
if (m_scene.RegionInfo.RegionSettings.DisableScripts)
flags |= Simulator.RegionFlags.SkipScripts;
flags |= RegionFlags.SkipScripts;
if (m_scene.RegionInfo.RegionSettings.DisablePhysics)
flags |= Simulator.RegionFlags.SkipPhysics;
flags |= RegionFlags.SkipPhysics;
if (m_scene.RegionInfo.RegionSettings.BlockFly)
flags |= Simulator.RegionFlags.NoFly;
flags |= RegionFlags.NoFly;
if (m_scene.RegionInfo.RegionSettings.RestrictPushing)
flags |= Simulator.RegionFlags.RestrictPushObject;
flags |= RegionFlags.RestrictPushObject;
if (m_scene.RegionInfo.RegionSettings.AllowLandJoinDivide)
flags |= Simulator.RegionFlags.AllowParcelChanges;
flags |= RegionFlags.AllowParcelChanges;
if (m_scene.RegionInfo.RegionSettings.BlockShowInSearch)
flags |= (Simulator.RegionFlags)(1 << 29);
flags |= (RegionFlags)(1 << 29);
if (m_scene.RegionInfo.RegionSettings.FixedSun)
flags |= Simulator.RegionFlags.SunFixed;
flags |= RegionFlags.SunFixed;
if (m_scene.RegionInfo.RegionSettings.Sandbox)
flags |= Simulator.RegionFlags.Sandbox;
flags |= RegionFlags.Sandbox;
// Fudge these to always on, so the menu options activate
//
flags |= Simulator.RegionFlags.AllowLandmark;
flags |= Simulator.RegionFlags.AllowSetHome;
flags |= RegionFlags.AllowLandmark;
flags |= RegionFlags.AllowSetHome;
// TODO: SkipUpdateInterestList
@@ -779,35 +779,35 @@ namespace OpenSim.Region.Environment.Modules.World.Estate
public uint GetEstateFlags()
{
Simulator.RegionFlags flags = Simulator.RegionFlags.None;
RegionFlags flags = RegionFlags.None;
if (m_scene.RegionInfo.EstateSettings.FixedSun)
flags |= Simulator.RegionFlags.SunFixed;
flags |= RegionFlags.SunFixed;
if (m_scene.RegionInfo.EstateSettings.PublicAccess)
flags |= (Simulator.RegionFlags.PublicAllowed |
Simulator.RegionFlags.ExternallyVisible);
flags |= (RegionFlags.PublicAllowed |
RegionFlags.ExternallyVisible);
if (m_scene.RegionInfo.EstateSettings.AllowVoice)
flags |= Simulator.RegionFlags.AllowVoice;
flags |= RegionFlags.AllowVoice;
if (m_scene.RegionInfo.EstateSettings.AllowDirectTeleport)
flags |= Simulator.RegionFlags.AllowDirectTeleport;
flags |= RegionFlags.AllowDirectTeleport;
if (m_scene.RegionInfo.EstateSettings.DenyAnonymous)
flags |= Simulator.RegionFlags.DenyAnonymous;
flags |= RegionFlags.DenyAnonymous;
if (m_scene.RegionInfo.EstateSettings.DenyIdentified)
flags |= Simulator.RegionFlags.DenyIdentified;
flags |= RegionFlags.DenyIdentified;
if (m_scene.RegionInfo.EstateSettings.DenyTransacted)
flags |= Simulator.RegionFlags.DenyTransacted;
flags |= RegionFlags.DenyTransacted;
if (m_scene.RegionInfo.EstateSettings.AbuseEmailToEstateOwner)
flags |= Simulator.RegionFlags.AbuseEmailToEstateOwner;
flags |= RegionFlags.AbuseEmailToEstateOwner;
if (m_scene.RegionInfo.EstateSettings.BlockDwell)
flags |= Simulator.RegionFlags.BlockDwell;
flags |= RegionFlags.BlockDwell;
if (m_scene.RegionInfo.EstateSettings.EstateSkipScripts)
flags |= Simulator.RegionFlags.EstateSkipScripts;
flags |= RegionFlags.EstateSkipScripts;
if (m_scene.RegionInfo.EstateSettings.ResetHomeOnTeleport)
flags |= Simulator.RegionFlags.ResetHomeOnTeleport;
flags |= RegionFlags.ResetHomeOnTeleport;
if (m_scene.RegionInfo.EstateSettings.TaxFree)
flags |= Simulator.RegionFlags.TaxFree;
flags |= RegionFlags.TaxFree;
if (m_scene.RegionInfo.EstateSettings.DenyMinors)
flags |= (Simulator.RegionFlags)(1 << 30);
flags |= (RegionFlags)(1 << 30);
return (uint)flags;
}

View File

@@ -263,12 +263,12 @@ namespace OpenSim.Region.Environment.Modules.World.Land
{
if (checkBan.isBannedFromLand(avatar.AgentId))
{
checkBan.sendLandProperties(-30000, false, (int)ParcelManager.ParcelResult.Single, avatar);
checkBan.sendLandProperties(-30000, false, (int)ParcelResult.Single, avatar);
return; //Only send one
}
if (checkBan.isRestrictedFromLand(avatar.AgentId))
{
checkBan.sendLandProperties(-40000, false, (int)ParcelManager.ParcelResult.Single, avatar);
checkBan.sendLandProperties(-40000, false, (int)ParcelResult.Single, avatar);
return; //Only send one
}
}

View File

@@ -162,16 +162,16 @@ namespace OpenSim.Region.Environment.Modules.World.Land
public void sendLandProperties(int sequence_id, bool snap_selection, int request_result, IClientAPI remote_client)
{
IEstateModule estateModule = m_scene.RequestModuleInterface<IEstateModule>();
uint regionFlags = 336723974 & ~((uint)(Simulator.RegionFlags.AllowLandmark | Simulator.RegionFlags.AllowSetHome));
uint regionFlags = 336723974 & ~((uint)(RegionFlags.AllowLandmark | RegionFlags.AllowSetHome));
if (estateModule != null)
regionFlags = estateModule.GetRegionFlags();
// In a perfect world, this would have worked.
//
// if ((landData.Flags & (uint)Parcel.ParcelFlags.AllowLandmark) != 0)
// regionFlags |= (uint)Simulator.RegionFlags.AllowLandmark;
// regionFlags |= (uint)RegionFlags.AllowLandmark;
// if (landData.OwnerID == remote_client.AgentId)
// regionFlags |= (uint)Simulator.RegionFlags.AllowSetHome;
// regionFlags |= (uint)RegionFlags.AllowSetHome;
remote_client.SendLandProperties(remote_client, sequence_id,
snap_selection, request_result, landData,
(float)m_scene.RegionInfo.RegionSettings.ObjectBonus,
@@ -252,7 +252,7 @@ namespace OpenSim.Region.Environment.Modules.World.Land
{
ParcelManager.ParcelAccessEntry entry = new ParcelManager.ParcelAccessEntry();
entry.AgentID = avatar;
entry.Flags = ParcelManager.AccessList.Ban;
entry.Flags = AccessList.Ban;
entry.Time = new DateTime();
if (landData.ParcelAccessList.Contains(entry))
{
@@ -269,7 +269,7 @@ namespace OpenSim.Region.Environment.Modules.World.Land
{
ParcelManager.ParcelAccessEntry entry = new ParcelManager.ParcelAccessEntry();
entry.AgentID = avatar;
entry.Flags = ParcelManager.AccessList.Access;
entry.Flags = AccessList.Access;
entry.Time = new DateTime();
if (!landData.ParcelAccessList.Contains(entry))
{
@@ -322,7 +322,7 @@ namespace OpenSim.Region.Environment.Modules.World.Land
#region AccessList Functions
public List<UUID> createAccessListArrayByFlag(ParcelManager.AccessList flag)
public List<UUID> createAccessListArrayByFlag(AccessList flag)
{
List<UUID> list = new List<UUID>();
foreach (ParcelManager.ParcelAccessEntry entry in landData.ParcelAccessList)
@@ -344,16 +344,16 @@ namespace OpenSim.Region.Environment.Modules.World.Land
IClientAPI remote_client)
{
if (flags == (uint) ParcelManager.AccessList.Access || flags == (uint) ParcelManager.AccessList.Both)
if (flags == (uint) AccessList.Access || flags == (uint) AccessList.Both)
{
List<UUID> avatars = createAccessListArrayByFlag(ParcelManager.AccessList.Access);
remote_client.SendLandAccessListData(avatars,(uint) ParcelManager.AccessList.Access,landData.LocalID);
List<UUID> avatars = createAccessListArrayByFlag(AccessList.Access);
remote_client.SendLandAccessListData(avatars,(uint) AccessList.Access,landData.LocalID);
}
if (flags == (uint) ParcelManager.AccessList.Ban || flags == (uint) ParcelManager.AccessList.Both)
if (flags == (uint) AccessList.Ban || flags == (uint) AccessList.Both)
{
List<UUID> avatars = createAccessListArrayByFlag(ParcelManager.AccessList.Ban);
remote_client.SendLandAccessListData(avatars, (uint)ParcelManager.AccessList.Ban, landData.LocalID);
List<UUID> avatars = createAccessListArrayByFlag(AccessList.Ban);
remote_client.SendLandAccessListData(avatars, (uint)AccessList.Ban, landData.LocalID);
}
}
@@ -369,7 +369,7 @@ namespace OpenSim.Region.Environment.Modules.World.Land
List<ParcelManager.ParcelAccessEntry> toRemove = new List<ParcelManager.ParcelAccessEntry>();
foreach (ParcelManager.ParcelAccessEntry entry in newData.ParcelAccessList)
{
if (entry.Flags == (ParcelManager.AccessList) flags)
if (entry.Flags == (AccessList) flags)
{
toRemove.Add(entry);
}
@@ -384,7 +384,7 @@ namespace OpenSim.Region.Environment.Modules.World.Land
ParcelManager.ParcelAccessEntry temp = new ParcelManager.ParcelAccessEntry();
temp.AgentID = entry.AgentID;
temp.Time = new DateTime(); //Pointless? Yes.
temp.Flags = (ParcelManager.AccessList) flags;
temp.Flags = (AccessList) flags;
if (!newData.ParcelAccessList.Contains(temp))
{

View File

@@ -482,8 +482,7 @@ namespace OpenSim.Region.Environment.Modules.World.NPC
{
}
public virtual void SendWindData(float[] map) { }
public virtual void SendWindData(int p1x, int p1y, int p2x, int p2y, float[] map) { }
public virtual void SendWindData(Vector2[] windSpeeds) { }
public virtual void MoveAgentIntoRegion(RegionInfo regInfo, Vector3 pos, Vector3 look)
{

View File

@@ -45,7 +45,7 @@ namespace OpenSim.Region.Environment.Modules
private Random rndnums = new Random(System.Environment.TickCount);
private Scene m_scene = null;
private bool ready = false;
private float[] windarr = new float[256*256];
private Vector2[] windSpeeds = new Vector2[16 * 16];
private Dictionary<UUID, ulong> m_rootAgents = new Dictionary<UUID, ulong>();
@@ -54,7 +54,6 @@ namespace OpenSim.Region.Environment.Modules
public void Initialise(Scene scene, IConfigSource config)
{
m_log.Debug("[WIND] Initializing");
m_scene = scene;
@@ -120,15 +119,13 @@ namespace OpenSim.Region.Environment.Modules
public void WindToClient(IClientAPI client)
{
if (ready)
{
//if (!sunFixed)
//GenWindPos(); // Generate shared values once
client.SendWindData(windarr);
client.SendWindData(windSpeeds);
m_log.Debug("[WIND] Initial update for new client");
}
}
public void WindUpdate()
@@ -149,11 +146,7 @@ namespace OpenSim.Region.Environment.Modules
{
if (!avatar.IsChildAgent)
{
avatar.ControllingClient.SendWindData(
0,
0,0,1,
windarr);
avatar.ControllingClient.SendWindData(windSpeeds);
}
}
@@ -169,7 +162,7 @@ namespace OpenSim.Region.Environment.Modules
foreach (ScenePresence avatar in avatars)
{
if (!avatar.IsChildAgent)
avatar.ControllingClient.SendWindData(windarr);
avatar.ControllingClient.SendWindData(windSpeeds);
}
// set estate settings for region access to sun position
@@ -182,35 +175,14 @@ namespace OpenSim.Region.Environment.Modules
private void GenWindPos()
{
//windarr = new float[256*256];
Array.Clear(windarr, 0, 256 * 256);
//float i = 0f;
//float i2 = 2f;
for (int x = 0; x < 16; x++)
for (int y = 0; y < 16; y++)
{
for (int y = 0; y < 16; y++)
for (int x = 0; x < 16; x++)
{
windarr[x * 256 + y] = (float)(rndnums.NextDouble() * 2d - 1d);
windSpeeds[y * 16 + x].X = (float)(rndnums.NextDouble() * 2d - 1d);
windSpeeds[y * 16 + x].Y = (float)(rndnums.NextDouble() * 2d - 1d);
}
}
for (int x = 16; x < 32; x++)
{
for (int y = 0; y < 16; y++)
{
windarr[x * 256 + y] = (float)(rndnums.NextDouble() * 2d - 1d);
}
}
// m_log.Debug("[SUN] Velocity("+Velocity.X+","+Velocity.Y+","+Velocity.Z+")");
}
private void ClientLoggedOut(UUID AgentId)