Inheritance: MonoBehaviour
        public async Task <ActionResult <FollowingResponse> > Follow(string username)
        {
            _logger.LogInformation("Received profile follow request.");
            _logger.LogInformation("Profile username: {0}", username);

            User currentUser = _currentUserService.GetCurrentUser(HttpContext);

            _logger.LogInformation("Requesting user email: {0}", currentUser.Email);

            try
            {
                Follow newFollow = await _followService.FollowUser(username, currentUser.Email);

                newFollow.Follower = currentUser;

                // Publish event.
                _logger.LogInformation("Publishing follow notification.");
                await _notificationService.Publish(new FollowNotification(_mapper.Map <FollowResponse>(newFollow)));

                _logger.LogInformation("Successfully followed '{0}' for '{1}'.", username, currentUser.Email);

                return(Ok(_mapper.Map <FollowingResponse>(newFollow)));
            }
            catch (EntityNotFoundException <string> )
            {
                _logger.LogError("Profile with username '{0}' does not exist.", username);
                return(NotFound());
            }
            catch (OwnProfileFollowException)
            {
                _logger.LogError("User '{0}' cannot follow their own profile '{1}'.", currentUser.Email, username);
                return(BadRequest());
            }
        }
Exemple #2
0
        public void Config()
        {
            follow = new Follow()
            {
                Id        = "5d2e0e4cbb113a00010368c3",
                Follower  = "5d0a17701a0a4200017de6c7",
                Following = "5d111299f3b75e0001f4ed78"
            };

            claims = new ClaimsIdentity(new Claim[]
            {
                new Claim(ClaimTypes.Name, "abc"),
                new Claim(ClaimTypes.Role, "member"),
                new Claim("user_id", "5d2e0e4cbb113a0001036a12")
            });

            user = new User()
            {
                Id                = "5d027ea59b358d247cd21aa3",
                Active            = true,
                Address           = "Nam Dinh",
                Avatar            = "",
                ContributionPoint = 0,
                CreatedDate       = DateTime.Now,
                DisplayName       = "PhongTv",
                Dob               = DateTime.Parse("02/01/1997"),
                FirstName         = "Tran",
                FollowerCount     = 0,
                FollowingCount    = 34,
                Gender            = true,
                Interested        = null,
                IsFirstTime       = false,
                LastName          = "phong",
                UserName          = "******"
            };

            userSecond = new User()
            {
                Id                = "5d027ea59b358d212o3iu456b",
                Active            = true,
                Address           = "Nam Dinh",
                Avatar            = "",
                ContributionPoint = 0,
                CreatedDate       = DateTime.Now,
                DisplayName       = "PhongTv",
                Dob               = DateTime.Parse("02/01/1997"),
                FirstName         = "Tran",
                FollowerCount     = 0,
                FollowingCount    = 34,
                Gender            = true,
                Interested        = null,
                IsFirstTime       = false,
                LastName          = "phong",
                UserName          = "******"
            };

            getAllFollowerIds.Add("5d111299f3b75e0001f4ed78");
            getAllFollowingIds.Add("5d111299f3b75e0001f4ed78");
            mockfollowService = new Mock <IFollowService>();
        }
Exemple #3
0
        public async Task <IActionResult> FollowUser(int id, int recipientId)
        {
            if (id != int.Parse(User.FindFirst(ClaimTypes.NameIdentifier).Value))
            {
                return(Unauthorized());
            }

            var follow = await _repo.GetFollow(id, recipientId);

            if (follow != null)
            {
                return(BadRequest("You already followed this user"));
            }

            if (await _repo.GetUser(recipientId) == null)
            {
                return(NotFound());
            }

            follow = new Follow
            {
                FollowerId = id,
                FollowedId = recipientId
            };

            _repo.Add <Follow>(follow);

            if (await _repo.SaveAll())
            {
                return(Ok());
            }

            return(BadRequest("Failed to add user"));
        }
        public void InsertEdge()
        {
            var person1 = new Person
            {
                Age  = 22,
                Name = "A"
            };

            var person2 = new Person
            {
                Age  = 25,
                Name = "B"
            };

            db.InsertMultiple <Person>(new Person[] { person1, person2 });

            var follow = new Follow
            {
                CreatedDate = DateTime.Now,
                Follower    = person1.Id,
                Followee    = person2.Id
            };

            db.Insert <Follow>(follow);

            Assert.NotNull(follow.Key);
        }
