Merge branch 'avination-current' into careminster

Conflicts:
	OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs
	OpenSim/Region/Framework/Interfaces/IDynamicMenuModule.cs
	OpenSim/Region/OptionalModules/ViewerSupport/DynamicMenuModule.cs
	OpenSim/Region/OptionalModules/World/MoneyModule/SampleMoneyModule.cs
avinationmerge
Melanie 2013-06-06 03:20:15 +01:00
commit fe4a67efb6
29 changed files with 559 additions and 52 deletions

View File

@ -97,7 +97,7 @@ namespace OpenSim.Capabilities.Handlers
llsdItem.asset_id = invItem.AssetID;
llsdItem.created_at = invItem.CreationDate;
llsdItem.desc = invItem.Description;
llsdItem.flags = (int)invItem.Flags;
llsdItem.flags = ((int)invItem.Flags) & 0xff;
llsdItem.item_id = invItem.ID;
llsdItem.name = invItem.Name;
llsdItem.parent_id = invItem.Folder;

View File

@ -411,7 +411,7 @@ namespace OpenSim.Capabilities.Handlers
llsdItem.asset_id = invItem.AssetID;
llsdItem.created_at = invItem.CreationDate;
llsdItem.desc = invItem.Description;
llsdItem.flags = (int)invItem.Flags;
llsdItem.flags = ((int)invItem.Flags) & 0xff;
llsdItem.item_id = invItem.ID;
llsdItem.name = invItem.Name;
llsdItem.parent_id = invItem.Folder;

View File

