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


C# RoomUser.GetClient方法代码示例

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


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

示例1: OnUserWalk

        internal void OnUserWalk(RoomUser User)
        {
            if (User == null)
                return;
            foreach (RoomItem item in balls.Values)
            {
                int differenceX = User.X - item.GetX;
                int differenceY = User.Y - item.GetY;

                if (differenceX <= 1 && differenceX >= -1 && differenceY <= 1 && differenceY >= -1)
                {
                    int NewX = differenceX * -1;
                    int NewY = differenceY * -1;

                    NewX = NewX + item.GetX;
                    NewY = NewY + item.GetY;

                    if (item.interactingBallUser == User.userID && item.GetRoom().GetGameMap().ValidTile(NewX, NewY))
                    {
                        item.interactingBallUser = 0;
                        MoveBall(item, User.GetClient(), User.Coordinate, item.Coordinate, 6);
                    }
                    else if (item.GetRoom().GetGameMap().ValidTile(NewX, NewY))
                    {
                        MoveBall(item, User.GetClient(), NewX, NewY);
                    }
                }
            }
        }
开发者ID:BjkGkh,项目名称:R106,代码行数:29,代码来源:Soccer.cs

示例2: DeliverRandomPinataItem

        /// <summary>
        ///     Delivers the random pinata item.
        /// </summary>
        /// <param name="user">The user.</param>
        /// <param name="room">The room.</param>
        /// <param name="item">The item.</param>
        internal void DeliverRandomPinataItem(RoomUser user, Room room, RoomItem item)
        {
            if (room == null || item == null || item.GetBaseItem().InteractionType != Interaction.Pinata ||
                !Pinatas.ContainsKey(item.GetBaseItem().ItemId))
                return;

            PinataItem pinataItem;
            Pinatas.TryGetValue(item.GetBaseItem().ItemId, out pinataItem);

            if (pinataItem == null || pinataItem.Rewards.Count < 1)
                return;

            item.RefreshItem();

            //@TODO :: KESSILER, now PINATA DOESNT WORK. MUST CREATE SOLUTION LATER.

            //item.BaseName = pinataItem.Rewards[new Random().Next((pinataItem.Rewards.Count - 1))];

            item.ExtraData = string.Empty;
            room.GetRoomItemHandler().RemoveFurniture(user.GetClient(), item.Id, false);

            using (IQueryAdapter queryReactor = Yupi.GetDatabaseManager().GetQueryReactor())
                queryReactor.RunFastQuery(
                    $"UPDATE items_rooms SET item_name='{item.BaseName}', extra_data='' WHERE id='{item.Id}'");

            if (!room.GetRoomItemHandler().SetFloorItem(user.GetClient(), item, item.X, item.Y, 0, true, false, true))
                user.GetClient().GetHabbo().GetInventoryComponent().AddItem(item);
        }
开发者ID:ImNotSatan,项目名称:Yupi,代码行数:34,代码来源:PinataHandler.cs

示例3: DeliverRandomPinataItem

        /// <summary>
        /// Delivers the random pinata item.
        /// </summary>
        /// <param name="user">The user.</param>
        /// <param name="room">The room.</param>
        /// <param name="item">The item.</param>
        internal void DeliverRandomPinataItem(RoomUser user, Room room, RoomItem item)
        {
            if (room == null || item == null || item.GetBaseItem().InteractionType != Interaction.Pinata || !Pinatas.ContainsKey(item.GetBaseItem().ItemId))
                return;

            PinataItem pinataItem;
            Pinatas.TryGetValue(item.GetBaseItem().ItemId, out pinataItem);

            if (pinataItem == null || pinataItem.Rewards.Count < 1)
                return;

            item.RefreshItem();
            item.BaseItem = pinataItem.Rewards[new Random().Next((pinataItem.Rewards.Count - 1))];

            item.ExtraData = string.Empty;
            room.GetRoomItemHandler().RemoveFurniture(user.GetClient(), item.Id, false);
            using (var queryReactor = AzureEmulator.GetDatabaseManager().GetQueryReactor())
            {
                queryReactor.RunFastQuery(string.Format("UPDATE items_rooms SET base_item='{0}', extra_data='' WHERE id='{1}'", item.BaseItem, item.Id));
                queryReactor.RunQuery();
            }

            if (!room.GetRoomItemHandler().SetFloorItem(user.GetClient(), item, item.X, item.Y, 0, true, false, true))
                user.GetClient().GetHabbo().GetInventoryComponent().AddItem(item);
        }
