public override void OnRequest(OrbClientInfo client, OrbRequestArgs args)
        {
            FindOnlineMobile(client);

            if (args == null)
            {
                SendResponse(null);
            }
            else if (!(args is ExtractRequestArgs))
            {
                SendResponse(null);
            }
            else if (!this.IsOnline)
            {
                SendResponse(null);
            }

            _args = args as ExtractRequestArgs;

            if (_args.ItemSerials == null)
            {
                _picker              = new BoundingBoxPickerEx();
                _picker.OnCancelled += new BoundingBoxExCancelled(OnTargetCancelled);
                _picker.Begin(this.Mobile, new BoundingBoxCallback(BoundingBox_Callback), null);
            }
            else
            {
                ExtractItems(_args.ItemSerials);
            }
        }
예제 #2
0
        private ExtractRequestArgs CreateExtractRequestArgs()
        {
            ExtractRequestArgs args = new ExtractRequestArgs();

            args.ItemSerials   = _itemSerials;
            args.NonStatic     = _nonStatic;
            args.Static        = _static;
            args.Frozen        = _frozen;
            args.MaxZSet       = _useMaxZ;
            args.MaxZ          = (short)_maxZ;
            args.MinZSet       = _useMinZ;
            args.MinZ          = (short)_minZ;
            args.Foundation    = _foundation;
            args.ExtractHues   = _hues;
            args.MultipleRects = _multipleRects;

            return(args);
        }
예제 #3
0
        // Extract the user selected items
        private void StartExtraction(object state)
        {
            ExtractRequestArgs args = CreateExtractRequestArgs();
            // submit the request to the server
            ExtractResponse resp = Connection.ExtractDesign(args);

            if (resp == null)
            {
                RaiseExtractedEvent(null);
                return;
            }
            else
            {
                _items = resp.Items != null ? resp.Items : new DesignItemCol();
            }

            if (_frozen && _mode == ExtractMode.Area)
            {
                for (int i = 0; i < resp.Rects.Count; ++i)
                {
                    ExtractFrozenItems(resp.Rects[i], resp.Map, _hues);
                }
            }

            if (resp == null || resp.Items.Count == 0)
            {
                RaiseExtractedEvent(null);
            }

            DesignData design = null;

            if (resp.Items.Count > 0)
            {
                design = new DesignData(_name, _category, _subsection);
                design.ImportItems(resp.Items, true, _foundation);
            }

            RaiseExtractedEvent(design);
        }
		public override void OnRequest(OrbClientInfo client, OrbRequestArgs args)
		{
			FindOnlineMobile(client);

			if(args == null)
				SendResponse(null);
			else if(!(args is ExtractRequestArgs))
				SendResponse(null);
			else if(!this.IsOnline)
				SendResponse(null);

			_args = args as ExtractRequestArgs;

			if(_args.ItemSerials == null)
			{
				_picker = new BoundingBoxPickerEx();
				_picker.OnCancelled += new BoundingBoxExCancelled(OnTargetCancelled);
				_picker.Begin( this.Mobile, new BoundingBoxCallback( BoundingBox_Callback ), null );
			}
			else
			{
				ExtractItems(_args.ItemSerials);
			}
		}
예제 #5
0
        public static ExtractResponse ExtractDesign(ExtractRequestArgs args)
        {
            Ultima.Client.BringToTop();

            return((ExtractResponse)ExecuteRequest("UOAR_ExtractDesign", args));
        }