Merge branch 'master' of melanie@opensimulator.org:/var/git/opensim

slimupdates
Melanie 2010-04-04 02:24:52 +01:00
commit dc58c985e8
8 changed files with 78 additions and 62 deletions

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,23 +523,27 @@ namespace OpenSim.Region.ClientStack.LindenUDP
int dataLength = buffer.DataLength; int dataLength = buffer.DataLength;
// Keep appending ACKs until there is no room left in the buffer or there are // NOTE: I'm seeing problems with some viewers when ACKs are appended to zerocoded packets so I've disabled that here
// no more ACKs to append if (!isZerocoded)
uint ackCount = 0;
uint ack;
while (dataLength + 5 < buffer.Data.Length && udpClient.PendingAcks.Dequeue(out ack))
{ {
Utils.UIntToBytesBig(ack, buffer.Data, dataLength); // Keep appending ACKs until there is no room left in the buffer or there are
dataLength += 4; // no more ACKs to append
++ackCount; uint ackCount = 0;
} uint ack;
while (dataLength + 5 < buffer.Data.Length && udpClient.PendingAcks.Dequeue(out ack))
{
Utils.UIntToBytesBig(ack, buffer.Data, dataLength);
dataLength += 4;
++ackCount;
}
if (ackCount > 0) if (ackCount > 0)
{ {
// Set the last byte of the packet equal to the number of appended ACKs // Set the last byte of the packet equal to the number of appended ACKs
buffer.Data[dataLength++] = (byte)ackCount; buffer.Data[dataLength++] = (byte)ackCount;
// 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

@ -144,6 +144,12 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.UserAccounts
return account; return account;
} }
public override bool StoreUserAccount(UserAccount data)
{
// This remote connector refuses to serve this method
return false;
}
#endregion #endregion
} }
} }

View File

@ -176,18 +176,7 @@ namespace OpenSim.Server.Handlers.UserAccounts
byte[] StoreAccount(Dictionary<string, object> request) byte[] StoreAccount(Dictionary<string, object> request)
{ {
//if (!request.ContainsKey("account")) // No can do. No changing user accounts from remote sims
// return FailureResult();
//if (request["account"] == null)
// return FailureResult();
//if (!(request["account"] is Dictionary<string, object>))
// return FailureResult();
UserAccount account = new UserAccount(request);
if (m_UserAccountService.StoreUserAccount(account))
return SuccessResult();
return FailureResult(); return FailureResult();
} }

View File

@ -104,6 +104,8 @@ namespace OpenSim.Services.Connectors.SimianGrid
OSDMap response = WebUtil.PostToService(m_serverUrl, requestArgs); OSDMap response = WebUtil.PostToService(m_serverUrl, requestArgs);
if (response["Success"].AsBoolean() && response["Identities"] is OSDArray) if (response["Success"].AsBoolean() && response["Identities"] is OSDArray)
{ {
bool md5hashFound = false;
OSDArray identities = (OSDArray)response["Identities"]; OSDArray identities = (OSDArray)response["Identities"];
for (int i = 0; i < identities.Count; i++) for (int i = 0; i < identities.Count; i++)
{ {
@ -114,13 +116,19 @@ namespace OpenSim.Services.Connectors.SimianGrid
{ {
string credential = identity["Credential"].AsString(); string credential = identity["Credential"].AsString();
if (password == credential || "$1$" + Utils.MD5String(password) == credential) if (password == credential || "$1$" + Utils.MD5String(password) == credential || Utils.MD5String(password) == credential)
return Authorize(principalID); return Authorize(principalID);
md5hashFound = true;
break;
} }
} }
} }
m_log.Warn("[SIMIAN AUTH CONNECTOR]: Authentication failed for " + principalID); if (md5hashFound)
m_log.Warn("[SIMIAN AUTH CONNECTOR]: Authentication failed for " + principalID + " using md5hash $1$" + Utils.MD5String(password));
else
m_log.Warn("[SIMIAN AUTH CONNECTOR]: Authentication failed for " + principalID + ", no md5hash identity found");
} }
else else
{ {

View File

@ -395,7 +395,7 @@ namespace OpenSim.Services.Connectors.SimianGrid
} }
else else
{ {
m_log.Warn("[SIMIAN PRESENCE CONNECTOR]: Failed to retrieve sessions for " + userID + ": " + response["Message"].AsString()); m_log.Debug("[SIMIAN PRESENCE CONNECTOR]: No session returned for " + userID + ": " + response["Message"].AsString());
} }
} }

View File

@ -187,7 +187,7 @@ namespace OpenSim.Services.Connectors
return accounts; return accounts;
} }
public bool StoreUserAccount(UserAccount data) public virtual bool StoreUserAccount(UserAccount data)
{ {
Dictionary<string, object> sendData = new Dictionary<string, object>(); Dictionary<string, object> sendData = new Dictionary<string, object>();
//sendData["SCOPEID"] = scopeID.ToString(); //sendData["SCOPEID"] = scopeID.ToString();

View File

@ -134,6 +134,10 @@ namespace OpenSim.Services.UserAccountService
u.UserTitle = d.Data["UserTitle"].ToString(); u.UserTitle = d.Data["UserTitle"].ToString();
else else
u.UserTitle = string.Empty; u.UserTitle = string.Empty;
if (d.Data.ContainsKey("UserLevel") && d.Data["UserLevel"] != null)
Int32.TryParse(d.Data["UserLevel"], out u.UserLevel);
if (d.Data.ContainsKey("UserFlags") && d.Data["UserFlags"] != null)
Int32.TryParse(d.Data["UserFlags"], out u.UserFlags);
if (d.Data.ContainsKey("ServiceURLs") && d.Data["ServiceURLs"] != null) if (d.Data.ContainsKey("ServiceURLs") && d.Data["ServiceURLs"] != null)
{ {
@ -218,6 +222,10 @@ namespace OpenSim.Services.UserAccountService
d.Data = new Dictionary<string, string>(); d.Data = new Dictionary<string, string>();
d.Data["Email"] = data.Email; d.Data["Email"] = data.Email;
d.Data["Created"] = data.Created.ToString(); d.Data["Created"] = data.Created.ToString();
d.Data["UserLevel"] = data.UserLevel.ToString();
d.Data["UserFlags"] = data.UserFlags.ToString();
if (data.UserTitle != null)
d.Data["UserTitle"] = data.UserTitle.ToString();
List<string> parts = new List<string>(); List<string> parts = new List<string>();