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


C# RoomItem.ReqUpdate方法代码示例

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


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

示例1: OnTrigger

        public override void OnTrigger(GameClient session, RoomItem item, int request, bool hasRights)
        {
            if (session == null)
                return;

            RoomUser user = item.GetRoom().GetRoomUserManager().GetRoomUserByHabbo(session.GetHabbo().Id);

            if (user == null)
                return;

            if (user.Coordinate != item.SquareInFront && user.CanWalk)
            {
                user.MoveTo(item.SquareInFront);
                return;
            }

            if (!item.GetRoom().GetGameMap().CanWalk(item.SquareBehind.X, item.SquareBehind.Y, user.AllowOverride))
                return;

            if (item.InteractingUser == 0)
            {
                item.InteractingUser = user.HabboId;

                user.CanWalk = false;

                if (user.IsWalking && (user.GoalX != item.SquareInFront.X || user.GoalY != item.SquareInFront.Y))
                    user.ClearMovement();

                user.AllowOverride = true;
                user.MoveTo(item.Coordinate);

                item.ReqUpdate(4, true);
            }
        }
开发者ID:sgf,项目名称:Yupi,代码行数:34,代码来源:InteractorOneWayGate.cs

示例2:

        void IFurniTrigger.OnTrigger(GameClient Session, RoomItem Item, int Request, bool UserHasRights)
        {
            if (Item.ExtraData != "1" && Item.GetBaseItem().VendingIds.Count >= 1 && Item.InteractingUser == 0 && Session != null)
            {
                RoomUser user = Item.GetRoom().GetRoomUserManager().GetRoomUserByHabbo(Session.GetHabbo().Id);
                if (user == null)
                    return;

                if (!Gamemap.TilesTouching(user.X, user.Y, Item.GetX, Item.GetY))
                {
                    user.MoveTo(Item.SquareInFront);
                    return;
                }

                Item.InteractingUser = Session.GetHabbo().Id;

                //user.ClearMovement(true);
                user.SetRot(Rotation.Calculate(user.X, user.Y, Item.GetX, Item.GetY), false);

                Item.ReqUpdate(2, true);

                Item.ExtraData = "1";
                Item.UpdateState(false, true);
            }
        }
开发者ID:BjkGkh,项目名称:R106,代码行数:25,代码来源:VendingTrigger.cs

示例3: OnTrigger

        public override void OnTrigger(GameClient session, RoomItem item, int request, bool hasRights)
        {
            if (item.ExtraData == "1" || !item.GetBaseItem().VendingIds.Any() || item.InteractingUser != 0u ||
                session == null)
                return;

            var roomUserByHabbo = item.GetRoom().GetRoomUserManager().GetRoomUserByHabbo(session.GetHabbo().Id);

            if (roomUserByHabbo == null)
                return;

            if (!Gamemap.TilesTouching(roomUserByHabbo.X, roomUserByHabbo.Y, item.X, item.Y))
            {
                roomUserByHabbo.MoveTo(item.SquareInFront);
                return;
            }

            item.InteractingUser = session.GetHabbo().Id;
            roomUserByHabbo.CanWalk = false;
            roomUserByHabbo.ClearMovement();

            roomUserByHabbo.SetRot(PathFinder.CalculateRotation(roomUserByHabbo.X, roomUserByHabbo.Y, item.X, item.Y));

            item.ReqUpdate(2, true);
            item.ExtraData = "1";
            item.UpdateState(false, true);
        }
开发者ID:kessiler,项目名称:azureEmulator,代码行数:27,代码来源:InteractorVendor.cs

示例4: OnTrigger

        public override void OnTrigger(GameClient session, RoomItem item, int request, bool hasRights)
        {
            RoomUser roomUser = null;
            if (session != null)
                roomUser = item.GetRoom().GetRoomUserManager().GetRoomUserByHabbo(session.GetHabbo().Id);

            if (roomUser == null)
                return;

            if (Gamemap.TilesTouching(item.X, item.Y, roomUser.X, roomUser.Y))
            {
                if (item.ExtraData == "-1")
                    return;

                if (request == -1)
                {
                    item.ExtraData = "0";
                    item.UpdateState();
                    return;
                }

                item.ExtraData = "-1";
                item.UpdateState(false, true);
                item.ReqUpdate(4, true);
                return;
            }

            roomUser.MoveTo(item.SquareInFront);
        }
开发者ID:kessiler,项目名称:azureEmulator,代码行数:29,代码来源:InteractorDice.cs

示例5: OnTrigger

        public void OnTrigger(GameClients.GameClient Session, RoomItem Item, int Request, bool HasRights)
        {
            RoomUser User = null;
            if (Session != null)
                User = Item.GetRoom().GetRoomUserManager().GetRoomUserByHabbo(Session.GetHabbo().Id);
            if (User == null)
                return;

            if (Gamemap.TilesTouching(Item.GetX, Item.GetY, User.X, User.Y))
            {
                if (Item.ExtraData != "-1")
                {
                    if (Request == -1)
                    {
                        Item.ExtraData = "0";
                        Item.UpdateState();
                    }
                    else
                    {
                        Item.ExtraData = "-1";
                        Item.UpdateState(false, true);
                        Item.ReqUpdate(4, true);
                    }
                }
            }
            else
            {
                User.MoveTo(Item.SquareInFront);
            }
        }
