public CreateObjectResponse CreateObject(CreateObjectRequest request)
        {
            EnsureAbsoluteUri(request);
            var command = new CreateObject(_userId, _secret, _builder, _authenticator) { Parameters = request };

            return (CreateObjectResponse) ((ICommandExecutor) this).Execute(command);
        }
Example #2
0
        /// -----------------------------------------------------------------
        /// <summary>
        /// </summary>
        // -----------------------------------------------------------------
        public Dispatcher.Messages.ResponseBase CreateObjectHandler(Dispatcher.Messages.RequestBase irequest)
        {
            if (irequest.GetType() != typeof(CreateObjectRequest))
            {
                return(OperationFailed("wrong type of request object"));
            }

            CreateObjectRequest request = (CreateObjectRequest)irequest;

            if (request.AssetID == UUID.Zero)
            {
                return(OperationFailed("missing asset id"));
            }

            SceneObjectGroup sog = null;

            try
            {
                m_log.DebugFormat("[ObjectHandlers] create object \"{0}\" from asset {1}", request.Name, request.AssetID);

                sog = GetRezReadySceneObject(request.AssetID, request.Name, request.Description,
                                             request._UserAccount.PrincipalID, UUID.Zero);
                if (sog == null)
                {
                    return(OperationFailed("unable to create object from asset"));
                }

                if (request.ObjectID != UUID.Zero)
                {
                    sog.UUID = request.ObjectID;
                }

                if (!String.IsNullOrEmpty(request.StartParameter))
                {
                    if (m_jsonstore != null)
                    {
                        // really should register an event handler on the scene to destroy this
                        // store when we are done
                        UUID storeID = sog.UUID;
                        m_jsonstore.CreateStore(request.StartParameter, ref storeID);
                    }
                }

                if (!m_scene.AddNewSceneObject(sog, false, request.Position, request.Rotation, request.Velocity))
                {
                    return(OperationFailed("failed to add the object to the scene"));
                }

                sog.CreateScriptInstances(0, true, m_scene.DefaultScriptEngine, 3);
                sog.ScheduleGroupForFullUpdate();
            }
            catch (Exception e)
            {
                m_log.WarnFormat("[ObjectHandlers] exception thrown in CreateObjectHandler; {0}", e.ToString());
                return(OperationFailed(e.Message));
            }

            return(new CreateObjectResponse(sog.UUID));
        }
Example #3
0
        public static async Task <Person> Create(AmazonCloudDirectoryClient c, string schemaARN, string directoryARN, string facetName, string itemName)
        {
            var facets = await c.ListFacetNamesAsync(new ListFacetNamesRequest()
            {
                SchemaArn = schemaARN
            });

            Console.WriteLine("facets:" + JsonConvert.SerializeObject(facets));


            var lpp = await c.ListObjectParentPathsAsync(new ListObjectParentPathsRequest()
            {
                DirectoryArn    = directoryARN,
                ObjectReference = new ObjectReference()
                {
                    Selector = "/"
                }
            });

            Console.WriteLine("parent paths:" + JsonConvert.SerializeObject(lpp));


            var cor = new CreateObjectRequest();

            cor.DirectoryArn = directoryARN;

            var p = new Person()
            {
                username = "******", website = "test website"
            };

            var oal = CloudDirectoryJsonHelpers.Serialise(p, facetName, schemaARN);

            cor.ObjectAttributeList = oal;

            cor.ParentReference = new ObjectReference()
            {
                Selector = "/"
            };
            // [^\/\[\]\(\):\{\}#@!?\s\\;]+)
            cor.LinkName = itemName;


            cor.SchemaFacets = new List <SchemaFacet>()
            {
                new SchemaFacet()
                {
                    FacetName = facetName,
                    SchemaArn =
                        schemaARN
                }
            };

            await c.CreateObjectAsync(cor);

            return(p);
        }
Example #4
0
 private void CreateXDFactoryInitializer()
 {
     _xdFactory = new Lazy <XDFactory>(() =>
     {
         var req      = new CreateObjectRequest(CreateObjectRequest.OBJECT_XDFACTORY);
         var response = Client.SendRequestWithResponse(req);
         var objectId = BigEndianBitConverter.ToInt32(response.Data, 0);
         return(new XDFactory(objectId, Client));
     });
 }
Example #5
0
        public CreateObjectResponse CreateObject(CreateObjectRequest request)
        {
            EnsureAbsoluteUri(request);
            var command = new CreateObject(_userId, _secret, _builder, _authenticator)
            {
                Parameters = request
            };

            return((CreateObjectResponse)((ICommandExecutor)this).Execute(command));
        }
Example #6
0
        protected override async Task <Entity> CreateNewAsync(ApiOptions options)
        {
            // Create a new object
            var request = new CreateObjectRequest()
            {
                Object = this
            };

            ApiOptions.Apply(request, options);
            var response = await request.ExecuteAsync();

            if (response.Status.IsSuccessful == false)
            {
                throw response.Status.ToFault();
            }

            // 3. Update the last known state based on the differences
            Debug.Assert(response.Object != null, "If status is successful, then created object should not be null.");
            return(response.Object);
        }