开发者ID:BjkGkh,项目名称:Azure2,代码行数:31,代码来源:PinataHandler.cs

示例4: OnUserWalk

        internal void OnUserWalk(RoomUser User)
        {
            if (User == null)
                return;
            foreach (RoomItem item in pucks.Values)
            {
                int differenceX = User.X - item.GetX;
                int differenceY = User.Y - item.GetY;

                if (differenceX <= 1 && differenceX >= -1 && differenceY <= 1 && differenceY >= -1)
                {
                    int NewX = differenceX * -1;
                    int NewY = differenceY * -1;

                    NewX = NewX + item.GetX;
                    NewY = NewY + item.GetY;

                    if (item.interactingBallUser == User.userID && room.GetGameMap().ValidTile(NewX, NewY))
                    {
                        item.interactingBallUser = 0;

                        MovePuck(item, User.GetClient(), User.Coordinate, item.Coordinate, 6, User.team);
                    }
                    else if (room.GetGameMap().ValidTile(NewX, NewY))
                    {
                        MovePuck(item, User.GetClient(), NewX, NewY, User.team);
                    }
                }
            }

            if (banzaiStarted)
            {
                HandleBanzaiTiles(User.Coordinate, User.team, User);
            }
        }
开发者ID:BjkGkh,项目名称:R106,代码行数:35,代码来源:BattleBanzai.cs

示例5: OnUserEnterRoom

		internal override void OnUserEnterRoom(RoomUser User)
		{
			if (User.GetClient() != null && User.GetClient().GetHabbo() != null)
			{
				RoomUser roomUser = base.GetRoomUser();
				if (roomUser != null && User.GetClient().GetHabbo().Username == roomUser.PetData.OwnerName)
				{
					Random random = new Random();
					string[] value = PetLocale.GetValue("welcome.speech.pet");
					string message = value[random.Next(0, checked(value.Length - 1))];
                    message += User.GetUsername();
					roomUser.Chat(null, message, false, 0, 0);
				}
			}
		}
开发者ID:BjkGkh,项目名称:Mercury,代码行数:15,代码来源:PetBot.cs

示例6: OnUserEnterRoom

 public override void OnUserEnterRoom(RoomUser RoomUser_0)
 {
     speechthread = new Thread(delegate()
     {
         try
         {
             if (RoomUser_0 != null && RoomUser_0.GetClient() != null && this.uBot.BotType == "friendbot")
             {
                 Thread.Sleep(1000);
                 base.GetRoomUser().HandleSpeech(null, "Hallo " + RoomUser_0.GetClient().GetHabbo().Username + " wie gehts dir?", false);
             }
         }
         catch { }
     });
     speechthread.Start();
 }
开发者ID:RootkitR,项目名称:Essential-5.1,代码行数:16,代码来源:UserBotInt.cs

示例7: ActivateShield

 private static void ActivateShield(RoomUser user)
 {
     int Effect = (int)user.team + 48;
     user.GetClient().GetHabbo().GetEffectsInventoryComponent().method_2(Effect, true);
     user.shieldActive = true;
     user.shieldCounter += 10;
 }
开发者ID:RootkitR,项目名称:Essential-5.1,代码行数:7,代码来源:Freeze.cs

示例8: OnUserChat

 internal override void OnUserChat(RoomUser user, string text, bool shout)
 {
     if (!_unit.GetRoom().CheckRights(user.GetClient(), true))
         return;
     if (text == "yes")
     {
     }
 }
开发者ID:Kristopher-RZ,项目名称:Firewind,代码行数:8,代码来源:SpyAI.cs

示例9: Handle

        public bool Handle(RoomUser user, Team team, RoomItem item)
        {
            if (user != null && !user.IsBot && user.GetClient() != null)
            {
                ServerMessage servermsg = new ServerMessage();
                servermsg.Init(25);
                servermsg.AppendInt32(user.VirtualId);
                servermsg.AppendStringWithBreak(message);
                servermsg.AppendBoolean(false);

                user.GetClient().SendMessage(servermsg);
                handler.OnEvent(itemID);
                return true;
            }

            return false;
        }
