mirror of
https://github.com/opensim/opensim.git
synced 2026-08-05 08:55:56 +08:00
Several more buglets removed.
This commit is contained in:
@@ -278,6 +278,9 @@ namespace OpenSim.Server.Base
|
||||
{
|
||||
foreach (KeyValuePair<string, object> kvp in data)
|
||||
{
|
||||
if (kvp.Value == null)
|
||||
continue;
|
||||
|
||||
XmlElement elem = parent.OwnerDocument.CreateElement("",
|
||||
kvp.Key, "");
|
||||
|
||||
|
||||
@@ -65,7 +65,7 @@ namespace OpenSim.Server.Handlers.Presence
|
||||
body = body.Trim();
|
||||
|
||||
//m_log.DebugFormat("[XXX]: query String: {0}", body);
|
||||
|
||||
string method = string.Empty;
|
||||
try
|
||||
{
|
||||
Dictionary<string, object> request =
|
||||
@@ -74,7 +74,7 @@ namespace OpenSim.Server.Handlers.Presence
|
||||
if (!request.ContainsKey("METHOD"))
|
||||
return FailureResult();
|
||||
|
||||
string method = request["METHOD"].ToString();
|
||||
method = request["METHOD"].ToString();
|
||||
|
||||
switch (method)
|
||||
{
|
||||
@@ -97,7 +97,7 @@ namespace OpenSim.Server.Handlers.Presence
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
m_log.Debug("[PRESENCE HANDLER]: Exception {0}" + e);
|
||||
m_log.DebugFormat("[PRESENCE HANDLER]: Exception in method {0}: {1}", method, e);
|
||||
}
|
||||
|
||||
return FailureResult();
|
||||
@@ -188,9 +188,11 @@ namespace OpenSim.Server.Handlers.Presence
|
||||
|
||||
if (request.ContainsKey("lookAt"))
|
||||
Vector3.TryParse(request["lookAt"].ToString(), out look);
|
||||
|
||||
|
||||
if (m_PresenceService.ReportAgent(session, region, position, look))
|
||||
{
|
||||
return SuccessResult();
|
||||
}
|
||||
|
||||
return FailureResult();
|
||||
}
|
||||
|
||||
@@ -61,11 +61,11 @@ namespace OpenSim.Server.Handlers.Simulation
|
||||
{
|
||||
//m_log.Debug("[CONNECTION DEBUGGING]: AgentHandler Called");
|
||||
|
||||
m_log.Debug("---------------------------");
|
||||
m_log.Debug(" >> uri=" + request["uri"]);
|
||||
m_log.Debug(" >> content-type=" + request["content-type"]);
|
||||
m_log.Debug(" >> http-method=" + request["http-method"]);
|
||||
m_log.Debug("---------------------------\n");
|
||||
//m_log.Debug("---------------------------");
|
||||
//m_log.Debug(" >> uri=" + request["uri"]);
|
||||
//m_log.Debug(" >> content-type=" + request["content-type"]);
|
||||
//m_log.Debug(" >> http-method=" + request["http-method"]);
|
||||
//m_log.Debug("---------------------------\n");
|
||||
|
||||
Hashtable responsedata = new Hashtable();
|
||||
responsedata["content_type"] = "text/html";
|
||||
@@ -320,7 +320,7 @@ namespace OpenSim.Server.Handlers.Simulation
|
||||
responsedata["int_response_code"] = HttpStatusCode.OK;
|
||||
responsedata["str_response_string"] = "OpenSim agent " + id.ToString();
|
||||
|
||||
m_log.Debug("[AGENT HANDLER]: Agent Deleted.");
|
||||
m_log.Debug("[AGENT HANDLER]: Agent Released/Deleted.");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -59,13 +59,13 @@ namespace OpenSim.Server.Handlers.Simulation
|
||||
|
||||
public Hashtable Handler(Hashtable request)
|
||||
{
|
||||
m_log.Debug("[CONNECTION DEBUGGING]: ObjectHandler Called");
|
||||
//m_log.Debug("[CONNECTION DEBUGGING]: ObjectHandler Called");
|
||||
|
||||
m_log.Debug("---------------------------");
|
||||
m_log.Debug(" >> uri=" + request["uri"]);
|
||||
m_log.Debug(" >> content-type=" + request["content-type"]);
|
||||
m_log.Debug(" >> http-method=" + request["http-method"]);
|
||||
m_log.Debug("---------------------------\n");
|
||||
//m_log.Debug("---------------------------");
|
||||
//m_log.Debug(" >> uri=" + request["uri"]);
|
||||
//m_log.Debug(" >> content-type=" + request["content-type"]);
|
||||
//m_log.Debug(" >> http-method=" + request["http-method"]);
|
||||
//m_log.Debug("---------------------------\n");
|
||||
|
||||
Hashtable responsedata = new Hashtable();
|
||||
responsedata["content_type"] = "text/html";
|
||||
@@ -75,7 +75,7 @@ namespace OpenSim.Server.Handlers.Simulation
|
||||
string action;
|
||||
if (!Utils.GetParams((string)request["uri"], out objectID, out regionID, out action))
|
||||
{
|
||||
m_log.InfoFormat("[REST COMMS]: Invalid parameters for object message {0}", request["uri"]);
|
||||
m_log.InfoFormat("[OBJECT HANDLER]: Invalid parameters for object message {0}", request["uri"]);
|
||||
responsedata["int_response_code"] = 404;
|
||||
responsedata["str_response_string"] = "false";
|
||||
|
||||
@@ -101,7 +101,7 @@ namespace OpenSim.Server.Handlers.Simulation
|
||||
//}
|
||||
else
|
||||
{
|
||||
m_log.InfoFormat("[REST COMMS]: method {0} not supported in object message", method);
|
||||
m_log.InfoFormat("[OBJECT HANDLER]: method {0} not supported in object message", method);
|
||||
responsedata["int_response_code"] = HttpStatusCode.MethodNotAllowed;
|
||||
responsedata["str_response_string"] = "Mthod not allowed";
|
||||
|
||||
@@ -148,13 +148,13 @@ namespace OpenSim.Server.Handlers.Simulation
|
||||
ISceneObject sog = null;
|
||||
try
|
||||
{
|
||||
//sog = SceneObjectSerializer.FromXml2Format(sogXmlStr);
|
||||
//m_log.DebugFormat("[OBJECT HANDLER]: received {0}", sogXmlStr);
|
||||
sog = s.DeserializeObject(sogXmlStr);
|
||||
sog.ExtraFromXmlString(extraStr);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
m_log.InfoFormat("[REST COMMS]: exception on deserializing scene object {0}", ex.Message);
|
||||
m_log.InfoFormat("[OBJECT HANDLER]: exception on deserializing scene object {0}", ex.Message);
|
||||
responsedata["int_response_code"] = HttpStatusCode.BadRequest;
|
||||
responsedata["str_response_string"] = "Bad request";
|
||||
return;
|
||||
@@ -171,13 +171,22 @@ namespace OpenSim.Server.Handlers.Simulation
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
m_log.InfoFormat("[REST COMMS]: exception on setting state for scene object {0}", ex.Message);
|
||||
m_log.InfoFormat("[OBJECT HANDLER]: exception on setting state for scene object {0}", ex.Message);
|
||||
// ignore and continue
|
||||
}
|
||||
}
|
||||
}
|
||||
// This is the meaning of POST object
|
||||
bool result = m_SimulationService.CreateObject(destination, sog, false);
|
||||
|
||||
bool result = false;
|
||||
try
|
||||
{
|
||||
// This is the meaning of POST object
|
||||
result = m_SimulationService.CreateObject(destination, sog, false);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
m_log.DebugFormat("[OBJECT HANDLER]: Exception in CreateObject: {0}", e.StackTrace);
|
||||
}
|
||||
|
||||
responsedata["int_response_code"] = HttpStatusCode.OK;
|
||||
responsedata["str_response_string"] = result.ToString();
|
||||
|
||||
@@ -68,7 +68,7 @@ namespace OpenSim.Server.Handlers.UserAccounts
|
||||
//httpRequest.Headers["authorization"] ...
|
||||
|
||||
//m_log.DebugFormat("[XXX]: query String: {0}", body);
|
||||
|
||||
string method = string.Empty;
|
||||
try
|
||||
{
|
||||
Dictionary<string, object> request =
|
||||
@@ -77,7 +77,7 @@ namespace OpenSim.Server.Handlers.UserAccounts
|
||||
if (!request.ContainsKey("METHOD"))
|
||||
return FailureResult();
|
||||
|
||||
string method = request["METHOD"].ToString();
|
||||
method = request["METHOD"].ToString();
|
||||
|
||||
switch (method)
|
||||
{
|
||||
@@ -88,11 +88,11 @@ namespace OpenSim.Server.Handlers.UserAccounts
|
||||
case "setaccount":
|
||||
return StoreAccount(request);
|
||||
}
|
||||
m_log.DebugFormat("[PRESENCE HANDLER]: unknown method request: {0}", method);
|
||||
m_log.DebugFormat("[USER SERVICE HANDLER]: unknown method request: {0}", method);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
m_log.Debug("[PRESENCE HANDLER]: Exception {0}" + e);
|
||||
m_log.DebugFormat("[USER SERVICE HANDLER]: Exception in method {0}: {1}", method, e);
|
||||
}
|
||||
|
||||
return FailureResult();
|
||||
@@ -134,7 +134,9 @@ namespace OpenSim.Server.Handlers.UserAccounts
|
||||
if (account == null)
|
||||
result["result"] = "null";
|
||||
else
|
||||
{
|
||||
result["result"] = account.ToKeyValuePairs();
|
||||
}
|
||||
|
||||
return ResultToBytes(result);
|
||||
}
|
||||
@@ -247,7 +249,6 @@ namespace OpenSim.Server.Handlers.UserAccounts
|
||||
private byte[] ResultToBytes(Dictionary<string, object> result)
|
||||
{
|
||||
string xmlString = ServerUtils.BuildXmlResponse(result);
|
||||
//m_log.DebugFormat("[GRID HANDLER]: resp string: {0}", xmlString);
|
||||
UTF8Encoding encoding = new UTF8Encoding();
|
||||
return encoding.GetBytes(xmlString);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user