* Updates MXP.dll to latest version.

* MXP: Corrects an issue whereby session requests were never correctly acknowledged.
GenericGridServerConcept
Adam Frisby 2009-02-22 09:31:24 +00:00
parent dd828956e6
commit a7f5e09c7f
3 changed files with 35 additions and 11 deletions

View File

@ -25,6 +25,7 @@ namespace OpenSim.Client.MXP.PacketHandler
private readonly Transmitter transmitter; private readonly Transmitter transmitter;
private readonly IList<Session> sessions = new List<Session>(); private readonly IList<Session> sessions = new List<Session>();
private readonly IList<Session> sessionsToClient = new List<Session>();
private readonly IList<MXPClientView> sessionsToRemove = new List<MXPClientView>(); private readonly IList<MXPClientView> sessionsToRemove = new List<MXPClientView>();
private readonly String cloudUrl; private readonly String cloudUrl;
@ -217,24 +218,24 @@ namespace OpenSim.Client.MXP.PacketHandler
{ {
if (transmitter.PendingSessionCount > 0) if (transmitter.PendingSessionCount > 0)
{ {
sessions.Add(transmitter.AcceptPendingSession()); Session tmp = transmitter.AcceptPendingSession();
sessions.Add(tmp);
sessionsToClient.Add(tmp);
} }
foreach (MXPClientView clientView in Clients) List<Session> tmpRemove = new List<Session>();
foreach (Session session in sessionsToClient)
{ {
int messagesProcessedCount = 0;
Session session = clientView.Session;
while (session.AvailableMessages > 0) while (session.AvailableMessages > 0)
{ {
Message message = session.Receive(); Message message = session.Receive();
if (message.GetType() == typeof(JoinRequestMessage)) if (message.GetType() == typeof (JoinRequestMessage))
{ {
JoinRequestMessage joinRequestMessage = (JoinRequestMessage)message; JoinRequestMessage joinRequestMessage = (JoinRequestMessage) message;
bool authorized = AuthoriseUser(joinRequestMessage.ParticipantName, bool authorized = AuthoriseUser(joinRequestMessage.ParticipantName,
joinRequestMessage.ParticipantPassphrase, joinRequestMessage.ParticipantPassphrase,
@ -246,7 +247,9 @@ namespace OpenSim.Client.MXP.PacketHandler
UUID mxpSessionID = UUID.Random(); UUID mxpSessionID = UUID.Random();
m_log.Info("[MXP ClientStack] Session join request success: " + session.SessionId + " (" + (session.IsIncoming ? "from" : "to") + " " + session.RemoteEndPoint.Address + ":" + session.RemoteEndPoint.Port + ")"); m_log.Info("[MXP ClientStack] Session join request success: " + session.SessionId + " (" +
(session.IsIncoming ? "from" : "to") + " " + session.RemoteEndPoint.Address + ":" +
session.RemoteEndPoint.Port + ")");
AcceptConnection(session, joinRequestMessage, mxpSessionID); AcceptConnection(session, joinRequestMessage, mxpSessionID);
@ -258,12 +261,33 @@ namespace OpenSim.Client.MXP.PacketHandler
} }
else else
{ {
m_log.Info("[MXP ClientStack] Session join request failure: " + session.SessionId + " (" + (session.IsIncoming ? "from" : "to") + " " + session.RemoteEndPoint.Address + ":" + session.RemoteEndPoint.Port + ")"); m_log.Info("[MXP ClientStack] Session join request failure: " + session.SessionId + " (" +
(session.IsIncoming ? "from" : "to") + " " + session.RemoteEndPoint.Address + ":" +
session.RemoteEndPoint.Port + ")");
DeclineConnection(session, joinRequestMessage); DeclineConnection(session, joinRequestMessage);
} }
tmpRemove.Add(session);
} }
}
}
foreach (Session session in tmpRemove)
{
sessionsToClient.Remove(session);
}
foreach (MXPClientView clientView in Clients)
{
int messagesProcessedCount = 0;
Session session = clientView.Session;
while (session.AvailableMessages > 0)
{
Message message = session.Receive();
if (message.GetType() == typeof(LeaveRequestMessage)) if (message.GetType() == typeof(LeaveRequestMessage))
{ {

Binary file not shown.

Binary file not shown.