Exemple #5
0
        /// <summary>
        /// 修改
        /// </summary>
        public override void EntityUpdate()
        {
            FollowRule rule   = new FollowRule();
            Follow     entity = EntityGet();

            rule.RUpdate(entity);
        }
Exemple #6
0
        public async Task <IActionResult> Follow(string user, string followee)
        {
            var cmd = new Follow(user, followee);
            await _client.Execute(cmd);

            return(Ok());
        }
Exemple #7
0
        public Follow DeleteFollow(int UserId, int FollowingId)
        {
            SqlConnection sqlConnection;

            sqlConnection = new SqlConnection(Properties.Settings.Default.DbConnectionString);
            sqlConnection.Open();

            Follow follow = new Follow();

            SqlCommand sqlCommand;

            sqlCommand             = new SqlCommand("DeleteFollow", sqlConnection);
            sqlCommand.CommandType = System.Data.CommandType.StoredProcedure;
            sqlCommand.Parameters.AddWithValue("UserId", UserId);
            sqlCommand.Parameters.AddWithValue("FollowingId", FollowingId);
            var reader = sqlCommand.ExecuteReader();

            while (reader.Read())
            {
                follow.UserId      = int.Parse(reader["UserId"].ToString());
                follow.FollowingId = int.Parse(reader["FollowingId"].ToString());
            }

            sqlConnection.Close();
            return(follow);
        }
        public ActionResult Follow(int channelid, bool followed)
        {
            int     res     = 0;
            Follow  follow  = followmanager.Find(x => x.Channel.id == channelid && x.Owner.id == CurrentSession.User.id);
            Channel channel = channelmanager.Find(x => x.id == channelid);

            if (follow != null && followed == false)
            {
                res = followmanager.Delete(follow);
            }
            else if (follow == null && followed == true)
            {
                res = followmanager.Insert(new Follow()
                {
                    CreatedOn = DateTime.Now,
                    Channel   = channel,
                    Owner     = CurrentSession.User
                });
            }
            if (res > 0)
            {
                return(Json(new { hasError = false, errorMessage = string.Empty, result = channel.Follows.Count }));
            }
            return(Json(new { hasError = true, errorMessage = "Takip etme işlemi gerçekleştirilemedi.", result = channel.Follows.Count }));
        }