Example #7
0
        public bool CreateObject(GridRegion destination, ISceneEntity sog)
        {
            CreateObjectRequest request = new CreateObjectRequest();

            request.Object      = sog;
            request.Destination = destination;
            AutoResetEvent resetEvent = new AutoResetEvent(false);
            OSDMap         result     = null;

            m_syncMessagePoster.Get(destination.ServerURI, request.ToOSD(), (osdresp) =>
            {
                result = osdresp;
                resetEvent.Set();
            });
            bool success = resetEvent.WaitOne(10000);

            if (!success)
            {
                return(false);
            }
            return(result["Success"].AsBoolean());
        }
Example #8
0
 protected override IRuleElement CreateObject(CreateObjectRequest req)
 => new YmnosRule(req.Descriptor.GetElementName(), typiconSerializer, SerializerRoot.QueryProcessor);
 protected override IRuleElement CreateObject(CreateObjectRequest req)
 => new PsalmRule(req.Descriptor.GetElementName(), SerializerRoot.QueryProcessor, new PsalmRuleVMFactory(SerializerRoot));
Example #10
0
 protected override IRuleElement CreateObject(CreateObjectRequest req)
 {
     return(new Notice(req.Descriptor.GetElementName(), req.Parent, SerializerRoot.QueryProcessor));
 }
Example #11
0
        /// <summary>
        /// Creates the object
        /// </summary>
        public Task CreateAsync()
        {
            var request = new CreateObjectRequest(ObjectSpecifier, new ReadOnlyArray <PropertyValue>(_properties));

            return(Client.SendRequestAsync(DeviceInstance, request));
        }
Example #12
0
 protected override IRuleElement CreateObject(CreateObjectRequest req)
 {
     return new And(req.Descriptor.GetElementName());
 }
Example #13
0
 protected override IRuleElement CreateObject(CreateObjectRequest req)
 {
     return(new DateByDaysFromEaster(req.Descriptor.GetElementName(), SerializerRoot.QueryProcessor));
 }
 protected override IRuleElement CreateObject(CreateObjectRequest req)
 {
     return(new GetDayOfWeek(req.Descriptor.GetElementName()));
 }
Example #15
0
 protected override IRuleElement CreateObject(CreateObjectRequest req)
 {
     return(new IsCelebrating(req.Descriptor.GetElementName()));
 }
Example #16
0
        OSDMap LocalSimulationServiceConnector_OnMessageReceived(OSDMap message)
        {
            if (!message.ContainsKey("Method"))
            {
                return(null);
            }
            switch (message["Method"].AsString())
            {
            case "CreateAgentRequest":
                CreateAgentRequest createAgentRequest = new CreateAgentRequest();
                createAgentRequest.FromOSD(message);
                CreateAgentResponse createAgentResponse = new CreateAgentResponse();
                createAgentResponse.Success = CreateAgent(createAgentRequest.Destination, createAgentRequest.CircuitData, createAgentRequest.TeleportFlags, out createAgentResponse);
                return(createAgentResponse.ToOSD());

            case "UpdateAgentPositionRequest":
                UpdateAgentPositionRequest updateAgentPositionRequest = new UpdateAgentPositionRequest();
                updateAgentPositionRequest.FromOSD(message);
                return(new OSDMap()
                {
                    new KeyValuePair <string, OSD>("Success", UpdateAgent(updateAgentPositionRequest.Destination, updateAgentPositionRequest.Update))
                });

            case "UpdateAgentDataRequest":
                UpdateAgentDataRequest updateAgentDataRequest = new UpdateAgentDataRequest();
                updateAgentDataRequest.FromOSD(message);
                return(new OSDMap()
                {
                    new KeyValuePair <string, OSD>("Success", UpdateAgent(updateAgentDataRequest.Destination, updateAgentDataRequest.Update))
                });

            case "FailedToMoveAgentIntoNewRegionRequest":
                FailedToMoveAgentIntoNewRegionRequest failedToMoveAgentIntoNewRegionRequest = new FailedToMoveAgentIntoNewRegionRequest();
                failedToMoveAgentIntoNewRegionRequest.FromOSD(message);
                FailedToMoveAgentIntoNewRegion(failedToMoveAgentIntoNewRegionRequest.AgentID, failedToMoveAgentIntoNewRegionRequest.RegionID);
                break;

            case "CloseAgentRequest":
                CloseAgentRequest closeAgentRequest = new CloseAgentRequest();
                closeAgentRequest.FromOSD(message);
                CloseAgent(closeAgentRequest.Destination, closeAgentRequest.AgentID);
                break;

            case "MakeChildAgentRequest":
                MakeChildAgentRequest makeChildAgentRequest = new MakeChildAgentRequest();
                makeChildAgentRequest.FromOSD(message);
                MakeChildAgent(makeChildAgentRequest.AgentID, makeChildAgentRequest.OldRegion, makeChildAgentRequest.Destination, makeChildAgentRequest.IsCrossing);
                break;

            case "FailedToTeleportAgentRequest":
                FailedToTeleportAgentRequest failedToTeleportAgentRequest = new FailedToTeleportAgentRequest();
                failedToTeleportAgentRequest.FromOSD(message);
                FailedToTeleportAgent(failedToTeleportAgentRequest.Destination, failedToTeleportAgentRequest.FailedRegionID,
                                      failedToTeleportAgentRequest.AgentID, failedToTeleportAgentRequest.Reason, failedToTeleportAgentRequest.IsCrossing);
                break;

            case "RetrieveAgentRequest":
                RetrieveAgentRequest retrieveAgentRequest = new RetrieveAgentRequest();
                retrieveAgentRequest.FromOSD(message);
                RetrieveAgentResponse retrieveAgentResponse = new RetrieveAgentResponse();
                retrieveAgentResponse.Success = RetrieveAgent(retrieveAgentRequest.Destination, retrieveAgentRequest.AgentID, retrieveAgentRequest.AgentIsLeaving,
                                                              out retrieveAgentResponse.AgentData, out retrieveAgentResponse.CircuitData);
                return(retrieveAgentResponse.ToOSD());

            case "CreateObjectRequest":
                CreateObjectRequest createObjectRequest = new CreateObjectRequest();
                createObjectRequest.FromOSD(message);
                createObjectRequest.Scene = GetScene(createObjectRequest.Destination.RegionID);
                createObjectRequest.DeserializeObject();
                return(new OSDMap()
                {
                    new KeyValuePair <string, OSD>("Success", CreateObject(createObjectRequest.Destination, createObjectRequest.Object))
                });
            }
            return(null);
        }
