当前位置: 首页>>代码示例>>C#>>正文


C# RoomUser.RemoveStatus方法代码示例

本文整理汇总了C#中RoomUser.RemoveStatus方法的典型用法代码示例。如果您正苦于以下问题:C# RoomUser.RemoveStatus方法的具体用法?C# RoomUser.RemoveStatus怎么用?C# RoomUser.RemoveStatus使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在RoomUser的用法示例。


在下文中一共展示了RoomUser.RemoveStatus方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: IsValidStep

        /// <summary>
        ///     Determines whether [is valid step] [the specified user].
        /// </summary>
        /// <param name="user">The user.</param>
        /// <param name="from">From.</param>
        /// <param name="to">To.</param>
        /// <param name="endOfPath">if set to <c>true</c> [end of path].</param>
        /// <param name="Override">if set to <c>true</c> [override].</param>
        /// <returns><c>true</c> if [is valid step] [the specified user]; otherwise, <c>false</c>.</returns>
        internal bool IsValidStep(RoomUser user, Vector2D @from, Vector2D to, bool endOfPath, bool Override)
        {
            if (user == null)
                return false;
            Point square = new Point(to.X, to.Y);
            if (user.IsBot == false && user.GetClient() != null)
            {
                if (GuildGates.ContainsKey(square))
                {
                    uint guildId = GuildGates[square].GroupId;
                    if (guildId > 0 &&
                        user.GetClient()
                            .GetHabbo()
                            .UserGroups.Any(member => member != null && member.GroupId == guildId)) return true;
                }
            }

            if (!ValidTile(to.X, to.Y))
                return false;
            if (Override)
                return true;
            if (GameMap[to.X, to.Y] == 3 && !endOfPath || GameMap[to.X, to.Y] == 0 ||
                GameMap[to.X, to.Y] == 2 && !endOfPath)
                return false;
            RoomUser userForSquare = _room.GetRoomUserManager().GetUserForSquare(to.X, to.Y);
            if (userForSquare != null && endOfPath && !_room.RoomData.AllowWalkThrough)
            {
                user.HasPathBlocked = true;
                user.Path.Clear();
                user.IsWalking = false;
                user.RemoveStatus("mv");
                _room.GetRoomUserManager().UpdateUserStatus(user, false);
                if (!user.RidingHorse || user.IsPet || user.IsBot)
                    return true;
                RoomUser roomUserByVirtualId =
                    _room.GetRoomUserManager().GetRoomUserByVirtualId(Convert.ToInt32(user.HorseId));

                ServerMessage message = new ServerMessage(LibraryParser.OutgoingRequest("UpdateUserStatusMessageComposer"));
                message.AppendInteger(1);
                if (roomUserByVirtualId != null)
                {
                    roomUserByVirtualId.IsWalking = false;
                    roomUserByVirtualId.ClearMovement();
                    roomUserByVirtualId.RemoveStatus("mv");
                    roomUserByVirtualId.SerializeStatus(message, "");
                }
                user.GetClient().GetHabbo().CurrentRoom.SendMessage(message);
            }
            else if (userForSquare != null && !_room.RoomData.AllowWalkThrough && !userForSquare.IsWalking)
                return false;
            return SqAbsoluteHeight(to.X, to.Y) - SqAbsoluteHeight(@from.X, @from.Y) <= 1.5;
        }
开发者ID:sgf,项目名称:Yupi,代码行数:61,代码来源:Gamemap.cs

