From 791c6188fd3b0347299c2bb0e88df90cc0747008 Mon Sep 17 00:00:00 2001 From: Melanie Date: Mon, 4 Jan 2010 02:07:31 +0000 Subject: Some work on avatar service. Retrieval and storage done --- OpenSim/Services/AvatarService/AvatarService.cs | 32 +++++++++++++++++++------ 1 file changed, 25 insertions(+), 7 deletions(-) (limited to 'OpenSim/Services/AvatarService/AvatarService.cs') diff --git a/OpenSim/Services/AvatarService/AvatarService.cs b/OpenSim/Services/AvatarService/AvatarService.cs index 1f5b257..ffcdcc5 100644 --- a/OpenSim/Services/AvatarService/AvatarService.cs +++ b/OpenSim/Services/AvatarService/AvatarService.cs @@ -51,27 +51,45 @@ namespace OpenSim.Services.AvatarService m_log.Debug("[AVATAR SERVICE]: Starting avatar service"); } - public AvatarData GetAvatar(UUID userID) + public AvatarData GetAvatar(UUID principalID) { - return null; + + AvatarBaseData[] av = m_Database.Get("PrincipalID", principalID.ToString()); + if (av.Length == 0) + return null; + + AvatarData ret = new AvatarData(); + ret.AvatarType = Convert.ToInt32(av[0].Data["AvatarType"]); + + av[0].Data.Remove("AvatarType"); + + ret.Data = av[0].Data; + + return ret; } - public bool SetAvatar(UUID userID, AvatarData avatar) + public bool SetAvatar(UUID principalID, AvatarData avatar) { - return false; + AvatarBaseData av = new AvatarBaseData(); + + av.PrincipalID = principalID; + av.Data = avatar.Data; + av.Data["AvatarType"] = avatar.AvatarType.ToString(); + + return m_Database.Store(av); } - public bool ResetAvatar(UUID userID) + public bool ResetAvatar(UUID principalID) { return false; } - public bool SetItems(UUID userID, string[] names, string[] values) + public bool SetItems(UUID principalID, string[] names, string[] values) { return false; } - public bool RemoveItems(UUID userID, string[] names) + public bool RemoveItems(UUID principalID, string[] names) { return false; } -- cgit v1.1