public bool CheckName(string firstName, LastName lastName) { if (Initializing) { throw new InvalidOperationException("still initializing"); } if (_caps.CheckName == null) { throw new InvalidOperationException("access denied; only approved developers have access to the registration api"); } // Create the POST data LLSDMap query = new LLSDMap(); query.Add("username", LLSD.FromString(firstName)); query.Add("last_name_id", LLSD.FromInteger(lastName.ID)); byte[] postData = LLSDParser.SerializeXmlBytes(query); CapsClient request = new CapsClient(_caps.CheckName); request.OnComplete += new CapsClient.CompleteCallback(CheckNameResponse); request.StartRequest(); // FIXME: return(false); }
public LLSD ToLLSD(int faceNumber) { LLSDMap tex = new LLSDMap(10); if (faceNumber >= 0) { tex["face_number"] = LLSD.FromInteger(faceNumber); } tex["colors"] = RGBA.ToLLSD(); tex["scales"] = LLSD.FromReal(RepeatU); tex["scalet"] = LLSD.FromReal(RepeatV); tex["offsets"] = LLSD.FromReal(OffsetU); tex["offsett"] = LLSD.FromReal(OffsetV); tex["imagerot"] = LLSD.FromReal(Rotation); tex["bump"] = LLSD.FromInteger((int)Bump); tex["shiny"] = LLSD.FromInteger((int)Shiny); tex["fullbright"] = LLSD.FromBoolean(Fullbright); tex["media_flags"] = LLSD.FromInteger(Convert.ToInt32(MediaFlags)); tex["mapping"] = LLSD.FromInteger((int)TexMapType); tex["glow"] = LLSD.FromReal(Glow); if (TextureID != LLObject.TextureEntry.WHITE_TEXTURE) { tex["imageid"] = LLSD.FromUUID(TextureID); } else { tex["imageid"] = LLSD.FromUUID(LLUUID.Zero); } return(tex); }
public LLSD ToLLSD() { LLSDMap map = new LLSDMap(); map["texture"] = LLSD.FromUUID(SculptTexture); map["type"] = LLSD.FromInteger((int)Type); return(map); }
public LLSD ToLLSD() { LLSDMap path = new LLSDMap(14); path["begin"] = LLSD.FromReal(Data.PathBegin); path["curve"] = LLSD.FromInteger((int)Data.PathCurve); path["end"] = LLSD.FromReal(Data.PathEnd); path["radius_offset"] = LLSD.FromReal(Data.PathRadiusOffset); path["revolutions"] = LLSD.FromReal(Data.PathRevolutions); path["scale_x"] = LLSD.FromReal(Data.PathScaleX); path["scale_y"] = LLSD.FromReal(Data.PathScaleY); path["shear_x"] = LLSD.FromReal(Data.PathShearX); path["shear_y"] = LLSD.FromReal(Data.PathShearY); path["skew"] = LLSD.FromReal(Data.PathSkew); path["taper_x"] = LLSD.FromReal(Data.PathTaperX); path["taper_y"] = LLSD.FromReal(Data.PathTaperY); path["twist"] = LLSD.FromReal(Data.PathTwist); path["twist_begin"] = LLSD.FromReal(Data.PathTwistBegin); LLSDMap profile = new LLSDMap(4); profile["begin"] = LLSD.FromReal(Data.ProfileBegin); profile["curve"] = LLSD.FromInteger((int)Data.ProfileCurve); profile["hole"] = LLSD.FromInteger((int)Data.ProfileHole); profile["end"] = LLSD.FromReal(Data.ProfileEnd); profile["hollow"] = LLSD.FromReal(Data.ProfileHollow); LLSDMap volume = new LLSDMap(2); volume["path"] = path; volume["profile"] = profile; LLSDMap prim = new LLSDMap(9); prim["name"] = LLSD.FromString(Properties.Name); prim["description"] = LLSD.FromString(Properties.Description); prim["phantom"] = LLSD.FromBoolean(((Flags & ObjectFlags.Phantom) != 0)); prim["physical"] = LLSD.FromBoolean(((Flags & ObjectFlags.Physics) != 0)); prim["position"] = Position.ToLLSD(); prim["rotation"] = Rotation.ToLLSD(); prim["scale"] = Scale.ToLLSD(); prim["material"] = LLSD.FromInteger((int)Data.Material); prim["shadows"] = LLSD.FromBoolean(((Flags & ObjectFlags.CastShadows) != 0)); prim["textures"] = Textures.ToLLSD(); prim["volume"] = volume; if (ParentID != 0) { prim["parentid"] = LLSD.FromInteger(ParentID); } prim["light"] = Light.ToLLSD(); prim["flex"] = Flexible.ToLLSD(); prim["sculpt"] = Sculpt.ToLLSD(); return(prim); }
/// <summary> /// Returns the new user ID or throws an exception containing the error code /// The error codes can be found here: https://wiki.secondlife.com/wiki/RegAPIError /// </summary> /// <param name="user">New user account to create</param> /// <returns>The UUID of the new user account</returns> public LLUUID CreateUser(CreateUserParam user) { if (Initializing) { throw new InvalidOperationException("still initializing"); } if (_caps.CreateUser == null) { throw new InvalidOperationException("access denied; only approved developers have access to the registration api"); } // Create the POST data LLSDMap query = new LLSDMap(); query.Add("username", LLSD.FromString(user.FirstName)); query.Add("last_name_id", LLSD.FromInteger(user.LastName.ID)); query.Add("email", LLSD.FromString(user.Email)); query.Add("password", LLSD.FromString(user.Password)); query.Add("dob", LLSD.FromString(user.Birthdate.ToString("yyyy-MM-dd"))); if (user.LimitedToEstate != null) { query.Add("limited_to_estate", LLSD.FromInteger(user.LimitedToEstate.Value)); } if (!string.IsNullOrEmpty(user.StartRegionName)) { query.Add("start_region_name", LLSD.FromInteger(user.LimitedToEstate.Value)); } if (user.StartLocation != null) { query.Add("start_local_x", LLSD.FromReal(user.StartLocation.Value.X)); query.Add("start_local_y", LLSD.FromReal(user.StartLocation.Value.Y)); query.Add("start_local_z", LLSD.FromReal(user.StartLocation.Value.Z)); } if (user.StartLookAt != null) { query.Add("start_look_at_x", LLSD.FromReal(user.StartLookAt.Value.X)); query.Add("start_look_at_y", LLSD.FromReal(user.StartLookAt.Value.Y)); query.Add("start_look_at_z", LLSD.FromReal(user.StartLookAt.Value.Z)); } byte[] postData = LLSDParser.SerializeXmlBytes(query); // Make the request CapsClient request = new CapsClient(_caps.CreateUser); request.OnComplete += new CapsClient.CompleteCallback(CreateUserResponse); request.StartRequest(); // FIXME: Block return(LLUUID.Zero); }
/// <summary> /// /// </summary> /// <returns></returns> public LLSD ToLLSD() { LLSDMap map = new LLSDMap(); map["simulate_lod"] = LLSD.FromInteger(Softness); map["gravity"] = LLSD.FromReal(Gravity); map["air_friction"] = LLSD.FromReal(Drag); map["wind_sensitivity"] = LLSD.FromReal(Wind); map["tension"] = LLSD.FromReal(Tension); map["user_force"] = Force.ToLLSD(); return(map); }
/// <summary> /// /// </summary> /// <param name="layer"></param> public void RequestMapLayer(GridLayerType layer) { Uri url = Client.Network.CurrentSim.Caps.CapabilityURI("MapLayer"); if (url != null) { LLSDMap body = new LLSDMap(); body["Flags"] = LLSD.FromInteger((int)layer); CapsClient request = new CapsClient(url); request.OnComplete += new CapsClient.CompleteCallback(MapLayerResponseHandler); request.StartRequest(body); } }