示例2: IsValidStep2

        /// <summary>
        ///     Determines whether [is valid step2] [the specified user].
        /// </summary>
        /// <param name="user">The user.</param>
        /// <param name="from">From.</param>
        /// <param name="to">To.</param>
        /// <param name="endOfPath">if set to <c>true</c> [end of path].</param>
        /// <param name="Override">if set to <c>true</c> [override].</param>
        /// <returns><c>true</c> if [is valid step2] [the specified user]; otherwise, <c>false</c>.</returns>
        internal bool IsValidStep2(RoomUser user, Point @from, Point to, bool endOfPath, bool Override)
        {
            if (user == null)
                return false;

            if (GuildGates.ContainsKey(to))
            {
                RoomItem roomItem = GuildGates[to];
                uint guildId = roomItem.GroupId;
                if (guildId > 0)
                    if (user.GetClient().GetHabbo() != null &&
                        user.GetClient().GetHabbo().MyGroups != null &&
                        user.GetClient().GetHabbo().MyGroups.Contains(guildId))
                    {
                        roomItem.ExtraData = "1";
                        roomItem.UpdateState();
                        return true;
                    }
            }
            if (!ValidTile2(to.X, to.Y))
                return false;
            if (Override)
                return true;
            if (GameMap[to.X, to.Y] == 3 && !endOfPath || GameMap[to.X, to.Y] == 0 ||
                GameMap[to.X, to.Y] == 2 && !endOfPath ||
                SqAbsoluteHeight(to.X, to.Y) - SqAbsoluteHeight(@from.X, @from.Y) > 1.5)
                return false;
            RoomUser userForSquare = _room.GetRoomUserManager().GetUserForSquare(to.X, to.Y);
            if (userForSquare != null && endOfPath && !_room.RoomData.AllowWalkThrough)
            {
                user.HasPathBlocked = true;
                user.Path.Clear();
                user.IsWalking = false;
                user.RemoveStatus("mv");
                _room.GetRoomUserManager().UpdateUserStatus(user, false);
                if (user.RidingHorse && !user.IsPet && !user.IsBot)
                {
                    RoomUser roomUserByVirtualId =
                        _room.GetRoomUserManager().GetRoomUserByVirtualId(Convert.ToInt32(user.HorseId));
                    roomUserByVirtualId.IsWalking = false;
                    roomUserByVirtualId.RemoveStatus("mv");
                    ServerMessage message = new ServerMessage(LibraryParser.OutgoingRequest("UpdateUserStatusMessageComposer"));
                    message.AppendInteger(1);
                    roomUserByVirtualId.SerializeStatus(message, "");
                    user.GetClient().GetHabbo().CurrentRoom.SendMessage(message);
                }
            }
            else if (userForSquare != null && !_room.RoomData.AllowWalkThrough && !userForSquare.IsWalking)
                return false;
            user.HasPathBlocked = false;
            return true;
        }
开发者ID:sgf,项目名称:Yupi,代码行数:61,代码来源:Gamemap.cs

示例3: IsValidStep

        /// <summary>
        /// Determines whether [is valid step] [the specified user].
        /// </summary>
        /// <param name="RoomUser">The user.</param>
        /// <param name="StartPosition">From.</param>
        /// <param name="NextPosition">To.</param>
        /// <param name="endOfPath">if set to <c>true</c> [end of path].</param>
        /// <param name="HasOverride">if set to <c>true</c> [override].</param>
        /// <returns><c>true</c> if [is valid step] [the specified user]; otherwise, <c>false</c>.</returns>
        internal bool IsValidStep(RoomUser RoomUser, Vector2D StartPosition, Vector2D NextPosition, bool endOfPath, bool HasOverride)
        {
            if (RoomUser == null)
                return false;

            Point NextPositionSquare = new Point(NextPosition.X, NextPosition.Y);
            RoomUser RoomUsersInTile = UserRoom.GetRoomUserManager().GetUserForSquare(NextPosition.X, NextPosition.Y);
            List<RoomItem> RoomItemsInTile = GetCoordinatedItems(NextPositionSquare);

            if (RoomItemsInTile.Any(item => item.Height > (RoomUser.Z + 1.5))) return false;

            if ((!RoomUser.IsBot) && (!RoomUser.IsPet) && (RoomUser.GetClient() != null))
            {
                if (GuildGates.ContainsKey(NextPositionSquare))
                {
                    int GroupId = GuildGates[NextPositionSquare].GroupId;

                    if (GroupId > 0 && RoomUser.GetClient().GetHabbo().UserGroups.Any(member => ((member != null) && (member.GroupId == GroupId))))
                        return true;
                }
            }

            if (!ValidTile(NextPosition.X, NextPosition.Y))
                return false;

            if (HasOverride)
                return true;

            if (!CanWalk(NextPosition.X, NextPosition.Y, HasOverride))
                return false;

            if ((RoomUsersInTile != null) && (!RoomUsersInTile.IsWalking) && (endOfPath))
                return false;

            if (((GameMap[NextPosition.X, NextPosition.Y] == 3) && (!endOfPath)) || (GameMap[NextPosition.X, NextPosition.Y] == 0) || ((GameMap[NextPosition.X, NextPosition.Y] == 2) && (!endOfPath)))
                return false;

            if ((RoomUsersInTile != null) && (endOfPath) && (!UserRoom.RoomData.AllowWalkThrough))
            {
                RoomUser.HasPathBlocked = true;
                RoomUser.Path.Clear();
                RoomUser.IsWalking = false;
                RoomUser.RemoveStatus("mv");
                UserRoom.GetRoomUserManager().UpdateUserStatus(RoomUser, false);

                if (!RoomUser.RidingHorse || RoomUser.IsPet || RoomUser.IsBot)
                    return true;

                RoomUser roomUserByVirtualId = UserRoom.GetRoomUserManager().GetRoomUserByVirtualId(Convert.ToInt32(RoomUser.HorseId));
                ServerMessage message = new ServerMessage(LibraryParser.OutgoingRequest("UpdateUserStatusMessageComposer"));
                message.AppendInteger(1);

                if (roomUserByVirtualId != null)
                {
                    roomUserByVirtualId.IsWalking = false;
                    roomUserByVirtualId.ClearMovement();
                    roomUserByVirtualId.RemoveStatus("mv");
                    roomUserByVirtualId.SerializeStatus(message, "");
                }

                RoomUser.GetClient().GetHabbo().CurrentRoom.SendMessage(message);
            }
            else if (RoomItemsInTile.All(item => item.GetBaseItem().Walkable))
                return true;
            else if ((RoomUsersInTile != null) && (!UserRoom.RoomData.AllowWalkThrough) && (!RoomUsersInTile.IsWalking))
                return false;

            return ((SqAbsoluteHeight(NextPosition.X, NextPosition.Y) - SqAbsoluteHeight(StartPosition.X, StartPosition.Y)) <= 1.5);
        }
