Merge branch 'careminster-presence-refactor' of ssh://3dhosting.de/var/git/careminster into careminster-presence-refactor
commit
cea7905602
File diff suppressed because it is too large
Load Diff
|
@ -787,8 +787,6 @@ CREATE TABLE `regionwindlight` (
|
|||
PRIMARY KEY (`region_id`)
|
||||
);
|
||||
|
||||
ALTER TABLE estate_settings AUTO_INCREMENT = 100;
|
||||
COMMIT;
|
||||
|
||||
:VERSION 33 #---------------------
|
||||
|
||||
|
|
|
@ -44,6 +44,7 @@ namespace OpenSim.Framework.Console
|
|||
{
|
||||
public int last;
|
||||
public long lastLineSeen;
|
||||
public bool newConnection = true;
|
||||
}
|
||||
|
||||
// A console that uses REST interfaces
|
||||
|
@ -424,6 +425,12 @@ namespace OpenSim.Framework.Console
|
|||
XmlElement rootElement = xmldoc.CreateElement("", "ConsoleSession",
|
||||
"");
|
||||
|
||||
if (c.newConnection)
|
||||
{
|
||||
c.newConnection = false;
|
||||
Output("+++" + DefaultPrompt);
|
||||
}
|
||||
|
||||
lock (m_Scrollback)
|
||||
{
|
||||
long startLine = m_LineNumber - m_Scrollback.Count;
|
||||
|
|
|
@ -373,7 +373,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
|
|||
// Save avatar attachment information
|
||||
if (m_scene.AvatarFactory != null)
|
||||
{
|
||||
m_log.Debug("[ATTACHMENTS MODULE]: Saving avatar attachment. AgentID: " + remoteClient.AgentId + ", ItemID: " + itemID);
|
||||
m_log.Debug("[ATTACHMENTS MODULE]: Dettaching from UserID: " + remoteClient.AgentId + ", ItemID: " + itemID);
|
||||
m_scene.AvatarFactory.UpdateDatabase(remoteClient.AgentId, presence.Appearance);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -198,7 +198,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
|
|||
|
||||
public void UpdateDatabase(UUID user, AvatarAppearance appearance)
|
||||
{
|
||||
//m_log.DebugFormat("[APPEARANCE]: UpdateDatabase");
|
||||
m_log.DebugFormat("[APPEARANCE]: UpdateDatabase");
|
||||
AvatarData adata = new AvatarData(appearance);
|
||||
m_scene.AvatarService.SetAvatar(user, adata);
|
||||
}
|
||||
|
|
|
@ -55,6 +55,11 @@ namespace OpenSim.Region.CoreModules.Avatar.Dialog
|
|||
|
||||
m_scene.AddCommand(
|
||||
this, "alert general", "alert general <message>", "Send an alert to everyone", HandleAlertConsoleCommand);
|
||||
|
||||
m_scene.AddCommand(
|
||||
this, "alert dialog", "alert dialog <message>", "Send a dialog alert to everyone", HandleAlertConsoleCommand);
|
||||
|
||||
|
||||
}
|
||||
|
||||
public void PostInitialise() {}
|
||||
|
@ -181,6 +186,14 @@ namespace OpenSim.Region.CoreModules.Avatar.Dialog
|
|||
"[DIALOG]: Sending general alert in region {0} with message {1}", m_scene.RegionInfo.RegionName, message);
|
||||
SendGeneralAlert(message);
|
||||
}
|
||||
else if (cmdparams[1] == "dialog")
|
||||
{
|
||||
string message = CombineParams(cmdparams, 2);
|
||||
|
||||
m_log.InfoFormat(
|
||||
"[DIALOG]: Sending dialog alert in region {0} with message {1}", m_scene.RegionInfo.RegionName, message);
|
||||
SendNotificationToUsersInRegion(UUID.Zero, "System", message);
|
||||
}
|
||||
else
|
||||
{
|
||||
string firstName = cmdparams[1];
|
||||
|
|
|
@ -396,7 +396,12 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
|||
agent.Position = position;
|
||||
SetCallbackURL(agent, sp.Scene.RegionInfo);
|
||||
|
||||
UpdateAgent(reg, finalDestination, agent);
|
||||
if (!UpdateAgent(reg, finalDestination, agent))
|
||||
{
|
||||
// Region doesn't take it
|
||||
Fail(sp, finalDestination);
|
||||
return;
|
||||
}
|
||||
|
||||
m_log.DebugFormat(
|
||||
"[ENTITY TRANSFER MODULE]: Sending new CAPS seed url {0} to client {1}", capsPath, sp.UUID);
|
||||
|
@ -421,21 +426,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
|||
// that the client contacted the destination before we send the attachments and close things here.
|
||||
if (!WaitForCallback(sp.UUID))
|
||||
{
|
||||
// Client never contacted destination. Let's restore everything back
|
||||
sp.ControllingClient.SendTeleportFailed("Problems connecting to destination.");
|
||||
|
||||
// Fail. Reset it back
|
||||
sp.IsChildAgent = false;
|
||||
|
||||
ResetFromTransit(sp.UUID);
|
||||
|
||||
// Yikes! We should just have a ref to scene here.
|
||||
//sp.Scene.InformClientOfNeighbours(sp);
|
||||
EnableChildAgents(sp);
|
||||
|
||||
// Finally, kill the agent we just created at the destination.
|
||||
m_aScene.SimulationService.CloseAgent(finalDestination, sp.UUID);
|
||||
|
||||
Fail(sp, finalDestination);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -475,6 +466,22 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
|||
}
|
||||
}
|
||||
|
||||
private void Fail(ScenePresence sp, GridRegion finalDestination)
|
||||
{
|
||||
// Client never contacted destination. Let's restore everything back
|
||||
sp.ControllingClient.SendTeleportFailed("Problems connecting to destination.");
|
||||
|
||||
// Fail. Reset it back
|
||||
sp.IsChildAgent = false;
|
||||
|
||||
ResetFromTransit(sp.UUID);
|
||||
|
||||
EnableChildAgents(sp);
|
||||
|
||||
// Finally, kill the agent we just created at the destination.
|
||||
m_aScene.SimulationService.CloseAgent(finalDestination, sp.UUID);
|
||||
|
||||
}
|
||||
|
||||
protected virtual bool CreateAgent(ScenePresence sp, GridRegion reg, GridRegion finalDestination, AgentCircuitData agentCircuit, uint teleportFlags, out string reason)
|
||||
{
|
||||
|
@ -813,7 +820,12 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
|||
cAgent.CallbackURI = "http://" + m_scene.RegionInfo.ExternalHostName + ":" + m_scene.RegionInfo.HttpPort +
|
||||
"/agent/" + agent.UUID.ToString() + "/" + m_scene.RegionInfo.RegionID.ToString() + "/release/";
|
||||
|
||||
m_scene.SimulationService.UpdateAgent(neighbourRegion, cAgent);
|
||||
if (!m_scene.SimulationService.UpdateAgent(neighbourRegion, cAgent))
|
||||
{
|
||||
// region doesn't take it
|
||||
ResetFromTransit(agent.UUID);
|
||||
return agent;
|
||||
}
|
||||
|
||||
// Next, let's close the child agent connections that are too far away.
|
||||
agent.CloseChildAgents(neighbourx, neighboury);
|
||||
|
@ -914,12 +926,40 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
|||
/// </summary>
|
||||
public void EnableChildAgent(ScenePresence sp, GridRegion region)
|
||||
{
|
||||
m_log.DebugFormat("[ENTITY TRANSFER]: Enabling child agent in new neighour {0}", region.RegionName);
|
||||
|
||||
AgentCircuitData currentAgentCircuit = sp.Scene.AuthenticateHandler.GetAgentCircuitData(sp.ControllingClient.CircuitCode);
|
||||
AgentCircuitData agent = sp.ControllingClient.RequestClientInfo();
|
||||
agent.BaseFolder = UUID.Zero;
|
||||
agent.InventoryFolder = UUID.Zero;
|
||||
agent.startpos = new Vector3(128, 128, 70);
|
||||
agent.child = true;
|
||||
agent.Appearance = sp.Appearance;
|
||||
agent.CapsPath = CapsUtil.GetRandomCapsObjectPath();
|
||||
|
||||
agent.ChildrenCapSeeds = new Dictionary<ulong, string>(sp.Scene.CapsModule.GetChildrenSeeds(sp.UUID));
|
||||
m_log.DebugFormat("[XXX] Seeds 1 {0}", agent.ChildrenCapSeeds.Count);
|
||||
|
||||
if (!agent.ChildrenCapSeeds.ContainsKey(sp.Scene.RegionInfo.RegionHandle))
|
||||
agent.ChildrenCapSeeds.Add(sp.Scene.RegionInfo.RegionHandle, sp.ControllingClient.RequestClientInfo().CapsPath);
|
||||
m_log.DebugFormat("[XXX] Seeds 2 {0}", agent.ChildrenCapSeeds.Count);
|
||||
|
||||
sp.AddNeighbourRegion(region.RegionHandle, agent.CapsPath);
|
||||
foreach (ulong h in agent.ChildrenCapSeeds.Keys)
|
||||
m_log.DebugFormat("[XXX] --> {0}", h);
|
||||
m_log.DebugFormat("[XXX] Adding {0}", region.RegionHandle);
|
||||
agent.ChildrenCapSeeds.Add(region.RegionHandle, agent.CapsPath);
|
||||
|
||||
if (sp.Scene.CapsModule != null)
|
||||
{
|
||||
sp.Scene.CapsModule.SetChildrenSeed(sp.UUID, agent.ChildrenCapSeeds);
|
||||
}
|
||||
|
||||
if (currentAgentCircuit != null)
|
||||
{
|
||||
agent.ServiceURLs = currentAgentCircuit.ServiceURLs;
|
||||
agent.Viewer = currentAgentCircuit.Viewer;
|
||||
}
|
||||
|
||||
IPEndPoint external = region.ExternalEndPoint;
|
||||
if (external != null)
|
||||
|
|
|
@ -123,17 +123,14 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsIn.Neighbour
|
|||
|
||||
public GridRegion HelloNeighbour(ulong regionHandle, RegionInfo thisRegion)
|
||||
{
|
||||
m_log.DebugFormat("[NEIGHBOUR IN CONNECTOR]: HelloNeighbour from {0}, to {1}. Count = {2}",
|
||||
thisRegion.RegionName, regionHandle, m_Scenes.Count);
|
||||
foreach (Scene s in m_Scenes)
|
||||
{
|
||||
if (s.RegionInfo.RegionHandle == regionHandle)
|
||||
{
|
||||
m_log.Debug("[NEIGHBOUR IN CONNECTOR]: Found region to SendHelloNeighbour");
|
||||
//m_log.DebugFormat("[NEIGHBOUR IN CONNECTOR]: HelloNeighbour from {0} to {1}", thisRegion.RegionName, s.RegionInfo.RegionName);
|
||||
return s.IncomingHelloNeighbour(thisRegion);
|
||||
}
|
||||
}
|
||||
m_log.DebugFormat("[NEIGHBOUR IN CONNECTOR]: region handle {0} not found", regionHandle);
|
||||
return null;
|
||||
}
|
||||
|
||||
|
|
|
@ -181,22 +181,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid
|
|||
|
||||
public List<GridRegion> GetNeighbours(UUID scopeID, UUID regionID)
|
||||
{
|
||||
if (m_LocalCache.ContainsKey(regionID))
|
||||
{
|
||||
List<GridRegion> neighbours = m_LocalCache[regionID].GetNeighbours();
|
||||
if (neighbours.Count == 0)
|
||||
// try the DB
|
||||
neighbours = m_GridService.GetNeighbours(scopeID, regionID);
|
||||
return neighbours;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_log.WarnFormat("[LOCAL GRID CONNECTOR]: GetNeighbours: Requested region {0} is not on this sim", regionID);
|
||||
return new List<GridRegion>();
|
||||
}
|
||||
|
||||
// Don't go to the DB
|
||||
//return m_GridService.GetNeighbours(scopeID, regionID);
|
||||
return m_GridService.GetNeighbours(scopeID, regionID);
|
||||
}
|
||||
|
||||
public GridRegion GetRegionByUUID(UUID scopeID, UUID regionID)
|
||||
|
|
|
@ -153,12 +153,9 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid
|
|||
return false;
|
||||
}
|
||||
|
||||
// Let's override GetNeighbours completely -- never go to the grid server
|
||||
// Neighbours are/should be cached locally
|
||||
// For retrieval from the DB, caller should call GetRegionByPosition
|
||||
public override List<GridRegion> GetNeighbours(UUID scopeID, UUID regionID)
|
||||
{
|
||||
return m_LocalGridService.GetNeighbours(scopeID, regionID);
|
||||
return base.GetNeighbours(scopeID, regionID);
|
||||
}
|
||||
|
||||
public override GridRegion GetRegionByUUID(UUID scopeID, UUID regionID)
|
||||
|
|
|
@ -121,17 +121,17 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Neighbour
|
|||
|
||||
public GridRegion HelloNeighbour(ulong regionHandle, RegionInfo thisRegion)
|
||||
{
|
||||
m_log.DebugFormat("[NEIGHBOUR CONNECTOR]: HelloNeighbour from {0}, to {1}. Count = {2}",
|
||||
thisRegion.RegionName, regionHandle, m_Scenes.Count);
|
||||
m_log.DebugFormat("[NEIGHBOUR CONNECTOR]: HelloNeighbour from {0}, to {1}.",
|
||||
thisRegion.RegionName, regionHandle);
|
||||
foreach (Scene s in m_Scenes)
|
||||
{
|
||||
if (s.RegionInfo.RegionHandle == regionHandle)
|
||||
{
|
||||
m_log.Debug("[NEIGHBOUR CONNECTOR]: Found region to SendHelloNeighbour");
|
||||
//m_log.Debug("[NEIGHBOUR CONNECTOR]: Found region to SendHelloNeighbour");
|
||||
return s.IncomingHelloNeighbour(thisRegion);
|
||||
}
|
||||
}
|
||||
m_log.DebugFormat("[NEIGHBOUR CONNECTOR]: region handle {0} not found", regionHandle);
|
||||
//m_log.DebugFormat("[NEIGHBOUR CONNECTOR]: region handle {0} not found", regionHandle);
|
||||
return null;
|
||||
}
|
||||
|
||||
|
|
|
@ -181,7 +181,6 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation
|
|||
// else do the remote thing
|
||||
if (!m_localBackend.IsLocalRegion(destination.RegionHandle))
|
||||
{
|
||||
//m_regionClient.SendUserInformation(regInfo, aCircuit);
|
||||
return m_remoteConnector.CreateAgent(destination, aCircuit, teleportFlags, out reason);
|
||||
}
|
||||
return false;
|
||||
|
|
|
@ -964,12 +964,6 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
// Let the grid service module know, so this can be cached
|
||||
m_eventManager.TriggerOnRegionUp(otherRegion);
|
||||
|
||||
RegionInfo regInfo = new RegionInfo(xcell, ycell, otherRegion.InternalEndPoint, otherRegion.ExternalHostName);
|
||||
regInfo.RegionID = otherRegion.RegionID;
|
||||
regInfo.RegionName = otherRegion.RegionName;
|
||||
regInfo.ScopeID = otherRegion.ScopeID;
|
||||
regInfo.ExternalHostName = otherRegion.ExternalHostName;
|
||||
GridRegion r = new GridRegion(regInfo);
|
||||
try
|
||||
{
|
||||
ForEachScenePresence(delegate(ScenePresence agent)
|
||||
|
@ -984,7 +978,7 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
old.Add(otherRegion.RegionHandle);
|
||||
agent.DropOldNeighbours(old);
|
||||
if (m_teleportModule != null)
|
||||
m_teleportModule.EnableChildAgent(agent, r);
|
||||
m_teleportModule.EnableChildAgent(agent, otherRegion);
|
||||
}
|
||||
}
|
||||
);
|
||||
|
@ -1368,6 +1362,8 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
m_regInfo.EstateSettings.EstateOwner = account.PrincipalID;
|
||||
m_regInfo.EstateSettings.Save();
|
||||
}
|
||||
else
|
||||
m_log.ErrorFormat("[SCENE]: Unable to store account. If this simulator is connected to a grid,\n you must create the estate owner account first.");
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -1546,6 +1542,7 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
{
|
||||
m_log.DebugFormat("[REGION]: Enabling logins for {0}", RegionInfo.RegionName);
|
||||
LoginsDisabled = false;
|
||||
m_sceneGridService.InformNeighborsThatRegionisUp(RequestModuleInterface<INeighbourService>(), RegionInfo);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1830,6 +1827,8 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
{
|
||||
RegisterCommsEvents();
|
||||
|
||||
m_sceneGridService.SetScene(this);
|
||||
|
||||
// These two 'commands' *must be* next to each other or sim rebooting fails.
|
||||
//m_sceneGridService.RegisterRegion(m_interregionCommsOut, RegionInfo);
|
||||
|
||||
|
@ -1840,24 +1839,6 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
throw new Exception(error);
|
||||
}
|
||||
|
||||
m_sceneGridService.SetScene(this);
|
||||
m_sceneGridService.InformNeighborsThatRegionisUp(RequestModuleInterface<INeighbourService>(), RegionInfo);
|
||||
|
||||
//Dictionary<string, string> dGridSettings = m_sceneGridService.GetGridSettings();
|
||||
|
||||
//if (dGridSettings.ContainsKey("allow_forceful_banlines"))
|
||||
//{
|
||||
// if (dGridSettings["allow_forceful_banlines"] != "TRUE")
|
||||
// {
|
||||
// m_log.Info("[GRID]: Grid is disabling forceful parcel banlists");
|
||||
// EventManager.TriggerSetAllowForcefulBan(false);
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// m_log.Info("[GRID]: Grid is allowing forceful parcel banlists");
|
||||
// EventManager.TriggerSetAllowForcefulBan(true);
|
||||
// }
|
||||
//}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -3944,6 +3925,8 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
m_log.DebugFormat(
|
||||
"[SCENE]: Incoming child agent update for {0} in {1}", cAgentData.AgentID, RegionInfo.RegionName);
|
||||
|
||||
// XPTO: if this agent is not allowed here as root, always return false
|
||||
|
||||
// We have to wait until the viewer contacts this region after receiving EAC.
|
||||
// That calls AddNewClient, which finally creates the ScenePresence
|
||||
ScenePresence childAgentUpdate = WaitGetScenePresence(cAgentData.AgentID);
|
||||
|
|
|
@ -182,23 +182,16 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
{
|
||||
//m_log.Info("[INTER]: " + debugRegionName + ": SceneCommunicationService: Sending InterRegion Notification that region is up " + region.RegionName);
|
||||
|
||||
for (int x = (int)region.RegionLocX - 1; x <= region.RegionLocX + 1; x++)
|
||||
List<GridRegion> neighbours = m_scene.GridService.GetNeighbours(m_scene.RegionInfo.ScopeID, m_scene.RegionInfo.RegionID);
|
||||
m_log.DebugFormat("[INTERGRID]: Informing {0} neighbours that this region is up", neighbours.Count);
|
||||
foreach (GridRegion n in neighbours)
|
||||
{
|
||||
for (int y = (int)region.RegionLocY - 1; y <= region.RegionLocY + 1; y++)
|
||||
{
|
||||
if (!((x == region.RegionLocX) && (y == region.RegionLocY))) // skip this region
|
||||
{
|
||||
ulong handle = Utils.UIntsToLong((uint)x * Constants.RegionSize, (uint)y * Constants.RegionSize);
|
||||
InformNeighbourThatRegionUpDelegate d = InformNeighboursThatRegionIsUpAsync;
|
||||
|
||||
d.BeginInvoke(neighbourService, region, handle,
|
||||
d.BeginInvoke(neighbourService, region, n.RegionHandle,
|
||||
InformNeighborsThatRegionisUpCompleted,
|
||||
d);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public delegate void SendChildAgentDataUpdateDelegate(AgentPosition cAgentData, ulong regionHandle);
|
||||
|
||||
|
|
|
@ -3390,6 +3390,7 @@ Console.WriteLine("Scripted Sit ofset {0}", m_pos);
|
|||
{
|
||||
if (cAgent.Attachments != null)
|
||||
{
|
||||
m_appearance.ClearAttachments();
|
||||
foreach (AttachmentData att in cAgent.Attachments)
|
||||
{
|
||||
m_appearance.SetAttachment(att.AttachPoint, att.ItemID, att.AssetID);
|
||||
|
|
|
@ -502,25 +502,33 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
|||
return remainder;
|
||||
}
|
||||
|
||||
// Old implementation of llRot2Euler, now normalized
|
||||
|
||||
public LSL_Vector llRot2Euler(LSL_Rotation r)
|
||||
public LSL_Vector llRot2Euler(LSL_Rotation q1)
|
||||
{
|
||||
m_host.AddScriptLPS(1);
|
||||
//This implementation is from http://lslwiki.net/lslwiki/wakka.php?wakka=LibraryRotationFunctions. ckrinke
|
||||
LSL_Rotation t = new LSL_Rotation(r.x * r.x, r.y * r.y, r.z * r.z, r.s * r.s);
|
||||
double m = (t.x + t.y + t.z + t.s);
|
||||
if (m == 0) return new LSL_Vector();
|
||||
double n = 2 * (r.y * r.s + r.x * r.z);
|
||||
double p = m * m - n * n;
|
||||
if (p > 0)
|
||||
return new LSL_Vector(NormalizeAngle(Math.Atan2(2.0 * (r.x * r.s - r.y * r.z), (-t.x - t.y + t.z + t.s))),
|
||||
NormalizeAngle(Math.Atan2(n, Math.Sqrt(p))),
|
||||
NormalizeAngle(Math.Atan2(2.0 * (r.z * r.s - r.x * r.y), (t.x - t.y - t.z + t.s))));
|
||||
else if (n > 0)
|
||||
return new LSL_Vector(0.0, Math.PI * 0.5, NormalizeAngle(Math.Atan2((r.z * r.s + r.x * r.y), 0.5 - t.x - t.z)));
|
||||
else
|
||||
return new LSL_Vector(0.0, -Math.PI * 0.5, NormalizeAngle(Math.Atan2((r.z * r.s + r.x * r.y), 0.5 - t.x - t.z)));
|
||||
LSL_Vector eul = new LSL_Vector();
|
||||
|
||||
double sqw = q1.s*q1.s;
|
||||
double sqx = q1.x*q1.x;
|
||||
double sqy = q1.z*q1.z;
|
||||
double sqz = q1.y*q1.y;
|
||||
double unit = sqx + sqy + sqz + sqw; // if normalised is one, otherwise is correction factor
|
||||
double test = q1.x*q1.z + q1.y*q1.s;
|
||||
if (test > 0.4999*unit) { // singularity at north pole
|
||||
eul.z = 2 * Math.Atan2(q1.x,q1.s);
|
||||
eul.y = Math.PI/2;
|
||||
eul.x = 0;
|
||||
return eul;
|
||||
}
|
||||
if (test < -0.4999*unit) { // singularity at south pole
|
||||
eul.z = -2 * Math.Atan2(q1.x,q1.s);
|
||||
eul.y = -Math.PI/2;
|
||||
eul.x = 0;
|
||||
return eul;
|
||||
}
|
||||
eul.z = Math.Atan2(2*q1.z*q1.s-2*q1.x*q1.y , sqx - sqy - sqz + sqw);
|
||||
eul.y = Math.Asin(2*test/unit);
|
||||
eul.x = Math.Atan2(2*q1.x*q1.s-2*q1.z*q1.y , -sqx + sqy - sqz + sqw);
|
||||
return eul;
|
||||
}
|
||||
|
||||
/* From wiki:
|
||||
|
@ -3065,9 +3073,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
|||
{
|
||||
m_host.AddScriptLPS(1);
|
||||
|
||||
if (m_host.ParentGroup.RootPart.AttachmentPoint == 0)
|
||||
return;
|
||||
|
||||
TaskInventoryItem item;
|
||||
|
||||
m_host.TaskInventory.LockItemsForRead(true);
|
||||
|
@ -3093,12 +3098,17 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
|||
|
||||
ScenePresence presence = World.GetScenePresence(m_host.OwnerID);
|
||||
|
||||
/*
|
||||
IAttachmentsModule attachmentsModule = m_ScriptEngine.World.AttachmentsModule;
|
||||
if (attachmentsModule != null)
|
||||
{
|
||||
attachmentsModule.AttachObject(
|
||||
presence.ControllingClient, grp.LocalId,
|
||||
(uint)attachment, Quaternion.Identity, Vector3.Zero, false);
|
||||
}
|
||||
*/
|
||||
grp.AttachToAgent(m_host.OwnerID, (uint)attachment, Vector3.Zero, false);
|
||||
}
|
||||
}
|
||||
|
||||
public void llDetachFromAvatar()
|
||||
|
@ -9470,7 +9480,18 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
|||
{
|
||||
m_host.AddScriptLPS(1);
|
||||
DetectParams detectedParams = m_ScriptEngine.GetDetectParams(m_itemID, 0);
|
||||
if (detectedParams == null) return; // only works on the first detected avatar
|
||||
if (detectedParams == null)
|
||||
{
|
||||
if (m_host.IsAttachment == true)
|
||||
{
|
||||
detectedParams = new DetectParams();
|
||||
detectedParams.Key = m_host.OwnerID;
|
||||
}
|
||||
else
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
ScenePresence avatar = World.GetScenePresence(detectedParams.Key);
|
||||
if (avatar != null)
|
||||
|
@ -9479,6 +9500,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
|||
new Vector3((float)pos.x, (float)pos.y, (float)pos.z),
|
||||
new Vector3((float)lookAt.x, (float)lookAt.y, (float)lookAt.z));
|
||||
}
|
||||
|
||||
ScriptSleep(1000);
|
||||
}
|
||||
|
||||
|
|
|
@ -2221,15 +2221,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
|||
if (avatar != null && avatar.UUID != m_host.OwnerID)
|
||||
{
|
||||
if (avatar.IsChildAgent == false)
|
||||
{
|
||||
if (avatar.PhysicsActor != null && avatar.PhysicsActor.Position != null)
|
||||
{
|
||||
result.Add(avatar.UUID);
|
||||
result.Add(avatar.PhysicsActor.Position);
|
||||
result.Add(avatar.AbsolutePosition);
|
||||
result.Add(avatar.Name);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
return result;
|
||||
}
|
||||
|
|
|
@ -210,9 +210,6 @@ namespace OpenSim.Services.Connectors
|
|||
GridRegion rinfo = new GridRegion((Dictionary<string, object>)r);
|
||||
rinfos.Add(rinfo);
|
||||
}
|
||||
else
|
||||
m_log.DebugFormat("[GRID CONNECTOR]: GetNeighbours {0}, {1} received invalid response type {2}",
|
||||
scopeID, regionID, r.GetType());
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -299,9 +296,9 @@ namespace OpenSim.Services.Connectors
|
|||
{
|
||||
if (replyData["result"] is Dictionary<string, object>)
|
||||
rinfo = new GridRegion((Dictionary<string, object>)replyData["result"]);
|
||||
else
|
||||
m_log.DebugFormat("[GRID CONNECTOR]: GetRegionByPosition {0}, {1}-{2} received no region",
|
||||
scopeID, x, y);
|
||||
//else
|
||||
// m_log.DebugFormat("[GRID CONNECTOR]: GetRegionByPosition {0}, {1}-{2} received no region",
|
||||
// scopeID, x, y);
|
||||
}
|
||||
else
|
||||
m_log.DebugFormat("[GRID CONNECTOR]: GetRegionByPosition {0}, {1}-{2} received null response",
|
||||
|
|
|
@ -114,10 +114,9 @@ namespace OpenSim.Services.Connectors.SimianGrid
|
|||
{
|
||||
if (identity["Type"].AsString() == "md5hash")
|
||||
{
|
||||
string credential = identity["Credential"].AsString();
|
||||
|
||||
if (password == credential || "$1$" + password == credential || "$1$" + Utils.MD5String(password) == credential || Utils.MD5String(password) == credential)
|
||||
return Authorize(principalID);
|
||||
string authorizeResult;
|
||||
if (CheckPassword(principalID, password, identity["Credential"].AsString(), out authorizeResult))
|
||||
return authorizeResult;
|
||||
|
||||
md5hashFound = true;
|
||||
break;
|
||||
|
@ -125,9 +124,7 @@ namespace OpenSim.Services.Connectors.SimianGrid
|
|||
}
|
||||
}
|
||||
|
||||
if (md5hashFound)
|
||||
m_log.Warn("[SIMIAN AUTH CONNECTOR]: Authentication failed for " + principalID + " using md5hash $1$" + Utils.MD5String(password));
|
||||
else
|
||||
if (!md5hashFound)
|
||||
m_log.Warn("[SIMIAN AUTH CONNECTOR]: Authentication failed for " + principalID + ", no md5hash identity found");
|
||||
}
|
||||
else
|
||||
|
@ -228,6 +225,48 @@ namespace OpenSim.Services.Connectors.SimianGrid
|
|||
return false;
|
||||
}
|
||||
|
||||
private bool CheckPassword(UUID userID, string password, string simianGridCredential, out string authorizeResult)
|
||||
{
|
||||
if (simianGridCredential.Contains(":"))
|
||||
{
|
||||
// Salted version
|
||||
int idx = simianGridCredential.IndexOf(':');
|
||||
string finalhash = simianGridCredential.Substring(0, idx);
|
||||
string salt = simianGridCredential.Substring(idx + 1);
|
||||
|
||||
if (finalhash == Utils.MD5String(password + ":" + salt))
|
||||
{
|
||||
authorizeResult = Authorize(userID);
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_log.Warn("[SIMIAN AUTH CONNECTOR]: Authentication failed for " + userID +
|
||||
" using md5hash " + Utils.MD5String(password) + ":" + salt);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// Unsalted version
|
||||
if (password == simianGridCredential ||
|
||||
"$1$" + password == simianGridCredential ||
|
||||
"$1$" + Utils.MD5String(password) == simianGridCredential ||
|
||||
Utils.MD5String(password) == simianGridCredential)
|
||||
{
|
||||
authorizeResult = Authorize(userID);
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_log.Warn("[SIMIAN AUTH CONNECTOR]: Authentication failed for " + userID +
|
||||
" using md5hash $1$" + Utils.MD5String(password));
|
||||
}
|
||||
}
|
||||
|
||||
authorizeResult = null;
|
||||
return false;
|
||||
}
|
||||
|
||||
private string Authorize(UUID userID)
|
||||
{
|
||||
NameValueCollection requestArgs = new NameValueCollection
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/*
|
||||
/*
|
||||
* Copyright (c) Contributors, http://opensimulator.org/
|
||||
* See CONTRIBUTORS.TXT for a full list of copyright holders.
|
||||
*
|
||||
|
|
|
@ -483,7 +483,7 @@ namespace OpenSim.Services.Connectors.Simulation
|
|||
}
|
||||
catch (WebException ex)
|
||||
{
|
||||
m_log.InfoFormat("[REMOTE SIMULATION CONNECTOR]: exception on reply of agent delete {0}", ex.Message);
|
||||
m_log.InfoFormat("[REMOTE SIMULATION CONNECTOR]: exception on reply of agent delete from {0}: {1}", destination.RegionName, ex.Message);
|
||||
return false;
|
||||
}
|
||||
finally
|
||||
|
|
|
@ -273,14 +273,15 @@ namespace OpenSim.Services.GridService
|
|||
if (region != null)
|
||||
{
|
||||
// Not really? Maybe?
|
||||
List<RegionData> rdatas = m_Database.Get(region.posX - (int)Constants.RegionSize, region.posY - (int)Constants.RegionSize,
|
||||
region.posX + (int)Constants.RegionSize, region.posY + (int)Constants.RegionSize, scopeID);
|
||||
List<RegionData> rdatas = m_Database.Get(region.posX - (int)Constants.RegionSize - 1, region.posY - (int)Constants.RegionSize - 1,
|
||||
region.posX + (int)Constants.RegionSize + 1, region.posY + (int)Constants.RegionSize + 1, scopeID);
|
||||
|
||||
foreach (RegionData rdata in rdatas)
|
||||
if (rdata.RegionID != regionID)
|
||||
rinfos.Add(RegionData2RegionInfo(rdata));
|
||||
|
||||
}
|
||||
m_log.DebugFormat("[GRID SERVICE]: region {0} has {1} neighours", region.RegionName, rinfos.Count);
|
||||
return rinfos;
|
||||
}
|
||||
|
||||
|
|
|
@ -29,6 +29,8 @@ using System;
|
|||
using System.Collections.Generic;
|
||||
using OpenMetaverse;
|
||||
|
||||
using OpenSim.Framework;
|
||||
|
||||
namespace OpenSim.Services.Interfaces
|
||||
{
|
||||
public class UserAccount
|
||||
|
@ -50,7 +52,7 @@ namespace OpenSim.Services.Interfaces
|
|||
LastName = lastName;
|
||||
Email = email;
|
||||
ServiceURLs = new Dictionary<string, object>();
|
||||
// Created = ???
|
||||
Created = Util.UnixTimeSinceEpoch();
|
||||
}
|
||||
|
||||
public string FirstName;
|
||||
|
|
|
@ -357,7 +357,7 @@ namespace OpenSim.Services.UserAccountService
|
|||
/// <param name="lastName"></param>
|
||||
/// <param name="password"></param>
|
||||
/// <param name="email"></param>
|
||||
public void CreateUser(string firstName, string lastName, string password, string email)
|
||||
private void CreateUser(string firstName, string lastName, string password, string email)
|
||||
{
|
||||
UserAccount account = GetUserAccount(UUID.Zero, firstName, lastName);
|
||||
if (null == account)
|
||||
|
@ -374,12 +374,14 @@ namespace OpenSim.Services.UserAccountService
|
|||
|
||||
if (StoreUserAccount(account))
|
||||
{
|
||||
bool success = false;
|
||||
bool success;
|
||||
if (m_AuthenticationService != null)
|
||||
{
|
||||
success = m_AuthenticationService.SetPassword(account.PrincipalID, password);
|
||||
if (!success)
|
||||
m_log.WarnFormat("[USER ACCOUNT SERVICE]: Unable to set password for account {0} {1}.",
|
||||
firstName, lastName);
|
||||
}
|
||||
|
||||
GridRegion home = null;
|
||||
if (m_GridService != null)
|
||||
|
@ -399,12 +401,16 @@ namespace OpenSim.Services.UserAccountService
|
|||
firstName, lastName);
|
||||
|
||||
if (m_InventoryService != null)
|
||||
{
|
||||
success = m_InventoryService.CreateUserInventory(account.PrincipalID);
|
||||
if (!success)
|
||||
m_log.WarnFormat("[USER ACCOUNT SERVICE]: Unable to create inventory for account {0} {1}.",
|
||||
firstName, lastName);
|
||||
}
|
||||
|
||||
m_log.InfoFormat("[USER ACCOUNT SERVICE]: Account {0} {1} created successfully", firstName, lastName);
|
||||
} else {
|
||||
m_log.ErrorFormat("[USER ACCOUNT SERVICE]: Account creation failed for account {0} {1}", firstName, lastName);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
|
|
@ -126,7 +126,7 @@
|
|||
; -->>> There are multiple connection strings defined in several places. Check it carefully!
|
||||
;
|
||||
; storage_plugin="OpenSim.Data.MySQL.dll"
|
||||
; storage_connection_string="Data Source=localhost;Database=opensim;User ID=opensim;Password=*****;";
|
||||
; storage_connection_string="Data Source=localhost;Database=opensim;User ID=opensim;Password=*****;Old Guids=true;";
|
||||
; If you want to use a different database/server for estate data, then
|
||||
; uncomment and change this connect string. Defaults to the above if not set
|
||||
; estate_connection_string="Data Source=localhost;Database=opensim;User ID=opensim;Password=*****;";
|
||||
|
|
|
@ -5,13 +5,13 @@
|
|||
|
||||
;; HG1.5 handlers are: OpenSim.Server.Handlers.dll:GatekeeperService
|
||||
;; OpenSim.Server.Handlers.dll:UserAgentService
|
||||
;; OpenSim.Server.Handlers.dll:HGInventoryServiceInConnector
|
||||
;; An additional OpenSim.Server.Handlers.dll:AssetServiceConnector is started
|
||||
;; in port 8002, outside the firewall
|
||||
;; Additional OpenSim.Server.Handlers.dll:AssetServiceConnector and
|
||||
;; OpenSim.Server.Handlers.dll:XInventoryInConnector
|
||||
;; are started in port 8002, outside the firewall
|
||||
;;
|
||||
|
||||
[Startup]
|
||||
ServiceConnectors = "8003/OpenSim.Server.Handlers.dll:AssetServiceConnector,8003/OpenSim.Server.Handlers.dll:XInventoryServiceInConnector,8002/OpenSim.Server.Handlers.dll:FreeswitchServerConnector,8003/OpenSim.Server.Handlers.dll:GridServiceConnector,8003/OpenSim.Server.Handlers.dll:GridInfoServerInConnector,8003/OpenSim.Server.Handlers.dll:AuthenticationServiceConnector,8002/OpenSim.Server.Handlers.dll:OpenIdServerConnector,8003/OpenSim.Server.Handlers.dll:AvatarServiceConnector,8002/OpenSim.Server.Handlers.dll:LLLoginServiceInConnector,8003/OpenSim.Server.Handlers.dll:PresenceServiceConnector,8003/OpenSim.Server.Handlers.dll:UserAccountServiceConnector,8003/OpenSim.Server.Handlers.dll:GridUserServiceConnector,8003/OpenSim.Server.Handlers.dll:FriendsServiceConnector,8002/OpenSim.Server.Handlers.dll:GatekeeperServiceInConnector,8002/OpenSim.Server.Handlers.dll:UserAgentServerConnector,HGInventoryService@8002/OpenSim.Server.Handlers.dll:XInventoryInConnector,8002/OpenSim.Server.Handlers.dll:AssetServiceConnector"
|
||||
ServiceConnectors = "8003/OpenSim.Server.Handlers.dll:AssetServiceConnector,8003/OpenSim.Server.Handlers.dll:XInventoryInConnector,8002/OpenSim.Server.Handlers.dll:FreeswitchServerConnector,8003/OpenSim.Server.Handlers.dll:GridServiceConnector,8003/OpenSim.Server.Handlers.dll:GridInfoServerInConnector,8003/OpenSim.Server.Handlers.dll:AuthenticationServiceConnector,8002/OpenSim.Server.Handlers.dll:OpenIdServerConnector,8003/OpenSim.Server.Handlers.dll:AvatarServiceConnector,8002/OpenSim.Server.Handlers.dll:LLLoginServiceInConnector,8003/OpenSim.Server.Handlers.dll:PresenceServiceConnector,8003/OpenSim.Server.Handlers.dll:UserAccountServiceConnector,8003/OpenSim.Server.Handlers.dll:GridUserServiceConnector,8003/OpenSim.Server.Handlers.dll:FriendsServiceConnector,8002/OpenSim.Server.Handlers.dll:GatekeeperServiceInConnector,8002/OpenSim.Server.Handlers.dll:UserAgentServerConnector,HGInventoryService@8002/OpenSim.Server.Handlers.dll:XInventoryInConnector,8002/OpenSim.Server.Handlers.dll:AssetServiceConnector"
|
||||
|
||||
; * This is common for all services, it's the network setup for the entire
|
||||
; * server instance, if none if specified above
|
||||
|
@ -28,7 +28,7 @@ ServiceConnectors = "8003/OpenSim.Server.Handlers.dll:AssetServiceConnector,8003
|
|||
|
||||
[DatabaseService]
|
||||
StorageProvider = "OpenSim.Data.MySQL.dll"
|
||||
ConnectionString = "Data Source=localhost;Database=opensim;User ID=opensim;Password=opensim123;"
|
||||
ConnectionString = "Data Source=localhost;Database=opensim;User ID=opensim;Password=*****;Old Guids=true;"
|
||||
|
||||
; * As an example, the below configuration precisely mimicks the legacy
|
||||
; * asset server. It is read by the asset IN connector (defined above)
|
||||
|
|
|
@ -28,7 +28,7 @@ ServiceConnectors = "8003/OpenSim.Server.Handlers.dll:AssetServiceConnector,8003
|
|||
|
||||
[DatabaseService]
|
||||
StorageProvider = "OpenSim.Data.MySQL.dll"
|
||||
ConnectionString = "Data Source=localhost;Database=opensim;User ID=opensim;Password=opensim123;"
|
||||
ConnectionString = "Data Source=localhost;Database=opensim;User ID=opensim;Password=*****;Old Guids=true;"
|
||||
|
||||
|
||||
; * As an example, the below configuration precisely mimicks the legacy
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
; Uncomment these lines if you want to use mysql storage
|
||||
; Change the connection string to your db details
|
||||
;StorageProvider = "OpenSim.Data.MySQL.dll"
|
||||
;ConnectionString = "Data Source=localhost;Database=opensim;User ID=opensim;Password=***;"
|
||||
;ConnectionString = "Data Source=localhost;Database=opensim;User ID=opensim;Password=***;Old Guids=true;"
|
||||
|
||||
[AssetService]
|
||||
DefaultAssetLoader = "OpenSim.Framework.AssetLoader.Filesystem.dll"
|
||||
|
|
Loading…
Reference in New Issue