Example #17
0
 protected override IRuleElement CreateObject(CreateObjectRequest req)
 {
     return(new RootContainer(req.Descriptor.GetElementName()));
 }
Example #18
0
 protected override IRuleElement CreateObject(CreateObjectRequest req) => new CommonRuleElement(SerializerRoot);
 protected override IRuleElement CreateObject(CreateObjectRequest req) => new WorshipSequence(SerializerRoot, req.Descriptor.GetElementName());
Example #20
0
 protected override IRuleElement CreateObject(CreateObjectRequest req)
 => new KOdiRule(req.Descriptor.GetElementName(), req.Parent as KanonasRule);
Example #21
0
 protected override IRuleElement CreateObject(CreateObjectRequest req)
 {
     return(new KanonasRule(req.Descriptor.GetElementName(), new KanonasRuleVMFactory(SerializerRoot), req.Parent));
 }
 protected override IRuleElement CreateObject(CreateObjectRequest req)
 {
     return(new TheotokionAppRule(req.Descriptor.GetElementName(), SerializerRoot.QueryProcessor));
 }
 protected override IRuleElement CreateObject(CreateObjectRequest req)
 => new ModifyReplacedDay(req.Descriptor.GetElementName(), req.Parent);
Example #24
0
        protected override async Task<Entity> CreateNewAsync(ApiOptions options)
        {
            // Create a new object
            var request = new CreateObjectRequest() { Object = this };
            ApiOptions.Apply(request, options);
            var response = await request.ExecuteAsync();
            if (response.Status.IsSuccessful == false)
                throw response.Status.ToFault();

            // 3. Update the last known state based on the differences
            Debug.Assert(response.Object != null, "If status is successful, then created object should not be null.");
            return response.Object;
        }
 protected override IRuleElement CreateObject(CreateObjectRequest req)
 {
     return(new KKatavasiaRule(req.Descriptor.GetElementName(), SerializerRoot.QueryProcessor, SerializerRoot.TypiconSerializer));
 }
 protected override IRuleElement CreateObject(CreateObjectRequest req)
 {
     return(new ExapostilarionRule(new ExapostilarionRuleVMFactory(SerializerRoot), req.Descriptor.GetElementName()));
 }
Example #27
0
 protected override IRuleElement CreateObject(CreateObjectRequest req) => new VariableWorshipRule(SerializerRoot);
Example #28
0
 protected override IRuleElement CreateObject(CreateObjectRequest req) => new If(req.Descriptor.GetElementName());
 protected override IRuleElement CreateObject(CreateObjectRequest req)
 => new KKanonasItemRule(req.Descriptor.GetElementName(), SerializerRoot.TypiconSerializer);
 protected override IRuleElement CreateObject(CreateObjectRequest req)
 {
     return(new IsTwoSaints(req.Descriptor.GetElementName()));
 }
 protected override IRuleElement CreateObject(CreateObjectRequest req)
 {
     return(new TextHolder(new TextHolderVMFactory(SerializerRoot), req.Descriptor.GetElementName()));
 }