From 06ecdf1967848e3f0c6b6f98aba61c7ad099f65d Mon Sep 17 00:00:00 2001 From: Melanie Date: Wed, 18 Nov 2009 08:21:28 +0000 Subject: Tweak presence handling and whip up a database connector and handler for testign the new generic table handling --- .../Handlers/Presence/PresenceServerPostHandler.cs | 27 ++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'OpenSim/Server') diff --git a/OpenSim/Server/Handlers/Presence/PresenceServerPostHandler.cs b/OpenSim/Server/Handlers/Presence/PresenceServerPostHandler.cs index 9ca5120..2558fa0 100644 --- a/OpenSim/Server/Handlers/Presence/PresenceServerPostHandler.cs +++ b/OpenSim/Server/Handlers/Presence/PresenceServerPostHandler.cs @@ -94,6 +94,33 @@ namespace OpenSim.Server.Handlers.Presence byte[] Report(Dictionary request) { + PresenceInfo info = new PresenceInfo(); + info.Data = new Dictionary(); + + if (request["PrincipalID"] == null || request["RegionID"] == null) + return FailureResult(); + + if (!UUID.TryParse(request["PrincipalID"].ToString(), + out info.PrincipalID)) + return FailureResult(); + + if (!UUID.TryParse(request["RegionID"].ToString(), + out info.RegionID)) + return FailureResult(); + + foreach (KeyValuePair kvp in request) + { + if (kvp.Key == "METHOD" || + kvp.Key == "PrincipalID" || + kvp.Key == "RegionID") + continue; + + info.Data[kvp.Key] = kvp.Value; + } + + if (m_PresenceService.Report(info)) + return SuccessResult(); + return FailureResult(); } -- cgit v1.1