开发者ID:BjkGkh,项目名称:Azure2,代码行数:78,代码来源:Gamemap.cs

示例4: UpdateUserEffect

        private void UpdateUserEffect(RoomUser User, int x, int y)
        {
            if (User.IsBot)
                return;
            byte NewCurrentUserItemEffect = room.GetGameMap().EffectMap[x, y];
            if (NewCurrentUserItemEffect > 0)
            {
                ItemEffectType Type = ByteToItemEffectEnum.Parse(NewCurrentUserItemEffect);
                if (Type != User.CurrentItemEffect)
                {
                    switch (Type)
                    {
                        case ItemEffectType.Iceskates:
                            {
                                if (User.GetClient().GetHabbo().Gender == "M")
                                    User.GetClient().GetHabbo().GetAvatarEffectsInventoryComponent().ApplyCustomEffect(38);
                                else
                                    User.GetClient().GetHabbo().GetAvatarEffectsInventoryComponent().ApplyCustomEffect(39);
                                User.CurrentItemEffect = ItemEffectType.Iceskates;
                                break;
                            }

                        case ItemEffectType.Normalskates:
                            {
                                if (User.GetClient().GetHabbo().Gender == "M")
                                {
                                    User.GetClient().GetHabbo().GetAvatarEffectsInventoryComponent().ApplyCustomEffect(55);
                                }
                                else
                                {
                                    User.GetClient().GetHabbo().GetAvatarEffectsInventoryComponent().ApplyCustomEffect(56);
                                }
                                //56=girls
                                //55=
                                User.CurrentItemEffect = Type;
                                break;
                            }
                        case ItemEffectType.Swim:
                            {
                                User.GetClient().GetHabbo().GetAvatarEffectsInventoryComponent().ApplyCustomEffect(29);
                                User.CurrentItemEffect = Type;
                                break;
                            }
                        case ItemEffectType.SwimLow:
                            {
                                User.GetClient().GetHabbo().GetAvatarEffectsInventoryComponent().ApplyCustomEffect(30);
                                User.CurrentItemEffect = Type;
                                break;
                            }
                        case ItemEffectType.SwimHalloween:
                            {
                                User.GetClient().GetHabbo().GetAvatarEffectsInventoryComponent().ApplyCustomEffect(37);
                                User.CurrentItemEffect = Type;
                                break;
                            }
                        case ItemEffectType.None:
                            {
                                User.GetClient().GetHabbo().GetAvatarEffectsInventoryComponent().ApplyCustomEffect(-1);
                                User.CurrentItemEffect = Type;
                                break;
                            }
                        case ItemEffectType.PublicPool:
                            {
                                User.AddStatus("swim", string.Empty);
                                User.CurrentItemEffect = Type;
                                break;
                            }

                    }
                }
            }
            else if (User.CurrentItemEffect != ItemEffectType.None && NewCurrentUserItemEffect == 0)
            {
                User.GetClient().GetHabbo().GetAvatarEffectsInventoryComponent().ApplyEffect(-1);
                User.CurrentItemEffect = ItemEffectType.None;
                User.RemoveStatus("swim");
            }
        }
开发者ID:habb0,项目名称:PiciEmulator,代码行数:78,代码来源:RoomUserManager.cs

