示例#1
0
    void SetStartInformation(int fingerID, Vector2 startPosition, float startTime)
    {
        StartInformation start = new StartInformation();
        start.position = startPosition;
        start.time = startTime;

        if (m_StartPositions.ContainsKey(fingerID))
        {
            m_StartPositions[fingerID] = start;
        }
        else
        {
            m_StartPositions.Add(fingerID, start);
        }
    }
        internal HttpMessage CreateStartPlaybackRequest(StartInformation body)
        {
            var message = _pipeline.CreateMessage();
            var request = message.Request;

            request.Method = RequestMethod.Post;
            var uri = new RawRequestUriBuilder();

            uri.Reset(endpoint);
            uri.AppendPath("/playback/start", false);
            request.Uri = uri;
            request.Headers.Add("Accept", "application/json");
            request.Headers.Add("Content-Type", "application/json");
            var content = new Utf8JsonRequestContent();

            content.JsonWriter.WriteObjectValue(body);
            request.Content = content;
            return(message);
        }
        public async Task <ResponseWithHeaders <IReadOnlyDictionary <string, string>, TestProxyStartPlaybackHeaders> > StartPlaybackAsync(StartInformation body, CancellationToken cancellationToken = default)
        {
            if (body == null)
            {
                throw new ArgumentNullException(nameof(body));
            }

            using var message = CreateStartPlaybackRequest(body);
            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);

            var headers = new TestProxyStartPlaybackHeaders(message.Response);

            switch (message.Response.Status)
            {
            case 200:
            {
                IReadOnlyDictionary <string, string> value = default;
                using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false);

                Dictionary <string, string> dictionary = new Dictionary <string, string>();
                foreach (var property in document.RootElement.EnumerateObject())
                {
                    dictionary.Add(property.Name, property.Value.GetString());
                }
                value = dictionary;
                return(ResponseWithHeaders.FromValue(value, headers, message.Response));
            }
示例#4
0
        public UserObject(StartInformation info)
        {
            CharacterIndex = info.Index;

            ObjectID = info.ObjectID;

            Name       = info.Name;
            NameColour = info.NameColour;

            Class  = info.Class;
            Gender = info.Gender;

            Title     = info.GuildName;
            GuildRank = info.GuildRank;

            CurrentLocation = info.Location;
            Direction       = info.Direction;

            CurrentHP = info.CurrentHP;
            CurrentMP = info.CurrentMP;

            Level      = info.Level;
            Experience = info.Experience;

            HairType   = info.HairType;
            HairColour = info.HairColour;

            ArmourShape        = info.Armour;
            ArmourImage        = info.ArmourImage;
            ArmourColour       = info.ArmourColour;
            LibraryWeaponShape = info.Weapon;

            Poison = info.Poison;

            InSafeZone = info.InSafeZone;

            AttackMode = info.AttackMode;
            PetMode    = info.PetMode;

            Horse = info.Horse;
            Dead  = info.Dead;

            HorseShape  = info.HorseShape;
            HelmetShape = info.HelmetShape;
            ShieldShape = info.Shield;

            Gold = info.Gold;
            GameScene.Game.DayTime             = info.DayTime;
            GameScene.Game.GroupBox.AllowGroup = info.AllowGroup;

            HermitPoints = info.HermitPoints;

            foreach (ClientUserMagic magic in info.Magics)
            {
                Magics[magic.Info] = magic;
            }

            foreach (ClientBuffInfo buff in info.Buffs)
            {
                Buffs.Add(buff);
                VisibleBuffs.Add(buff.Type);
            }



            UpdateLibraries();

            SetFrame(new ObjectAction(!Dead ? MirAction.Standing : MirAction.Dead, Direction, CurrentLocation));

            GameScene.Game.FillItems(info.Items);

            foreach (ClientBeltLink link in info.BeltLinks)
            {
                if (link.Slot < 0 || link.Slot >= GameScene.Game.BeltBox.Links.Length)
                {
                    continue;
                }

                GameScene.Game.BeltBox.Links[link.Slot].LinkInfoIndex = link.LinkInfoIndex;
                GameScene.Game.BeltBox.Links[link.Slot].LinkItemIndex = link.LinkItemIndex;
            }
            GameScene.Game.BeltBox.UpdateLinks();

            foreach (ClientAutoPotionLink link in info.AutoPotionLinks)
            {
                if (link.Slot < 0 || link.Slot >= GameScene.Game.AutoPotionBox.Links.Length)
                {
                    continue;
                }

                GameScene.Game.AutoPotionBox.Links[link.Slot] = link;
            }
            GameScene.Game.AutoPotionBox.UpdateLinks();

            GameScene.Game.MapControl.AddObject(this);
        }