Пример #1
0
        public string Post([FromBody] string value)
        {
            var config = JsonConvert.DeserializeObject <Config>(File.ReadAllText("config.json"));

            var content = SkyNet.Copy($"{config.SkynetUrlPost}", "clipboard", value);

            foreach (var peer in config.Peers)
            {
                var client = new RestClient($"{peer}/api/clipboard")
                {
                    UserAgent = "Sia-Agent"
                };

                var request = new RestRequest()
                {
                    Method        = Method.PUT,
                    RequestFormat = DataFormat.Json
                };

                request.AddJsonBody(content);

                var asd = client.Execute(request);
            }

            return(content);
        }
Пример #2
0
    public void Update()
    {
        if (_currBattle != null)
        {
            if (_currBattle.Update())
            {
                //update own synet for testing
                _skyNet.update(_currBattle);
            }
            else
            {
                Object.Destroy(_currBattle);
            }
        }
        else
        {
            Node clicked = m_nodeController.checkNodes();
            if (clicked != null)
            {
                //freezeplanet movement;
                if (clicked._nodeType == NODE_TYPES.BATTLE)
                {
                    _playerShip = new Ship("PLAYER", 20.0f, 5.0f, 1.0f);
                    _playerShip.AddWeapon(new Weapon(WEAPONS_TYPE.CANNON, EFFECT_TYPE.NONE));
                    _playerShip.AddWeapon(new Weapon(WEAPONS_TYPE.CANNON, EFFECT_TYPE.NONE));
                    _playerShip._level = 1;

                    _skyNet     = new SkyNet(ref _playerShip, _playerShip._level);
                    _currBattle = ScriptableObject.CreateInstance <Battle>();
                    _currBattle.StartBattle(_playerShip);
                    clicked._gameObject.GetComponent <MeshRenderer>().material.color = Color.magenta;
                }
            }
        }
    }
Пример #3
0
 public Audio(SkyNet.Model.Audio element)
     : base(element)
 {
     this.Picture = element.Picture;
     this.Duration = element.Duration;
     this.Title = element.Title;
     this.Artist = element.Artist;
     this.Album = element.Album;
     this.Album_Artist = element.Album_Artist;
     this.Genre = element.Genre;
 }
Пример #4
0
        public string Get(string folder)
        {
            var config = JsonConvert.DeserializeObject <Config>(File.ReadAllText("config.json"));

            var value = File.ReadAllText(@"clipboard\skyclipboard.txt");

            var tuple = SkyNet.Paste($"{config.SkynetUrlGet}", value);

            File.WriteAllBytes($@"{folder}\{tuple.Item1}", tuple.Item2);

            return($@"{folder}\{tuple.Item1}");
        }
Пример #5
0
    public void StartBattle(Ship playerShip, Ship enemy)
    {
        _playerShip = playerShip;
        _enemy      = enemy;

        // prepare skynet lists

        _skyNet = new SkyNet(ref _enemy, _playerShip._level, new Strategy(7, 2, 1, _enemy));

        //set targets
        _enemy._target      = _playerShip;
        _playerShip._target = _enemy;
        _battleActive       = true;
    }
Пример #6
0
    public void StartBattle(Ship ship)
    {
        _ship  = ship;
        _enemy = new Ship("ENEMY", 20.0f, 5.0f, 5.0f);
        _enemy.AddWeapon(new Weapon(WEAPONS_TYPE.CANNON, EFFECT_TYPE.NONE));
        _enemy.AddWeapon(new Weapon(WEAPONS_TYPE.CANNON, EFFECT_TYPE.NONE));

        // prepare skynet lists
        _skyNet = new SkyNet(ref _enemy, _ship._level);

        //set targets
        _enemy._target = _ship;
        _ship._target  = _enemy;
        _battleActive  = true;
    }
Пример #7
0
    public void StartBattle()
    {
        _playerShip = new Ship("PLAYER", 20.0f, 5.0f, 1.0f);
        _playerShip.AddWeapon(new Weapon(WEAPONS_TYPE.CANNON, EFFECT_TYPE.NONE));
        _playerShip.AddWeapon(new Weapon(WEAPONS_TYPE.CANNON, EFFECT_TYPE.NONE));
        _playerShip._level = 1;

        _enemyShip = new Ship("ENEMY", 20.0f, 5.0f, 5.0f);
        _enemyShip.AddWeapon(new Weapon(WEAPONS_TYPE.CANNON, EFFECT_TYPE.NONE));
        _enemyShip.AddWeapon(new Weapon(WEAPONS_TYPE.CANNON, EFFECT_TYPE.NONE));

        _skyNet      = new SkyNet(ref _playerShip, _playerShip._level, new Strategy(7, 2, 1, _playerShip));
        _skyNetEnemy = new SkyNet(ref _enemyShip, _enemyShip._level, new Strategy(7, 2, 1, _enemyShip));

        _playerShip._target = _enemyShip;
        _enemyShip._target  = _playerShip;
        _battleOver         = false;
        _battleStart        = true;

        Debug.Log("Start");
        _timer = 0.0f;
        Turn();
    }
Пример #8
0
 public Video(SkyNet.Model.Video element)
     : base(element)
 {
     this.Height = element.Height;
     this.Width = element.Width;
     this.Picture = element.Picture;
     this.Duration = element.Duration;
     this.BitRate = element.BitRate;
 }
Пример #9
0
 public UserQuota(SkyNet.Model.UserQuota uq)
     : base()
 {
     this.Available = uq.Available;
     this.Quota = uq.Quota;
 }
Пример #10
0
 public Photo(SkyNet.Model.Photo photo)
     : base(photo)
 {
     this.Height = photo.Height;
     this.Width = photo.Width;
     this.Images = photo.Images;
     this.When_Taken = photo.When_Taken;
     this.Location = photo.Location;
 }
Пример #11
0
 public Location(SkyNet.Model.Location loc)
     : base()
 {
     this.Lattitude = loc.Lattitude;
     this.Longitude = loc.Longitude;
 }
Пример #12
0
 public Image(SkyNet.Model.Image img)
 {
     this.Height = img.Height;
     this.Source = img.Source;
     this.Type = img.Type;
     this.Width = img.Width;
 }
Пример #13
0
 public Folder(SkyNet.Model.Folder folder)
     : base(folder)
 {
     this.Count = folder.Count;
 }
Пример #14
0
 public Album(SkyNet.Model.Album album)
     : base(album)
 {
 }
Пример #15
0
 public File(SkyNet.Model.File fromFile)
     : base()
 {
     this.Comments_Count = fromFile.Comments_Count;
             this.Comments_Enabled = fromFile.Comments_Enabled;
             this.Created_Time = fromFile.Created_Time;
             this.Data = fromFile.Data;
             this.Description = fromFile.Description;
             this.From = fromFile.From;
             this.Id = fromFile.Id;
             this.Is_Embeddable = fromFile.Is_Embeddable;
             this.Link = fromFile.Link;
             this.Name = fromFile.Name;
             this.Parent_Id = fromFile.Parent_Id;
             this.Shared_With = fromFile.Shared_With;
             this.Size = fromFile.Size;
             this.Source = fromFile.Source;
             this.Type = fromFile.Type;
             this.Updated_Time = fromFile.Updated_Time;
             this.Upload_Location = fromFile.Upload_Location;
 }
Пример #16
0
        public void TestMethod1()
        {
            var content = SkyNet.Copy("https://siasky.net/skynet/skyfile/", "clipboard", @"C:\Users\Khanimamba\Desktop\Cake\New folder\Example.txt");

            SkyNet.Paste("https://siasky.net/", content);
        }