aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ClientStack
diff options
context:
space:
mode:
authorAdam Frisby2008-11-08 17:20:54 +0000
committerAdam Frisby2008-11-08 17:20:54 +0000
commitcf0a14bec94322656f57890d49fead85ed31730e (patch)
tree861596444093bb68567cda8583cd0e94a618c120 /OpenSim/Region/ClientStack
parentFix broken build since r7179 (diff)
downloadopensim-SC_OLD-cf0a14bec94322656f57890d49fead85ed31730e.zip
opensim-SC_OLD-cf0a14bec94322656f57890d49fead85ed31730e.tar.gz
opensim-SC_OLD-cf0a14bec94322656f57890d49fead85ed31730e.tar.bz2
opensim-SC_OLD-cf0a14bec94322656f57890d49fead85ed31730e.tar.xz
* Added IClientIM to IClientCore interfaces
* Changed SendInstantMessage, dropped fromAgentSession and imSessionID as security precaution, see http://opensimulator.org/wiki/OpenSim_0.6_IClientAPI#Porting_Guide for details on porting. * Removed unused usings from Framework.*
Diffstat (limited to 'OpenSim/Region/ClientStack')
-rw-r--r--OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs31
1 files changed, 18 insertions, 13 deletions
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
index d63933d..2a0f97d 100644
--- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
+++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
@@ -52,7 +52,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
52 /// Handles new client connections 52 /// Handles new client connections
53 /// Constructor takes a single Packet and authenticates everything 53 /// Constructor takes a single Packet and authenticates everything
54 /// </summary> 54 /// </summary>
55 public class LLClientView : IClientAPI, IClientCore 55 public class LLClientView : IClientAPI, IClientCore, IClientIM
56 { 56 {
57 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 57 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
58 58
@@ -394,6 +394,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP
394 AuthenticateResponse sessionInfo, UUID agentId, UUID sessionId, uint circuitCode, EndPoint proxyEP, 394 AuthenticateResponse sessionInfo, UUID agentId, UUID sessionId, uint circuitCode, EndPoint proxyEP,
395 ClientStackUserSettings userSettings) 395 ClientStackUserSettings userSettings)
396 { 396 {
397 // Should be called first?
398 RegisterInterfaces();
399
397 m_GroupsModule = scene.RequestModuleInterface<IGroupsModule>(); 400 m_GroupsModule = scene.RequestModuleInterface<IGroupsModule>();
398 m_moneyBalance = 1000; 401 m_moneyBalance = 1000;
399 402
@@ -1076,19 +1079,16 @@ namespace OpenSim.Region.ClientStack.LindenUDP
1076 /// <summary> 1079 /// <summary>
1077 /// Send an instant message to this client 1080 /// Send an instant message to this client
1078 /// </summary> 1081 /// </summary>
1079 public void SendInstantMessage(UUID fromAgent, UUID fromAgentSession, string message, UUID toAgent, 1082 public void SendInstantMessage(UUID fromAgent, string message, UUID toAgent, string fromName, byte dialog, uint timeStamp)
1080 UUID imSessionID, string fromName, byte dialog, uint timeStamp)
1081 { 1083 {
1082 SendInstantMessage( 1084 SendInstantMessage(fromAgent, message, toAgent, fromName, dialog, timeStamp, false, new byte[0]);
1083 fromAgent, fromAgentSession, message, toAgent,
1084 imSessionID, fromName, dialog, timeStamp, false, new byte[0]);
1085 } 1085 }
1086 1086
1087 /// <summary> 1087 /// <summary>
1088 /// Send an instant message to this client 1088 /// Send an instant message to this client
1089 /// </summary> 1089 /// </summary>
1090 public void SendInstantMessage(UUID fromAgent, UUID fromAgentSession, string message, UUID toAgent, 1090 public void SendInstantMessage(UUID fromAgent, string message, UUID toAgent,
1091 UUID imSessionID, string fromName, byte dialog, uint timeStamp, 1091 string fromName, byte dialog, uint timeStamp,
1092 bool fromGroup, byte[] binaryBucket) 1092 bool fromGroup, byte[] binaryBucket)
1093 { 1093 {
1094 if (((Scene)(m_scene)).ExternalChecks.ExternalChecksCanInstantMessage(fromAgent, toAgent)) 1094 if (((Scene)(m_scene)).ExternalChecks.ExternalChecksCanInstantMessage(fromAgent, toAgent))
@@ -1097,15 +1097,15 @@ namespace OpenSim.Region.ClientStack.LindenUDP
1097 = (ImprovedInstantMessagePacket)PacketPool.Instance.GetPacket(PacketType.ImprovedInstantMessage); 1097 = (ImprovedInstantMessagePacket)PacketPool.Instance.GetPacket(PacketType.ImprovedInstantMessage);
1098 1098
1099 msg.AgentData.AgentID = fromAgent; 1099 msg.AgentData.AgentID = fromAgent;
1100 msg.AgentData.SessionID = fromAgentSession; 1100 msg.AgentData.SessionID = UUID.Zero;
1101 msg.MessageBlock.FromAgentName = Utils.StringToBytes(fromName); 1101 msg.MessageBlock.FromAgentName = Utils.StringToBytes(fromName);
1102 msg.MessageBlock.Dialog = dialog; 1102 msg.MessageBlock.Dialog = dialog;
1103 msg.MessageBlock.FromGroup = fromGroup; 1103 msg.MessageBlock.FromGroup = fromGroup;
1104 msg.MessageBlock.ID = imSessionID; 1104 msg.MessageBlock.ID = fromAgent ^ toAgent;
1105 msg.MessageBlock.Offline = 0; 1105 msg.MessageBlock.Offline = 0;
1106 msg.MessageBlock.ParentEstateID = 0; 1106 msg.MessageBlock.ParentEstateID = 0;
1107 msg.MessageBlock.Position = new Vector3(); 1107 msg.MessageBlock.Position = new Vector3();
1108 msg.MessageBlock.RegionID = UUID.Random(); 1108 msg.MessageBlock.RegionID = UUID.Zero;
1109 msg.MessageBlock.Timestamp = timeStamp; 1109 msg.MessageBlock.Timestamp = timeStamp;
1110 msg.MessageBlock.ToAgentID = toAgent; 1110 msg.MessageBlock.ToAgentID = toAgent;
1111 msg.MessageBlock.Message = Utils.StringToBytes(message); 1111 msg.MessageBlock.Message = Utils.StringToBytes(message);
@@ -6919,10 +6919,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP
6919 /// <param name="fromSessionID"></param> 6919 /// <param name="fromSessionID"></param>
6920 /// <param name="FromAvatarName"></param> 6920 /// <param name="FromAvatarName"></param>
6921 /// <param name="Message"></param> 6921 /// <param name="Message"></param>
6922 public void SendBlueBoxMessage(UUID FromAvatarID, UUID fromSessionID, String FromAvatarName, String Message) 6922 public void SendBlueBoxMessage(UUID FromAvatarID, String FromAvatarName, String Message)
6923 { 6923 {
6924 if (!ChildAgentStatus()) 6924 if (!ChildAgentStatus())
6925 SendInstantMessage(FromAvatarID, fromSessionID, Message, AgentId, SessionId, FromAvatarName, 1, (uint)Util.UnixTimeSinceEpoch()); 6925 SendInstantMessage(FromAvatarID, Message, AgentId, FromAvatarName, 1, (uint)Util.UnixTimeSinceEpoch());
6926 6926
6927 //SendInstantMessage(FromAvatarID, fromSessionID, Message, AgentId, SessionId, FromAvatarName, (byte)21,(uint) Util.UnixTimeSinceEpoch()); 6927 //SendInstantMessage(FromAvatarID, fromSessionID, Message, AgentId, SessionId, FromAvatarName, (byte)21,(uint) Util.UnixTimeSinceEpoch());
6928 } 6928 }
@@ -7675,6 +7675,11 @@ namespace OpenSim.Region.ClientStack.LindenUDP
7675 } 7675 }
7676 } 7676 }
7677 7677
7678 protected virtual void RegisterInterfaces()
7679 {
7680 RegisterInterface<IClientIM>(this);
7681 }
7682
7678 public bool TryGet<T>(out T iface) 7683 public bool TryGet<T>(out T iface)
7679 { 7684 {
7680 if (m_clientInterfaces.ContainsKey(typeof(T))) 7685 if (m_clientInterfaces.ContainsKey(typeof(T)))