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


C# RoomItem.GetRoom方法代码示例

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


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

示例1:

        void IFurniTrigger.OnRemove(GameClient Session, RoomItem Item)
        {
            Item.ExtraData = "0";

            if (Item.InteractingUser != 0)
            {
                RoomUser User = Item.GetRoom().GetRoomUserManager().GetRoomUserByHabbo(Item.InteractingUser);

                if (User != null)
                {
                    User.UnlockWalking();
                }

                Item.InteractingUser = 0;
            }

            if (Item.InteractingUser2 != 0)
            {
                RoomUser User = Item.GetRoom().GetRoomUserManager().GetRoomUserByHabbo(Item.InteractingUser2);

                if (User != null)
                {
                    User.UnlockWalking();
                }

                Item.InteractingUser2 = 0;
            }

            //Item.GetRoom().RegenerateUserMatrix();
        }
开发者ID:BjkGkh,项目名称:R106,代码行数:30,代码来源:TeleportTrigger.cs

示例2: OnTrigger

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

            switch (request)
            {
                case -1: // Open interface

                    break;

                default:
                    if (item.ExtraData == "1")
                    {
                        item.GetRoom().GetRoomMusicController().Stop();
                        item.ExtraData = "0";
                    }
                    else
                    {
                        item.GetRoom().GetRoomMusicController().Start();
                        item.ExtraData = "1";
                    }

                    item.UpdateState();

                    item.GetRoom().GetRoomMusicController().BroadcastCurrentSongData(item.GetRoom());
                    break;
            }
        }
开发者ID:BjkGkh,项目名称:Azure2,代码行数:29,代码来源:InteractorJukebox.cs

示例3: OnTrigger

        public void OnTrigger(GameClient session, RoomItem item, int request, bool hasRights)
        {
            if (item == null || item.GetRoom() == null || session == null || session.GetHabbo() == null)
            {
                return;
            }
            RoomUser roomUserByHabbo = item.GetRoom().GetRoomUserManager().GetRoomUserByHabbo(session.GetHabbo().Id);
            if (roomUserByHabbo == null)
            {
                return;
            }

            if(roomUserByHabbo.Coordinate == item.Coordinate || roomUserByHabbo.Coordinate == item.SquareInFront)
            {
                if(item.InteractingUser != 0)
                {
                    return;
                }
                item.InteractingUser = roomUserByHabbo.GetClient().GetHabbo().Id;
            }
            else if (roomUserByHabbo.CanWalk)
            {
                roomUserByHabbo.MoveTo(item.SquareInFront);
            }
        }
开发者ID:BjkGkh,项目名称:Azure2,代码行数:25,代码来源:InteractorTeleport.cs

示例4: OnPlace

        public override void OnPlace(GameClient session, RoomItem item)
        {
            item.ExtraData = "0";

            if (item.InteractingUser != 0)
            {
                RoomUser user = item.GetRoom().GetRoomUserManager().GetRoomUserByHabbo(item.InteractingUser);

                if (user != null)
                {
                    user.ClearMovement();
                    user.AllowOverride = false;
                    user.CanWalk = true;
                }

                item.InteractingUser = 0;
            }

            if (item.InteractingUser2 != 0)
            {
                RoomUser user = item.GetRoom().GetRoomUserManager().GetRoomUserByHabbo(item.InteractingUser2);

                if (user != null)
                {
                    user.ClearMovement();
                    user.AllowOverride = false;
                    user.CanWalk = true;
                }

                item.InteractingUser2 = 0;
            }
        }
开发者ID:sgf,项目名称:Yupi,代码行数:32,代码来源:InteractorTeleport.cs

示例5: 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))
            {
                var num = item.GetBaseItem().Modes - 1;
                int num2, num3;
                int.TryParse(item.ExtraData, out num2);

                if (num2 <= 0)
                    num3 = 1;
                else
                {
                    if (num2 >= num)
                        num3 = 0;
                    else
                        num3 = num2 + 1;
                }

                item.ExtraData = num3.ToString();
                item.UpdateState();
                item.GetRoom().GetWiredHandler().ExecuteWired(Interaction.TriggerStateChanged, roomUser, item);

                return;
            }

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