开发者ID:BjkGkh,项目名称:Custom-R2,代码行数:30,代码来源:InteractorDice.cs

示例6: OnTrigger

        public override void OnTrigger(GameClient session, RoomItem item, int request, bool hasRights)
        {
            if (item.ExtraData == "-1")
                return;

            item.ExtraData = "-1";
            item.UpdateState(false, true);
            item.ReqUpdate(3, true);
        }
开发者ID:kessiler,项目名称:azureEmulator,代码行数:9,代码来源:InteractorSpinningBottle.cs

示例7: OnWiredTrigger

        public override void OnWiredTrigger(RoomItem item)
        {
            if (item.ExtraData == "-1")
                return;

            item.ExtraData = "-1";
            item.UpdateState(false, true);
            item.ReqUpdate(3, true);
        }
开发者ID:kessiler,项目名称:azureEmulator,代码行数:9,代码来源:InteractorSpinningBottle.cs

示例8: OnTrigger

 public void OnTrigger(GameClients.GameClient Session, RoomItem Item, int Request, bool HasRights)
 {
     if (Item.ExtraData != "-1")
     {
         Item.ExtraData = "-1";
         Item.UpdateState(false, true);
         Item.ReqUpdate(3, true);
     }
 }
开发者ID:BjkGkh,项目名称:07052014,代码行数:9,代码来源:InteractorSpinningBottle.cs

示例9: OnWiredTrigger

 public void OnWiredTrigger(RoomItem Item)
 {
     if (Item.ExtraData != "0")
     {
         Item.ExtraData = "0";
         Item.UpdateState(false, true);
         Item.ReqUpdate(10, true);
     }
 }
开发者ID:BjkGkh,项目名称:07052014,代码行数:9,代码来源:InteractorLoveShuffler.cs

示例10: OnWiredTrigger

 public void OnWiredTrigger(RoomItem item)
 {
     if (item.ExtraData != "0")
     {
         return;
     }
     item.ExtraData = "1";
     item.UpdateState(false, true);
     item.ReqUpdate(4, true);
 }
开发者ID:BjkGkh,项目名称:Azure2,代码行数:10,代码来源:InteractorAlert.cs

示例11: OnWiredTrigger

 public void OnWiredTrigger(RoomItem item)
 {
     if (item.ExtraData == "-1")
     {
         return;
     }
     item.ExtraData = "-1";
     item.UpdateState();
     item.ReqUpdate(10, true);
 }
开发者ID:BjkGkh,项目名称:Azure2,代码行数:10,代码来源:InteractorHabboWheel.cs

示例12: OnTrigger

		public void OnTrigger(GameClient Session, RoomItem Item, int Request, bool HasRights)
		{
			if (!HasRights)
			{
				return;
			}
			if (Item.ExtraData == "0")
			{
				Item.ExtraData = "1";
				Item.UpdateState(false, true);
				Item.ReqUpdate(4, true);
			}
		}
开发者ID:BjkGkh,项目名称:Mercury,代码行数:13,代码来源:InteractorAlert.cs

示例13: ExecuteAction

        public void ExecuteAction(RoomItem theItem)
        {
            if (theItem.ExtraData == "0")
            {
                theItem.ExtraData = ButterflyEnvironment.GetRandomNumber(1, 4).ToString();
                theItem.ReqUpdate(20, false);
            }
            else if (theItem.ExtraData != "-1")
            {
                theItem.ExtraData = "-1";
            }

            theItem.UpdateState(false, true);
        }
开发者ID:BjkGkh,项目名称:R106,代码行数:14,代码来源:LoveShufflerInteractor.cs

示例14: OnTrigger

 public void OnTrigger(GameClient session, RoomItem item, int request, bool hasRights)
 {
     if (!hasRights)
     {
         return;
     }
     if (item.ExtraData != "0")
     {
         return;
     }
     item.ExtraData = "1";
     item.UpdateState(false, true);
     item.ReqUpdate(4, true);
 }
开发者ID:BjkGkh,项目名称:Azure2,代码行数:14,代码来源:InteractorAlert.cs

示例15:

        void IFurniTrigger.OnTrigger(GameClient Session, RoomItem Item, int Request, bool UserHasRights)
        {
            if (!UserHasRights)
            {
                return;
            }

            if (Item.ExtraData != "-1")
            {
                Item.ExtraData = "-1";
                Item.UpdateState();
                Item.ReqUpdate(10, true);
            }
        }
开发者ID:BjkGkh,项目名称:R106,代码行数:14,代码来源:HabboWheelTrigger.cs


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