Add copyright headers. Formatting cleanup.

0.6.5-rc1
Jeff Ames 2009-04-27 05:22:44 +00:00
parent 6077bbda30
commit 8dbcfc70bf
8 changed files with 208 additions and 189 deletions

View File

@ -202,27 +202,27 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
{ {
try try
{ {
path = rdata.path.Substring(rdata.Parameters[0].Length+qPrefix.Length+2); path = rdata.path.Substring(rdata.Parameters[0].Length+qPrefix.Length+2);
if(File.Exists(path)) if (File.Exists(path))
{ {
Rest.Log.DebugFormat("{0} File located <{1}>", MsgId, path); Rest.Log.DebugFormat("{0} File located <{1}>", MsgId, path);
Byte[] data = File.ReadAllBytes(path); Byte[] data = File.ReadAllBytes(path);
rdata.initXmlWriter(); rdata.initXmlWriter();
rdata.writer.WriteStartElement(String.Empty,"File",String.Empty); rdata.writer.WriteStartElement(String.Empty,"File",String.Empty);
rdata.writer.WriteAttributeString("name", path); rdata.writer.WriteAttributeString("name", path);
rdata.writer.WriteBase64(data,0,data.Length); rdata.writer.WriteBase64(data,0,data.Length);
rdata.writer.WriteFullEndElement(); rdata.writer.WriteFullEndElement();
} }
else else
{ {
Rest.Log.DebugFormat("{0} Invalid parameters: <{1}>", MsgId, path); Rest.Log.DebugFormat("{0} Invalid parameters: <{1}>", MsgId, path);
rdata.Fail(Rest.HttpStatusCodeNotFound, String.Format("invalid parameters : {0}", path)); rdata.Fail(Rest.HttpStatusCodeNotFound, String.Format("invalid parameters : {0}", path));
} }
} }
catch (Exception e) catch (Exception e)
{ {
Rest.Log.DebugFormat("{0} Invalid parameters: <{1}>", MsgId, e.Message); Rest.Log.DebugFormat("{0} Invalid parameters: <{1}>", MsgId, e.Message);
rdata.Fail(Rest.HttpStatusCodeNotFound, String.Format("invalid parameters : {0} {1}", rdata.Fail(Rest.HttpStatusCodeNotFound, String.Format("invalid parameters : {0} {1}",
path, e.Message)); path, e.Message));
} }
} }
@ -249,21 +249,21 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
{ {
try try
{ {
path = rdata.path.Substring(rdata.Parameters[0].Length+qPrefix.Length+2); path = rdata.path.Substring(rdata.Parameters[0].Length+qPrefix.Length+2);
bool maymod = File.Exists(path); bool maymod = File.Exists(path);
rdata.initXmlReader(); rdata.initXmlReader();
XmlReader xml = rdata.reader; XmlReader xml = rdata.reader;
if (!xml.ReadToFollowing("File")) if (!xml.ReadToFollowing("File"))
{ {
Rest.Log.DebugFormat("{0} Invalid request data: <{1}>", MsgId, rdata.path); Rest.Log.DebugFormat("{0} Invalid request data: <{1}>", MsgId, rdata.path);
rdata.Fail(Rest.HttpStatusCodeBadRequest,"invalid request data"); rdata.Fail(Rest.HttpStatusCodeBadRequest,"invalid request data");
} }
Byte[] data = Convert.FromBase64String(xml.ReadElementContentAsString("File", "")); Byte[] data = Convert.FromBase64String(xml.ReadElementContentAsString("File", ""));
File.WriteAllBytes(path,data); File.WriteAllBytes(path,data);
modified = maymod; modified = maymod;
created = ! maymod; created = ! maymod;
} }
@ -319,21 +319,21 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
{ {
try try
{ {
path = rdata.path.Substring(rdata.Parameters[0].Length+qPrefix.Length+2); path = rdata.path.Substring(rdata.Parameters[0].Length+qPrefix.Length+2);
bool maymod = File.Exists(path); bool maymod = File.Exists(path);
rdata.initXmlReader(); rdata.initXmlReader();
XmlReader xml = rdata.reader; XmlReader xml = rdata.reader;
if (!xml.ReadToFollowing("File")) if (!xml.ReadToFollowing("File"))
{ {
Rest.Log.DebugFormat("{0} Invalid request data: <{1}>", MsgId, rdata.path); Rest.Log.DebugFormat("{0} Invalid request data: <{1}>", MsgId, rdata.path);
rdata.Fail(Rest.HttpStatusCodeBadRequest,"invalid request data"); rdata.Fail(Rest.HttpStatusCodeBadRequest,"invalid request data");
} }
Byte[] data = Convert.FromBase64String(xml.ReadElementContentAsString("File", "")); Byte[] data = Convert.FromBase64String(xml.ReadElementContentAsString("File", ""));
File.WriteAllBytes(path,data); File.WriteAllBytes(path,data);
modified = maymod; modified = maymod;
created = ! maymod; created = ! maymod;
} }
@ -389,12 +389,12 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
{ {
try try
{ {
path = rdata.path.Substring(rdata.Parameters[0].Length+qPrefix.Length+2); path = rdata.path.Substring(rdata.Parameters[0].Length+qPrefix.Length+2);
if(File.Exists(path)) if (File.Exists(path))
{ {
File.Delete(path); File.Delete(path);
} }
} }
catch (Exception e) catch (Exception e)
{ {

View File

@ -259,7 +259,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Chat
Connect(); Connect();
} }
lock(m_connectors) lock (m_connectors)
m_connectors.Add(this); m_connectors.Add(this);
m_enabled = true; m_enabled = true;
@ -306,8 +306,8 @@ namespace OpenSim.Region.OptionalModules.Avatar.Chat
} }
lock(m_connectors) lock (m_connectors)
m_connectors.Remove(this); m_connectors.Remove(this);
} }
} }
@ -845,7 +845,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Chat
_pdk_ = (_pdk_+1)%PING_PERIOD; // cycle the ping trigger _pdk_ = (_pdk_+1)%PING_PERIOD; // cycle the ping trigger
_icc_++; // increment the inter-consecutive-connect-delay counter _icc_++; // increment the inter-consecutive-connect-delay counter
lock(m_connectors) lock (m_connectors)
foreach (IRCConnector connector in m_connectors) foreach (IRCConnector connector in m_connectors)
{ {

View File

@ -105,7 +105,6 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
} }
m_debugEnabled = groupsConfig.GetBoolean("XmlRpcDebugEnabled", true); m_debugEnabled = groupsConfig.GetBoolean("XmlRpcDebugEnabled", true);
} }
m_log.Info("[GROUPS-MESSAGING]: XmlRpcGroupsMessaging starting up"); m_log.Info("[GROUPS-MESSAGING]: XmlRpcGroupsMessaging starting up");
@ -123,7 +122,6 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
if (m_debugEnabled) m_log.DebugFormat("[GROUPS-MESSAGING] {0} called", System.Reflection.MethodBase.GetCurrentMethod().Name); if (m_debugEnabled) m_log.DebugFormat("[GROUPS-MESSAGING] {0} called", System.Reflection.MethodBase.GetCurrentMethod().Name);
m_groupsModule = scene.RequestModuleInterface<IGroupsModule>(); m_groupsModule = scene.RequestModuleInterface<IGroupsModule>();
// No groups module, no groups messaging // No groups module, no groups messaging
@ -164,13 +162,12 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
m_sceneList.Remove(scene); m_sceneList.Remove(scene);
} }
public void Close() public void Close()
{ {
if (!m_groupMessagingEnabled) if (!m_groupMessagingEnabled)
return; return;
if(m_debugEnabled) m_log.Debug("[GROUPS-MESSAGING]: Shutting down XmlRpcGroupsMessaging module."); if (m_debugEnabled) m_log.Debug("[GROUPS-MESSAGING]: Shutting down XmlRpcGroupsMessaging module.");
foreach (Scene scene in m_sceneList) foreach (Scene scene in m_sceneList)
{ {
@ -222,19 +219,17 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
{ {
m_log.DebugFormat("[GROUPS-MESSAGING] {0} called", System.Reflection.MethodBase.GetCurrentMethod().Name); m_log.DebugFormat("[GROUPS-MESSAGING] {0} called", System.Reflection.MethodBase.GetCurrentMethod().Name);
DebugGridInstantMessage(msg); DebugGridInstantMessage(msg);
} }
// Incoming message from a group // Incoming message from a group
if ((msg.fromGroup == true) && if ((msg.fromGroup == true) &&
( (msg.dialog == (byte)InstantMessageDialog.SessionSend) ((msg.dialog == (byte)InstantMessageDialog.SessionSend)
|| (msg.dialog == (byte)InstantMessageDialog.SessionAdd) || (msg.dialog == (byte)InstantMessageDialog.SessionAdd)
|| (msg.dialog == (byte)InstantMessageDialog.SessionDrop) || (msg.dialog == (byte)InstantMessageDialog.SessionDrop)))
))
{ {
ProcessMessageFromGroupSession(msg); ProcessMessageFromGroupSession(msg);
} }
} }
private void ProcessMessageFromGroupSession(GridInstantMessage msg) private void ProcessMessageFromGroupSession(GridInstantMessage msg)
@ -254,53 +249,52 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
case (byte)InstantMessageDialog.SessionSend: case (byte)InstantMessageDialog.SessionSend:
if (!m_agentsInGroupSession.ContainsKey(msg.toAgentID) if (!m_agentsInGroupSession.ContainsKey(msg.toAgentID)
&& !m_agentsDroppedSession.ContainsKey(msg.toAgentID)) && !m_agentsDroppedSession.ContainsKey(msg.toAgentID))
{ {
// Agent not in session and hasn't dropped from session // Agent not in session and hasn't dropped from session
// Add them to the session for now, and Invite them // Add them to the session for now, and Invite them
AddAgentToGroupSession(msg.toAgentID, msg.imSessionID); AddAgentToGroupSession(msg.toAgentID, msg.imSessionID);
UUID toAgentID = new UUID(msg.toAgentID); UUID toAgentID = new UUID(msg.toAgentID);
IClientAPI activeClient = GetActiveClient(toAgentID); IClientAPI activeClient = GetActiveClient(toAgentID);
if (activeClient != null) if (activeClient != null)
{ {
UUID groupID = new UUID(msg.fromAgentID); UUID groupID = new UUID(msg.fromAgentID);
GroupRecord groupInfo = m_groupsModule.GetGroupRecord(groupID); GroupRecord groupInfo = m_groupsModule.GetGroupRecord(groupID);
if (groupInfo != null) if (groupInfo != null)
{ {
if (m_debugEnabled) m_log.DebugFormat("[GROUPS-MESSAGING] Sending chatterbox invite instant message"); if (m_debugEnabled) m_log.DebugFormat("[GROUPS-MESSAGING] Sending chatterbox invite instant message");
// Force? open the group session dialog??? // Force? open the group session dialog???
IEventQueue eq = activeClient.Scene.RequestModuleInterface<IEventQueue>(); IEventQueue eq = activeClient.Scene.RequestModuleInterface<IEventQueue>();
eq.ChatterboxInvitation( eq.ChatterboxInvitation(
groupID groupID
, groupInfo.GroupName , groupInfo.GroupName
, new UUID(msg.fromAgentID) , new UUID(msg.fromAgentID)
, msg.message, new UUID(msg.toAgentID) , msg.message, new UUID(msg.toAgentID)
, msg.fromAgentName , msg.fromAgentName
, msg.dialog , msg.dialog
, msg.timestamp , msg.timestamp
, msg.offline == 1 , msg.offline == 1
, (int)msg.ParentEstateID , (int)msg.ParentEstateID
, msg.Position , msg.Position
, 1 , 1
, new UUID(msg.imSessionID) , new UUID(msg.imSessionID)
, msg.fromGroup , msg.fromGroup
, Utils.StringToBytes(groupInfo.GroupName) , Utils.StringToBytes(groupInfo.GroupName)
); );
eq.ChatterBoxSessionAgentListUpdates(
new UUID(groupID)
, new UUID(msg.fromAgentID)
, new UUID(msg.toAgentID)
, false //canVoiceChat
, false //isModerator
, false //text mute
);
eq.ChatterBoxSessionAgentListUpdates(
new UUID(groupID)
, new UUID(msg.fromAgentID)
, new UUID(msg.toAgentID)
, false //canVoiceChat
, false //isModerator
, false //text mute
);
}
}
} }
}
}
else if (!m_agentsDroppedSession.ContainsKey(msg.toAgentID)) else if (!m_agentsDroppedSession.ContainsKey(msg.toAgentID))
{ {
// User hasn't dropped, so they're in the session, // User hasn't dropped, so they're in the session,
@ -322,10 +316,8 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
default: default:
m_log.WarnFormat("[GROUPS-MESSAGING] I don't know how to proccess a {0} message.", ((InstantMessageDialog)msg.dialog).ToString()); m_log.WarnFormat("[GROUPS-MESSAGING] I don't know how to proccess a {0} message.", ((InstantMessageDialog)msg.dialog).ToString());
break; break;
}
} }
}
#endregion #endregion
@ -333,16 +325,16 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
private void RemoveAgentFromGroupSession(Guid agentID, Guid sessionID) private void RemoveAgentFromGroupSession(Guid agentID, Guid sessionID)
{ {
if( m_agentsInGroupSession.ContainsKey(sessionID) ) if (m_agentsInGroupSession.ContainsKey(sessionID))
{ {
// If in session remove // If in session remove
if( m_agentsInGroupSession[sessionID].Contains(agentID) ) if (m_agentsInGroupSession[sessionID].Contains(agentID))
{ {
m_agentsInGroupSession[sessionID].Remove(agentID); m_agentsInGroupSession[sessionID].Remove(agentID);
} }
// If not in dropped list, add // If not in dropped list, add
if( !m_agentsDroppedSession[sessionID].Contains(agentID) ) if (!m_agentsDroppedSession[sessionID].Contains(agentID))
{ {
if (m_debugEnabled) m_log.DebugFormat("[GROUPS-MESSAGING] Dropped {1} from session {0}", sessionID, agentID); if (m_debugEnabled) m_log.DebugFormat("[GROUPS-MESSAGING] Dropped {1} from session {0}", sessionID, agentID);
m_agentsDroppedSession[sessionID].Add(agentID); m_agentsDroppedSession[sessionID].Add(agentID);
@ -356,13 +348,13 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
CreateGroupSessionTracking(sessionID); CreateGroupSessionTracking(sessionID);
// If nessesary, remove from dropped list // If nessesary, remove from dropped list
if( m_agentsDroppedSession[sessionID].Contains(agentID) ) if (m_agentsDroppedSession[sessionID].Contains(agentID))
{ {
m_agentsDroppedSession[sessionID].Remove(agentID); m_agentsDroppedSession[sessionID].Remove(agentID);
} }
// If nessesary, add to in session list // If nessesary, add to in session list
if( !m_agentsInGroupSession[sessionID].Contains(agentID) ) if (!m_agentsInGroupSession[sessionID].Contains(agentID))
{ {
if (m_debugEnabled) m_log.DebugFormat("[GROUPS-MESSAGING] Added {1} to session {0}", sessionID, agentID); if (m_debugEnabled) m_log.DebugFormat("[GROUPS-MESSAGING] Added {1} to session {0}", sessionID, agentID);
m_agentsInGroupSession[sessionID].Add(agentID); m_agentsInGroupSession[sessionID].Add(agentID);
@ -385,7 +377,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
{ {
m_log.DebugFormat("[GROUPS-MESSAGING] {0} called", System.Reflection.MethodBase.GetCurrentMethod().Name); m_log.DebugFormat("[GROUPS-MESSAGING] {0} called", System.Reflection.MethodBase.GetCurrentMethod().Name);
DebugGridInstantMessage(im); DebugGridInstantMessage(im);
} }
// Start group IM session // Start group IM session
@ -424,13 +416,13 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
SendMessageToGroup(im, groupID); SendMessageToGroup(im, groupID);
} }
} }
#endregion #endregion
private void SendMessageToGroup(GridInstantMessage im, UUID groupID) private void SendMessageToGroup(GridInstantMessage im, UUID groupID)
{ {
if (m_debugEnabled) m_log.DebugFormat("[GROUPS-MESSAGING] {0} called", System.Reflection.MethodBase.GetCurrentMethod().Name); if (m_debugEnabled) m_log.DebugFormat("[GROUPS-MESSAGING] {0} called", System.Reflection.MethodBase.GetCurrentMethod().Name);
foreach (GroupMembersData member in m_groupsModule.GroupMembersRequest(null, groupID)) foreach (GroupMembersData member in m_groupsModule.GroupMembersRequest(null, groupID))
{ {
if (m_agentsDroppedSession[im.imSessionID].Contains(member.AgentID.Guid)) if (m_agentsDroppedSession[im.imSessionID].Contains(member.AgentID.Guid))
@ -441,15 +433,15 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
} }
// Copy Message // Copy Message
GridInstantMessage msg = new GridInstantMessage(); GridInstantMessage msg = new GridInstantMessage();
msg.imSessionID = im.imSessionID; msg.imSessionID = im.imSessionID;
msg.fromAgentName = im.fromAgentName; msg.fromAgentName = im.fromAgentName;
msg.message = im.message; msg.message = im.message;
msg.dialog = im.dialog; msg.dialog = im.dialog;
msg.offline = im.offline; msg.offline = im.offline;
msg.ParentEstateID = im.ParentEstateID; msg.ParentEstateID = im.ParentEstateID;
msg.Position = im.Position; msg.Position = im.Position;
msg.RegionID = im.RegionID; msg.RegionID = im.RegionID;
msg.binaryBucket = im.binaryBucket; msg.binaryBucket = im.binaryBucket;
msg.timestamp = (uint)Util.UnixTimeSinceEpoch(); msg.timestamp = (uint)Util.UnixTimeSinceEpoch();
@ -464,8 +456,8 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
{ {
// If they're not local, forward across the grid // If they're not local, forward across the grid
if (m_debugEnabled) m_log.DebugFormat("[GROUPS-MESSAGING] Delivering to {0} via Grid", member.AgentID); if (m_debugEnabled) m_log.DebugFormat("[GROUPS-MESSAGING] Delivering to {0} via Grid", member.AgentID);
m_msgTransferModule.SendInstantMessage(msg, delegate(bool success) { }); m_msgTransferModule.SendInstantMessage(msg, delegate(bool success) { });
} }
else else
{ {
// Deliver locally, directly // Deliver locally, directly
@ -488,24 +480,20 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
sessionMap.Add("type", OSD.FromInteger(0)); sessionMap.Add("type", OSD.FromInteger(0));
sessionMap.Add("voice_enabled", OSD.FromBoolean(false)); sessionMap.Add("voice_enabled", OSD.FromBoolean(false));
OSDMap bodyMap = new OSDMap(4); OSDMap bodyMap = new OSDMap(4);
bodyMap.Add("session_id", OSD.FromUUID(groupID)); bodyMap.Add("session_id", OSD.FromUUID(groupID));
bodyMap.Add("temp_session_id", OSD.FromUUID(groupID)); bodyMap.Add("temp_session_id", OSD.FromUUID(groupID));
bodyMap.Add("success", OSD.FromBoolean(true)); bodyMap.Add("success", OSD.FromBoolean(true));
bodyMap.Add("session_info", sessionMap); bodyMap.Add("session_info", sessionMap);
IEventQueue queue = remoteClient.Scene.RequestModuleInterface<IEventQueue>(); IEventQueue queue = remoteClient.Scene.RequestModuleInterface<IEventQueue>();
if (queue != null) if (queue != null)
{ {
queue.Enqueue(EventQueueHelper.buildEvent("ChatterBoxSessionStartReply", bodyMap), remoteClient.AgentId); queue.Enqueue(EventQueueHelper.buildEvent("ChatterBoxSessionStartReply", bodyMap), remoteClient.AgentId);
} }
} }
private void DebugGridInstantMessage(GridInstantMessage im) private void DebugGridInstantMessage(GridInstantMessage im)
{ {
if (m_debugEnabled) if (m_debugEnabled)
@ -535,7 +523,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
foreach (Scene scene in m_sceneList) foreach (Scene scene in m_sceneList)
{ {
if (scene.Entities.ContainsKey(agentID) && if (scene.Entities.ContainsKey(agentID) &&
scene.Entities[agentID] is ScenePresence) scene.Entities[agentID] is ScenePresence)
{ {
ScenePresence user = (ScenePresence)scene.Entities[agentID]; ScenePresence user = (ScenePresence)scene.Entities[agentID];
if (!user.IsChildAgent) if (!user.IsChildAgent)
@ -546,7 +534,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
{ {
child = user.ControllingClient; child = user.ControllingClient;
} }
} }
} }
// If we didn't find a root, then just return whichever child we found, or null if none // If we didn't find a root, then just return whichever child we found, or null if none
@ -555,5 +543,4 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
#endregion #endregion
} }
} }

View File

@ -143,13 +143,13 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
if (m_msgTransferModule == null) if (m_msgTransferModule == null)
{ {
m_msgTransferModule = scene.RequestModuleInterface<IMessageTransferModule>(); m_msgTransferModule = scene.RequestModuleInterface<IMessageTransferModule>();
// No message transfer module, no notices, group invites, rejects, ejects, etc // No message transfer module, no notices, group invites, rejects, ejects, etc
if (m_msgTransferModule == null) if (m_msgTransferModule == null)
{ {
m_groupsEnabled = false; m_groupsEnabled = false;
m_log.Error("[GROUPS]: Could not get MessageTransferModule"); m_log.Error("[GROUPS]: Could not get MessageTransferModule");
Close(); Close();
return; return;
} }
@ -157,7 +157,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
lock (m_sceneList) lock (m_sceneList)
{ {
m_sceneList.Add(scene); m_sceneList.Add(scene);
} }
scene.EventManager.OnNewClient += OnNewClient; scene.EventManager.OnNewClient += OnNewClient;
@ -178,7 +178,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
lock (m_sceneList) lock (m_sceneList)
{ {
m_sceneList.Remove(scene); m_sceneList.Remove(scene);
} }
} }
@ -313,16 +313,13 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
GroupName = "Unknown"; GroupName = "Unknown";
} }
remote_client.SendGroupNameReply(GroupID, GroupName); remote_client.SendGroupNameReply(GroupID, GroupName);
} }
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);
// 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))
{ {
@ -334,7 +331,6 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
UUID fromAgentID = new UUID(im.fromAgentID); UUID fromAgentID = new UUID(im.fromAgentID);
if ((inviteInfo != null) && (fromAgentID == inviteInfo.AgentID)) if ((inviteInfo != null) && (fromAgentID == inviteInfo.AgentID))
{ {
// Accept // Accept
if (im.dialog == (byte)InstantMessageDialog.GroupInvitationAccept) if (im.dialog == (byte)InstantMessageDialog.GroupInvitationAccept)
{ {
@ -373,10 +369,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
{ {
if (m_debugEnabled) m_log.DebugFormat("[GROUPS] Received a reject invite notice."); if (m_debugEnabled) m_log.DebugFormat("[GROUPS] Received a reject invite notice.");
m_groupData.RemoveAgentToGroupInvite(inviteID); m_groupData.RemoveAgentToGroupInvite(inviteID);
} }
} }
} }
@ -411,14 +404,14 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
binBucket = binBucket.Remove(0, 14).Trim(); binBucket = binBucket.Remove(0, 14).Trim();
if (m_debugEnabled) if (m_debugEnabled)
{ {
m_log.WarnFormat("I don't understand a group notice binary bucket of: {0}", binBucket); m_log.WarnFormat("I don't understand a group notice binary bucket of: {0}", binBucket);
OSDMap binBucketOSD = (OSDMap)OSDParser.DeserializeLLSDXml(binBucket); OSDMap binBucketOSD = (OSDMap)OSDParser.DeserializeLLSDXml(binBucket);
foreach (string key in binBucketOSD.Keys) foreach (string key in binBucketOSD.Keys)
{ {
m_log.WarnFormat("{0}: {1}", key, binBucketOSD[key].ToString()); m_log.WarnFormat("{0}: {1}", key, binBucketOSD[key].ToString());
} }
} }
// treat as if no attachment // treat as if no attachment
@ -429,7 +422,6 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
bucket[18] = 0; //dunno bucket[18] = 0; //dunno
} }
m_groupData.AddGroupNotice(GroupID, NoticeID, im.fromAgentName, Subject, Message, bucket); m_groupData.AddGroupNotice(GroupID, NoticeID, im.fromAgentName, Subject, Message, bucket);
if (OnNewGroupNotice != null) if (OnNewGroupNotice != null)
{ {
@ -446,12 +438,8 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
msg.toAgentID = member.AgentID.Guid; msg.toAgentID = member.AgentID.Guid;
OutgoingInstantMessage(msg, member.AgentID); OutgoingInstantMessage(msg, member.AgentID);
} }
} }
} }
} }
@ -477,11 +465,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
UUID groupID = new UUID(im.fromAgentID); UUID groupID = new UUID(im.fromAgentID);
ejectee.SendAgentDropGroup(groupID); ejectee.SendAgentDropGroup(groupID);
} }
} }
} }
private void OnGridInstantMessage(GridInstantMessage msg) private void OnGridInstantMessage(GridInstantMessage msg)
@ -491,7 +475,6 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
// Trigger the above event handler // Trigger the above event handler
OnInstantMessage(null, msg); OnInstantMessage(null, msg);
// If a message from a group arrives here, it may need to be forwarded to a local client // If a message from a group arrives here, it may need to be forwarded to a local client
if (msg.fromGroup == true) if (msg.fromGroup == true)
{ {
@ -501,17 +484,15 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
case (byte)InstantMessageDialog.GroupNotice: case (byte)InstantMessageDialog.GroupNotice:
UUID toAgentID = new UUID(msg.toAgentID); UUID toAgentID = new UUID(msg.toAgentID);
IClientAPI localClient = GetActiveClient(toAgentID); IClientAPI localClient = GetActiveClient(toAgentID);
if( localClient != null ) if (localClient != null)
{ {
localClient.SendInstantMessage(msg); localClient.SendInstantMessage(msg);
} }
break; break;
} }
} }
} }
#endregion #endregion
#region IGroupsModule Members #region IGroupsModule Members
@ -570,8 +551,8 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
List<GroupMembersData> data = m_groupData.GetGroupMembers(groupID); List<GroupMembersData> data = m_groupData.GetGroupMembers(groupID);
if (m_debugEnabled) if (m_debugEnabled)
{ {
foreach (GroupMembersData member in data) foreach (GroupMembersData member in data)
{ {
m_log.DebugFormat("[GROUPS] {0} {1}", member.AgentID, member.Title); m_log.DebugFormat("[GROUPS] {0} {1}", member.AgentID, member.Title);
} }
} }
@ -588,8 +569,8 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
if (m_debugEnabled) if (m_debugEnabled)
{ {
foreach (GroupRolesData member in data) foreach (GroupRolesData member in data)
{ {
m_log.DebugFormat("[GROUPS] {0} {1}", member.Title, member.Members); m_log.DebugFormat("[GROUPS] {0} {1}", member.Title, member.Members);
} }
} }
@ -606,8 +587,8 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
if (m_debugEnabled) if (m_debugEnabled)
{ {
foreach (GroupRoleMembersData member in data) foreach (GroupRoleMembersData member in data)
{ {
m_log.DebugFormat("[GROUPS] Av: {0} Role: {1}", member.MemberID, member.RoleID); m_log.DebugFormat("[GROUPS] Av: {0} Role: {1}", member.MemberID, member.RoleID);
} }
} }