开发者ID:habb0,项目名称:PiciEmulator,代码行数:17,代码来源:ShowMessage.cs

示例10: Handle

        public bool Handle(RoomUser user, Team team, RoomItem item)
        {
            if (user != null && !user.IsBot && user.GetClient() != null && !string.IsNullOrWhiteSpace(message))
            {
                ServerMessage servermsg = new ServerMessage();
                servermsg.Init(Outgoing.Whisp);
                servermsg.AppendInt32(user.VirtualId);
                servermsg.AppendString(message);
                servermsg.AppendInt32(0);
                servermsg.AppendInt32(0);
                servermsg.AppendInt32(0);
                servermsg.AppendInt32(-1);
                user.GetClient().SendMessage(servermsg);
                handler.OnEvent(itemID);
                return true;
            }

            return false;
        }
开发者ID:BjkGkh,项目名称:Custom-R2,代码行数:19,代码来源:ShowMessage.cs

示例11: Handle

 public bool Handle(RoomUser user, Team team, RoomItem item)
 {
     if (user == null || user.GetClient() == null || user.GetClient().GetHabbo() == null)
         return false;
     user.GetClient().GetHabbo().GetAvatarEffectsInventoryComponent().ApplyCustomEffect(4);
     cycles = 0;
     if (delay == 0 && user != null)
     {
         return TeleportUser(user);
     }
     else
     {
         lock (delayedUsers.SyncRoot)
         {
             delayedUsers.Enqueue(user);
         }
         handler.RequestCycle(this);
     }
     return false;
 }
开发者ID:BjkGkh,项目名称:07052014,代码行数:20,代码来源:TeleportToItem.cs

示例12: DeliverRandomPinataItem

		internal void DeliverRandomPinataItem(RoomUser User, Room Room, RoomItem Item)
		{
			if (Room == null || Item == null || Item.GetBaseItem().InteractionType != InteractionType.pinata || !this.Pinatas.ContainsKey(Item.GetBaseItem().ItemId))
			{
				return;
			}
			PinataItem pinataItem;
			this.Pinatas.TryGetValue(Item.GetBaseItem().ItemId, out pinataItem);
			if (pinataItem == null || pinataItem.Rewards.Count < 1)
			{
				return;
			}
			int getX = Item.GetX;
			int getY = Item.GetY;
			double getZ = Item.GetZ;
			Thread.Sleep(900);
			Item.refreshItem();
			Item.BaseItem = pinataItem.Rewards[new Random().Next(checked(pinataItem.Rewards.Count - 1))];
			Item.ExtraData = "";
			Room.GetRoomItemHandler().RemoveFurniture(User.GetClient(), Item.Id, false);
			using (IQueryAdapter queryreactor = CyberEnvironment.GetDatabaseManager().getQueryReactor())
			{
				queryreactor.runFastQuery(string.Concat(new object[]
				{
					"UPDATE items SET base_item = '",
					Item.BaseItem,
					"', extra_data = '' WHERE id = ",
					Item.Id
				}));
				queryreactor.runQuery();
			}
			Room.GetRoomItemHandler().SetFloorItem(Item, getX, getY, getZ, 0, false);
			ServerMessage serverMessage = new ServerMessage(Outgoing.AddFloorItemMessageComposer);
			Item.Serialize(serverMessage);
			serverMessage.AppendString(Room.Owner);
			Room.SendMessage(serverMessage);
			Room.GetRoomItemHandler().SetFloorItem(User.GetClient(), Item, Item.GetX, Item.GetY, 0, true, false, true);
		}
开发者ID:kessiler,项目名称:habboServer,代码行数:38,代码来源:PinataHandler.cs