示例6: OnPlace

        public void OnPlace(GameClients.GameClient Session, RoomItem Item)
        {
            Item.ExtraData = "0";

            if (Item.InteractingUser != 0)
            {
                RoomUser User = Item.GetRoom().GetRoomUserManager().GetRoomUserByHabbo(Item.InteractingUser);

                if (User != null)
                {
                    User.ClearMovement(true);
                    User.AllowOverride = false;
                    User.CanWalk = true;
                }

                Item.InteractingUser = 0;
            }

            if (Item.InteractingUser2 != 0)
            {
                RoomUser User = Item.GetRoom().GetRoomUserManager().GetRoomUserByHabbo(Item.InteractingUser2);

                if (User != null)
                {
                    User.ClearMovement(true);
                    User.AllowOverride = false;
                    User.CanWalk = true;
                }

                Item.InteractingUser2 = 0;
            }
        }
开发者ID:BjkGkh,项目名称:07052014,代码行数:32,代码来源:InteractorTeleport.cs

示例7: OnTrigger

        public override void OnTrigger(GameClient Session, RoomItem Item, int Request, bool UserHasRights)
        {
            RoomUser User = Item.GetRoom().GetRoomUserByHabbo(Session.GetHabbo().Id);

            if (User == null)
            {
                return;
            }

            if (Item.GetRoom().TilesTouching(Item.X, Item.Y, 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);
                    }
                }
            }
            else
            {
                User.MoveTo(Item.SquareInFront);
            }
        }
开发者ID:habb0,项目名称:uberEmu-stabilized,代码行数:31,代码来源:FurniInteractor.cs

示例8: 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

示例9: OnWiredTrigger

        public override void OnWiredTrigger(RoomItem item)
        {
            uint num = item.GetBaseItem().Modes - 1;

            if (num <= 0)
                item.UpdateState(false, true);

            int num2;
            int.TryParse(item.ExtraData, out num2);
            int num3;

            if (num2 <= 0)
                num3 = 1;
            else
            {
                if (num2 >= num)
                    num3 = 0;
                else
                    num3 = num2 + 1;
            }

            if (num3 == 0 && !item.GetRoom().GetGameMap().ItemCanBePlacedHere(item.X, item.Y))
                return;

            item.ExtraData = num3.ToString();
            item.UpdateState();
            item.GetRoom().GetGameMap().UpdateMapForItem(item);
        }
开发者ID:sgf,项目名称:Yupi,代码行数:28,代码来源:InteractorHCGate.cs

示例10: OnPlace

        public override void OnPlace(GameClient session, RoomItem item)
        {
            item.ExtraData = "0";

            if (item.InteractingUser != 0u)
            {
                var roomUserByHabbo = item.GetRoom().GetRoomUserManager().GetRoomUserByHabbo(item.InteractingUser);

                if (roomUserByHabbo != null)
                {
                    roomUserByHabbo.ClearMovement();
                    roomUserByHabbo.AllowOverride = false;
                    roomUserByHabbo.CanWalk = true;
                }

                item.InteractingUser = 0u;
            }

            if (item.InteractingUser2 == 0u)
                return;

            var roomUserByHabbo2 = item.GetRoom().GetRoomUserManager().GetRoomUserByHabbo(item.InteractingUser2);

            if (roomUserByHabbo2 != null)
            {
                roomUserByHabbo2.ClearMovement();
                roomUserByHabbo2.AllowOverride = false;
                roomUserByHabbo2.CanWalk = true;
            }

            item.InteractingUser2 = 0u;
        }
开发者ID:kessiler,项目名称:azureEmulator,代码行数:32,代码来源:InteractorQuickTeleport.cs

示例11: OnTrigger

		public void OnTrigger(GameClient Session, RoomItem Item, int Request, bool HasRights)
		{
			if (Item == null || Item.GetRoom() == null || Session == null || Session.GetHabbo() == null)
			{
				return;
			}
			RoomUser roomUserByHabbo = Item.GetRoom().GetRoomUserManager().GetRoomUserByHabbo(Session.GetHabbo().Id);
			if (roomUserByHabbo == null)
			{
				return;
			}
			if (!(roomUserByHabbo.Coordinate == Item.Coordinate) && !(roomUserByHabbo.Coordinate == Item.SquareInFront))
			{
				if (roomUserByHabbo.CanWalk)
				{
					roomUserByHabbo.MoveTo(Item.SquareInFront);
				}
				return;
			}
			if (Item.InteractingUser != 0u)
			{
				return;
			}
			roomUserByHabbo.TeleDelay = 2;
			Item.InteractingUser = roomUserByHabbo.GetClient().GetHabbo().Id;
		}
开发者ID:kessiler,项目名称:habboServer,代码行数:26,代码来源:InteractorHopper.cs

