Presence Step 1

slimupdates
Melanie 2009-12-27 01:27:51 +00:00
parent 88b3b98811
commit 982e3ff5d9
4 changed files with 14 additions and 22 deletions

View File

@ -32,10 +32,11 @@ using OpenSim.Framework;
namespace OpenSim.Data
{
public struct PresenceData
// This MUST be a ref type!
public class PresenceData
{
public UUID UUID;
public UUID currentRegion;
public UUID PrincipalID;
public UUID RegionID;
public Dictionary<string, string> Data;
}
@ -48,9 +49,6 @@ namespace OpenSim.Data
PresenceData Get(UUID principalID);
bool SetUserDataItem(UUID principalID, string item, string value);
bool SetRegionDataItem(UUID principalID, string item, string value);
bool Delete(UUID regionID);
}
}

View File

@ -95,7 +95,6 @@ namespace OpenSim.Server.Handlers.Presence
byte[] Report(Dictionary<string, string> request)
{
PresenceInfo info = new PresenceInfo();
info.Data = new Dictionary<string, string>();
if (request["PrincipalID"] == null || request["RegionID"] == null)
return FailureResult();
@ -108,15 +107,6 @@ namespace OpenSim.Server.Handlers.Presence
out info.RegionID))
return FailureResult();
foreach (KeyValuePair<string, string> 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();

View File

@ -25,6 +25,7 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
using System;
using OpenSim.Framework;
using System.Collections.Generic;
using OpenMetaverse;
@ -35,7 +36,13 @@ namespace OpenSim.Services.Interfaces
{
public UUID PrincipalID;
public UUID RegionID;
public Dictionary<string, string> Data;
public UUID SessionID;
public UUID SecureSessionID;
public bool Online;
public DateTime Login;
public DateTime Logout;
public Vector3 Position;
public Vector3 LookAt;
}
public interface IPresenceService

View File

@ -55,11 +55,8 @@ namespace OpenSim.Services.PresenceService
PresenceData p = new PresenceData();
p.Data = new Dictionary<string, string>();
p.UUID = presence.PrincipalID;
p.currentRegion = presence.RegionID;
foreach (KeyValuePair<string, string> kvp in presence.Data)
p.Data[kvp.Key] = kvp.Value;
p.PrincipalID = presence.PrincipalID;
p.RegionID = presence.RegionID;
return false;
}