示例5: IsValidStep

 internal bool IsValidStep(RoomUser User, Vector2D From, Vector2D To, bool EndOfPath, bool Override)
 {
     if (!this.ValidTile(To.X, To.Y))
         return false;
     if (Override)
         return true;
     if ((int)this.mGameMap[To.X, To.Y] == 3 && !EndOfPath || (int)this.mGameMap[To.X, To.Y] == 0 || (int)this.mGameMap[To.X, To.Y] == 2 && !EndOfPath || this.SqAbsoluteHeight(To.X, To.Y) - this.SqAbsoluteHeight(From.X, From.Y) > 1.5)
         return false;
     RoomUser userForSquare = this.room.GetRoomUserManager().GetUserForSquare(To.X, To.Y);
     if (userForSquare != null && EndOfPath && this.room.AllowWalkthrough == 0)
     {
         User.HasPathBlocked = true;
         User.Path.Clear();
         User.IsWalking = false;
         User.RemoveStatus("mv");
         this.room.GetRoomUserManager().UpdateUserStatus(User, false);
         if (User.RidingHorse && !User.IsPet && !User.IsBot)
         {
             RoomUser roomUserByVirtualId = this.room.GetRoomUserManager().GetRoomUserByVirtualId(Convert.ToInt32(User.HorseID));
             roomUserByVirtualId.IsWalking = false;
             roomUserByVirtualId.RemoveStatus("mv");
             ServerMessage Message = new ServerMessage(Outgoing.UpdateUserStatusMessageComposer);
             Message.AppendInt32(1);
             roomUserByVirtualId.SerializeStatus(Message, "");
             User.GetClient().GetHabbo().CurrentRoom.SendMessage(Message);
         }
     }
     else if (userForSquare != null && this.room.AllowWalkthrough == 0 && !userForSquare.IsWalking)
         return false;
     return true;
 }
开发者ID:kessiler,项目名称:habboServer,代码行数:31,代码来源:Gamemap.cs

示例6: HandleSetMovement

        private void HandleSetMovement(SquarePoint Point, RoomUser User, ref bool updated, bool setSquareMap)
        {
            int nextX = Point.X;
            int nextY = Point.Y;

            User.RemoveStatus("mv");

            //double nextZ = room.GetGameMap().SqAbsoluteHeight(nextX, nextY);
            double nextZ = room.GetGameMap().GetNewZForUser(nextX, nextY, User.Z);

            //if (room.GetGameMap().SquareOccupied(nextX, nextY, nextZ))
            //    return;

            if (User.UserIsRidingAHorse())
                nextZ += 1;

            User.Statusses.Remove("lay");
            User.Statusses.Remove("sit");
            if (!User.isFlying)
                User.AddStatus("mv", nextX + "," + nextY + "," + TextHandling.GetString(nextZ));
            else
                User.AddStatus("mv", nextX + "," + nextY + "," + TextHandling.GetString(nextZ + 4 + (0.5 * Math.Sin(0.7 * User.flyk))));

            int newRot = Rotation.Calculate(User.X, User.Y, nextX, nextY, User.moonwalkEnabled);

            User.RotBody = newRot;
            User.RotHead = newRot;

            User.SetStep = true;
            User.SetX = nextX;
            User.SetY = nextY;
            User.SetZ = nextZ;

            UpdateUserEffect(User, User.SetX, User.SetY);
            updated = true;
            User.UpdateNeeded = true;


            if (setSquareMap)
            {
                room.GetGameMap().GameMap[User.X, User.Y] = User.SqState; // REstore the old one
                User.SqState = room.GetGameMap().GameMap[User.SetX, User.SetY];//Backup the new one
                
                if (!room.AllowWalkthrough)
                    room.GetGameMap().GameMap[nextX, nextY] = 0;
            }
        }
开发者ID:BjkGkh,项目名称:R106,代码行数:47,代码来源:RoomUserManager.cs

示例7: CalculatePath

        private void CalculatePath(RoomUser User, ref bool updated)
        {
            Gamemap map = room.GetGameMap();
            SquarePoint Point = DreamPathfinder.GetNextStep(User.X, User.Y, User.Z, User.GoalX, User.GoalY, map.GameMap, map.GetStackmap(), map.Model.SqFloorHeight,
                map.Model.MapSizeX, map.Model.MapSizeY, User.AllowOverride, map.DiagonalEnabled, map);

            if (Point.X == User.X && Point.Y == User.Y) //No path found, or reached goal (:
            {
                User.IsWalking = false;
                User.IsHorseWalking = false;
                User.OnStopWalk();
                User.RemoveStatus("mv");

                UpdateUserStatus(User, false);
            }
            else
            {
                HandleSetMovement(Point, User, ref updated, true);
                if (User.IsPet && User.PetGotUserRiding())
                {
                    RoomUser ridingPet = User.GetRoomUserRiding();
                    SetStepForUser(ridingPet);
                    HandleSetMovement(Point, ridingPet, ref updated, false);
                    UpdateUserEffect(ridingPet, ridingPet.X, ridingPet.Y);
                    ridingPet.UpdateNeeded = true;
                    FinishUserCycle(ridingPet);
                }
            }

            User.UpdateNeeded = true;
        }
开发者ID:BjkGkh,项目名称:R106,代码行数:31,代码来源:RoomUserManager.cs


注:本文中的RoomUser.RemoveStatus方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。