示例12: OnPlace

		public void OnPlace(GameClient Session, RoomItem Item)
		{
			Item.ExtraData = "0";
			if (Item.InteractingUser != 0u)
			{
				RoomUser roomUserByHabbo = Item.GetRoom().GetRoomUserManager().GetRoomUserByHabbo(Item.InteractingUser);
				if (roomUserByHabbo != null)
				{
					roomUserByHabbo.ClearMovement(true);
					roomUserByHabbo.AllowOverride = false;
					roomUserByHabbo.CanWalk = true;
				}
				Item.InteractingUser = 0u;
			}
			if (Item.InteractingUser2 != 0u)
			{
				RoomUser roomUserByHabbo2 = Item.GetRoom().GetRoomUserManager().GetRoomUserByHabbo(Item.InteractingUser2);
				if (roomUserByHabbo2 != null)
				{
					roomUserByHabbo2.ClearMovement(true);
					roomUserByHabbo2.AllowOverride = false;
					roomUserByHabbo2.CanWalk = true;
				}
				Item.InteractingUser2 = 0u;
			}
		}
开发者ID:BjkGkh,项目名称:Mercury,代码行数:26,代码来源:InteractorTeleport.cs

示例13: OnRemove

        public void OnRemove(GameClients.GameClient Session, RoomItem Item)
        {
            Item.ExtraData = "0";

            if (Item.InteractingUser != 0)
            {
                RoomUser User = Item.GetRoom().GetRoomUserManager().GetRoomUserByHabbo(Item.InteractingUser);

                if (User != null)
                {
                    User.UnlockWalking();
                }

                Item.InteractingUser = 0;
            }

            if (Item.InteractingUser2 != 0)
            {
                RoomUser User = Item.GetRoom().GetRoomUserManager().GetRoomUserByHabbo(Item.InteractingUser2);

                if (User != null)
                {
                    User.UnlockWalking();
                }

                Item.InteractingUser2 = 0;
            }
        }
开发者ID:BjkGkh,项目名称:07052014,代码行数:28,代码来源:InteractorTeleport.cs

示例14: OnPlace

        public override void OnPlace(GameClient session, RoomItem item)
        {
            item.GetRoom().GetRoomItemHandler().HopperCount++;

            using (IQueryAdapter queryReactor = Yupi.GetDatabaseManager().GetQueryReactor())
            {
                queryReactor.SetQuery("INSERT INTO items_hopper (hopper_id, room_id) VALUES (@hopperid, @roomid);");
                queryReactor.AddParameter("hopperid", item.Id);
                queryReactor.AddParameter("roomid", item.RoomId);
                queryReactor.RunQuery();
            }

            if (item.InteractingUser == 0u)
                return;

            RoomUser roomUserByHabbo = item.GetRoom().GetRoomUserManager().GetRoomUserByHabbo(item.InteractingUser);

            if (roomUserByHabbo != null)
            {
                roomUserByHabbo.ClearMovement();
                roomUserByHabbo.AllowOverride = false;
                roomUserByHabbo.CanWalk = true;
            }

            item.InteractingUser = 0u;
        }
开发者ID:sgf,项目名称:Yupi,代码行数:26,代码来源:InteractorHopper.cs

示例15: OnPlace

		public void OnPlace(GameClient Session, RoomItem Item)
		{
			checked
			{
				Item.GetRoom().GetRoomItemHandler().HopperCount++;
				using (IQueryAdapter queryreactor = CyberEnvironment.GetDatabaseManager().getQueryReactor())
				{
					queryreactor.setQuery("INSERT INTO items_hopper (hopper_id, room_id) VALUES (@hopperid, @roomid);");
					queryreactor.addParameter("hopperid", Item.Id);
					queryreactor.addParameter("roomid", Item.RoomId);
					queryreactor.runQuery();
				}
				if (Item.InteractingUser != 0u)
				{
					RoomUser roomUserByHabbo = Item.GetRoom().GetRoomUserManager().GetRoomUserByHabbo(Item.InteractingUser);
					if (roomUserByHabbo != null)
					{
						roomUserByHabbo.ClearMovement(true);
						roomUserByHabbo.AllowOverride = false;
						roomUserByHabbo.CanWalk = true;
					}
					Item.InteractingUser = 0u;
				}
			}
		}
开发者ID:kessiler,项目名称:habboServer,代码行数:25,代码来源:InteractorHopper.cs


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