aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/XmlRpcGroupsModule.cs
diff options
context:
space:
mode:
authorJustin Clarke Casey2009-07-24 20:08:26 +0000
committerJustin Clarke Casey2009-07-24 20:08:26 +0000
commita7c894829262f99d726c28b2b3438aa937f93446 (patch)
tree64b6294178c5260bbb131d40b98234a472909f47 /OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/XmlRpcGroupsModule.cs
parent* Apply asset and inventory name and description bound checks to MySQL (diff)
downloadopensim-SC-a7c894829262f99d726c28b2b3438aa937f93446.zip
opensim-SC-a7c894829262f99d726c28b2b3438aa937f93446.tar.gz
opensim-SC-a7c894829262f99d726c28b2b3438aa937f93446.tar.bz2
opensim-SC-a7c894829262f99d726c28b2b3438aa937f93446.tar.xz
* Apply http://opensimulator.org/mantis/view.php?id=3855
* Prevent session crashes when something goes wrong with group invite. * Thanks mcortez.
Diffstat (limited to 'OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/XmlRpcGroupsModule.cs')
-rw-r--r--OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/XmlRpcGroupsModule.cs64
1 files changed, 40 insertions, 24 deletions
diff --git a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/XmlRpcGroupsModule.cs b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/XmlRpcGroupsModule.cs
index fc19785..2cbc571 100644
--- a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/XmlRpcGroupsModule.cs
+++ b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/XmlRpcGroupsModule.cs
@@ -122,7 +122,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
122 return; 122 return;
123 } 123 }
124 124
125 m_log.Info("[GROUPS]: Initializing XmlRpcGroups"); 125 m_log.InfoFormat("[GROUPS]: Initializing {0}", this.Name);
126 126
127 string ServiceURL = groupsConfig.GetString("XmlRpcServiceURL", m_defaultXmlRpcServiceURL); 127 string ServiceURL = groupsConfig.GetString("XmlRpcServiceURL", m_defaultXmlRpcServiceURL);
128 bool DisableKeepAlive = groupsConfig.GetBoolean("XmlRpcDisableKeepAlive", false); 128 bool DisableKeepAlive = groupsConfig.GetBoolean("XmlRpcDisableKeepAlive", false);
@@ -138,6 +138,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
138 138
139 m_clientRequestIDFlushTimer.Interval = m_clientRequestIDFlushTimeOut; 139 m_clientRequestIDFlushTimer.Interval = m_clientRequestIDFlushTimeOut;
140 m_clientRequestIDFlushTimer.Elapsed += FlushClientRequestIDInfoCache; 140 m_clientRequestIDFlushTimer.Elapsed += FlushClientRequestIDInfoCache;
141 m_clientRequestIDFlushTimer.AutoReset = true;
141 m_clientRequestIDFlushTimer.Start(); 142 m_clientRequestIDFlushTimer.Start();
142 } 143 }
143 } 144 }
@@ -371,6 +372,12 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
371 UUID inviteID = new UUID(im.imSessionID); 372 UUID inviteID = new UUID(im.imSessionID);
372 GroupInviteInfo inviteInfo = m_groupData.GetAgentToGroupInvite(GetClientGroupRequestID(remoteClient), inviteID); 373 GroupInviteInfo inviteInfo = m_groupData.GetAgentToGroupInvite(GetClientGroupRequestID(remoteClient), inviteID);
373 374
375 if (inviteInfo == null)
376 {
377 if (m_debugEnabled) m_log.WarnFormat("[GROUPS]: Received an Invite IM for an invite that does not exist {0}.", inviteID);
378 return;
379 }
380
374 if (m_debugEnabled) m_log.DebugFormat("[GROUPS]: Invite is for Agent {0} to Group {1}.", inviteInfo.AgentID, inviteInfo.GroupID); 381 if (m_debugEnabled) m_log.DebugFormat("[GROUPS]: Invite is for Agent {0} to Group {1}.", inviteInfo.AgentID, inviteInfo.GroupID);
375 382
376 UUID fromAgentID = new UUID(im.fromAgentID); 383 UUID fromAgentID = new UUID(im.fromAgentID);
@@ -1037,32 +1044,41 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
1037 1044
1038 // Todo: Security check, probably also want to send some kind of notification 1045 // Todo: Security check, probably also want to send some kind of notification
1039 UUID InviteID = UUID.Random(); 1046 UUID InviteID = UUID.Random();
1040 m_groupData.AddAgentToGroupInvite(GetClientGroupRequestID(remoteClient), InviteID, groupID, roleID, invitedAgentID); 1047 GroupRequestID grid = GetClientGroupRequestID(remoteClient);
1041 1048
1042 if (m_msgTransferModule != null) 1049 m_groupData.AddAgentToGroupInvite(grid, InviteID, groupID, roleID, invitedAgentID);
1043 {
1044 Guid inviteUUID = InviteID.Guid;
1045 1050
1046 GridInstantMessage msg = new GridInstantMessage(); 1051 // Check to see if the invite went through, if it did not then it's possible
1047 1052 // the remoteClient did not validate or did not have permission to invite.
1048 msg.imSessionID = inviteUUID; 1053 GroupInviteInfo inviteInfo = m_groupData.GetAgentToGroupInvite(grid, InviteID);
1049
1050 // msg.fromAgentID = remoteClient.AgentId.Guid;
1051 msg.fromAgentID = groupID.Guid;
1052 msg.toAgentID = invitedAgentID.Guid;
1053 //msg.timestamp = (uint)Util.UnixTimeSinceEpoch();
1054 msg.timestamp = 0;
1055 msg.fromAgentName = remoteClient.Name;
1056 msg.message = string.Format("{0} has invited you to join a group. There is no cost to join this group.", remoteClient.Name);
1057 msg.dialog = (byte)OpenMetaverse.InstantMessageDialog.GroupInvitation;
1058 msg.fromGroup = true;
1059 msg.offline = (byte)0;
1060 msg.ParentEstateID = 0;
1061 msg.Position = Vector3.Zero;
1062 msg.RegionID = remoteClient.Scene.RegionInfo.RegionID.Guid;
1063 msg.binaryBucket = new byte[20];
1064 1054
1065 OutgoingInstantMessage(msg, invitedAgentID); 1055 if (inviteInfo != null)
1056 {
1057 if (m_msgTransferModule != null)
1058 {
1059 Guid inviteUUID = InviteID.Guid;
1060
1061 GridInstantMessage msg = new GridInstantMessage();
1062
1063 msg.imSessionID = inviteUUID;
1064
1065 // msg.fromAgentID = remoteClient.AgentId.Guid;
1066 msg.fromAgentID = groupID.Guid;
1067 msg.toAgentID = invitedAgentID.Guid;
1068 //msg.timestamp = (uint)Util.UnixTimeSinceEpoch();
1069 msg.timestamp = 0;
1070 msg.fromAgentName = remoteClient.Name;
1071 msg.message = string.Format("{0} has invited you to join a group. There is no cost to join this group.", remoteClient.Name);
1072 msg.dialog = (byte)OpenMetaverse.InstantMessageDialog.GroupInvitation;
1073 msg.fromGroup = true;
1074 msg.offline = (byte)0;
1075 msg.ParentEstateID = 0;
1076 msg.Position = Vector3.Zero;
1077 msg.RegionID = remoteClient.Scene.RegionInfo.RegionID.Guid;
1078 msg.binaryBucket = new byte[20];
1079
1080 OutgoingInstantMessage(msg, invitedAgentID);
1081 }
1066 } 1082 }
1067 } 1083 }
1068 1084