public void HandleAvatarPicksRequest(Object sender, string method, List <String> args) { if (!(sender is IClientAPI)) { return; } IClientAPI remoteClient = (IClientAPI)sender; UUID requestedUUID = new UUID(args[0]); #if (!ISWIN) Dictionary <UUID, string> picks = new Dictionary <UUID, string>(); foreach (ProfilePickInfo pick in ProfileFrontend.GetPicks(requestedUUID)) { picks.Add(pick.PickUUID, pick.Name); } #else Dictionary <UUID, string> picks = ProfileFrontend.GetPicks(requestedUUID).ToDictionary(Pick => Pick.PickUUID, Pick => Pick.Name); #endif remoteClient.SendAvatarPicksReply(requestedUUID, picks); }
public void HandleAvatarPicksRequest(Object sender, string method, List <String> args) { if (!(sender is IClientAPI)) { return; } IClientAPI remoteClient = (IClientAPI)sender; UUID requestedUUID = new UUID(args[0]); Dictionary <UUID, string> picks = ProfileFrontend.GetPicks(requestedUUID).ToDictionary(Pick => Pick.PickUUID, Pick => Pick.Name); remoteClient.SendAvatarPicksReply(requestedUUID, picks); }
public void HandleAvatarPicksRequest(object sender, string method, List <string> args) { if (!(sender is IClientAPI)) { return; } IClientAPI remoteClient = (IClientAPI)sender; UUID requestedUUID = new UUID(args [0]); // 20170120 - greythane - May need to check for NPC bots here and send an appropriate reply Dictionary <UUID, string> picks = ProfileFrontend.GetPicks(requestedUUID) .ToDictionary(Pick => Pick.PickUUID, Pick => Pick.Name); remoteClient.SendAvatarPicksReply(requestedUUID, picks); }
public byte[] GetPicks(OSDMap request) { UUID principalID = request["PrincipalID"].AsUUID(); List <ProfilePickInfo> Pick = ProfileConnector.GetPicks(principalID); OSDMap result = new OSDMap(); OSDArray array = new OSDArray(); foreach (ProfilePickInfo info in Pick) { array.Add(info.ToOSD()); } result["Result"] = array; string xmlString = OSDParser.SerializeJsonString(result); //MainConsole.Instance.DebugFormat("[AuroraDataServerPostHandler]: resp string: {0}", xmlString); UTF8Encoding encoding = new UTF8Encoding(); return(encoding.GetBytes(xmlString)); }
public Dictionary <string, object> Fill(WebInterface webInterface, string filename, OSHttpRequest httpRequest, OSHttpResponse httpResponse, Dictionary <string, object> requestParameters, ITranslator translator, out string response) { response = null; var vars = new Dictionary <string, object>(); string username = filename.Split('/').LastOrDefault(); UserAccount account = null; if (httpRequest.Query.ContainsKey("userid")) { string userid = httpRequest.Query["userid"].ToString(); account = webInterface.Registry.RequestModuleInterface <IUserAccountService>(). GetUserAccount(null, UUID.Parse(userid)); } else if (httpRequest.Query.ContainsKey("name") || username.Contains('.')) { string name = httpRequest.Query.ContainsKey("name") ? httpRequest.Query["name"].ToString() : username; name = name.Replace('.', ' '); account = webInterface.Registry.RequestModuleInterface <IUserAccountService>(). GetUserAccount(null, name); } else { username = username.Replace("%20", " "); account = webInterface.Registry.RequestModuleInterface <IUserAccountService>(). GetUserAccount(null, username); } if (account == null) { return(vars); } vars.Add("UserName", account.Name); IProfileConnector profileConnector = Framework.Utilities.DataManager.RequestPlugin <IProfileConnector>(); IUserProfileInfo profile = profileConnector == null ? null : profileConnector.GetUserProfile(account.PrincipalID); vars.Add("UserType", profile.MembershipGroup == "" ? "Resident" : profile.MembershipGroup); IWebHttpTextureService webhttpService = webInterface.Registry.RequestModuleInterface <IWebHttpTextureService>(); if (profile != null) { if (profile.Partner != UUID.Zero) { account = webInterface.Registry.RequestModuleInterface <IUserAccountService>(). GetUserAccount(null, profile.Partner); vars.Add("UserPartner", account.Name); } else { vars.Add("UserPartner", "No partner"); } vars.Add("UserAboutMe", profile.AboutText == "" ? "Nothing here" : profile.AboutText); string url = "../images/icons/no_picture.jpg"; if (webhttpService != null && profile.Image != UUID.Zero) { url = webhttpService.GetTextureURL(profile.Image); } vars.Add("UserPictureURL", url); List <Dictionary <string, object> > picks = new List <Dictionary <string, object> >(); foreach (var pick in profileConnector.GetPicks(profile.PrincipalID)) { url = "../images/icons/no_picture.jpg"; if (webhttpService != null && pick.SnapshotUUID != UUID.Zero) { url = webhttpService.GetTextureURL(pick.SnapshotUUID); } picks.Add(new Dictionary <string, object> { { "PickSnapshotURL", url }, { "PickName", pick.OriginalName }, { "PickSim", pick.SimName }, { "PickLocation", pick.GlobalPos } }); } vars.Add("Picks", picks); } vars.Add("UsersPicksText", translator.GetTranslatedString("UsersPicksText")); return(vars); }