@ -345,7 +345,7 @@ namespace OpenSim.Framework.Servers.HttpServer
if (responsedata == null)
continue;
if (req.PollServiceArgs.Type == PollServiceEventArgs.EventType.Normal)
if (req.PollServiceArgs.Type == PollServiceEventArgs.EventType.Normal) // This is the event queue
{
try
{

View File

@ -376,7 +376,7 @@ namespace OpenSim.Region.ClientStack.Linden
// TODO: Add EventQueueGet name/description for diagnostics
MainServer.Instance.AddPollServiceHTTPHandler(
eventQueueGetPath,
new PollServiceEventArgs(null, HasEvents, GetEvents, NoEvents, agentID, 1000));
new PollServiceEventArgs(null, HasEvents, GetEvents, NoEvents, agentID, 40000));
// m_log.DebugFormat(
// "[EVENT QUEUE GET MODULE]: Registered EQG handler {0} for {1} in {2}",

View File

@ -56,6 +56,7 @@ namespace OpenSim.Region.ClientStack.Linden
public PollServiceTextureEventArgs thepoll;
public UUID reqID;
public Hashtable request;
public bool send503;
}
public class aPollResponse
@ -244,7 +245,19 @@ namespace OpenSim.Region.ClientStack.Linden
reqinfo.thepoll = this;
reqinfo.reqID = x;
reqinfo.request = y;
reqinfo.send503 = false;
lock (responses)
{
if (responses.Count > 0)
{
if (m_queue.Count >= 4)
{
// Never allow more than 4 fetches to wait
reqinfo.send503 = true;
}
}
}
m_queue.Enqueue(reqinfo);
};
@ -276,6 +289,22 @@ namespace OpenSim.Region.ClientStack.Linden
UUID requestID = requestinfo.reqID;
if (requestinfo.send503)
{
response = new Hashtable();
response["int_response_code"] = 503;
response["str_response_string"] = "Throttled";
response["content_type"] = "text/plain";
response["keepalive"] = false;
response["reusecontext"] = false;
lock (responses)
responses[requestID] = new aPollResponse() {bytes = 0, response = response};
return;
}
// If the avatar is gone, don't bother to get the texture
if (m_scene.GetScenePresence(Id) == null)
{
@ -385,6 +414,9 @@ namespace OpenSim.Region.ClientStack.Linden
GetTextureModule.aPollResponse response;
if (responses.TryGetValue(key, out response))
{
// This is any error response
if (response.bytes == 0)
return true;
// Normal
if (BytesSent + response.bytes <= ThrottleBytes)
@ -411,12 +443,12 @@ namespace OpenSim.Region.ClientStack.Linden
return haskey;
}
public void ProcessTime()
{
PassTime();
}
private void PassTime()
{
currenttime = Util.EnvironmentTickCount();

View File

@ -1741,7 +1741,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
newBlock.CreationDate = item.CreationDate;
newBlock.SalePrice = item.SalePrice;
newBlock.SaleType = item.SaleType;
newBlock.Flags = item.Flags;
newBlock.Flags = item.Flags & 0xff;
newBlock.CRC =
Helpers.InventoryCRC(newBlock.CreationDate, newBlock.SaleType,
@ -1995,7 +1995,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
itemBlock.GroupID = item.GroupID;
itemBlock.GroupOwned = item.GroupOwned;
itemBlock.GroupMask = item.GroupPermissions;
itemBlock.Flags = item.Flags;
itemBlock.Flags = item.Flags & 0xff;
itemBlock.SalePrice = item.SalePrice;
itemBlock.SaleType = item.SaleType;
itemBlock.CreationDate = item.CreationDate;
@ -2062,7 +2062,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
bulkUpdate.ItemData[0].GroupID = item.GroupID;
bulkUpdate.ItemData[0].GroupOwned = item.GroupOwned;
bulkUpdate.ItemData[0].GroupMask = item.GroupPermissions;
bulkUpdate.ItemData[0].Flags = item.Flags;
bulkUpdate.ItemData[0].Flags = item.Flags & 0xff;
bulkUpdate.ItemData[0].SalePrice = item.SalePrice;
bulkUpdate.ItemData[0].SaleType = item.SaleType;
@ -2116,7 +2116,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
InventoryReply.InventoryData[0].GroupID = Item.GroupID;
InventoryReply.InventoryData[0].GroupOwned = Item.GroupOwned;
InventoryReply.InventoryData[0].GroupMask = Item.GroupPermissions;
InventoryReply.InventoryData[0].Flags = Item.Flags;
InventoryReply.InventoryData[0].Flags = Item.Flags & 0xff;
InventoryReply.InventoryData[0].SalePrice = Item.SalePrice;
InventoryReply.InventoryData[0].SaleType = Item.SaleType;
InventoryReply.InventoryData[0].CreationDate = Item.CreationDate;
@ -5137,6 +5137,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP
data.CollisionPlane.ToBytes(objectData, 0);
offsetPosition.ToBytes(objectData, 16);
Vector3 velocity = new Vector3(0, 0, 0);
Vector3 acceleration = new Vector3(0, 0, 0);
velocity.ToBytes(objectData, 28);
acceleration.ToBytes(objectData, 40);
// data.Velocity.ToBytes(objectData, 28);
// data.Acceleration.ToBytes(objectData, 40);
rotation.ToBytes(objectData, 52);

View File

@ -1135,7 +1135,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
if (!udpClient.IsConnected)
{
// m_log.Debug("[LLUDPSERVER]: Received a " + packet.Type + " packet for a unConnected client in " + m_scene.RegionInfo.RegionName);
m_log.Debug("[LLUDPSERVER]: Received a " + packet.Type + " packet for a unConnected client in " + m_scene.RegionInfo.RegionName);
return;
}

View File

@ -65,9 +65,6 @@ namespace OpenSim.Region.CoreModules.Avatar.Gods
protected Scene m_scene;
protected IDialogModule m_dialogModule;
protected Dictionary<UUID, string> m_capsDict =
new Dictionary<UUID, string>();
protected IDialogModule DialogModule
{
get
@ -89,7 +86,6 @@ namespace OpenSim.Region.CoreModules.Avatar.Gods
m_scene.RegisterModuleInterface<IGodsModule>(this);
m_scene.EventManager.OnNewClient += SubscribeToClientEvents;
m_scene.EventManager.OnRegisterCaps += OnRegisterCaps;
m_scene.EventManager.OnClientClosed += OnClientClosed;
scene.EventManager.OnIncomingInstantMessage +=
OnIncomingInstantMessage;
}
@ -125,15 +121,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Gods
client.OnRequestGodlikePowers -= RequestGodlikePowers;
}
private void OnClientClosed(UUID agentID, Scene scene)
{
m_capsDict.Remove(agentID);
}
private void OnRegisterCaps(UUID agentID, Caps caps)
{
string uri = "/CAPS/" + UUID.Random();
m_capsDict[agentID] = uri;
caps.RegisterHandler("UntrustedSimulatorMessage",
new RestStreamHandler("POST", uri,

View File

@ -1113,14 +1113,14 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
((Scene)(client.Scene)).RequestTeleportLocation(
client, regionInfo.RegionHandle, uinfo.HomePosition, uinfo.HomeLookAt,
(uint)(Constants.TeleportFlags.SetLastToTarget | Constants.TeleportFlags.ViaHome));
return true;
}
else
{
// can't find the Home region: Tell viewer and abort
client.SendTeleportFailed("Your home region could not be found.");
return false;
}
return true;
return false;
}
#endregion

View File

@ -387,7 +387,12 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
inventoryStoredPosition = objectGroup.RootPart.AttachOffset;
inventoryStoredRotation = objectGroup.RootPart.AttachRotation;
}
objectGroup.RootPart.Shape.State = objectGroup.RootPart.AttachPoint;
// Trees could be attached and it's been done, but it makes
// no sense. State must be preserved because it's the tree type
if (objectGroup.RootPart.Shape.PCode != (byte)PCode.Tree &&
objectGroup.RootPart.Shape.PCode != (byte)PCode.NewTree)
objectGroup.RootPart.Shape.State = objectGroup.RootPart.AttachPoint;
objectGroup.AbsolutePosition = inventoryStoredPosition;
objectGroup.RootPart.RotationOffset = inventoryStoredRotation;
@ -797,7 +802,9 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
g.RootPart.AttachPoint = g.RootPart.Shape.State;
g.RootPart.AttachOffset = g.AbsolutePosition;
g.RootPart.AttachRotation = g.GroupRotation;
g.RootPart.Shape.State = 0;
if (g.RootPart.Shape.PCode != (byte)PCode.NewTree &&
g.RootPart.Shape.PCode != (byte)PCode.Tree)
g.RootPart.Shape.State = 0;
}
objlist.Add(g);
@ -831,7 +838,9 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
g.RootPart.AttachPoint = g.RootPart.Shape.State;
g.RootPart.AttachOffset = g.AbsolutePosition;
g.RootPart.AttachRotation = g.GroupRotation;
g.RootPart.Shape.State = 0;
if (g.RootPart.Shape.PCode != (byte)PCode.NewTree &&
g.RootPart.Shape.PCode != (byte)PCode.Tree)
g.RootPart.Shape.State = 0;
objlist.Add(g);
XmlElement el = (XmlElement)n;

View File

@ -51,6 +51,7 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp
public UUID urlcode;
public Dictionary<UUID, RequestData> requests;
public bool isSsl;
public Scene scene;
}
public class RequestData
@ -66,6 +67,9 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp
public int startTime;
public bool responseSent;
public string uri;
public bool allowResponseType = false;
public UUID hostID;
public Scene scene;
}
/// <summary>
@ -171,6 +175,17 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp
public void RemoveRegion(Scene scene)
{
// Drop references to that scene
foreach (KeyValuePair<string, UrlData> kvp in m_UrlMap)
{
if (kvp.Value.scene == scene)
kvp.Value.scene = null;
}
foreach (KeyValuePair<UUID, UrlData> kvp in m_RequestMap)
{
if (kvp.Value.scene == scene)
kvp.Value.scene = null;
}
}
public void Close()
@ -198,6 +213,7 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp
urlData.urlcode = urlcode;
urlData.isSsl = false;
urlData.requests = new Dictionary<UUID, RequestData>();
urlData.scene = host.ParentGroup.Scene;
m_UrlMap[url] = urlData;
@ -316,6 +332,11 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp
if (!urlData.requests[request].responseSent)
{
string responseBody = body;
// If we have no OpenID from built-in browser, disable this
if (!urlData.requests[request].allowResponseType)
urlData.requests[request].responseType = "text/plain";
if (urlData.requests[request].responseType.Equals("text/plain"))
{
string value;
@ -532,7 +553,7 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp
//put response
response["int_response_code"] = requestData.responseCode;
response["str_response_string"] = requestData.responseBody;
response["content_type"] = "text/plain";
response["content_type"] = requestData.responseType;
response["keepalive"] = false;
response["reusecontext"] = false;
@ -600,6 +621,8 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp
requestData.requestDone = false;
requestData.startTime = System.Environment.TickCount;
requestData.uri = uri;
requestData.hostID = url.hostID;
requestData.scene = url.scene;
if (requestData.headers == null)
requestData.headers = new Dictionary<string, string>();
@ -608,6 +631,32 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp
string key = (string)header.Key;
string value = (string)header.Value;
requestData.headers.Add(key, value);
if (key == "cookie")
{
string[] parts = value.Split(new char[] {'='});
if (parts[0] == "agni_sl_session_id" && parts.Length > 1)
{
string cookie = Uri.UnescapeDataString(parts[1]);
string[] crumbs = cookie.Split(new char[] {':'});
UUID owner;
if (crumbs.Length == 2 && UUID.TryParse(crumbs[0], out owner))
{
if (crumbs[1].Length == 32)
{
Scene scene = requestData.scene;
if (scene != null)
{
SceneObjectPart host = scene.GetSceneObjectPart(requestData.hostID);
if (host != null)
{
if (host.OwnerID == owner)
requestData.allowResponseType = true;
}
}
}
}
}
}
}
foreach (DictionaryEntry de in request)
{

View File

@ -940,6 +940,8 @@ namespace OpenSim.Region.CoreModules.World.Land
newLand.LandData.Name = newLand.LandData.Name;
newLand.LandData.GlobalID = UUID.Random();
newLand.LandData.Dwell = 0;
// Clear "Show in search" on the cut out parcel to prevent double-charging
newLand.LandData.Flags &= ~(uint)ParcelFlags.ShowDirectory;
newLand.SetLandBitmap(newLand.GetSquareLandBitmap(start_x, start_y, end_x, end_y));

View File

@ -211,8 +211,8 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
{
if (regionInfos.Count == 0)
remoteClient.SendAgentAlertMessage("No regions found with that name.", true);
else if (regionInfos.Count == 1)
remoteClient.SendAgentAlertMessage("Region found!", false);
// else if (regionInfos.Count == 1)
// remoteClient.SendAgentAlertMessage("Region found!", false);
}
});
}

