Make ScopeID optional for http GetAccount and GetAccounts

If not specified then it assumes UUID.Zero. as occurs elsewhere in the codebase
0.7.2-post-fixes
Justin Clark-Casey (justincc) 2011-10-19 00:34:54 +01:00
parent eb65f5072d
commit ea65d4f5ce
1 changed files with 6 additions and 11 deletions

View File

@ -117,7 +117,6 @@ namespace OpenSim.Server.Handlers.UserAccounts
} }
return FailureResult(); return FailureResult();
} }
byte[] GetAccount(Dictionary<string, object> request) byte[] GetAccount(Dictionary<string, object> request)
@ -126,13 +125,7 @@ namespace OpenSim.Server.Handlers.UserAccounts
UUID scopeID = UUID.Zero; UUID scopeID = UUID.Zero;
Dictionary<string, object> result = new Dictionary<string, object>(); Dictionary<string, object> result = new Dictionary<string, object>();
if (!request.ContainsKey("ScopeID")) if (request.ContainsKey("ScopeID") && !UUID.TryParse(request["ScopeID"].ToString(), out scopeID))
{
result["result"] = "null";
return ResultToBytes(result);
}
if (!UUID.TryParse(request["ScopeID"].ToString(), out scopeID))
{ {
result["result"] = "null"; result["result"] = "null";
return ResultToBytes(result); return ResultToBytes(result);
@ -174,11 +167,11 @@ namespace OpenSim.Server.Handlers.UserAccounts
byte[] GetAccounts(Dictionary<string, object> request) byte[] GetAccounts(Dictionary<string, object> request)
{ {
if (!request.ContainsKey("ScopeID") || !request.ContainsKey("query")) if (!request.ContainsKey("query"))
return FailureResult(); return FailureResult();
UUID scopeID = UUID.Zero; UUID scopeID = UUID.Zero;
if (!UUID.TryParse(request["ScopeID"].ToString(), out scopeID)) if (request.ContainsKey("ScopeID") && !UUID.TryParse(request["ScopeID"].ToString(), out scopeID))
return FailureResult(); return FailureResult();
string query = request["query"].ToString(); string query = request["query"].ToString();
@ -187,7 +180,9 @@ namespace OpenSim.Server.Handlers.UserAccounts
Dictionary<string, object> result = new Dictionary<string, object>(); Dictionary<string, object> result = new Dictionary<string, object>();
if ((accounts == null) || ((accounts != null) && (accounts.Count == 0))) if ((accounts == null) || ((accounts != null) && (accounts.Count == 0)))
{
result["result"] = "null"; result["result"] = "null";
}
else else
{ {
int i = 0; int i = 0;
@ -208,7 +203,7 @@ namespace OpenSim.Server.Handlers.UserAccounts
byte[] StoreAccount(Dictionary<string, object> request) byte[] StoreAccount(Dictionary<string, object> request)
{ {
UUID principalID = UUID.Zero; UUID principalID = UUID.Zero;
if (!(request.ContainsKey("PrincipalID") && UUID.TryParse(request["PrincipalID"].ToString(), out principalID))) if (request.ContainsKey("PrincipalID") && !UUID.TryParse(request["PrincipalID"].ToString(), out principalID))
return FailureResult(); return FailureResult();
UUID scopeID = UUID.Zero; UUID scopeID = UUID.Zero;