Merge branch '0.6.9-post-fixes' into careminster

avinationmerge
Melanie 2010-05-31 17:57:48 +01:00
commit 0526a91206
41 changed files with 6504 additions and 1211 deletions

View File

@ -20,6 +20,7 @@
<delete dir="${distbindir}/.nant"/> <delete dir="${distbindir}/.nant"/>
<delete> <delete>
<fileset basedir="${distbindir}"> <fileset basedir="${distbindir}">
<include name="BUILDING.txt"/>
<include name="Makefile"/> <include name="Makefile"/>
<include name="nant-color"/> <include name="nant-color"/>
<include name="OpenSim.*"/> <include name="OpenSim.*"/>
@ -141,6 +142,8 @@
</exec> </exec>
<fail message="Failures reported in unit tests." unless="${int::parse(testresult.opensim.data.mysql.tests)==0}" /> <fail message="Failures reported in unit tests." unless="${int::parse(testresult.opensim.data.mysql.tests)==0}" />
<delete dir="%temp%"/>
</target> </target>
<target name="test-cov" depends="build"> <target name="test-cov" depends="build">

View File

@ -164,6 +164,7 @@ This software uses components from the following developers:
* log4net (http://logging.apache.org/log4net/) * log4net (http://logging.apache.org/log4net/)
* GlynnTucker.Cache (http://gtcache.sourceforge.net/) * GlynnTucker.Cache (http://gtcache.sourceforge.net/)
* NDesk.Options 0.2.1 (http://www.ndesk.org/Options) * NDesk.Options 0.2.1 (http://www.ndesk.org/Options)
* Json.NET 3.5 Release 6. The binary used is actually Newtonsoft.Json.Net20.dll for Mono 2.4 compatability (http://james.newtonking.com/projects/json-net.aspx)
Some plugins are based on Cable Beach Some plugins are based on Cable Beach
Cable Beach is Copyright (c) 2008 Intel Corporation Cable Beach is Copyright (c) 2008 Intel Corporation

View File

@ -635,9 +635,9 @@ namespace OpenSim.Data.MSSQL
/// <param name="connection">connection to the database</param> /// <param name="connection">connection to the database</param>
private void DeleteItemsInFolder(UUID folderID, SqlConnection connection) private void DeleteItemsInFolder(UUID folderID, SqlConnection connection)
{ {
using (SqlCommand command = new SqlCommand("DELETE FROM inventoryitems WHERE folderID=@folderID", connection)) using (SqlCommand command = new SqlCommand("DELETE FROM inventoryitems WHERE parentFolderID=@parentFolderID", connection))
{ {
command.Parameters.Add(database.CreateParameter("folderID", folderID)); command.Parameters.Add(database.CreateParameter("parentFolderID", folderID));
try try
{ {

View File

@ -582,8 +582,21 @@ namespace OpenSim.Data.MSSQL
/// <param name="appearance">the appearence</param> /// <param name="appearance">the appearence</param>
override public void UpdateUserAppearance(UUID user, AvatarAppearance appearance) override public void UpdateUserAppearance(UUID user, AvatarAppearance appearance)
{ {
string sql = @"DELETE FROM avatarappearance WHERE owner=@owner; string sql = @"DELETE FROM avatarappearance WHERE owner=@owner";
INSERT INTO avatarappearance using (AutoClosingSqlCommand cmd = database.Query(sql))
{
cmd.Parameters.Add(database.CreateParameter("@owner", appearance.Owner));
try
{
cmd.ExecuteNonQuery();
}
catch (Exception e)
{
m_log.ErrorFormat("[USER DB] Error deleting old user appearance, error: {0}", e.Message);
}
}
sql=@"INSERT INTO avatarappearance
(owner, serial, visual_params, texture, avatar_height, (owner, serial, visual_params, texture, avatar_height,
body_item, body_asset, skin_item, skin_asset, hair_item, body_item, body_asset, skin_item, skin_asset, hair_item,
hair_asset, eyes_item, eyes_asset, shirt_item, shirt_asset, hair_asset, eyes_item, eyes_asset, shirt_item, shirt_asset,

View File

@ -25,13 +25,17 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/ */
using OpenSim.Framework.Servers.HttpServer;
using System.Collections.Generic; using System.Collections.Generic;
using System.Reflection;
using log4net;
using OpenSim.Framework.Servers.HttpServer;
namespace OpenSim.Framework namespace OpenSim.Framework
{ {
public class MainServer public class MainServer
{ {
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
private static BaseHttpServer instance = null; private static BaseHttpServer instance = null;
private static Dictionary<uint, BaseHttpServer> m_Servers = private static Dictionary<uint, BaseHttpServer> m_Servers =
new Dictionary<uint, BaseHttpServer>(); new Dictionary<uint, BaseHttpServer>();
@ -53,6 +57,8 @@ namespace OpenSim.Framework
return m_Servers[port]; return m_Servers[port];
m_Servers[port] = new BaseHttpServer(port); m_Servers[port] = new BaseHttpServer(port);
m_log.InfoFormat("[MAIN HTTP SERVER]: Starting main http server on port {0}", port);
m_Servers[port].Start(); m_Servers[port].Start();
return m_Servers[port]; return m_Servers[port];

282
OpenSim/Framework/SLUtil.cs Normal file
View File

@ -0,0 +1,282 @@
using System;
using System.Collections.Generic;
using OpenMetaverse;
namespace OpenSim.Framework
{
public static class SLUtil
{
#region SL / file extension / content-type conversions
public static string SLAssetTypeToContentType(int assetType)
{
switch ((AssetType)assetType)
{
case AssetType.Texture:
return "image/x-j2c";
case AssetType.Sound:
return "application/ogg";
case AssetType.CallingCard:
return "application/vnd.ll.callingcard";
case AssetType.Landmark:
return "application/vnd.ll.landmark";
case AssetType.Clothing:
return "application/vnd.ll.clothing";
case AssetType.Object:
return "application/vnd.ll.primitive";
case AssetType.Notecard:
return "application/vnd.ll.notecard";
case AssetType.Folder:
return "application/vnd.ll.folder";
case AssetType.RootFolder:
return "application/vnd.ll.rootfolder";
case AssetType.LSLText:
return "application/vnd.ll.lsltext";
case AssetType.LSLBytecode:
return "application/vnd.ll.lslbyte";
case AssetType.TextureTGA:
case AssetType.ImageTGA:
return "image/tga";
case AssetType.Bodypart:
return "application/vnd.ll.bodypart";
case AssetType.TrashFolder:
return "application/vnd.ll.trashfolder";
case AssetType.SnapshotFolder:
return "application/vnd.ll.snapshotfolder";
case AssetType.LostAndFoundFolder:
return "application/vnd.ll.lostandfoundfolder";
case AssetType.SoundWAV:
return "audio/x-wav";
case AssetType.ImageJPEG:
return "image/jpeg";
case AssetType.Animation:
return "application/vnd.ll.animation";
case AssetType.Gesture:
return "application/vnd.ll.gesture";
case AssetType.Simstate:
return "application/x-metaverse-simstate";
case AssetType.Unknown:
default:
return "application/octet-stream";
}
}
public static sbyte ContentTypeToSLAssetType(string contentType)
{
switch (contentType)
{
case "image/x-j2c":
case "image/jp2":
return (sbyte)AssetType.Texture;
case "application/ogg":
return (sbyte)AssetType.Sound;
case "application/vnd.ll.callingcard":
case "application/x-metaverse-callingcard":
return (sbyte)AssetType.CallingCard;
case "application/vnd.ll.landmark":
case "application/x-metaverse-landmark":
return (sbyte)AssetType.Landmark;
case "application/vnd.ll.clothing":
case "application/x-metaverse-clothing":
return (sbyte)AssetType.Clothing;
case "application/vnd.ll.primitive":
case "application/x-metaverse-primitive":
return (sbyte)AssetType.Object;
case "application/vnd.ll.notecard":
case "application/x-metaverse-notecard":
return (sbyte)AssetType.Notecard;
case "application/vnd.ll.folder":
return (sbyte)AssetType.Folder;
case "application/vnd.ll.rootfolder":
return (sbyte)AssetType.RootFolder;
case "application/vnd.ll.lsltext":
case "application/x-metaverse-lsl":
return (sbyte)AssetType.LSLText;
case "application/vnd.ll.lslbyte":
case "application/x-metaverse-lso":
return (sbyte)AssetType.LSLBytecode;
case "image/tga":
// Note that AssetType.TextureTGA will be converted to AssetType.ImageTGA
return (sbyte)AssetType.ImageTGA;
case "application/vnd.ll.bodypart":
case "application/x-metaverse-bodypart":
return (sbyte)AssetType.Bodypart;
case "application/vnd.ll.trashfolder":
return (sbyte)AssetType.TrashFolder;
case "application/vnd.ll.snapshotfolder":
return (sbyte)AssetType.SnapshotFolder;
case "application/vnd.ll.lostandfoundfolder":
return (sbyte)AssetType.LostAndFoundFolder;
case "audio/x-wav":
return (sbyte)AssetType.SoundWAV;
case "image/jpeg":
return (sbyte)AssetType.ImageJPEG;
case "application/vnd.ll.animation":
case "application/x-metaverse-animation":
return (sbyte)AssetType.Animation;
case "application/vnd.ll.gesture":
case "application/x-metaverse-gesture":
return (sbyte)AssetType.Gesture;
case "application/x-metaverse-simstate":
return (sbyte)AssetType.Simstate;
case "application/octet-stream":
default:
return (sbyte)AssetType.Unknown;
}
}
public static sbyte ContentTypeToSLInvType(string contentType)
{
switch (contentType)
{
case "image/x-j2c":
case "image/jp2":
case "image/tga":
case "image/jpeg":
return (sbyte)InventoryType.Texture;
case "application/ogg":
case "audio/x-wav":
return (sbyte)InventoryType.Sound;
case "application/vnd.ll.callingcard":
case "application/x-metaverse-callingcard":
return (sbyte)InventoryType.CallingCard;
case "application/vnd.ll.landmark":
case "application/x-metaverse-landmark":
return (sbyte)InventoryType.Landmark;
case "application/vnd.ll.clothing":
case "application/x-metaverse-clothing":
case "application/vnd.ll.bodypart":
case "application/x-metaverse-bodypart":
return (sbyte)InventoryType.Wearable;
case "application/vnd.ll.primitive":
case "application/x-metaverse-primitive":
return (sbyte)InventoryType.Object;
case "application/vnd.ll.notecard":
case "application/x-metaverse-notecard":
return (sbyte)InventoryType.Notecard;
case "application/vnd.ll.folder":
return (sbyte)InventoryType.Folder;
case "application/vnd.ll.rootfolder":
return (sbyte)InventoryType.RootCategory;
case "application/vnd.ll.lsltext":
case "application/x-metaverse-lsl":
case "application/vnd.ll.lslbyte":
case "application/x-metaverse-lso":
return (sbyte)InventoryType.LSL;
case "application/vnd.ll.trashfolder":
case "application/vnd.ll.snapshotfolder":
case "application/vnd.ll.lostandfoundfolder":
return (sbyte)InventoryType.Folder;
case "application/vnd.ll.animation":
case "application/x-metaverse-animation":
return (sbyte)InventoryType.Animation;
case "application/vnd.ll.gesture":
case "application/x-metaverse-gesture":
return (sbyte)InventoryType.Gesture;
case "application/x-metaverse-simstate":
return (sbyte)InventoryType.Snapshot;
case "application/octet-stream":
default:
return (sbyte)InventoryType.Unknown;
}
}
#endregion SL / file extension / content-type conversions
/// <summary>
/// Parse a notecard in Linden format to a string of ordinary text.
/// </summary>
/// <param name="rawInput"></param>
/// <returns></returns>
public static string ParseNotecardToString(string rawInput)
{
return string.Join("\n", ParseNotecardToList(rawInput).ToArray());
}
/// <summary>
/// Parse a notecard in Linden format to a list of ordinary lines.
/// </summary>
/// <param name="rawInput"></param>
/// <returns></returns>
public static List<string> ParseNotecardToList(string rawInput)
{
string[] input = rawInput.Replace("\r", "").Split('\n');
int idx = 0;
int level = 0;
List<string> output = new List<string>();
string[] words;
while (idx < input.Length)
{
if (input[idx] == "{")
{
level++;
idx++;
continue;
}
if (input[idx]== "}")
{
level--;
idx++;
continue;
}
switch (level)
{
case 0:
words = input[idx].Split(' '); // Linden text ver
// Notecards are created *really* empty. Treat that as "no text" (just like after saving an empty notecard)
if (words.Length < 3)
return output;
int version = int.Parse(words[3]);
if (version != 2)
return output;
break;
case 1:
words = input[idx].Split(' ');
if (words[0] == "LLEmbeddedItems")
break;
if (words[0] == "Text")
{
int len = int.Parse(words[2]);
idx++;
int count = -1;
while (count < len)
{
// int l = input[idx].Length;
string ln = input[idx];
int need = len-count-1;
if (ln.Length > need)
ln = ln.Substring(0, need);
output.Add(ln);
count += ln.Length + 1;
idx++;
}
return output;
}
break;
case 2:
words = input[idx].Split(' '); // count
if (words[0] == "count")
{
int c = int.Parse(words[1]);
if (c > 0)
return output;
break;
}
break;
}
idx++;
}
return output;
}
}
}

View File

@ -208,6 +208,8 @@ namespace OpenSim.Framework.Serialization
m_bw.Write(header); m_bw.Write(header);
// Write out data // Write out data
// An IOException occurs if we try to write out an empty array in Mono 2.6
if (data.Length > 0)
m_bw.Write(data); m_bw.Write(data);
if (data.Length % 512 != 0) if (data.Length % 512 != 0)

View File

@ -311,7 +311,7 @@ namespace OpenSim.Framework.Servers.HttpServer
} }
catch (Exception e) catch (Exception e)
{ {
m_log.ErrorFormat("[BASE HTTP SERVER]: OnRequest() failed with {0} {1}", e.Message, e.StackTrace); m_log.Error(string.Format("[BASE HTTP SERVER]: OnRequest() failed with "), e);
} }
} }
@ -1572,7 +1572,6 @@ namespace OpenSim.Framework.Servers.HttpServer
public void Start() public void Start()
{ {
m_log.Info("[BASE HTTP SERVER]: Starting up HTTP Server");
StartHTTP(); StartHTTP();
} }
@ -1580,7 +1579,6 @@ namespace OpenSim.Framework.Servers.HttpServer
{ {
try try
{ {
m_log.Debug("[BASE HTTP SERVER]: Spawned main thread OK");
//m_httpListener = new HttpListener(); //m_httpListener = new HttpListener();
NotSocketErrors = 0; NotSocketErrors = 0;
if (!m_ssl) if (!m_ssl)

View File

@ -30,7 +30,7 @@ namespace OpenSim
public class VersionInfo public class VersionInfo
{ {
private const string VERSION_NUMBER = "0.6.9CM"; private const string VERSION_NUMBER = "0.6.9CM";
private const Flavour VERSION_FLAVOUR = Flavour.Dev; private const Flavour VERSION_FLAVOUR = Flavour.Post_Fixes;
public enum Flavour public enum Flavour
{ {

View File

@ -164,12 +164,12 @@ namespace OpenSim
m_config.Source = new IniConfigSource(); m_config.Source = new IniConfigSource();
m_config.Source.Merge(DefaultConfig()); m_config.Source.Merge(DefaultConfig());
m_log.Info("[CONFIG] Reading configuration settings"); m_log.Info("[CONFIG]: Reading configuration settings");
if (sources.Count == 0) if (sources.Count == 0)
{ {
m_log.FatalFormat("[CONFIG] Could not load any configuration"); m_log.FatalFormat("[CONFIG]: Could not load any configuration");
m_log.FatalFormat("[CONFIG] Did you copy the OpenSim.ini.example file to OpenSim.ini?"); m_log.FatalFormat("[CONFIG]: Did you copy the OpenSim.ini.example file to OpenSim.ini?");
Environment.Exit(1); Environment.Exit(1);
} }
@ -182,8 +182,8 @@ namespace OpenSim
if (!iniFileExists) if (!iniFileExists)
{ {
m_log.FatalFormat("[CONFIG] Could not load any configuration"); m_log.FatalFormat("[CONFIG]: Could not load any configuration");
m_log.FatalFormat("[CONFIG] Configuration exists, but there was an error loading it!"); m_log.FatalFormat("[CONFIG]: Configuration exists, but there was an error loading it!");
Environment.Exit(1); Environment.Exit(1);
} }
@ -257,20 +257,17 @@ namespace OpenSim
if (!IsUri(iniPath)) if (!IsUri(iniPath))
{ {
m_log.InfoFormat("[CONFIG] Reading configuration file {0}", m_log.InfoFormat("[CONFIG]: Reading configuration file {0}", Path.GetFullPath(iniPath));
Path.GetFullPath(iniPath));
m_config.Source.Merge(new IniConfigSource(iniPath)); m_config.Source.Merge(new IniConfigSource(iniPath));
success = true; success = true;
} }
else else
{ {
m_log.InfoFormat("[CONFIG] {0} is a http:// URI, fetching ...", m_log.InfoFormat("[CONFIG]: {0} is a http:// URI, fetching ...", iniPath);
iniPath);
// The ini file path is a http URI // The ini file path is a http URI
// Try to read it // Try to read it
//
try try
{ {
XmlReader r = XmlReader.Create(iniPath); XmlReader r = XmlReader.Create(iniPath);
@ -281,7 +278,7 @@ namespace OpenSim
} }
catch (Exception e) catch (Exception e)
{ {
m_log.FatalFormat("[CONFIG] Exception reading config from URI {0}\n" + e.ToString(), iniPath); m_log.FatalFormat("[CONFIG]: Exception reading config from URI {0}\n" + e.ToString(), iniPath);
Environment.Exit(1); Environment.Exit(1);
} }
} }

View File

@ -348,6 +348,23 @@ namespace OpenSim.Region.ClientStack.LindenUDP
protected PriorityQueue<double, ImprovedTerseObjectUpdatePacket.ObjectDataBlock> m_avatarTerseUpdates; protected PriorityQueue<double, ImprovedTerseObjectUpdatePacket.ObjectDataBlock> m_avatarTerseUpdates;
private PriorityQueue<double, ImprovedTerseObjectUpdatePacket.ObjectDataBlock> m_primTerseUpdates; private PriorityQueue<double, ImprovedTerseObjectUpdatePacket.ObjectDataBlock> m_primTerseUpdates;
private PriorityQueue<double, ObjectUpdatePacket.ObjectDataBlock> m_primFullUpdates; private PriorityQueue<double, ObjectUpdatePacket.ObjectDataBlock> m_primFullUpdates;
/// <value>
/// List used in construction of data blocks for an object update packet. This is to stop us having to
/// continually recreate it.
/// </value>
protected List<ObjectUpdatePacket.ObjectDataBlock> m_fullUpdateDataBlocksBuilder;
/// <value>
/// Maintain a record of all the objects killed. This allows us to stop an update being sent from the
/// thread servicing the m_primFullUpdates queue after a kill. If this happens the object persists as an
/// ownerless phantom.
///
/// All manipulation of this set has to occur under a m_primFullUpdate.SyncRoot lock
///
/// </value>
protected HashSet<uint> m_killRecord;
private int m_moneyBalance; private int m_moneyBalance;
private int m_animationSequenceNumber = 1; private int m_animationSequenceNumber = 1;
private bool m_SendLogoutPacketWhenClosing = true; private bool m_SendLogoutPacketWhenClosing = true;
@ -437,6 +454,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP
m_avatarTerseUpdates = new PriorityQueue<double, ImprovedTerseObjectUpdatePacket.ObjectDataBlock>(); m_avatarTerseUpdates = new PriorityQueue<double, ImprovedTerseObjectUpdatePacket.ObjectDataBlock>();
m_primTerseUpdates = new PriorityQueue<double, ImprovedTerseObjectUpdatePacket.ObjectDataBlock>(); m_primTerseUpdates = new PriorityQueue<double, ImprovedTerseObjectUpdatePacket.ObjectDataBlock>();
m_primFullUpdates = new PriorityQueue<double, ObjectUpdatePacket.ObjectDataBlock>(m_scene.Entities.Count); m_primFullUpdates = new PriorityQueue<double, ObjectUpdatePacket.ObjectDataBlock>(m_scene.Entities.Count);
m_fullUpdateDataBlocksBuilder = new List<ObjectUpdatePacket.ObjectDataBlock>();
m_killRecord = new HashSet<uint>();
m_assetService = m_scene.RequestModuleInterface<IAssetService>(); m_assetService = m_scene.RequestModuleInterface<IAssetService>();
m_hyperAssets = m_scene.RequestModuleInterface<IHyperAssetService>(); m_hyperAssets = m_scene.RequestModuleInterface<IHyperAssetService>();
@ -1473,8 +1492,13 @@ namespace OpenSim.Region.ClientStack.LindenUDP
kill.ObjectData[0].ID = localID; kill.ObjectData[0].ID = localID;
kill.Header.Reliable = true; kill.Header.Reliable = true;
kill.Header.Zerocoded = true; kill.Header.Zerocoded = true;
lock (m_primFullUpdates.SyncRoot)
{
m_killRecord.Add(localID);
OutPacket(kill, ThrottleOutPacketType.State); OutPacket(kill, ThrottleOutPacketType.State);
} }
}
/// <summary> /// <summary>
/// Send information about the items contained in a folder to the client. /// Send information about the items contained in a folder to the client.
@ -3513,10 +3537,15 @@ namespace OpenSim.Region.ClientStack.LindenUDP
if (count == 0) if (count == 0)
return; return;
outPacket.ObjectData = new ObjectUpdatePacket.ObjectDataBlock[count]; m_fullUpdateDataBlocksBuilder.Clear();
for (int i = 0; i < count; i++) for (int i = 0; i < count; i++)
{ {
outPacket.ObjectData[i] = m_primFullUpdates.Dequeue(); ObjectUpdatePacket.ObjectDataBlock block = m_primFullUpdates.Dequeue();
if (!m_killRecord.Contains(block.ID))
{
m_fullUpdateDataBlocksBuilder.Add(block);
// string text = Util.FieldToString(outPacket.ObjectData[i].Text); // string text = Util.FieldToString(outPacket.ObjectData[i].Text);
// if (text.IndexOf("\n") >= 0) // if (text.IndexOf("\n") >= 0)
@ -3525,10 +3554,18 @@ namespace OpenSim.Region.ClientStack.LindenUDP
// "[CLIENT]: Sending full info about prim {0} text {1} to client {2}", // "[CLIENT]: Sending full info about prim {0} text {1} to client {2}",
// outPacket.ObjectData[i].ID, text, Name); // outPacket.ObjectData[i].ID, text, Name);
} }
// else
// {
// m_log.WarnFormat(
// "[CLIENT]: Preventing full update for {0} after kill to {1}", block.ID, Name);
// }
} }
outPacket.ObjectData = m_fullUpdateDataBlocksBuilder.ToArray();
OutPacket(outPacket, ThrottleOutPacketType.State); OutPacket(outPacket, ThrottleOutPacketType.State);
} }
}
public void SendPrimTerseUpdate(SendPrimitiveTerseData data) public void SendPrimTerseUpdate(SendPrimitiveTerseData data)
{ {

View File

@ -513,6 +513,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
byte flags = buffer.Data[0]; byte flags = buffer.Data[0];
bool isResend = (flags & Helpers.MSG_RESENT) != 0; bool isResend = (flags & Helpers.MSG_RESENT) != 0;
bool isReliable = (flags & Helpers.MSG_RELIABLE) != 0; bool isReliable = (flags & Helpers.MSG_RELIABLE) != 0;
bool isZerocoded = (flags & Helpers.MSG_ZEROCODED) != 0;
LLUDPClient udpClient = outgoingPacket.Client; LLUDPClient udpClient = outgoingPacket.Client;
if (!udpClient.IsConnected) if (!udpClient.IsConnected)
@ -522,6 +523,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP
int dataLength = buffer.DataLength; int dataLength = buffer.DataLength;
// NOTE: I'm seeing problems with some viewers when ACKs are appended to zerocoded packets so I've disabled that here
if (!isZerocoded)
{
// Keep appending ACKs until there is no room left in the buffer or there are // Keep appending ACKs until there is no room left in the buffer or there are
// no more ACKs to append // no more ACKs to append
uint ackCount = 0; uint ackCount = 0;
@ -540,6 +544,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
// Set the appended ACKs flag on this packet // Set the appended ACKs flag on this packet
buffer.Data[0] = (byte)(buffer.Data[0] | Helpers.MSG_APPENDED_ACKS); buffer.Data[0] = (byte)(buffer.Data[0] | Helpers.MSG_APPENDED_ACKS);
} }
}
buffer.DataLength = dataLength; buffer.DataLength = dataLength;

View File

@ -105,10 +105,10 @@ namespace OpenSim.Region.ClientStack
if (m_networkServersInfo.HttpUsesSSL && (m_networkServersInfo.HttpListenerPort == m_networkServersInfo.httpSSLPort)) if (m_networkServersInfo.HttpUsesSSL && (m_networkServersInfo.HttpListenerPort == m_networkServersInfo.httpSSLPort))
{ {
m_log.Error("[HTTP]: HTTP Server config failed. HTTP Server and HTTPS server must be on different ports"); m_log.Error("[REGION SERVER]: HTTP Server config failed. HTTP Server and HTTPS server must be on different ports");
} }
m_log.Info("[REGION]: Starting HTTP server"); m_log.InfoFormat("[REGION SERVER]: Starting HTTP server on port {0}", m_httpServerPort);
m_httpServer.Start(); m_httpServer.Start();
base.StartupSpecific(); base.StartupSpecific();

View File

@ -286,6 +286,10 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat
fromName = avatar.Name; fromName = avatar.Name;
sourceType = ChatSourceType.Agent; sourceType = ChatSourceType.Agent;
} }
else if (c.SenderUUID != UUID.Zero)
{
fromID = c.SenderUUID;
}
// m_log.DebugFormat("[CHAT] Broadcast: fromID {0} fromName {1}, cType {2}, sType {3}", fromID, fromName, cType, sourceType); // m_log.DebugFormat("[CHAT] Broadcast: fromID {0} fromName {1}, cType {2}, sType {3}", fromID, fromName, cType, sourceType);
if (c.Scene != null) if (c.Scene != null)

View File

@ -147,9 +147,10 @@ namespace OpenSim.Region.CoreModules.Avatar.Combat.CombatModule
private void AvatarEnteringParcel(ScenePresence avatar, int localLandID, UUID regionID) private void AvatarEnteringParcel(ScenePresence avatar, int localLandID, UUID regionID)
{ {
ILandObject obj = avatar.Scene.LandChannel.GetLandObject(avatar.AbsolutePosition.X, avatar.AbsolutePosition.Y);
try try
{ {
ILandObject obj = avatar.Scene.LandChannel.GetLandObject(avatar.AbsolutePosition.X, avatar.AbsolutePosition.Y);
if ((obj.LandData.Flags & (uint)ParcelFlags.AllowDamage) != 0) if ((obj.LandData.Flags & (uint)ParcelFlags.AllowDamage) != 0)
{ {
avatar.Invulnerable = false; avatar.Invulnerable = false;

View File

@ -79,7 +79,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Dialog
{ {
ScenePresence sp = m_scene.GetScenePresence(agentID); ScenePresence sp = m_scene.GetScenePresence(agentID);
if (sp != null) if (sp != null && !sp.IsChildAgent)
sp.ControllingClient.SendAgentAlertMessage(message, modal); sp.ControllingClient.SendAgentAlertMessage(message, modal);
} }
@ -91,7 +91,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Dialog
{ {
ScenePresence presence = presenceList[i]; ScenePresence presence = presenceList[i];
if (presence.Firstname == firstName && presence.Lastname == lastName) if (!presence.IsChildAgent && presence.Firstname == firstName && presence.Lastname == lastName)
{ {
presence.ControllingClient.SendAgentAlertMessage(message, modal); presence.ControllingClient.SendAgentAlertMessage(message, modal);
break; break;
@ -130,7 +130,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Dialog
} }
ScenePresence sp = m_scene.GetScenePresence(avatarID); ScenePresence sp = m_scene.GetScenePresence(avatarID);
if (sp != null) if (sp != null && !sp.IsChildAgent)
sp.ControllingClient.SendDialog(objectName, objectID, ownerFirstName, ownerLastName, message, textureID, ch, buttonlabels); sp.ControllingClient.SendDialog(objectName, objectID, ownerFirstName, ownerLastName, message, textureID, ch, buttonlabels);
} }
@ -139,7 +139,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Dialog
{ {
ScenePresence sp = m_scene.GetScenePresence(avatarID); ScenePresence sp = m_scene.GetScenePresence(avatarID);
if (sp != null) if (sp != null && !sp.IsChildAgent)
sp.ControllingClient.SendLoadURL(objectName, objectID, ownerID, groupOwned, message, url); sp.ControllingClient.SendLoadURL(objectName, objectID, ownerID, groupOwned, message, url);
} }

View File

@ -131,8 +131,8 @@ namespace OpenSim.Region.CoreModules.Scripting.XMLRPC
{ {
// Start http server // Start http server
// Attach xmlrpc handlers // Attach xmlrpc handlers
m_log.Info("[REMOTE_DATA]: " + m_log.Info("[XML RPC MODULE]: " +
"Starting XMLRPC Server on port " + m_remoteDataPort + " for llRemoteData commands."); "Starting up XMLRPC Server on port " + m_remoteDataPort + " for llRemoteData commands.");
BaseHttpServer httpServer = new BaseHttpServer((uint) m_remoteDataPort); BaseHttpServer httpServer = new BaseHttpServer((uint) m_remoteDataPort);
httpServer.AddXmlRPCHandler("llRemoteData", XmlRpcRemoteData); httpServer.AddXmlRPCHandler("llRemoteData", XmlRpcRemoteData);
httpServer.Start(); httpServer.Start();
@ -192,7 +192,7 @@ namespace OpenSim.Region.CoreModules.Scripting.XMLRPC
// This should no longer happen, but the check is reasonable anyway // This should no longer happen, but the check is reasonable anyway
if (null == m_openChannels) if (null == m_openChannels)
{ {
m_log.Warn("[RemoteDataReply] Attempt to open channel before initialization is complete"); m_log.Warn("[XML RPC MODULE]: Attempt to open channel before initialization is complete");
return newChannel; return newChannel;
} }
@ -279,7 +279,7 @@ namespace OpenSim.Region.CoreModules.Scripting.XMLRPC
} }
else else
{ {
m_log.Warn("[RemoteDataReply]: Channel or message_id not found"); m_log.Warn("[XML RPC MODULE]: Channel or message_id not found");
} }
} }
@ -340,7 +340,7 @@ namespace OpenSim.Region.CoreModules.Scripting.XMLRPC
} }
else else
{ {
m_log.Error("UNABLE TO REMOVE COMPLETED REQUEST"); m_log.Error("[XML RPC MODULE]: UNABLE TO REMOVE COMPLETED REQUEST");
} }
} }
} }

View File

@ -260,7 +260,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Interregion
{ {
if (s.RegionInfo.RegionHandle == regionHandle) if (s.RegionInfo.RegionHandle == regionHandle)
{ {
//m_log.Debug("[LOCAL COMMS]: Found region to SendCreateObject"); m_log.Debug("[LOCAL COMMS]: Found region to SendCreateObject");
if (isLocalCall) if (isLocalCall)
{ {
// We need to make a local copy of the object // We need to make a local copy of the object

View File

@ -314,10 +314,13 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
{ {
// m_log.DebugFormat("[LOCAL INVENTORY SERVICES CONNECTOR]: Requesting inventory item {0}", item.ID); // m_log.DebugFormat("[LOCAL INVENTORY SERVICES CONNECTOR]: Requesting inventory item {0}", item.ID);
UUID requestedItemId = item.ID;
item = m_InventoryService.GetItem(item); item = m_InventoryService.GetItem(item);
if (null == item) if (null == item)
m_log.ErrorFormat("[LOCAL INVENTORY SERVICES CONNECTOR]: Could not find item with id {0}", item.ID); m_log.ErrorFormat(
"[LOCAL INVENTORY SERVICES CONNECTOR]: Could not find item with id {0}", requestedItemId);
return item; return item;
} }

View File

@ -275,7 +275,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver
part.TaskInventory.LockItemsForRead(false); part.TaskInventory.LockItemsForRead(false);
} }
if (m_scene.AddRestoredSceneObject(sceneObject, true, false)) if (!m_scene.AddRestoredSceneObject(sceneObject, true, false))
{ {
sceneObjectsLoadedCount++; sceneObjectsLoadedCount++;
sceneObject.CreateScriptInstances(0, false, m_scene.DefaultScriptEngine, 0); sceneObject.CreateScriptInstances(0, false, m_scene.DefaultScriptEngine, 0);

View File

@ -37,6 +37,37 @@ namespace OpenSim.Region.Framework.Interfaces
{ {
event NewGroupNotice OnNewGroupNotice; event NewGroupNotice OnNewGroupNotice;
/// <summary>
/// Create a group
/// </summary>
/// <param name="remoteClient"></param>
/// <param name="name"></param>
/// <param name="charter"></param>
/// <param name="showInList"></param>
/// <param name="insigniaID"></param>
/// <param name="membershipFee"></param>
/// <param name="openEnrollment"></param>
/// <param name="allowPublish"></param>
/// <param name="maturePublish"></param>
/// <returns>The UUID of the created group</returns>
UUID CreateGroup(
IClientAPI remoteClient, string name, string charter, bool showInList, UUID insigniaID, int membershipFee,
bool openEnrollment, bool allowPublish, bool maturePublish);
/// <summary>
/// Get a group
/// </summary>
/// <param name="name">Name of the group</param>
/// <returns>The group's data. Null if there is no such group.</returns>
GroupRecord GetGroupRecord(string name);
/// <summary>
/// Get a group
/// </summary>
/// <param name="GroupID">ID of the group</param>
/// <returns>The group's data. Null if there is no such group.</returns>
GroupRecord GetGroupRecord(UUID GroupID);
void ActivateGroup(IClientAPI remoteClient, UUID groupID); void ActivateGroup(IClientAPI remoteClient, UUID groupID);
List<GroupTitlesData> GroupTitlesRequest(IClientAPI remoteClient, UUID groupID); List<GroupTitlesData> GroupTitlesRequest(IClientAPI remoteClient, UUID groupID);
List<GroupMembersData> GroupMembersRequest(IClientAPI remoteClient, UUID groupID); List<GroupMembersData> GroupMembersRequest(IClientAPI remoteClient, UUID groupID);
@ -51,7 +82,6 @@ namespace OpenSim.Region.Framework.Interfaces
void SetGroupAcceptNotices(IClientAPI remoteClient, UUID groupID, bool acceptNotices, bool listInProfile); void SetGroupAcceptNotices(IClientAPI remoteClient, UUID groupID, bool acceptNotices, bool listInProfile);
void GroupTitleUpdate(IClientAPI remoteClient, UUID GroupID, UUID TitleRoleID); void GroupTitleUpdate(IClientAPI remoteClient, UUID GroupID, UUID TitleRoleID);
UUID CreateGroup(IClientAPI remoteClient, string name, string charter, bool showInList, UUID insigniaID, int membershipFee, bool openEnrollment, bool allowPublish, bool maturePublish);
GroupNoticeData[] GroupNoticesListRequest(IClientAPI remoteClient, UUID GroupID); GroupNoticeData[] GroupNoticesListRequest(IClientAPI remoteClient, UUID GroupID);
string GetGroupTitle(UUID avatarID); string GetGroupTitle(UUID avatarID);
@ -64,7 +94,6 @@ namespace OpenSim.Region.Framework.Interfaces
void LeaveGroupRequest(IClientAPI remoteClient, UUID GroupID); void LeaveGroupRequest(IClientAPI remoteClient, UUID GroupID);
void EjectGroupMemberRequest(IClientAPI remoteClient, UUID GroupID, UUID EjecteeID); void EjectGroupMemberRequest(IClientAPI remoteClient, UUID GroupID, UUID EjecteeID);
void InviteGroupRequest(IClientAPI remoteClient, UUID GroupID, UUID InviteeID, UUID RoleID); void InviteGroupRequest(IClientAPI remoteClient, UUID GroupID, UUID InviteeID, UUID RoleID);
GroupRecord GetGroupRecord(UUID GroupID);
void NotifyChange(UUID GroupID); void NotifyChange(UUID GroupID);
} }
} }

View File

@ -107,12 +107,12 @@ namespace OpenSim.Region.Framework.Scenes
public event OnSetRootAgentSceneDelegate OnSetRootAgentScene; public event OnSetRootAgentSceneDelegate OnSetRootAgentScene;
/// <summary> /// <summary>
/// Called when an object is touched/grabbed. /// Fired when an object is touched/grabbed.
/// </summary> /// </summary>
/// The originalID is the local ID of the part that was actually touched. The localID itself is always that of /// The originalID is the local ID of the part that was actually touched. The localID itself is always that of
/// the root part. /// the root part.
public delegate void ObjectGrabDelegate(uint localID, uint originalID, Vector3 offsetPos, IClientAPI remoteClient, SurfaceTouchEventArgs surfaceArgs);
public event ObjectGrabDelegate OnObjectGrab; public event ObjectGrabDelegate OnObjectGrab;
public delegate void ObjectGrabDelegate(uint localID, uint originalID, Vector3 offsetPos, IClientAPI remoteClient, SurfaceTouchEventArgs surfaceArgs);
public event ObjectGrabDelegate OnObjectGrabbing; public event ObjectGrabDelegate OnObjectGrabbing;
public event ObjectDeGrabDelegate OnObjectDeGrab; public event ObjectDeGrabDelegate OnObjectDeGrab;
@ -120,8 +120,11 @@ namespace OpenSim.Region.Framework.Scenes
public event OnPermissionErrorDelegate OnPermissionError; public event OnPermissionErrorDelegate OnPermissionError;
public delegate void NewRezScript(uint localID, UUID itemID, string script, int startParam, bool postOnRez, string engine, int stateSource); /// <summary>
/// Fired when a new script is created.
/// </summary>
public event NewRezScript OnRezScript; public event NewRezScript OnRezScript;
public delegate void NewRezScript(uint localID, UUID itemID, string script, int startParam, bool postOnRez, string engine, int stateSource);
public delegate void RemoveScript(uint localID, UUID itemID); public delegate void RemoveScript(uint localID, UUID itemID);
public event RemoveScript OnRemoveScript; public event RemoveScript OnRemoveScript;
@ -165,36 +168,33 @@ namespace OpenSim.Region.Framework.Scenes
public event ClientClosed OnClientClosed; public event ClientClosed OnClientClosed;
/// <summary>
/// This is fired when a scene object property that a script might be interested in (such as color, scale or
/// inventory) changes. Only enough information is sent for the LSL changed event
/// (see http://lslwiki.net/lslwiki/wakka.php?wakka=changed)
/// </summary>
public event ScriptChangedEvent OnScriptChangedEvent;
public delegate void ScriptChangedEvent(uint localID, uint change); public delegate void ScriptChangedEvent(uint localID, uint change);
public event ScriptChangedEvent OnScriptChangedEvent;
public delegate void ScriptControlEvent(uint localID, UUID item, UUID avatarID, uint held, uint changed); public delegate void ScriptControlEvent(uint localID, UUID item, UUID avatarID, uint held, uint changed);
public event ScriptControlEvent OnScriptControlEvent; public event ScriptControlEvent OnScriptControlEvent;
public delegate void ScriptAtTargetEvent(uint localID, uint handle, Vector3 targetpos, Vector3 atpos); public delegate void ScriptAtTargetEvent(uint localID, uint handle, Vector3 targetpos, Vector3 atpos);
public event ScriptAtTargetEvent OnScriptAtTargetEvent; public event ScriptAtTargetEvent OnScriptAtTargetEvent;
public delegate void ScriptNotAtTargetEvent(uint localID); public delegate void ScriptNotAtTargetEvent(uint localID);
public event ScriptNotAtTargetEvent OnScriptNotAtTargetEvent; public event ScriptNotAtTargetEvent OnScriptNotAtTargetEvent;
public delegate void ScriptAtRotTargetEvent(uint localID, uint handle, Quaternion targetrot, Quaternion atrot); public delegate void ScriptAtRotTargetEvent(uint localID, uint handle, Quaternion targetrot, Quaternion atrot);
public event ScriptAtRotTargetEvent OnScriptAtRotTargetEvent; public event ScriptAtRotTargetEvent OnScriptAtRotTargetEvent;
public delegate void ScriptNotAtRotTargetEvent(uint localID); public delegate void ScriptNotAtRotTargetEvent(uint localID);
public event ScriptNotAtRotTargetEvent OnScriptNotAtRotTargetEvent; public event ScriptNotAtRotTargetEvent OnScriptNotAtRotTargetEvent;
public delegate void ScriptColliding(uint localID, ColliderArgs colliders); public delegate void ScriptColliding(uint localID, ColliderArgs colliders);
public event ScriptColliding OnScriptColliderStart; public event ScriptColliding OnScriptColliderStart;
public event ScriptColliding OnScriptColliding; public event ScriptColliding OnScriptColliding;
public event ScriptColliding OnScriptCollidingEnd; public event ScriptColliding OnScriptCollidingEnd;
public event ScriptColliding OnScriptLandColliderStart; public event ScriptColliding OnScriptLandColliderStart;
public event ScriptColliding OnScriptLandColliding; public event ScriptColliding OnScriptLandColliding;
public event ScriptColliding OnScriptLandColliderEnd; public event ScriptColliding OnScriptLandColliderEnd;

View File

@ -532,7 +532,6 @@ namespace OpenSim.Region.Framework.Scenes
return null; return null;
} }
if (recipientParentFolderId == UUID.Zero) if (recipientParentFolderId == UUID.Zero)
{ {
InventoryFolderBase recipientRootFolder = InventoryService.GetRootFolder(recipientId); InventoryFolderBase recipientRootFolder = InventoryService.GetRootFolder(recipientId);
@ -2086,7 +2085,10 @@ namespace OpenSim.Region.Framework.Scenes
group.RootPart.IsAttachment = true; group.RootPart.IsAttachment = true;
} }
AddNewSceneObject(group, true); // If we're rezzing an attachment then don't ask AddNewSceneObject() to update the client since
// we'll be doing that later on. Scheduling more than one full update during the attachment
// process causes some clients to fail to display the attachment properly.
AddNewSceneObject(group, true, !attachment);
// m_log.InfoFormat("ray end point for inventory rezz is {0} {1} {2} ", RayEnd.X, RayEnd.Y, RayEnd.Z); // m_log.InfoFormat("ray end point for inventory rezz is {0} {1} {2} ", RayEnd.X, RayEnd.Y, RayEnd.Z);
// if attachment we set it's asset id so object updates can reflect that // if attachment we set it's asset id so object updates can reflect that
@ -2456,6 +2458,8 @@ namespace OpenSim.Region.Framework.Scenes
return; return;
} }
m_log.DebugFormat("[SCENE INVENTORY]: {0} {1} IsAttachment={2}", att.Name, att.LocalId, att.IsAttachment);
Console.WriteLine("HERE X");
ScenePresence presence; ScenePresence presence;
if (TryGetAvatar(remoteClient.AgentId, out presence)) if (TryGetAvatar(remoteClient.AgentId, out presence))
{ {
@ -2463,9 +2467,12 @@ namespace OpenSim.Region.Framework.Scenes
InventoryItemBase item = new InventoryItemBase(itemID, remoteClient.AgentId); InventoryItemBase item = new InventoryItemBase(itemID, remoteClient.AgentId);
item = InventoryService.GetItem(item); item = InventoryService.GetItem(item);
presence.Appearance.SetAttachment((int)AttachmentPt, itemID, item.AssetID /*att.UUID*/); presence.Appearance.SetAttachment((int)AttachmentPt, itemID, item.AssetID /*att.UUID*/);
Console.WriteLine("HERE Y");
if (m_AvatarFactory != null) if (m_AvatarFactory != null)
m_AvatarFactory.UpdateDatabase(remoteClient.AgentId, presence.Appearance); m_AvatarFactory.UpdateDatabase(remoteClient.AgentId, presence.Appearance);
Console.WriteLine("HERE Z");
} }
} }

View File

@ -124,6 +124,7 @@ namespace OpenSim.Region.Framework.Scenes
{ {
if (((SceneObjectGroup)ent).LocalId == primLocalID) if (((SceneObjectGroup)ent).LocalId == primLocalID)
{ {
m_log.DebugFormat("[SCENE]: Received full update request for {0} from {1}", primLocalID, remoteClient.Name);
((SceneObjectGroup)ent).SendFullUpdateToClient(remoteClient); ((SceneObjectGroup)ent).SendFullUpdateToClient(remoteClient);
return; return;
} }

View File

@ -1874,6 +1874,28 @@ namespace OpenSim.Region.Framework.Scenes
return sceneObject; return sceneObject;
} }
/// <summary>
/// Add an object into the scene that has come from storage
/// </summary>
///
/// <param name="sceneObject"></param>
/// <param name="attachToBackup">
/// If true, changes to the object will be reflected in its persisted data
/// If false, the persisted data will not be changed even if the object in the scene is changed
/// </param>
/// <param name="alreadyPersisted">
/// If true, we won't persist this object until it changes
/// If false, we'll persist this object immediately
/// </param>
/// <returns>
/// true if the object was added, false if an object with the same uuid was already in the scene
/// </returns>
public bool AddRestoredSceneObject(
SceneObjectGroup sceneObject, bool attachToBackup, bool alreadyPersisted, bool sendClientUpdates)
{
return m_sceneGraph.AddRestoredSceneObject(sceneObject, attachToBackup, alreadyPersisted, sendClientUpdates);
}
/// <summary> /// <summary>
/// Add an object into the scene that has come from storage /// Add an object into the scene that has come from storage
/// </summary> /// </summary>
@ -1893,7 +1915,7 @@ namespace OpenSim.Region.Framework.Scenes
public bool AddRestoredSceneObject( public bool AddRestoredSceneObject(
SceneObjectGroup sceneObject, bool attachToBackup, bool alreadyPersisted) SceneObjectGroup sceneObject, bool attachToBackup, bool alreadyPersisted)
{ {
return m_sceneGraph.AddRestoredSceneObject(sceneObject, attachToBackup, alreadyPersisted); return AddRestoredSceneObject(sceneObject, attachToBackup, alreadyPersisted, true);
} }
/// <summary> /// <summary>
@ -1927,7 +1949,7 @@ namespace OpenSim.Region.Framework.Scenes
} }
/// <summary> /// <summary>
/// Delete every object from the scene /// Delete every object from the scene. This does not include attachments worn by avatars.
/// </summary> /// </summary>
public void DeleteAllSceneObjects() public void DeleteAllSceneObjects()
{ {
@ -1938,10 +1960,14 @@ namespace OpenSim.Region.Framework.Scenes
foreach (EntityBase e in entities) foreach (EntityBase e in entities)
{ {
if (e is SceneObjectGroup) if (e is SceneObjectGroup)
{
SceneObjectGroup sog = (SceneObjectGroup)e;
if (!sog.IsAttachment)
DeleteSceneObject((SceneObjectGroup)e, false); DeleteSceneObject((SceneObjectGroup)e, false);
} }
} }
} }
}
/// <summary> /// <summary>
/// Synchronously delete the given object from the scene. /// Synchronously delete the given object from the scene.
@ -2502,7 +2528,7 @@ namespace OpenSim.Region.Framework.Scenes
/// <returns></returns> /// <returns></returns>
public bool IncomingCreateObject(ISceneObject sog) public bool IncomingCreateObject(ISceneObject sog)
{ {
//m_log.Debug(" >>> IncomingCreateObject(sog) <<< " + ((SceneObjectGroup)sog).AbsolutePosition + " deleted? " + ((SceneObjectGroup)sog).IsDeleted); m_log.Debug(" >>> IncomingCreateObject(sog) <<< " + ((SceneObjectGroup)sog).AbsolutePosition + " deleted? " + ((SceneObjectGroup)sog).IsDeleted);
SceneObjectGroup newObject; SceneObjectGroup newObject;
try try
{ {
@ -2574,10 +2600,12 @@ namespace OpenSim.Region.Framework.Scenes
if (sceneObject.IsAttachmentCheckFull()) // Attachment if (sceneObject.IsAttachmentCheckFull()) // Attachment
{ {
m_log.DebugFormat("[SCENE]: Adding attachment {0} {1}", sceneObject.Name, sceneObject.LocalId);
sceneObject.RootPart.AddFlag(PrimFlags.TemporaryOnRez); sceneObject.RootPart.AddFlag(PrimFlags.TemporaryOnRez);
sceneObject.RootPart.AddFlag(PrimFlags.Phantom); sceneObject.RootPart.AddFlag(PrimFlags.Phantom);
AddRestoredSceneObject(sceneObject, false, false); AddRestoredSceneObject(sceneObject, false, false, false);
// Handle attachment special case // Handle attachment special case
SceneObjectPart RootPrim = sceneObject.RootPart; SceneObjectPart RootPrim = sceneObject.RootPart;
@ -2585,6 +2613,8 @@ namespace OpenSim.Region.Framework.Scenes
// Fix up attachment Parent Local ID // Fix up attachment Parent Local ID
ScenePresence sp = GetScenePresence(sceneObject.OwnerID); ScenePresence sp = GetScenePresence(sceneObject.OwnerID);
Console.WriteLine("AAAA");
//uint parentLocalID = 0; //uint parentLocalID = 0;
if (sp != null) if (sp != null)
{ {
@ -2604,19 +2634,24 @@ namespace OpenSim.Region.Framework.Scenes
m_log.DebugFormat( m_log.DebugFormat(
"[ATTACHMENT]: Attach to avatar {0} at position {1}", sp.UUID, grp.AbsolutePosition); "[ATTACHMENT]: Attach to avatar {0} at position {1}", sp.UUID, grp.AbsolutePosition);
RootPrim.RemFlag(PrimFlags.TemporaryOnRez);
AttachObject( AttachObject(
sp.ControllingClient, grp.LocalId, (uint)0, grp.GroupRotation, grp.AbsolutePosition, false); sp.ControllingClient, grp.LocalId, (uint)0, grp.GroupRotation, grp.AbsolutePosition, false);
RootPrim.RemFlag(PrimFlags.TemporaryOnRez);
grp.SendGroupFullUpdate(); //grp.SendGroupFullUpdate();
} }
else else
{ {
RootPrim.RemFlag(PrimFlags.TemporaryOnRez); RootPrim.RemFlag(PrimFlags.TemporaryOnRez);
RootPrim.AddFlag(PrimFlags.TemporaryOnRez); RootPrim.AddFlag(PrimFlags.TemporaryOnRez);
} }
Console.WriteLine("BBBB");
} }
else else
{ {
m_log.DebugFormat("[SCENE]: Adding ordinary object {0} {1}", sceneObject.Name, sceneObject.LocalId);
AddRestoredSceneObject(sceneObject, true, false); AddRestoredSceneObject(sceneObject, true, false);
if (!Permissions.CanObjectEntry(sceneObject.UUID, if (!Permissions.CanObjectEntry(sceneObject.UUID,

View File

@ -1410,7 +1410,9 @@ namespace OpenSim.Region.Framework.Scenes
// now we have a child agent in this region. Request all interesting data about other (root) agents // now we have a child agent in this region. Request all interesting data about other (root) agents
agent.SendInitialFullUpdateToAllClients(); agent.SendInitialFullUpdateToAllClients();
Console.WriteLine("SCS 1");
agent.CrossAttachmentsIntoNewRegion(neighbourHandle, true); agent.CrossAttachmentsIntoNewRegion(neighbourHandle, true);
Console.WriteLine("SCS 2");
// m_scene.SendKillObject(m_localId); // m_scene.SendKillObject(m_localId);

View File

@ -216,11 +216,15 @@ namespace OpenSim.Region.Framework.Scenes
/// If true, we won't persist this object until it changes /// If true, we won't persist this object until it changes
/// If false, we'll persist this object immediately /// If false, we'll persist this object immediately
/// </param> /// </param>
/// <param name="sendClientUpdate">
/// If true, we send updates to the client to tell it about this object
/// If false, we leave it up to the caller to do this
/// </param>
/// <returns> /// <returns>
/// true if the object was added, false if an object with the same uuid was already in the scene /// true if the object was added, false if an object with the same uuid was already in the scene
/// </returns> /// </returns>
protected internal bool AddRestoredSceneObject( protected internal bool AddRestoredSceneObject(
SceneObjectGroup sceneObject, bool attachToBackup, bool alreadyPersisted) SceneObjectGroup sceneObject, bool attachToBackup, bool alreadyPersisted, bool sendClientUpdates)
{ {
// KF: Check for out-of-region, move inside and make static. // KF: Check for out-of-region, move inside and make static.
Vector3 npos = new Vector3(sceneObject.RootPart.GroupPosition.X, Vector3 npos = new Vector3(sceneObject.RootPart.GroupPosition.X,
@ -252,9 +256,30 @@ namespace OpenSim.Region.Framework.Scenes
sceneObject.HasGroupChanged = true; sceneObject.HasGroupChanged = true;
} }
return AddSceneObject(sceneObject, attachToBackup, true); return AddSceneObject(sceneObject, attachToBackup, sendClientUpdates);
} }
// /// <summary>
// /// Add an object into the scene that has come from storage
// /// </summary>
// /// <param name="sceneObject"></param>
// /// <param name="attachToBackup">
// /// If true, changes to the object will be reflected in its persisted data
// /// If false, the persisted data will not be changed even if the object in the scene is changed
// /// </param>
// /// <param name="alreadyPersisted">
// /// If true, we won't persist this object until it changes
// /// If false, we'll persist this object immediately
// /// </param>
// /// <returns>
// /// true if the object was added, false if an object with the same uuid was already in the scene
// /// </returns>
// protected internal bool AddRestoredSceneObject(
// SceneObjectGroup sceneObject, bool attachToBackup, bool alreadyPersisted)
// {
// AddRestoredSceneObject(sceneObject, attachToBackup, alreadyPersisted, true);
// }
/// <summary> /// <summary>
/// Add a newly created object to the scene. This will both update the scene, and send information about the /// Add a newly created object to the scene. This will both update the scene, and send information about the
/// new object to all clients interested in the scene. /// new object to all clients interested in the scene.
@ -560,7 +585,6 @@ namespace OpenSim.Region.Framework.Scenes
// m_log.DebugFormat( // m_log.DebugFormat(
// "[SCENE GRAPH]: Retrieved single object {0} for attachment to {1} on point {2}", // "[SCENE GRAPH]: Retrieved single object {0} for attachment to {1} on point {2}",
// objatt.Name, remoteClient.Name, AttachmentPt); // objatt.Name, remoteClient.Name, AttachmentPt);
if (objatt != null) if (objatt != null)
{ {
bool tainted = false; bool tainted = false;
@ -648,11 +672,13 @@ namespace OpenSim.Region.Framework.Scenes
protected internal bool AttachObject( protected internal bool AttachObject(
IClientAPI remoteClient, uint objectLocalID, uint AttachmentPt, Quaternion rot, Vector3 attachPos, bool silent) IClientAPI remoteClient, uint objectLocalID, uint AttachmentPt, Quaternion rot, Vector3 attachPos, bool silent)
{ {
Console.WriteLine("HERE A");
SceneObjectGroup group = GetGroupByPrim(objectLocalID); SceneObjectGroup group = GetGroupByPrim(objectLocalID);
if (group != null) if (group != null)
{ {
if (m_parentScene.Permissions.CanTakeObject(group.UUID, remoteClient.AgentId)) if (m_parentScene.Permissions.CanTakeObject(group.UUID, remoteClient.AgentId))
{ {
Console.WriteLine("HERE -1");
// If the attachment point isn't the same as the one previously used // If the attachment point isn't the same as the one previously used
// set it's offset position = 0 so that it appears on the attachment point // set it's offset position = 0 so that it appears on the attachment point
// and not in a weird location somewhere unknown. // and not in a weird location somewhere unknown.
@ -691,9 +717,12 @@ namespace OpenSim.Region.Framework.Scenes
itemId = group.GetFromItemID(); itemId = group.GetFromItemID();
} }
Console.WriteLine("HERE 0");
m_parentScene.AttachObject(remoteClient, AttachmentPt, itemId, group); m_parentScene.AttachObject(remoteClient, AttachmentPt, itemId, group);
Console.WriteLine("HERE 1");
group.AttachToAgent(remoteClient.AgentId, AttachmentPt, attachPos, silent); group.AttachToAgent(remoteClient.AgentId, AttachmentPt, attachPos, silent);
Console.WriteLine("HERE 2");
// In case it is later dropped again, don't let // In case it is later dropped again, don't let
// it get cleaned up // it get cleaned up
// //

View File

@ -1651,6 +1651,10 @@ namespace OpenSim.Region.Framework.Scenes
public void SendFullUpdateToClient(IClientAPI remoteClient) public void SendFullUpdateToClient(IClientAPI remoteClient)
{ {
if (IsAttachment)
m_log.DebugFormat(
"[SOG]: Sending full update to client {0} for {1} {2}", remoteClient.Name, Name, LocalId);
SendPartFullUpdate(remoteClient, RootPart, m_scene.Permissions.GenerateClientFlags(remoteClient.AgentId, RootPart.UUID)); SendPartFullUpdate(remoteClient, RootPart, m_scene.Permissions.GenerateClientFlags(remoteClient.AgentId, RootPart.UUID));
lockPartsForRead(true); lockPartsForRead(true);
@ -1673,8 +1677,9 @@ namespace OpenSim.Region.Framework.Scenes
/// <param name="part"></param> /// <param name="part"></param>
internal void SendPartFullUpdate(IClientAPI remoteClient, SceneObjectPart part, uint clientFlags) internal void SendPartFullUpdate(IClientAPI remoteClient, SceneObjectPart part, uint clientFlags)
{ {
// m_log.DebugFormat( if (IsAttachment)
// "[SOG]: Sendinging part full update to {0} for {1} {2}", remoteClient.Name, part.Name, part.LocalId); m_log.DebugFormat(
"[SOG]: Sending part full update to {0} for {1} {2}", remoteClient.Name, part.Name, part.LocalId);
if (m_rootPart.UUID == part.UUID) if (m_rootPart.UUID == part.UUID)
{ {
@ -2186,7 +2191,8 @@ namespace OpenSim.Region.Framework.Scenes
public void ScheduleFullUpdateToAvatar(ScenePresence presence) public void ScheduleFullUpdateToAvatar(ScenePresence presence)
{ {
// m_log.DebugFormat("[SOG]: Scheduling full update for {0} {1} just to avatar {2}", Name, UUID, presence.Name); if (IsAttachment)
m_log.DebugFormat("[SOG]: Scheduling full update for {0} {1} just to avatar {2}", Name, UUID, presence.Name);
RootPart.AddFullUpdateToAvatar(presence); RootPart.AddFullUpdateToAvatar(presence);
@ -2222,7 +2228,8 @@ namespace OpenSim.Region.Framework.Scenes
/// </summary> /// </summary>
public void ScheduleGroupForFullUpdate() public void ScheduleGroupForFullUpdate()
{ {
// m_log.DebugFormat("[SOG]: Scheduling full update for {0} {1}", Name, UUID); if (IsAttachment)
m_log.DebugFormat("[SOG]: Scheduling full update for {0} {1}", Name, UUID);
checkAtTargets(); checkAtTargets();
RootPart.ScheduleFullUpdate(); RootPart.ScheduleFullUpdate();

View File

@ -1273,13 +1273,14 @@ namespace OpenSim.Region.Framework.Scenes
{ {
ScenePresence[] avatars = m_parentGroup.Scene.GetScenePresences(); ScenePresence[] avatars = m_parentGroup.Scene.GetScenePresences();
for (int i = 0; i < avatars.Length; i++) for (int i = 0; i < avatars.Length; i++)
{ AddFullUpdateToAvatar(avatars[i]);
avatars[i].SceneViewer.QueuePartForUpdate(this);
}
} }
public void AddFullUpdateToAvatar(ScenePresence presence) public void AddFullUpdateToAvatar(ScenePresence presence)
{ {
if (IsAttachment)
m_log.DebugFormat("AddFullUpdateToAllAvatar() {0} for {1} {2}", presence.Name, Name, LocalId);
presence.SceneViewer.QueuePartForUpdate(this); presence.SceneViewer.QueuePartForUpdate(this);
} }
@ -1298,13 +1299,14 @@ namespace OpenSim.Region.Framework.Scenes
{ {
ScenePresence[] avatars = m_parentGroup.Scene.GetScenePresences(); ScenePresence[] avatars = m_parentGroup.Scene.GetScenePresences();
for (int i = 0; i < avatars.Length; i++) for (int i = 0; i < avatars.Length; i++)
{ AddTerseUpdateToAvatar(avatars[i]);
avatars[i].SceneViewer.QueuePartForUpdate(this);
}
} }
public void AddTerseUpdateToAvatar(ScenePresence presence) public void AddTerseUpdateToAvatar(ScenePresence presence)
{ {
if (IsAttachment)
m_log.DebugFormat("AddTerseUpdateToAvatar() {0} for {1} {2}", presence.Name, Name, LocalId);
presence.SceneViewer.QueuePartForUpdate(this); presence.SceneViewer.QueuePartForUpdate(this);
} }
@ -2713,7 +2715,8 @@ namespace OpenSim.Region.Framework.Scenes
/// </summary> /// </summary>
public void ScheduleFullUpdate() public void ScheduleFullUpdate()
{ {
// m_log.DebugFormat("[SCENE OBJECT PART]: Scheduling full update for {0} {1}", Name, LocalId); if (IsAttachment)
m_log.DebugFormat("[SOP]: Scheduling full update for {0} {1}", Name, LocalId);
if (m_parentGroup != null) if (m_parentGroup != null)
{ {
@ -2826,6 +2829,10 @@ namespace OpenSim.Region.Framework.Scenes
/// <param name="remoteClient"></param> /// <param name="remoteClient"></param>
public void SendFullUpdate(IClientAPI remoteClient, uint clientFlags) public void SendFullUpdate(IClientAPI remoteClient, uint clientFlags)
{ {
if (IsAttachment)
m_log.DebugFormat(
"[SCENE OBJECT PART]: Sending part full update to {0} for {1} {2}", remoteClient.Name, Name, LocalId);
m_parentGroup.SendPartFullUpdate(remoteClient, this, clientFlags); m_parentGroup.SendPartFullUpdate(remoteClient, this, clientFlags);
} }
@ -2834,6 +2841,10 @@ namespace OpenSim.Region.Framework.Scenes
/// </summary> /// </summary>
public void SendFullUpdateToAllClients() public void SendFullUpdateToAllClients()
{ {
if (IsAttachment)
m_log.DebugFormat(
"[SCENE OBJECT PART]: Sending full update for {0} {1} for all clients", Name, LocalId);
ScenePresence[] avatars = m_parentGroup.Scene.GetScenePresences(); ScenePresence[] avatars = m_parentGroup.Scene.GetScenePresences();
for (int i = 0; i < avatars.Length; i++) for (int i = 0; i < avatars.Length; i++)
{ {
@ -2845,6 +2856,10 @@ namespace OpenSim.Region.Framework.Scenes
public void SendFullUpdateToAllClientsExcept(UUID agentID) public void SendFullUpdateToAllClientsExcept(UUID agentID)
{ {
if (IsAttachment)
m_log.DebugFormat(
"[SCENE OBJECT PART]: Sending full update for {0} {1} to all clients except {2}", Name, LocalId, agentID);
ScenePresence[] avatars = m_parentGroup.Scene.GetScenePresences(); ScenePresence[] avatars = m_parentGroup.Scene.GetScenePresences();
for (int i = 0; i < avatars.Length; i++) for (int i = 0; i < avatars.Length; i++)
{ {
@ -2953,6 +2968,9 @@ namespace OpenSim.Region.Framework.Scenes
{ {
if (m_updateFlag == 2) // is a new prim, just created/reloaded or has major changes if (m_updateFlag == 2) // is a new prim, just created/reloaded or has major changes
{ {
if (IsAttachment)
m_log.DebugFormat("[SOP]: Sending scheduled full update for {0} {1}", Name, LocalId);
AddFullUpdateToAllAvatars(); AddFullUpdateToAllAvatars();
m_updateFlag = 0; //Same here m_updateFlag = 0; //Same here
} }

View File

@ -27,6 +27,7 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Reflection;
using OpenMetaverse; using OpenMetaverse;
using log4net; using log4net;
using OpenSim.Framework; using OpenSim.Framework;
@ -39,6 +40,8 @@ namespace OpenSim.Region.Framework.Scenes
{ {
public class SceneViewer : ISceneViewer public class SceneViewer : ISceneViewer
{ {
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
protected ScenePresence m_presence; protected ScenePresence m_presence;
protected UpdateQueue m_partsUpdateQueue = new UpdateQueue(); protected UpdateQueue m_partsUpdateQueue = new UpdateQueue();
protected Queue<SceneObjectGroup> m_pendingObjects; protected Queue<SceneObjectGroup> m_pendingObjects;
@ -60,6 +63,9 @@ namespace OpenSim.Region.Framework.Scenes
/// <param name="part"></param> /// <param name="part"></param>
public void QueuePartForUpdate(SceneObjectPart part) public void QueuePartForUpdate(SceneObjectPart part)
{ {
if (part.IsAttachment)
m_log.DebugFormat("[SCENE VIEWER]: Queueing part {0} {1} for update", part.Name, part.LocalId);
lock (m_partsUpdateQueue) lock (m_partsUpdateQueue)
{ {
m_partsUpdateQueue.Enqueue(part); m_partsUpdateQueue.Enqueue(part);
@ -134,7 +140,7 @@ namespace OpenSim.Region.Framework.Scenes
} }
else if (update.LastTerseUpdateTime <= part.TimeStampTerse) else if (update.LastTerseUpdateTime <= part.TimeStampTerse)
{ {
// m_log.DebugFormat( // m_log.DebugFormat(AddFullUpdateToAvatar
// "[SCENE PRESENCE]: Tersely updating prim {0}, {1} - part timestamp {2}", // "[SCENE PRESENCE]: Tersely updating prim {0}, {1} - part timestamp {2}",
// part.Name, part.UUID, part.TimeStampTerse); // part.Name, part.UUID, part.TimeStampTerse);

View File

@ -342,7 +342,13 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
private void OnInstantMessage(IClientAPI remoteClient, GridInstantMessage im) private void OnInstantMessage(IClientAPI remoteClient, GridInstantMessage im)
{ {
if (m_debugEnabled) m_log.DebugFormat("[GROUPS]: {0} called", System.Reflection.MethodBase.GetCurrentMethod().Name); if (m_debugEnabled)
{
m_log.DebugFormat("[GROUPS]: {0} called", System.Reflection.MethodBase.GetCurrentMethod().Name);
m_log.DebugFormat("[GROUPS]: remoteClient ({0}) im ({1})", remoteClient, im);
}
// Group invitations // Group invitations
if ((im.dialog == (byte)InstantMessageDialog.GroupInvitationAccept) || (im.dialog == (byte)InstantMessageDialog.GroupInvitationDecline)) if ((im.dialog == (byte)InstantMessageDialog.GroupInvitationAccept) || (im.dialog == (byte)InstantMessageDialog.GroupInvitationDecline))
@ -481,7 +487,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
if (member.AcceptNotices) if (member.AcceptNotices)
{ {
// Build notice IIM // Build notice IIM
GridInstantMessage msg = CreateGroupNoticeIM(UUID.Zero, NoticeID, (byte)OpenMetaverse.InstantMessageDialog.GroupNotice); GridInstantMessage msg = CreateGroupNoticeIM(GetRequestingAgentID(remoteClient), NoticeID, (byte)OpenMetaverse.InstantMessageDialog.GroupNotice);
msg.toAgentID = member.AgentID.Guid; msg.toAgentID = member.AgentID.Guid;
OutgoingInstantMessage(msg, member.AgentID); OutgoingInstantMessage(msg, member.AgentID);
@ -1024,12 +1030,22 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
public void InviteGroupRequest(IClientAPI remoteClient, UUID groupID, UUID invitedAgentID, UUID roleID) public void InviteGroupRequest(IClientAPI remoteClient, UUID groupID, UUID invitedAgentID, UUID roleID)
{ {
if (m_debugEnabled) m_log.DebugFormat("[GROUPS]: {0} called", System.Reflection.MethodBase.GetCurrentMethod().Name); if (m_debugEnabled)
{
m_log.DebugFormat("[GROUPS]: {0} called", System.Reflection.MethodBase.GetCurrentMethod().Name);
m_log.DebugFormat("[GROUPS]: remoteClient({0}) groupID({0}) invitedAgentID({0}) roleID({0})", remoteClient, groupID, invitedAgentID, roleID);
}
// Todo: Security check, probably also want to send some kind of notification // Todo: Security check, probably also want to send some kind of notification
UUID InviteID = UUID.Random(); UUID InviteID = UUID.Random();
m_groupData.AddAgentToGroupInvite(GetRequestingAgentID(remoteClient), InviteID, groupID, roleID, invitedAgentID); UUID requestingAgentID = GetRequestingAgentID(remoteClient);
if (requestingAgentID == UUID.Zero)
{
m_log.Error("[GROUPS] Group Invite Requires a valid requesting agent to be specified");
}
m_groupData.AddAgentToGroupInvite(requestingAgentID, InviteID, groupID, roleID, invitedAgentID);
// Check to see if the invite went through, if it did not then it's possible // Check to see if the invite went through, if it did not then it's possible
// the remoteClient did not validate or did not have permission to invite. // the remoteClient did not validate or did not have permission to invite.

View File

@ -40,6 +40,7 @@ using OpenMetaverse;
using OpenMetaverse.StructuredData; using OpenMetaverse.StructuredData;
using OpenSim.Framework; using OpenSim.Framework;
using OpenSim.Framework.Communications;
using OpenSim.Region.Framework.Interfaces; using OpenSim.Region.Framework.Interfaces;
namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
@ -66,6 +67,11 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
private string m_groupReadKey = string.Empty; private string m_groupReadKey = string.Empty;
private string m_groupWriteKey = string.Empty; private string m_groupWriteKey = string.Empty;
private IUserService m_userService = null;
private CommunicationsManager m_commManager = null;
private bool m_debugEnabled = false;
// Used to track which agents are have dropped from a group chat session // Used to track which agents are have dropped from a group chat session
// Should be reset per agent, on logon // Should be reset per agent, on logon
@ -110,7 +116,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
m_log.InfoFormat("[GROUPS-CONNECTOR]: Initializing {0}", this.Name); m_log.InfoFormat("[GROUPS-CONNECTOR]: Initializing {0}", this.Name);
m_groupsServerURI = groupsConfig.GetString("GroupsServerURI", string.Empty); m_groupsServerURI = groupsConfig.GetString("GroupsServerURI", groupsConfig.GetString("XmlRpcServiceURL", string.Empty));
if ((m_groupsServerURI == null) || if ((m_groupsServerURI == null) ||
(m_groupsServerURI == string.Empty)) (m_groupsServerURI == string.Empty))
{ {
@ -124,7 +130,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
m_groupReadKey = groupsConfig.GetString("XmlRpcServiceReadKey", string.Empty); m_groupReadKey = groupsConfig.GetString("XmlRpcServiceReadKey", string.Empty);
m_groupWriteKey = groupsConfig.GetString("XmlRpcServiceWriteKey", string.Empty); m_groupWriteKey = groupsConfig.GetString("XmlRpcServiceWriteKey", string.Empty);
m_debugEnabled = groupsConfig.GetBoolean("DebugEnabled", true);
// If we got all the config options we need, lets start'er'up // If we got all the config options we need, lets start'er'up
@ -142,6 +148,12 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
if (m_connectorEnabled) if (m_connectorEnabled)
{ {
scene.RegisterModuleInterface<IGroupsServicesConnector>(this); scene.RegisterModuleInterface<IGroupsServicesConnector>(this);
if (m_userService == null)
{
m_userService = scene.CommsManager.UserService;
m_commManager = scene.CommsManager;
}
} }
} }
@ -912,7 +924,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
string UserService; string UserService;
UUID SessionID; UUID SessionID;
GetClientGroupRequestID(requestingAgentID, out UserService, out SessionID); GetClientGroupRequestID(requestingAgentID, out UserService, out SessionID);
param.Add("requestingAgentID", requestingAgentID.ToString()); param.Add("RequestingAgentID", requestingAgentID.ToString());
param.Add("RequestingAgentUserService", UserService); param.Add("RequestingAgentUserService", UserService);
param.Add("RequestingSessionID", SessionID.ToString()); param.Add("RequestingSessionID", SessionID.ToString());
@ -920,6 +932,14 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
param.Add("ReadKey", m_groupReadKey); param.Add("ReadKey", m_groupReadKey);
param.Add("WriteKey", m_groupWriteKey); param.Add("WriteKey", m_groupWriteKey);
if (m_debugEnabled)
{
m_log.Debug("[XMLRPCGROUPDATA] XmlRpcCall Params:");
foreach (string key in param.Keys)
{
m_log.DebugFormat("[XMLRPCGROUPDATA] {0} : {1}", key, param[key]);
}
}
IList parameters = new ArrayList(); IList parameters = new ArrayList();
parameters.Add(param); parameters.Add(param);
@ -940,10 +960,13 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
m_log.ErrorFormat("[XMLRPCGROUPDATA]: An error has occured while attempting to access the XmlRpcGroups server method: {0}", function); m_log.ErrorFormat("[XMLRPCGROUPDATA]: An error has occured while attempting to access the XmlRpcGroups server method: {0}", function);
m_log.ErrorFormat("[XMLRPCGROUPDATA]: {0} ", e.ToString()); m_log.ErrorFormat("[XMLRPCGROUPDATA]: {0} ", e.ToString());
foreach (string ResponseLine in req.RequestResponse.Split(new string[] { Environment.NewLine },StringSplitOptions.None)) if ((req != null) && (req.RequestResponse != null))
{
foreach (string ResponseLine in req.RequestResponse.Split(new string[] { Environment.NewLine }, StringSplitOptions.None))
{ {
m_log.ErrorFormat("[XMLRPCGROUPDATA]: {0} ", ResponseLine); m_log.ErrorFormat("[XMLRPCGROUPDATA]: {0} ", ResponseLine);
} }
}
foreach (string key in param.Keys) foreach (string key in param.Keys)
{ {
@ -955,12 +978,13 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
return respData; return respData;
} }
if (resp.Value is Hashtable) if (resp.Value is Hashtable)
{ {
Hashtable respData = (Hashtable)resp.Value; Hashtable respData = (Hashtable)resp.Value;
if (respData.Contains("error") && !respData.Contains("succeed")) if (respData.Contains("error") && !respData.Contains("succeed"))
{ {
LogRespDataToConsoleError(respData); LogRespDataToConsoleError(function, respData);
} }
return respData; return respData;
@ -988,19 +1012,27 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
return error; return error;
} }
private void LogRespDataToConsoleError(Hashtable respData) private void LogRespDataToConsoleError(string function, Hashtable respData)
{ {
m_log.ErrorFormat("[XMLRPCGROUPDATA]: Error data from XmlRpcGroups server method: {0}", function);
m_log.Error("[XMLRPCGROUPDATA]: Error:"); m_log.Error("[XMLRPCGROUPDATA]: Error:");
foreach (string key in respData.Keys) foreach (string key in respData.Keys)
{ {
m_log.ErrorFormat("[XMLRPCGROUPDATA]: Key: {0}", key); m_log.ErrorFormat("[XMLRPCGROUPDATA]: Key: {0}", key);
if ((respData != null) && (respData.ContainsKey(key)) && (respData[key]!=null))
{
string[] lines = respData[key].ToString().Split(new char[] { '\n' }); string[] lines = respData[key].ToString().Split(new char[] { '\n' });
foreach (string line in lines) foreach (string line in lines)
{ {
m_log.ErrorFormat("[XMLRPCGROUPDATA]: {0}", line); m_log.ErrorFormat("[XMLRPCGROUPDATA]: {0}", line);
} }
}
else
{
m_log.ErrorFormat("[XMLRPCGROUPDATA]: {0} : Empty/NULL", key);
}
} }
} }
@ -1015,23 +1047,17 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
/// <returns></returns> /// <returns></returns>
private void GetClientGroupRequestID(UUID AgentID, out string UserServiceURL, out UUID SessionID) private void GetClientGroupRequestID(UUID AgentID, out string UserServiceURL, out UUID SessionID)
{ {
UserServiceURL = ""; // Default to local grid user service
UserServiceURL = m_commManager.NetworkServersInfo.UserURL; ;
// if AgentID == UUID, there will be no SessionID. This will be true when
// the region is requesting information for region use (object permissions for example)
SessionID = UUID.Zero; SessionID = UUID.Zero;
// Attempt to get User Profile, for SessionID
UserProfileData userProfile = m_userService.GetUserProfile(AgentID);
// Need to rework this based on changes to User Services if ((userProfile != null) && (userProfile is ForeignUserProfileData))
/*
UserAccount userAccount = m_accountService.GetUserAccount(UUID.Zero,AgentID);
if (userAccount == null)
{
// This should be impossible. If I've been passed a reference to a client
// that client should be registered with the UserService. So something
// is horribly wrong somewhere.
m_log.WarnFormat("[GROUPS]: Could not find a UserServiceURL for {0}", AgentID);
}
else if (userProfile is ForeignUserProfileData)
{ {
// They aren't from around here // They aren't from around here
ForeignUserProfileData fupd = (ForeignUserProfileData)userProfile; ForeignUserProfileData fupd = (ForeignUserProfileData)userProfile;
@ -1039,13 +1065,20 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
SessionID = fupd.CurrentAgent.SessionID; SessionID = fupd.CurrentAgent.SessionID;
} }
else else if (userProfile != null)
{ {
// They're a local user, use this: // Local, just use the local SessionID
UserServiceURL = m_commManager.NetworkServersInfo.UserURL;
SessionID = userProfile.CurrentAgent.SessionID; SessionID = userProfile.CurrentAgent.SessionID;
} }
*/ else if (AgentID != UUID.Zero)
{
// This should be impossible. If I've been passed a reference to a client
// that client should be registered with the UserService. So something
// is horribly wrong somewhere.
// m_log.WarnFormat("[XMLRPCGROUPDATA]: Could not find a UserServiceURL for {0}", AgentID);
}
} }
} }

View File

@ -146,6 +146,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.RegionReady
c.Position = new Vector3(((int)Constants.RegionSize * 0.5f), ((int)Constants.RegionSize * 0.5f), 30); c.Position = new Vector3(((int)Constants.RegionSize * 0.5f), ((int)Constants.RegionSize * 0.5f), 30);
c.Sender = null; c.Sender = null;
c.SenderUUID = UUID.Zero; c.SenderUUID = UUID.Zero;
c.Scene = m_scene;
m_log.InfoFormat("[RegionReady]: Region \"{0}\" is ready: \"{1}\" on channel {2}", m_log.InfoFormat("[RegionReady]: Region \"{0}\" is ready: \"{1}\" on channel {2}",
m_scene.RegionInfo.RegionName, c.Message, m_channelNotify); m_scene.RegionInfo.RegionName, c.Message, m_channelNotify);

View File

@ -10160,90 +10160,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
Notecard nc = new Notecard(); Notecard nc = new Notecard();
nc.lastRef = DateTime.Now; nc.lastRef = DateTime.Now;
nc.text = ParseText(text.Replace("\r", "").Split('\n')); nc.text = SLUtil.ParseNotecardToList(text).ToArray();
m_Notecards[assetID] = nc; m_Notecards[assetID] = nc;
} }
} }
protected static string[] ParseText(string[] input)
{
int idx = 0;
int level = 0;
List<string> output = new List<string>();
string[] words;
while (idx < input.Length)
{
if (input[idx] == "{")
{
level++;
idx++;
continue;
}
if (input[idx]== "}")
{
level--;
idx++;
continue;
}
switch (level)
{
case 0:
words = input[idx].Split(' '); // Linden text ver
// Notecards are created *really* empty. Treat that as "no text" (just like after saving an empty notecard)
if (words.Length < 3)
return new String[0];
int version = int.Parse(words[3]);
if (version != 2)
return new String[0];
break;
case 1:
words = input[idx].Split(' ');
if (words[0] == "LLEmbeddedItems")
break;
if (words[0] == "Text")
{
int len = int.Parse(words[2]);
idx++;
int count = -1;
while (count < len)
{
// int l = input[idx].Length;
string ln = input[idx];
int need = len-count-1;
if (ln.Length > need)
ln = ln.Substring(0, need);
output.Add(ln);
count += ln.Length + 1;
idx++;
}
return output.ToArray();
}
break;
case 2:
words = input[idx].Split(' '); // count
if (words[0] == "count")
{
int c = int.Parse(words[1]);
if (c > 0)
return new String[0];
break;
}
break;
}
idx++;
}
return output.ToArray();
}
public static bool IsCached(UUID assetID) public static bool IsCached(UUID assetID)
{ {
lock (m_Notecards) lock (m_Notecards)

View File

@ -71,6 +71,8 @@ namespace OpenSim.Server.Base
return m_Servers[port]; return m_Servers[port];
m_Servers[port] = new BaseHttpServer(port); m_Servers[port] = new BaseHttpServer(port);
m_Log.InfoFormat("[SERVER]: Starting new HTTP server on port {0}", port);
m_Servers[port].Start(); m_Servers[port].Start();
return m_Servers[port]; return m_Servers[port];
@ -109,6 +111,7 @@ namespace OpenSim.Server.Base
protected override void Initialise() protected override void Initialise()
{ {
m_Log.InfoFormat("[SERVER]: Starting HTTP server on port {0}", m_HttpServer.Port);
m_HttpServer.Start(); m_HttpServer.Start();
if (MainConsole.Instance is RemoteConsole) if (MainConsole.Instance is RemoteConsole)

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

Binary file not shown.

View File

@ -12,7 +12,7 @@
<log4net> <log4net>
<appender name="Console" type="OpenSim.Framework.Console.OpenSimAppender, OpenSim.Framework.Console"> <appender name="Console" type="OpenSim.Framework.Console.OpenSimAppender, OpenSim.Framework.Console">
<layout type="log4net.Layout.PatternLayout"> <layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%date{HH:mm:ss} - %message" /> <conversionPattern value="%date{HH:mm:ss,fff} - %message" />
</layout> </layout>
</appender> </appender>

View File

@ -15,16 +15,12 @@
; ;
InventoryServerURI = "http://myinventoryserver.com:8003" InventoryServerURI = "http://myinventoryserver.com:8003"
[GridService] [GridService]
; ;
; change this to your grid-wide grid server ; change this to your grid-wide grid server
; ;
GridServerURI = "http://mygridserver.com:8003" GridServerURI = "http://mygridserver.com:8003"
[Groups]
;
; change this to your grid-wide groups server
;
GroupsServerURI = "http://mygridserver.com:82/Grid/"
[Modules] [Modules]