private OperationResponse ItemOperationSpawn(Item item, SpawnItem operation)
        {
            // this should always return Ok
            MethodReturnValue result = this.CheckAccess(item);

            if (result.IsOk)
            {
                item.Rotation = operation.Rotation;
                item.Spawn(operation.Position);
                ((World)this.World).Radar.AddItem(item, operation.Position);
            }

            operation.OnComplete();
            return operation.GetOperationResponse(result);
        }
Ejemplo n.º 2
0
        /// <summary>
        ///   Spawns an item.
        /// </summary>
        /// <param name = "item">
        ///   The mmo item.
        /// </param>
        /// <param name = "operation">
        ///   The operation.
        /// </param>
        /// <param name = "interestArea">
        ///   The interest Area.
        /// </param>
        /// <returns>
        ///   error code ok
        /// </returns>
        private OperationResponse ItemOperationSpawn(MmoItem item, SpawnItem operation, InterestArea interestArea)
        {
            // this should always return Ok
            MethodReturnValue result = this.CheckAccess(item);

            if (result)
            {
                item.Rotation = operation.Rotation;
                item.Spawn(operation.Position);
                ((MmoWorld)this.World).Radar.AddItem(item, operation.Position);

                if (interestArea != null)
                {
                    lock (interestArea.SyncRoot)
                    {
                        interestArea.SubscribeItem(item);
                    }
                }
            }

            operation.OnComplete();
            return operation.GetOperationResponse(result);
        }