View File

@ -0,0 +1,52 @@
/*
* Copyright (c) Contributors, http://opensimulator.org/
* See CONTRIBUTORS.TXT for a full list of copyright holders.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of the OpenSimulator Project nor the
* names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
using System.Collections.Generic;
using OpenMetaverse;
using OpenSim.Framework;
using OpenSim.Region.Framework.Scenes;
namespace OpenSim.Region.Framework.Interfaces
{
public delegate bool HandlerDelegate(IClientAPI client, FloaterData data, string[] msg);
public abstract class FloaterData
{
public abstract int Channel { get; }
public abstract string FloaterName { get; set; }
public virtual string XmlName { get; set; }
public virtual string XmlText { get; set; }
public virtual HandlerDelegate Handler { get; set; }
}
public interface IDynamicFloaterModule
{
void DoUserFloater(UUID agentID, FloaterData dialogData, string configuration);
void FloaterControl(ScenePresence sp, FloaterData d, string msg);
}
}

View File

@ -43,6 +43,7 @@ namespace OpenSim.Region.Framework.Interfaces
public enum UserMode : int
{
Normal = 0,
RegionManager = 2,
God = 3
}

View File

@ -645,7 +645,7 @@ namespace OpenSim.Region.Framework.Scenes
m_nextPosition = m_group.AbsolutePosition + motionThisFrame;
m_group.AbsolutePosition = m_nextPosition;
m_group.RootPart.Velocity = v;
//m_group.RootPart.Velocity = v;
update = true;
}

View File

@ -2454,6 +2454,14 @@ namespace OpenSim.Region.Framework.Scenes
else
group.StopScriptInstances();
List<UUID> avatars = group.GetSittingAvatars();
foreach (UUID av in avatars)
{
ScenePresence p = GetScenePresence(av);
if (p != null)
p.StandUp();
}
SceneObjectPart[] partList = group.Parts;
foreach (SceneObjectPart part in partList)

View File

@ -272,6 +272,11 @@ namespace OpenSim.Region.Framework.Scenes
{
AttachmentPoint = 0;
// Don't zap trees
if (RootPart.Shape.PCode == (byte)PCode.Tree ||
RootPart.Shape.PCode == (byte)PCode.NewTree)
return;
// Even though we don't use child part state parameters for attachments any more, we still need to set
// these to zero since having them non-zero in rezzed scene objects will crash some clients. Even if
// we store them correctly, scene objects that we receive from elsewhere might not.

View File

@ -131,7 +131,15 @@ namespace OpenSim.Region.Framework.Scenes
public double this[int x, int y]
{
get { return map[x, y]; }
get
{
if (x < 0) x = 0;
if (y < 0) y = 0;
if (x >= (int)Constants.RegionSize) x = (int)Constants.RegionSize - 1;
if (y >= (int)Constants.RegionSize) y = (int)Constants.RegionSize - 1;
return map[x, y];
}
set
{
// Will "fix" terrain hole problems. Although not fantastically.

View File

@ -0,0 +1,238 @@
/*
* Copyright (c) Contributors, http://opensimulator.org/
* See CONTRIBUTORS.TXT for a full list of copyright holders.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of the OpenSimulator Project nor the
* names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
using System;
using System.IO;
using System.Reflection;
using System.Text;
using System.Collections.Generic;
using OpenMetaverse;
using OpenMetaverse.StructuredData;
using OpenSim;
using OpenSim.Region;
using OpenSim.Region.Framework;
using OpenSim.Region.Framework.Scenes;
using OpenSim.Region.Framework.Interfaces;
using OpenSim.Framework;
using OpenSim.Framework.Servers;
using OpenSim.Framework.Servers.HttpServer;
using Nini.Config;
using log4net;
using Mono.Addins;
using Caps = OpenSim.Framework.Capabilities.Caps;
using OSDMap = OpenMetaverse.StructuredData.OSDMap;
namespace OpenSim.Region.OptionalModules.ViewerSupport
{
[Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "DynamicFloater")]
public class DynamicFloaterModule : INonSharedRegionModule, IDynamicFloaterModule
{
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
private Scene m_scene;
private Dictionary<UUID, Dictionary<int, FloaterData>> m_floaters = new Dictionary<UUID, Dictionary<int, FloaterData>>();
public string Name
{
get { return "DynamicFloaterModule"; }
}
public Type ReplaceableInterface
{
get { return null; }
}
public void Initialise(IConfigSource config)
{
}
public void Close()
{
}
public void AddRegion(Scene scene)
{
m_scene = scene;
scene.EventManager.OnNewClient += OnNewClient;
scene.EventManager.OnClientClosed += OnClientClosed;
m_scene.RegisterModuleInterface<IDynamicFloaterModule>(this);
}
public void RegionLoaded(Scene scene)
{
}
public void RemoveRegion(Scene scene)
{
}
private void OnNewClient(IClientAPI client)
{
client.OnChatFromClient += OnChatFromClient;
}
private void OnClientClosed(UUID agentID, Scene scene)
{
m_floaters.Remove(agentID);
}
private void SendToClient(ScenePresence sp, string msg)
{
sp.ControllingClient.SendChatMessage(msg,
(byte)ChatTypeEnum.Owner,
sp.AbsolutePosition,
"Server",
UUID.Zero,
UUID.Zero,
(byte)ChatSourceType.Object,
(byte)ChatAudibleLevel.Fully);
}
public void DoUserFloater(UUID agentID, FloaterData dialogData, string configuration)
{
ScenePresence sp = m_scene.GetScenePresence(agentID);
if (sp == null || sp.IsChildAgent)
return;
if (!m_floaters.ContainsKey(agentID))
m_floaters[agentID] = new Dictionary<int, FloaterData>();
if (m_floaters[agentID].ContainsKey(dialogData.Channel))
return;
m_floaters[agentID].Add(dialogData.Channel, dialogData);
string xml;
if (dialogData.XmlText != null && dialogData.XmlText != String.Empty)
{
xml = dialogData.XmlText;
}
else
{
using (FileStream fs = File.Open(dialogData.XmlName + ".xml", FileMode.Open))
{
using (StreamReader sr = new StreamReader(fs))
xml = sr.ReadToEnd().Replace("\n", "");
}
}
List<string> xparts = new List<string>();
while (xml.Length > 0)
{
string x = xml;
if (x.Length > 600)
{
x = x.Substring(0, 600);
xml = xml.Substring(600);
}
else
{
xml = String.Empty;
}
xparts.Add(x);
}
for (int i = 0 ; i < xparts.Count ; i++)
SendToClient(sp, String.Format("># floater {2} create {0}/{1} " + xparts[i], i + 1, xparts.Count, dialogData.FloaterName));
SendToClient(sp, String.Format("># floater {0} {{notify:1}} {{channel: {1}}} {{node:cancel {{notify:1}}}} {{node:ok {{notify:1}}}} {2}", dialogData.FloaterName, (uint)dialogData.Channel, configuration));
}
private void OnChatFromClient(object sender, OSChatMessage msg)
{
if (msg.Sender == null)
return;
//m_log.DebugFormat("chan {0} msg {1}", msg.Channel, msg.Message);
IClientAPI client = msg.Sender;
if (!m_floaters.ContainsKey(client.AgentId))
return;
string[] parts = msg.Message.Split(new char[] {':'});
if (parts.Length == 0)
return;
ScenePresence sp = m_scene.GetScenePresence(client.AgentId);
if (sp == null || sp.IsChildAgent)
return;
Dictionary<int, FloaterData> d = m_floaters[client.AgentId];
// Work around a viewer bug - VALUE from any
// dialog can appear on this channel and needs to
// be dispatched to ALL open dialogs for the user
if (msg.Channel == 427169570)
{
if (parts[0] == "VALUE")
{
foreach (FloaterData dd in d.Values)
{
if(dd.Handler(client, dd, parts))
{
m_floaters[client.AgentId].Remove(dd.Channel);
SendToClient(sp, String.Format("># floater {0} destroy", dd.FloaterName));
break;
}
}
}
return;
}
if (!d.ContainsKey(msg.Channel))
return;
FloaterData data = d[msg.Channel];
if (parts[0] == "NOTIFY")
{
if (parts[1] == "cancel" || parts[1] == data.FloaterName)
{
m_floaters[client.AgentId].Remove(data.Channel);
SendToClient(sp, String.Format("># floater {0} destroy", data.FloaterName));
}
}
if (data.Handler != null && data.Handler(client, data, parts))
{
m_floaters[client.AgentId].Remove(data.Channel);
SendToClient(sp, String.Format("># floater {0} destroy", data.FloaterName));
}
}
public void FloaterControl(ScenePresence sp, FloaterData d, string msg)
{
string sendData = String.Format("># floater {0} {1}", d.FloaterName, msg);
SendToClient(sp, sendData);
}
}
}

View File

@ -110,8 +110,11 @@ namespace OpenSim.Region.OptionalModules.ViewerSupport
{
foreach (MenuItemData d in m_menuItems[UUID.Zero])
{
if (d.Mode == UserMode.God && (!m_scene.Permissions.IsGod(agentID)))
continue;
if (!m_scene.Permissions.IsGod(agentID))
{
if (d.Mode == UserMode.RegionManager && (!m_scene.Permissions.IsAdministrator(agentID)))
continue;
}
OSDMap loc = null;
switch (d.Location)

View File

@ -1045,12 +1045,37 @@ namespace OpenSim.Region.Physics.OdePlugin
if (me == midbox)
{
if (Math.Abs(contact.normal.Z) > 0.95f)
{
offset.Z = contact.pos.Z - _position.Z;
offset.X = (float)Math.Abs(offset.X) * 0.5f + contact.depth;
offset.Y = (float)Math.Abs(offset.Y) * 0.5f + contact.depth;
offset.Z = (float)Math.Abs(offset.Z) * 0.5f + contact.depth;
if (reverse)
{
offset.X *= -contact.normal.X;
offset.Y *= -contact.normal.Y;
offset.Z *= -contact.normal.Z;
}
else
{
offset.X *= contact.normal.X;
offset.Y *= contact.normal.Y;
offset.Z *= contact.normal.Z;
}
offset.X += contact.pos.X;
offset.Y += contact.pos.Y;
offset.Z += contact.pos.Z;
_position = offset;
return true;
}
else
offset.Z = contact.normal.Z;
offset.Normalize();
/*
if (reverse)
{
contact.normal.X = offset.X;
@ -1063,7 +1088,8 @@ namespace OpenSim.Region.Physics.OdePlugin
contact.normal.Y = -offset.Y;
contact.normal.Z = -offset.Z;
}
*/
//_position.Z = offset.Z;
return true;
}
@ -1071,8 +1097,20 @@ namespace OpenSim.Region.Physics.OdePlugin
{
float h = contact.pos.Z - _position.Z;
// Only do this if the normal is sufficiently pointing in the 'up' direction
if (Math.Abs(contact.normal.Z) > 0.95f)
{
// We Only want to do this if we're sunk into the object a bit and we're stuck and we're trying to move and feetcollision is false
if ((contact.depth > 0.0010f && _velocity.X == 0f && _velocity.Y == 0 && _velocity.Z == 0)
&& (_target_velocity.X > 0 || _target_velocity.Y > 0 || _target_velocity.Z > 0)
&& (!feetcollision) )
{
m_collisionException = true; // Stop looping, do this only once not X times Contacts
_position.Z += contact.depth + 0.01f; // Move us Up the amount that we sank in, and add 0.01 meters to gently lift avatar up.
return true;
}
if (contact.normal.Z > 0)
contact.normal.Z = 1.0f;
else

View File

@ -4643,20 +4643,31 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
ScenePresence presence = World.GetScenePresence(agentId);
if (presence != null && presence.PresenceType != PresenceType.Npc)
{
// agent must not be a god
if (presence.GodLevel >= 200) return;
if (destination == String.Empty)
destination = World.RegionInfo.RegionName;
// agent must be over the owners land
if (m_host.OwnerID == World.LandChannel.GetLandObject(presence.AbsolutePosition).LandData.OwnerID)
if (m_item.PermsGranter == agentId)
{
if ((m_item.PermsMask & ScriptBaseClass.PERMISSION_TELEPORT) != 0)
{
DoLLTeleport(presence, destination, targetPos, targetLookAt);
}
}
// agent must be wearing the object
if (m_host.ParentGroup.AttachmentPoint != 0 && m_host.OwnerID == presence.UUID)
{
DoLLTeleport(presence, destination, targetPos, targetLookAt);
}
else // or must be wearing the prim
else
{
if (m_host.ParentGroup.AttachmentPoint != 0 && m_host.OwnerID == presence.UUID)
// agent must not be a god
if (presence.GodLevel >= 200) return;
// agent must be over the owners land
ILandObject agentLand = World.LandChannel.GetLandObject(presence.AbsolutePosition);
ILandObject objectLand = World.LandChannel.GetLandObject(m_host.AbsolutePosition);
if (m_host.OwnerID == objectLand.LandData.OwnerID && m_host.OwnerID == agentLand.LandData.OwnerID)
{
DoLLTeleport(presence, destination, targetPos, targetLookAt);
}
@ -4670,24 +4681,29 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
m_host.AddScriptLPS(1);
UUID agentId = new UUID();
ulong regionHandle = Utils.UIntsToLong((uint)global_coords.x, (uint)global_coords.y);
ulong regionHandle = Utils.UIntsToLong((uint)(global_coords.x / 256) * 256, (uint)(global_coords.y / 256) * 256);
if (UUID.TryParse(agent, out agentId))
{
// This function is owner only!
if (m_host.OwnerID != agentId)
return;
ScenePresence presence = World.GetScenePresence(agentId);
// Can't TP sitting avatars
if (presence.ParentID != 0) // Sitting
return;
if (presence != null && presence.PresenceType != PresenceType.Npc)
{
// agent must not be a god
if (presence.GodLevel >= 200) return;
if (m_item.PermsGranter == agentId)
{
// If attached using llAttachToAvatarTemp, cowardly refuse
if (m_host.ParentGroup.AttachmentPoint != 0 && m_host.ParentGroup.FromItemID == UUID.Zero)
return;
// agent must be over the owners land
if (m_host.OwnerID == World.LandChannel.GetLandObject(presence.AbsolutePosition).LandData.OwnerID)
{
World.RequestTeleportLocation(presence.ControllingClient, regionHandle, targetPos, targetLookAt, (uint)TeleportFlags.ViaLocation);
}
else // or must be wearing the prim
{
if (m_host.ParentGroup.AttachmentPoint != 0 && m_host.OwnerID == presence.UUID)
if ((m_item.PermsMask & ScriptBaseClass.PERMISSION_TELEPORT) != 0)
{
World.RequestTeleportLocation(presence.ControllingClient, regionHandle, targetPos, targetLookAt, (uint)TeleportFlags.ViaLocation);
}
@ -7853,6 +7869,18 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
}
}
public LSL_List llGetPhysicsMaterial()
{
LSL_List result = new LSL_List();
result.Add(new LSL_Float(m_host.GravityModifier));
result.Add(new LSL_Float(m_host.Restitution));
result.Add(new LSL_Float(m_host.Friction));
result.Add(new LSL_Float(m_host.Density));
return result;
}
private void SetPhysicsMaterial(SceneObjectPart part, int material_bits,
float material_density, float material_friction,
float material_restitution, float material_gravity_modifier)
@ -13379,6 +13407,18 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
return null;
}
public void llSetContentType(LSL_Key id, LSL_Integer content_type)
{
if (m_UrlModule != null)
{
string type = "text.plain";
if (content_type == (int)ScriptBaseClass.CONTENT_TYPE_HTML)
type = "text/html";
m_UrlModule.HttpContentType(new UUID(id),type);
}
}
}
public class NotecardCache

View File

@ -398,7 +398,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins
objtype = 0;
part = ((SceneObjectGroup)ent).RootPart;
if (part.ParentGroup.AttachmentPoint != 0) // Attached so ignore
if (part.ParentGroup.RootPart.Shape.PCode != (byte)PCode.Tree &&
part.ParentGroup.RootPart.Shape.PCode != (byte)PCode.NewTree &&
part.ParentGroup.AttachmentPoint != 0) // Attached so ignore
continue;
if (part.Inventory.ContainsScripts())

View File

@ -433,5 +433,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces
void SetPrimitiveParamsEx(LSL_Key prim, LSL_List rules, string originFunc);
void llSetKeyframedMotion(LSL_List frames, LSL_List options);
LSL_List GetPrimitiveParamsEx(LSL_Key prim, LSL_List rules);
LSL_List llGetPhysicsMaterial();
void llSetContentType(LSL_Key id, LSL_Integer content_type);
}
}

View File

@ -80,6 +80,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
public const int PERMISSION_CHANGE_PERMISSIONS = 512;
public const int PERMISSION_TRACK_CAMERA = 1024;
public const int PERMISSION_CONTROL_CAMERA = 2048;
public const int PERMISSION_TELEPORT = 4096;
public const int AGENT_FLYING = 1;
public const int AGENT_ATTACHMENTS = 2;
@ -771,5 +772,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
/// process message parameter as regex
/// </summary>
public const int OS_LISTEN_REGEX_MESSAGE = 0x2;
public const int CONTENT_TYPE_TEXT = 0;
public const int CONTENT_TYPE_HTML = 1;
}
}