示例13: DeliverRandomPinataItem

		internal void DeliverRandomPinataItem(RoomUser User, Room Room, RoomItem Item)
		{
			if (Room == null || Item == null || Item.GetBaseItem().InteractionType != InteractionType.pinata || !this.Pinatas.ContainsKey(Item.GetBaseItem().ItemId))
			{
				return;
			}
			PinataItem pinataItem;
			this.Pinatas.TryGetValue(Item.GetBaseItem().ItemId, out pinataItem);
			if (pinataItem == null || pinataItem.Rewards.Count < 1)
			{
				return;
			}
			int getX = Item.GetX;
			int getY = Item.GetY;
            double getZ = Item.GetZ;
			Item.refreshItem();
			Item.BaseItem = pinataItem.Rewards[new Random().Next(checked(pinataItem.Rewards.Count - 1))];
			Item.ExtraData = "";
			Room.GetRoomItemHandler().RemoveFurniture(User.GetClient(), Item.Id, false);
			using (IQueryAdapter queryreactor = MercuryEnvironment.GetDatabaseManager().getQueryreactor())
			{
				queryreactor.runFastQuery(string.Concat(new object[]
				{
					"UPDATE items SET base_item = '",
					Item.BaseItem,
					"', extra_data = '' WHERE id = ",
					Item.Id
				}));
				queryreactor.runQuery();
			}
			//Room.GetRoomItemHandler().SetFloorItem(Item, getX, getY, getZ, 0, false);
			if (!Room.GetRoomItemHandler().SetFloorItem(User.GetClient(), Item, Item.GetX, Item.GetY, 0, true, false, true))
            {
                User.GetClient().GetHabbo().GetInventoryComponent().AddItem(Item);
            }
		}
开发者ID:BjkGkh,项目名称:Mercury,代码行数:36,代码来源:PinataHandler.cs

示例14: OnUserSay

		public override void OnUserSay(RoomUser RoomUser_0, string string_0)
		{
            if (base.GetRoom().method_100(base.GetRoomUser().X, base.GetRoomUser().Y, RoomUser_0.X, RoomUser_0.Y) <= 8)
			{
                BotResponse @class = base.GetRoomBot().GetResponse(string_0);
				if (@class != null)
				{
                    string text = base.GetRoom().method_20(RoomUser_0, @class.Response);
					string text2 = @class.ResponseType.ToLower();
					if (text2 != null)
					{
						if (!(text2 == "say"))
						{
							if (!(text2 == "shout"))
							{
								if (text2 == "whisper")
								{
                                    ServerMessage Message = new ServerMessage(Outgoing.Whisp); // Updated
									Message.AppendInt32(base.GetRoomUser().VirtualId);
									Message.AppendStringWithBreak(text);
                                    Message.AppendInt32(0);
                                    Message.AppendInt32(0);
                                    Message.AppendInt32(-1);
									RoomUser_0.GetClient().SendMessage(Message);
								}
							}
							else
							{
								base.GetRoomUser().HandleSpeech(null, text, true);
							}
						}
						else
						{
							base.GetRoomUser().HandleSpeech(null, text, false);
						}
					}
					if (@class.ServeId >= 1)
					{
						RoomUser_0.CarryItem(@class.ServeId);
					}
				}
			}
		}
开发者ID:RootkitR,项目名称:Essential-5.1,代码行数:43,代码来源:GenericBot.cs

示例15: Handle

        public bool Handle(RoomUser user, Team team, RoomItem item)
        {
            if (user != null && !user.IsBot && user.GetClient() != null)
            {
                if (user.GetClient().GetHabbo().Rank >= 6) // staff can't be kicked
                    return false;

                if (user.IsOwner()) // can't kick room owner
                {
                    user.GetClient().SendillustrationMessage("admin.persistent", "WIRED REACTIE: Gebruiker wegsturen", "Je bent uit de kamer gestuurd door de Wired.<br><br><b>" + message + "</b>\r\r<i>De kamer eigenaar zal niet worden weggestuurd!");
                    return false;
                }

                GenericTriggerWithModes.DoAnimation(this.item);

                user.GetClient().SendillustrationMessage("admin.persistent", user.GetClient().GetHabbo().CurrentRoom.Name, "Je bent uit de kamer gestuurd door de Wired.<br><br><b>" + message);
                ButterflyEnvironment.GetGame().GetRoomManager().GetRoom(user.RoomId).GetRoomUserManager().RemoveUserFromRoom(user.GetClient(), true, false);
                handler.OnEvent(this.item.Id);

                return true;

            }
            return false;
        }
开发者ID:BjkGkh,项目名称:R106,代码行数:24,代码来源:Kick.cs


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