View File

@ -1,4 +1,31 @@
using System; /*
* Copyright (c) Contributors, http://opensimulator.org/
* See CONTRIBUTORS.TXT for a full list of copyright holders.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of the OpenSimulator Project nor the
* names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
using System;
using System.Collections; using System.Collections;
using System.Collections.Generic; using System.Collections.Generic;
using System.Text; using System.Text;

View File

@ -1,4 +1,31 @@
using System; /*
* Copyright (c) Contributors, http://opensimulator.org/
* See CONTRIBUTORS.TXT for a full list of copyright holders.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of the OpenSimulator Project nor the
* names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
using System;
using System.Collections; using System.Collections;
using System.Collections.Generic; using System.Collections.Generic;
using System.Text; using System.Text;
@ -20,7 +47,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
{ {
lock (m_threads) lock (m_threads)
{ {
if(m_threads.Count == 0) if (m_threads.Count == 0)
return; return;
int i = 0; int i = 0;

View File

@ -42,7 +42,7 @@ namespace OpenSim
Host.Console.Info("Microthreaded 2" + param); Host.Console.Info("Microthreaded 2" + param);
yield return null; yield return null;
int c = 100; int c = 100;
while(c-- < 0) while (c-- < 0)
{ {
Host.Console.Info("Microthreaded Looped " + c + " " + param); Host.Console.Info("Microthreaded Looped " + c + " " + param);
yield return null; yield return null;
@ -64,7 +64,7 @@ namespace OpenSim
Microthread(TestMicrothread("Ohai")); Microthread(TestMicrothread("Ohai"));
int i = 0; int i = 0;
while(threads.Count > 0) while (threads.Count > 0)
{ {
i++; i++;
bool running = threads[i%threads.Count].MoveNext(); bool running = threads[i%threads.Count].MoveNext();

View File

@ -6852,7 +6852,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
part.ScriptSetTemporaryStatus(tempOnRez); part.ScriptSetTemporaryStatus(tempOnRez);
break; break;
case (int)ScriptBaseClass.PRIM_TEXGEN: case (int)ScriptBaseClass.PRIM_TEXGEN:
if (remain < 2) if (remain < 2)
return; return;
@ -6894,7 +6894,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
} }
} }
public LSL_String llXorBase64Strings(string str1, string str2) public LSL_String llXorBase64Strings(string str1, string str2)
{ {
m_host.AddScriptLPS(1); m_host.AddScriptLPS(1);
@ -7215,7 +7214,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
// vector profilecut // vector profilecut
res.Add(new LSL_Vector(Shape.ProfileBegin / 50000.0, 1 - Shape.ProfileEnd / 50000.0, 0)); res.Add(new LSL_Vector(Shape.ProfileBegin / 50000.0, 1 - Shape.ProfileEnd / 50000.0, 0));
// vector tapera // vector tapera
res.Add(new LSL_Vector(Shape.PathTaperX / 100.0, Shape.PathTaperY / 100.0, 0)); res.Add(new LSL_Vector(Shape.PathTaperX / 100.0, Shape.PathTaperY / 100.0, 0));
@ -7228,7 +7226,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
// float skew // float skew
res.Add(new LSL_Float(Shape.PathSkew / 100.0)); res.Add(new LSL_Float(Shape.PathSkew / 100.0));
break; break;
} }
break; break;
@ -7246,11 +7243,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
res.Add(new LSL_String(texface.TextureID.ToString())); res.Add(new LSL_String(texface.TextureID.ToString()));
res.Add(new LSL_Vector(texface.RepeatU, res.Add(new LSL_Vector(texface.RepeatU,
texface.RepeatV, texface.RepeatV,
0)); 0));
res.Add(new LSL_Vector(texface.OffsetU, res.Add(new LSL_Vector(texface.OffsetU,
texface.OffsetV, texface.OffsetV,
0)); 0));
res.Add(new LSL_Float(texface.Rotation)); res.Add(new LSL_Float(texface.Rotation));
} }
} }
@ -7262,11 +7259,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
res.Add(new LSL_String(texface.TextureID.ToString())); res.Add(new LSL_String(texface.TextureID.ToString()));
res.Add(new LSL_Vector(texface.RepeatU, res.Add(new LSL_Vector(texface.RepeatU,
texface.RepeatV, texface.RepeatV,
0)); 0));
res.Add(new LSL_Vector(texface.OffsetU, res.Add(new LSL_Vector(texface.OffsetU,
texface.OffsetV, texface.OffsetV,
0)); 0));
res.Add(new LSL_Float(texface.Rotation)); res.Add(new LSL_Float(texface.Rotation));
} }
} }
@ -7286,8 +7283,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
{ {
texcolor = tex.GetFace((uint)face).RGBA; texcolor = tex.GetFace((uint)face).RGBA;
res.Add(new LSL_Vector(texcolor.R, res.Add(new LSL_Vector(texcolor.R,
texcolor.G, texcolor.G,
texcolor.B)); texcolor.B));
res.Add(new LSL_Float(texcolor.A)); res.Add(new LSL_Float(texcolor.A));
} }
} }
@ -7295,8 +7292,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
{ {
texcolor = tex.GetFace((uint)face).RGBA; texcolor = tex.GetFace((uint)face).RGBA;
res.Add(new LSL_Vector(texcolor.R, res.Add(new LSL_Vector(texcolor.R,
texcolor.G, texcolor.G,
texcolor.B)); texcolor.B));
res.Add(new LSL_Float(texcolor.A)); res.Add(new LSL_Float(texcolor.A));
} }
break; break;
@ -7335,8 +7332,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
res.Add(new LSL_Float(shape.FlexiWind)); // wind res.Add(new LSL_Float(shape.FlexiWind)); // wind
res.Add(new LSL_Float(shape.FlexiTension)); // tension res.Add(new LSL_Float(shape.FlexiTension)); // tension
res.Add(new LSL_Vector(shape.FlexiForceX, // force res.Add(new LSL_Vector(shape.FlexiForceX, // force
shape.FlexiForceY, shape.FlexiForceY,
shape.FlexiForceZ)); shape.FlexiForceZ));
break; break;
case (int)ScriptBaseClass.PRIM_TEXGEN: case (int)ScriptBaseClass.PRIM_TEXGEN:
@ -7358,8 +7355,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
else else
res.Add(new LSL_Integer(0)); res.Add(new LSL_Integer(0));
res.Add(new LSL_Vector(shape.LightColorR, // color res.Add(new LSL_Vector(shape.LightColorR, // color
shape.LightColorG, shape.LightColorG,
shape.LightColorB)); shape.LightColorB));
res.Add(new LSL_Float(shape.LightIntensity)); // intensity res.Add(new LSL_Float(shape.LightIntensity)); // intensity
res.Add(new LSL_Float(shape.LightRadius)); // radius res.Add(new LSL_Float(shape.LightRadius)); // radius
res.Add(new LSL_Float(shape.LightFalloff)); // falloff res.Add(new LSL_Float(shape.LightFalloff)); // falloff