View File

@ -2009,5 +2009,15 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
{
m_LSL_Functions.llSetPhysicsMaterial(material_bits, material_gravity_modifier, material_restitution, material_friction, material_density);
}
public LSL_List llGetPhysicsMaterial()
{
return m_LSL_Functions.llGetPhysicsMaterial();
}
public void llSetContentType(LSL_Key id, LSL_Integer content_type)
{
m_LSL_Functions.llSetContentType(id, content_type);
}
}
}

7
bin/enter_uuid.xml Normal file
View File

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<floater can_close="true" can_drag_on_left="false" can_minimize="false" can_resize="false" height="100" name="enter_uuid" title="ID Required" width="390">
<text bottom="-30" left="10">Enter UUID</text>
<line_editor bottom="-60" left="10" width="370" name="new_owner" height="20"/>
<button bottom="-90" width="80" height="20" left="300" label="OK" name="ok" />
<button bottom="-90" width="80" height="20" left="210" label="Cancel" name="cancel" />
</floater>

View File

@ -1812,6 +1812,8 @@
<Reference name="OpenSim.Framework.Servers.HttpServer"/>
<Reference name="OpenSim.Region.CoreModules"/>
<Reference name="OpenSim.Region.ClientStack.LindenUDP"/>
<Reference name="OpenSim.Region.Framework.Interfaces"/>
<Reference name="OpenSim.Region.Framework.Scenes"/>
<Reference name="OpenSim.Region.Framework"/>
<Reference name="OpenSim.Region.Physics.Manager"/>
<Reference name="OpenSim.Server.Base"/>
@ -3263,6 +3265,7 @@
<Reference name="OpenSim.Framework.Servers"/>
<Reference name="OpenSim.Framework.Servers.HttpServer"/>
<Reference name="OpenSim.Region.Framework"/>
<Reference name="OpenSim.Region.Framework.Interfaces"/>
<Reference name="OpenSim.Region.CoreModules"/>
<Reference name="OpenSim.Region.OptionalModules"/>
<Reference name="OpenSim.Region.Physics.Manager"/>