Exemple #9
0
        public async Task <IActionResult> OnPostFollowAsync(string id)
        {
            Profile = await Context.Profiles
                      .Include(p => p.Follows)
                      .Where(p => p.ProfileID == id)
                      .FirstOrDefaultAsync();

            if (Profile == null)
            {
                return(Page());
            }
            string UserID = UserManager.GetUserId(User);
            Follow follow = Profile.Follows.Where(f => f.FollowerID == UserID).FirstOrDefault();

            if (follow == null)
            {
                Follow newFollow = new Follow
                {
                    FollowerID             = UserID,
                    ProfileID              = id,
                    UpdateTime             = DateTime.Now,
                    NovelMonthlyInvolver   = false,
                    ProfileMonthlyInvolver = false
                };
                Context.Follows.Add(newFollow);
                await Context.SaveChangesAsync();
            }
            else
            {
                Context.Follows.Remove(follow);
                await Context.SaveChangesAsync();
            }

            return(RedirectToPage("./Index", "OnGet", new { id }));
        }
        public ActionResult <Follow> DeleteFollow(long subForumId)
        {
            Follow follow = new Follow();

            follow.SubForumId = subForumId;
            string authHeaderValue = Request.Headers["Authorization"];
            var    tokenClaims     = GetClaims(authHeaderValue.Substring("Bearer ".Length).Trim());

            follow.UserId = Convert.ToInt32(tokenClaims.Claims.Where(c => c.Type == ClaimTypes.NameIdentifier).FirstOrDefault().Value);
            if (FollowExists(follow))
            {
                if (_followLogic.RemoveFollow(follow))
                {
                    return(Ok("Unsubscribed"));
                }
                else
                {
                    return(StatusCode(404));
                }
            }
            else
            {
                return(StatusCode(409, "Not subscribed"));
            }
        }
        public async Task <IActionResult> Edit(int id, [Bind("Id,BreweryId,ApplicationId")] Follow follow)
        {
            if (id != follow.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(follow);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!FollowExists(follow.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["ApplicationId"] = new SelectList(_context.ApplicationUser, "Id", "Id", follow.ApplicationId);
            ViewData["BreweryId"]     = new SelectList(_context.Brewery, "Id", "Id", follow.BreweryId);
            return(View(follow));
        }
Exemple #12
0
 /// <summary>
 /// 新增(传入事务处理)
 /// </summary>
 /// <param name="p_BE">要新增的实体</param>
 /// <param name="sqlTrans">事务类</param>
 public void RAdd(BaseEntity p_BE, IDBTransAccess sqlTrans)
 {
     try
     {
         this.CheckCorrect(p_BE);
         Follow    entity = (Follow)p_BE;
         string    sql    = "SELECT * FROM Data_Follow WHERE Sort=" + SysString.ToDBString(entity.Sort);
         DataTable dt     = sqlTrans.Fill(sql);
         if (dt.Rows.Count > 0)
         {
             throw new BaseException("流程序号已存在,请重新选择");
         }
         sql = "SELECT * FROM Data_Follow WHERE Name=" + SysString.ToDBString(entity.Name);
         dt  = sqlTrans.Fill(sql);
         if (dt.Rows.Count > 0)
         {
             throw new BaseException("流程已存在,请重新生成");
         }
         FollowCtl control = new FollowCtl(sqlTrans);
         entity.ID = (int)EntityIDTable.GetID((long)SysEntity.Data_Follow, sqlTrans);
         control.AddNew(entity);
     }
     catch (BaseException)
     {
         throw;
     }
     catch (Exception E)
     {
         throw new BaseException(E.Message);
     }
 }
        public void FollowTest1()
        {
            for (int x = 0; x < 2; x++)
            {
                int lineNumber = 0;

                using (Follow follow = new Follow(x == 0 ? _legacySourcePath : _modernSourcePath))
                {
                    var followList = follow.FollowList();

                    var lines = File.ReadLines(Path.Combine(Directory.GetCurrentDirectory(), "follow.csv"));

                    foreach (var line in lines)
                    {
                        TextFieldParser parser = new TextFieldParser(new StringReader(line));
                        parser.HasFieldsEnclosedInQuotes = true;
                        parser.SetDelimiters(",");
                        string[] fields = parser.ReadFields();

                        if (!FollowRecordCompare(followList, fields, lineNumber))
                        {
                            Assert.Fail("Match failed on line: " + (lineNumber + 1).ToString());
                        }

                        lineNumber++;
                    }
                }
            }

            Assert.IsFalse(false, "FollowTest1 Passed!!");
        }
 public void UpdateFollow(Follow followToUpdate, FollowRequestData RequestData)
 {
     // can only change the stats.
     followToUpdate.FollowState = RequestData.State;
     _context.Follows.Update(followToUpdate);
     _context.SaveChanges();
 }
    // Update is called once per frame
    void Update()
    {
        follow = GetComponent<Follow>();
        if(bulletCount > bulletMax) {
            bulletCount = bulletMax;
        }
        if(follow.player != null) {
            var rotation = Quaternion.LookRotation(follow.player.position - gun.transform.position);
            gun.transform.rotation = Quaternion.Slerp(transform.rotation, rotation, Time.deltaTime * damping);

            playerDistance = Vector3.Distance(transform.position,follow.player.position);
            if(playerDistance < shootingDistance) {
                //PistolGrip();
                // TODO this needs work
                if(bulletCount > 0 && canShoot) {
                    Debug.Log ("Get Here");

                GameObject thebullet = (GameObject)Instantiate(bullet_prefab, gun.transform.position + gun.transform.forward *3, gun.transform.rotation);
                thebullet.rigidbody.AddForce( gun.transform.forward * bulletImpulse, ForceMode.Impulse);
                thebullet.GetComponent<BulletScript>().shooter = shooter;
                gameObject.GetComponent<PlayerInfo>().AddShotTaken();
                bulletCount--;
                canShoot = false;
                }
                if(!canShoot) {
                    shootingRefresh -= Time.deltaTime;
                    if(shootingRefresh <= 0) {
                        canShoot = true;
                        shootingRefresh = 3f;
                    }
                }
            }
        }
    }
Exemple #16
0
        public async Task <IHttpActionResult> PutFollow(int id, Follow follow)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != follow.Id)
            {
                return(BadRequest());
            }

            db.Entry(follow).State = EntityState.Modified;

            try
            {
                await db.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!FollowExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(StatusCode(HttpStatusCode.NoContent));
        }
        public async Task <IActionResult> PutFollow(int id, Follow follow)
        {
            if (id != follow.UserId)
            {
                return(BadRequest());
            }

            _context.Entry(follow).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!FollowExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
Exemple #18
0
        public async Task UnfollowUser(AppUser sourceUser, AppUser followedUser)
        {
            Follow follow = await _context.Follows.SingleOrDefaultAsync(x =>
                                                                        x.SourceUser == sourceUser && x.FollowedUser == followedUser);

            _context.Follows.Remove(follow);
        }
Exemple #19
0
        public async Task <IActionResult> OnPostUnInvolveAsync(int id)
        {
            NovelID = id;
            await LoadAsync(id);

            if (UserID == null)
            {
                return(Challenge());
            }

            Follow follow = await Context.Follows
                            .Where(f => f.NovelID == NovelID)
                            .Where(f => f.FollowerID == UserID)
                            .FirstOrDefaultAsync();

            if (follow == null)
            {
                StatusMessage = "Error: 無效操作";
                return(Page());
            }
            else
            {
                if (!follow.NovelMonthlyInvolver)
                {
                    StatusMessage = "Error: 您沒有每月Involve這部創作";
                    return(Page());
                }
                follow.NovelMonthlyInvolver = false;
            }
            Context.Attach(follow).State = EntityState.Modified;
            await Context.SaveChangesAsync();

            StatusMessage = "UnInvolve成功";
            return(Page());
        }
Exemple #20
0
 private void MoveByRoute()
 {
     try
     {
         foreach (var point in route.Points)
         {
             Application.Current.Dispatcher.Invoke(delegate
             {
                 this.point      = point;
                 marker.Position = point;
                 if (human != null)
                 {
                     human.marker.Position = point;
                     human.point           = point;
                     Follow?.Invoke(this, null);
                 }
             });
             Thread.Sleep(1000);
         }
         if (human == null)
         {
             Arrived?.Invoke(this, null);
         }
         else
         {
             MessageBox.Show("Passenger arrived");
             human = null;
             Arrived?.Invoke(this, null);
         }
     }
     catch { };
 }
Exemple #21
0
        private async Task LoadAsync(string id)
        {
            UserID = UserManager.GetUserId(User);
            if (UserID == id)
            {
                ProfileOwner = true;
            }
            InvolverUser = await Context.Users.Where(u => u.Id == id).FirstOrDefaultAsync();

            Profile = await Context.Profiles
                      .Include(p => p.Follows)
                      .Where(p => p.ProfileID == id)
                      .FirstOrDefaultAsync();

            if (Profile != null)
            {
                Follow ExistingFollow = Profile.Follows
                                        .Where(f => f.FollowerID == UserID)
                                        .FirstOrDefault();
                if (ExistingFollow != null)
                {
                    Followed = true;
                }
                else
                {
                    Followed = false;
                }
            }
        }
        public bool FollowUnfollowUser(String userId, String followerId)
        {
            Follow follow = this.FirstOrDefault(x => x.UserId == userId && x.FollowerId == followerId);

            if (follow == null)
            {
                follow            = new Follow();
                follow.UserId     = userId;
                follow.FollowerId = followerId;
                follow.CreateDate = DateTime.Now;
                follow.Active     = true;
                this.Create(follow);
                this.Save();
            }
            else
            {
                if (follow.Active == true)
                {
                    follow.Active = false;
                }
                else
                {
                    follow.Active = true;
                }

                this.Update(follow);
                this.Save();
            }
            return(follow.Active);
        }
Exemple #23
0
        public void RemoveEdgeById()
        {
            var graph = Graph();

            var createdGraph = CreateNewGraph();

            var v1 = graph.InsertVertex <Person>(new Person
            {
                Age  = 21,
                Name = "raoof hojat"
            });

            var v2 = graph.InsertVertex <Person>(new Person
            {
                Age  = 21,
                Name = "raoof hojat"
            });

            var follow = new Follow
            {
                Followee    = v1.Id,
                Follower    = v2.Id,
                CreatedDate = DateTime.Now
            };

            var inserted = graph.InsertEdge <Follow>(follow);

            graph.RemoveEdgeById <Follow>(inserted.Key);

            var removed = graph.GetEdge <Follow>(inserted.Key);

            Assert.Null(removed);
        }
Exemple #24
0
        public IActionResult Add(int id)
        {
            try
            {
                if (id == UserModel.Id)
                {
                    return(Json(false.ToResult("不能关注自己")));
                }

                var entity = new Follow {
                    FollowAccountId = id
                };
                entity.AccountId  = UserModel.Id;
                entity.CreateTime = DateTime.Now;
                _context.Follow.Add(entity);
                _context.SaveChanges();
                return(Json(true.ToResult()));
            }
            catch (DbUpdateException ex)
            {
                return(Json(false.ToResult("请勿重复操作")));
            }
            catch (Exception ex)
            {
                return(Json(false.ToResult("未知错误,请联系管理人员")));
            }
        }
Exemple #25
0
        public ActionResult Follow(string followeeId, string actionName, int postId)
        {
            var userId = User.Identity.GetUserId();


            if (_context.Follows.Any(f => f.FollowerId == userId && f.FolloweeId == followeeId))
            {
                TempData["Message"] = "You are already following this person";
                return(RedirectToAction(actionName, "Posts"));
            }

            if (followeeId == userId)
            {
                TempData["Message"] = "You cannot follow yourself";
                return(RedirectToAction(actionName, "Posts"));
            }

            var follow = new Follow
            {
                FolloweeId = followeeId,
                FollowerId = userId
            };

            _context.Follows.Add(follow);
            _context.SaveChanges();


            TempData["Message"] = "You are now following " + _context.Users.Single(u => u.Id == followeeId).Name;
            return(RedirectToAction(actionName, "Posts", new { postId = postId }));
        }
Exemple #26
0
        public async Task <ResponseWrapper <String> > FollowPlayer(String username, ApplicationUser user)
        {
            var response = new ResponseWrapper <String>
            {
                Success = true,
                Status  = "", Data = username
            };

            var player = await _UserRepo.GetPlayerByUsername(username);

            if (player == null)
            {
                response.Success = false;
                response.Status  = "Player does not exist in the database.";
                return(response);
            }

            var follow = new Follow()
            {
                Player = player,
                User   = user
            };

            var updatedPlayer = _UserRepo.FollowPlayer(follow, user);

            if (updatedPlayer == null)
            {
                response.Success = false;
                response.Status  = "Follow action failed.";
                return(response);
            }

            return(response);
        }
        public async Task <IActionResult> Subscribe(string?id, [FromServices] UserManager <User> userManager)
        {
            if (ModelState.IsValid)
            {
                //Finder brugeren man ønsker at følge.
                var userIWantToFollow = await userManager.FindByIdAsync(id);

                //Finder brugeren der er logget ind.
                var user = await userManager.GetUserAsync(User);

                //Tjekker at brugeren ikke er i ens follow list.
                if (await _context.Follow.Where(m => m.followersId == userIWantToFollow.Id).Where(m => m.followingId == user.Id).SingleOrDefaultAsync() == null)
                {
                    //Opretter ny følger.
                    var follower = new Follow()
                    {
                        Followers = userIWantToFollow, Following = user
                    };

                    //Tilføjer brugeren til databasen.
                    _context.Add(follower);

                    //Gemmer ændringen i databasen.
                    await _context.SaveChangesAsync();
                }

                //Returnerer til action(Index) i users.
                return(RedirectToAction("Index", "Users"));
            }
            // Returnerer til action(Index) i users.
            return(RedirectToAction("Index", "Users"));
        }
Exemple #28
0
 public void OnLoad()
 {
     Variables.Hero = ObjectManager.LocalHero;
     this.pause     = Variables.Hero.ClassId != ClassId.CDOTA_Unit_Hero_Visage;
     if (this.pause)
     {
         return;
     }
     Variables.MenuManager     = new MenuManager(Me.Name);
     Variables.Familiars       = ObjectManager.GetEntities <Unit>().Where(unit => unit.Name.Contains("npc_dota_visage_familiar") && unit.IsAlive).ToList();
     Variables.graveChill      = new GraveChill(Me.Spellbook.Spell1);
     Variables.soulAssumption  = new SoulAssumption(Me.Spellbook.Spell2);
     Variables.familiarControl = new FamiliarControl();
     Variables.MenuManager.Menu.AddToMainMenu();
     Variables.EnemyTeam      = Me.GetEnemyTeam();
     this.familiarAutoLastHit = new FamiliarAutoLast();
     this.autoNuke            = new AutoNuke();
     this.follow      = new Follow();
     this.drawText    = new DrawText();
     this.targetFind  = new TargetFind();
     this.combo       = new Combo();
     this.talentAbuse = new TalentAbuse();
     Game.PrintMessage(
         "VisageSharp" + System.Reflection.Assembly.GetExecutingAssembly().GetName().Version + " loaded");
 }
        public IHttpActionResult DeleteFollow(int id, int unfollowId)
        {
            FollowStoredProcedureRepository followStored = new FollowStoredProcedureRepository();
            Follow follow = followStored.DeleteFollow(id, unfollowId);

            return(Ok(follow));
        }
Exemple #30
0
        public void ReplaceEdgeIfMatchFailed()
        {
            var graph = Graph();

            var createdGraph = CreateNewGraph();

            var v1 = graph.InsertVertex <Person>(new Person
            {
                Age  = 21,
                Name = "raoof hojat"
            });

            var v2 = graph.InsertVertex <Person>(new Person
            {
                Age  = 21,
                Name = "raoof hojat"
            });

            var follow = new Follow
            {
                Followee    = v1.Id,
                Follower    = v2.Id,
                CreatedDate = DateTime.Now
            };

            var inserted = graph.InsertEdge <Follow>(follow);

            Assert.Throws <ArangoServerException>(() => graph.ReplaceEdge <Follow>(follow, ifMatchRev: $"{inserted.Rev}0"));
        }
        public IActionResult Follow(int id)
        {
            //instatiate a follow
            Follow follow = new Follow();
            //set applicationid as fk
            string userId = User.FindFirst(ClaimTypes.NameIdentifier).Value;

            follow.ApplicationId = userId;

            //Set follower of Fan type's Id as FK
            if (this.User.IsInRole("Fan"))
            {
                Fan fanFollower = _context.Fan.Where(f => f.ApplicationId == userId).FirstOrDefault();
                follow.FanFollowerId = fanFollower.Id;
            }
            //Set follower of type Brewery type's Id as soft FK
            if (this.User.IsInRole("Brewery"))
            {
                Brewery breweryFollower = _context.Brewery.Where(b => b.ApplicationId == userId).FirstOrDefault();
                follow.BreweryFollowerId = breweryFollower.Id;
            }

            //set Id of brewery being followed as fk
            follow.BreweryId = id;
            //add to table
            _context.Follow.Add(follow);
            //save changes
            _context.SaveChanges();
            //return to same view (redirect to index action)
            return(RedirectToAction("Index", "Breweries"));
        }
Exemple #32
0
 public Player(Connection connection)
 {
     this.connection = connection; //without this, new Packets(this); wouldn't function.
     if(connection != null)
         loginDetails = connection.getLoginDetails();
     appearance = new Appearance();
     follow = new Follow(this);
     bank = new Bank(this);
     inventory = new Inventory(this);
     equipment = new Equipment(this);
     friends = new Friends(this);
     prayers = new Prayers(this);
     skills = new Skills(this);
     attackStyle = new AttackStyle();
     packets = new Packets(this);
     localEnvironment = new LocalEnvironment(this);
     updateFlags = new AppearanceUpdateFlags(this);
     walkingQueue = new WalkingQueue(this);
     specialAttack = new SpecialAttack(this);
     chat = true;
     split = false;
     mouse = true;
     aid = false;
     magicType = 1;
     achievementDiaryTab = false;
     forgeCharge = 40;
     smallPouchAmount = 0;
     mediumPouchAmount = 0;
     largePouchAmount = 0;
     giantPouchAmount = 0;
     defenderWave = 0;
     autoRetaliate = false;
     vengeance = false;
     lastVengeanceTime = 0;
     poisonAmount = 0;
     specialAmount = 100;
     skullCycles = 0;
     prayerPoints = 1;
     recoilCharges = 40;
     barrowTunnel = -1;
     barrowKillCount = 0;
     barrowBrothersKilled = new bool[6];
     slayerPoints = 0;
     removedSlayerTasks = new string[4];
     for (int i = 0; i < removedSlayerTasks.Length; i++)
     {
         removedSlayerTasks[i] = "-";
     }
     agilityArenaStatus = 0;
     taggedLastAgilityPillar = false;
     paidAgilityArena = false;
     teleblockTime = 0;
     lastHit = -1;
     superAntipoisonCycles = 0;
     antifireCycles = 0;
     tradeRequests = new List<Player>();
     duelRequests = new List<Player>();
 }
Exemple #33
0
 public Target(CreatureData c, FightActions action, byte priority, FightSecurity security, FightStances stance, Attack attackMode, Follow followMode)
     : base(c.Name, c.HitPoints, c.ExperiencePoints, c.SummonMana, c.ConvinceMana, c.MaxDamage, c.CanIllusion, c.CanSeeInvisible, c.FrontAttack, c.Immunities, c.Strengths, c.Weaknesses, c.Sounds, c.Loot)
 {
     this.Action = action;
     this.Priority = priority;
     this.Security = security;
     this.Stance = stance;
     this.AttackMode = attackMode;
     this.FollowMode = followMode;
     this.Extra = new List<FightExtraPair>();
 }
Exemple #34
0
 public Entity()
 {
     this.entityFocusId = -1;
     queuedHits = new Queue<Hits.Hit>();
     hits = new Hits();
     hidden = false;
     dead = false;
     target = null;
     attacker = null;
     combatTurns = 0;
     poisonAmount = 0;
     killers = new Dictionary<Entity, double>();
     temporaryAttributes = new Dictionary<string, Object>();
     follow = new Follow(this);
     sprite = new Sprite();
     this.location = new Location(2322 + misc.random(1), 3171 + misc.random(5), 0);
 }
 private List<Follow> GetFollows(int id)
 {
     List<Follow> follows = new List<Follow>();
     Follow follow1 = new Follow();
     follow1.UserId = 1 + id;
     follow1.UserName = "******";
     follow1.Content = "follow1";
     follows.Add(follow1);
     Follow follow2 = new Follow();
     follow2.UserId = 2 + id;
     follow2.UserName = "******";
     follow2.Content = "follow2";
     follows.Add(follow2);
     Follow follow3 = new Follow();
     follow3.UserId = 3 + id;
     follow3.UserName = "******";
     follow3.Content = "follow3";
     follows.Add(follow3);
     return follows;
 }
 void Awake()
 {
     if (!this.follow)
         this.follow = GetComponentInParent<Follow>();
     shaking = false;
 }
	private void Awake() {
		follow = GetComponent<Follow>();
	}
Exemple #38
0
        public void AddTarget(string name, FightActions action, byte priority, FightSecurity security, FightStances stance, Attack attackMode, Follow followMode)
        {
            CreatureData c = null;

            if (CreatureLists.AllCreatures.ContainsKey(name))
            {
                c = CreatureLists.AllCreatures[name];
            }
            else
            {
                c = new CreatureData(name, 0, 0, 0, 0, 0, false, false, FrontAttack.None, null, null, null, null, null);
            }

            Targets.Add(new Target(c, action, priority, security, stance, attackMode, followMode));
        }
Exemple #39
0
 public static void SetModes(this Client client, Attack attack, Follow follow)
 {
     Core.Client.FollowMode = follow;
     Core.Client.AttackMode = attack;
     Tibia.Packets.Outgoing.FightModesPacket.Send(Core.Client, (byte)Core.Client.AttackMode, (byte)Core.Client.FollowMode, (byte)Core.Client.SafeMode);
 }
Exemple #40
0
 void Start()
 {
     _follow = GetComponent<Follow>();
     _groupActor = _gc.Group.GetComponent<Actor>();
     _isRescued = false;
 }
Exemple #41
0
 public void AddAllCreatures(FightActions action, byte priority, FightSecurity security, FightStances stance, Attack attackMode, Follow followMode)
 {
     foreach (var c in CreatureLists.AllCreatures)
     {
         Targets.Add(new Target(c.Value, action, priority, security, stance, attackMode, followMode));
     }
 }
Exemple #42
0
    private Follow follow; //the parent object's follow script

    #endregion Fields

    #region Methods

    void Awake()
    {
        follow = transform.parent.GetComponent<Follow>();
    }
 // Use this for initialization
 void Awake()
 {
     follow = GetComponent<Follow>();
     bulletCount = bulletMax;
 }
 public IHttpActionResult Post(Follow follow)
 {
     _adapter.Follow(follow);
     return Ok();
 }
Exemple #45
0
 //--------------------------------------------------------
 public void Follow(GameObject target, Follow followNode, float stopping)
 {
     nav.SetDestination(target.transform.position);
     nav.Resume();
     StartCoroutine("FollowRoutine", new object[] {target, followNode, stopping});
 }
 public void Follow(Follow follow)
 {
     ApplicationDbContext db = new ApplicationDbContext();
     db.Follows.Add(follow);
     db.SaveChanges();
 }