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

View File

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

View File

@ -600,14 +600,14 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
public List<GroupMembersData> GroupMembersRequest(IClientAPI remoteClient, UUID groupID)
{
if (m_debugEnabled) m_log.DebugFormat("[GROUPS]: {0} called", System.Reflection.MethodBase.GetCurrentMethod().Name);
List<GroupMembersData> data = m_groupData.GetGroupMembers(GetRequestingAgentID(remoteClient), groupID);
if (m_debugEnabled)
{
foreach (GroupMembersData member in data)
{
m_log.DebugFormat("[GROUPS]: Member({0}) - IsOwner({1})", member.AgentID, member.IsOwner);
}
List<GroupMembersData> data = m_groupData.GetGroupMembers(GetRequestingAgentID(remoteClient), groupID);
if (m_debugEnabled)
{
foreach (GroupMembersData member in data)
{
m_log.DebugFormat("[GROUPS]: Member({0}) - IsOwner({1})", member.AgentID, member.IsOwner);
}
}
return data;
@ -627,14 +627,14 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
{
if (m_debugEnabled) m_log.DebugFormat("[GROUPS]: {0} called", System.Reflection.MethodBase.GetCurrentMethod().Name);
List<GroupRoleMembersData> data = m_groupData.GetGroupRoleMembers(GetRequestingAgentID(remoteClient), groupID);
if (m_debugEnabled)
{
foreach (GroupRoleMembersData member in data)
{
m_log.DebugFormat("[GROUPS]: Member({0}) - Role({1})", member.MemberID, member.RoleID);
}
List<GroupRoleMembersData> data = m_groupData.GetGroupRoleMembers(GetRequestingAgentID(remoteClient), groupID);
if (m_debugEnabled)
{
foreach (GroupRoleMembersData member in data)
{
m_log.DebugFormat("[GROUPS]: Member({0}) - Role({1})", member.MemberID, member.RoleID);
}
}
return data;
}
@ -1143,11 +1143,11 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
OSDMap llDataStruct = new OSDMap(3);
llDataStruct.Add("AgentData", AgentData);
llDataStruct.Add("GroupData", GroupData);
llDataStruct.Add("NewGroupData", NewGroupData);
if (m_debugEnabled)
{
m_log.InfoFormat("[GROUPS]: {0}", OSDParser.SerializeJsonString(llDataStruct));
llDataStruct.Add("NewGroupData", NewGroupData);
if (m_debugEnabled)
{
m_log.InfoFormat("[GROUPS]: {0}", OSDParser.SerializeJsonString(llDataStruct));
}
IEventQueue queue = remoteClient.Scene.RequestModuleInterface<IEventQueue>();
@ -1307,16 +1307,16 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
//
}
#endregion
private UUID GetRequestingAgentID(IClientAPI client)
{
UUID requestingAgentID = UUID.Zero;
if (client != null)
{
requestingAgentID = client.AgentId;
}
return requestingAgentID;
#endregion
private UUID GetRequestingAgentID(IClientAPI client)
{
UUID requestingAgentID = UUID.Zero;
if (client != null)
{
requestingAgentID = client.AgentId;
}
return requestingAgentID;
}
}

View File

@ -176,18 +176,7 @@ namespace OpenSim.Server.Handlers.UserAccounts
byte[] StoreAccount(Dictionary<string, object> request)
{
//if (!request.ContainsKey("account"))
// 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();
// No can do. No changing user accounts from remote sims
return FailureResult();
}

View File

@ -104,6 +104,8 @@ namespace OpenSim.Services.Connectors.SimianGrid
OSDMap response = WebUtil.PostToService(m_serverUrl, requestArgs);
if (response["Success"].AsBoolean() && response["Identities"] is OSDArray)
{
bool md5hashFound = false;
OSDArray identities = (OSDArray)response["Identities"];
for (int i = 0; i < identities.Count; i++)
{
@ -114,13 +116,19 @@ namespace OpenSim.Services.Connectors.SimianGrid
{
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);
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
{

View File

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

View File

@ -134,6 +134,10 @@ namespace OpenSim.Services.UserAccountService
u.UserTitle = d.Data["UserTitle"].ToString();
else
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)
{
@ -218,6 +222,10 @@ namespace OpenSim.Services.UserAccountService
d.Data = new Dictionary<string, string>();
d.Data["Email"] = data.Email;
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>();