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


C# GameClients.GameClient类代码示例

本文整理汇总了C#中Mercury.HabboHotel.GameClients.GameClient的典型用法代码示例。如果您正苦于以下问题:C# GameClient类的具体用法?C# GameClient怎么用?C# GameClient使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: OnTrigger

		public void OnTrigger(GameClient Session, RoomItem Item, int Request, bool HasRights)
		{
			if (!HasRights)
			{
				return;
			}
			int num = 0;
			int.TryParse(Item.ExtraData, out num);
			checked
			{
				if (Request == 1)
				{
					num++;
				}
				else
				{
					if (Request == 2)
					{
						num--;
					}
					else
					{
						if (Request == 3)
						{
							num = 0;
						}
					}
				}
				Item.ExtraData = num.ToString();
				Item.UpdateState(false, true);
			}
		}
开发者ID:BjkGkh,项目名称:Mercury,代码行数:32,代码来源:InteractorScoreCounter.cs

示例2: 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:BjkGkh,项目名称:Mercury,代码行数:26,代码来源:InteractorHopper.cs

示例3: TryProgressRegistrationAchievements

        internal void TryProgressRegistrationAchievements(GameClient Session)
        {
            if (Session.GetHabbo() == null)
            {
                return;
            }
            UserAchievement regACH = Session.GetHabbo().GetAchievementData("ACH_RegistrationDuration");
            if (regACH == null)
            {
                ProgressUserAchievement(Session, "ACH_RegistrationDuration", 1, true);
                return;
            }
            else if (regACH.Level == 5)
            {
                return;//Already Completed!
            }
            int sinceMember = MercuryEnvironment.GetUnixTimestamp() - (int)Session.GetHabbo().CreateDate;
            int daysSinceMember = Convert.ToInt32(Math.Round((double)259200 / 86400));

            if (daysSinceMember == regACH.Progress)
            {
                return;
            }
            int dais = daysSinceMember - regACH.Progress;
            if (dais < 1)
                return;

            ProgressUserAchievement(Session, "ACH_RegistrationDuration", dais, false);

        }
开发者ID:BjkGkh,项目名称:Mercury,代码行数:30,代码来源:AchievementManager.cs

示例4: GiveBadge

		internal void GiveBadge(string Badge, bool InDatabase, GameClient Session, bool WiredReward = false)
		{
			if (WiredReward)
			{
				Session.SendMessage(this.SerializeBadgeReward(!this.HasBadge(Badge)));
			}
			if (this.HasBadge(Badge))
			{
				return;
			}
			if (InDatabase)
			{
				using (IQueryAdapter queryreactor = MercuryEnvironment.GetDatabaseManager().getQueryreactor())
				{
					queryreactor.setQuery(string.Concat(new object[]
					{
						"INSERT INTO user_badges (user_id,badge_id,badge_slot) VALUES (",
						this.UserId,
						",@badge,",
						0,
						")"
					}));
					queryreactor.addParameter("badge", Badge);
					queryreactor.runQuery();
				}
			}
			this.Badges.Add(Badge, new Badge(Badge, 0));
			Session.SendMessage(this.SerializeBadge(Badge));
            Session.SendMessage(this.Update(Badge));
		}
开发者ID:BjkGkh,项目名称:Mercury,代码行数:30,代码来源:BadgeComponent.cs

示例5: OnPlace

		public void OnPlace(GameClient Session, RoomItem Item)
		{
			checked
			{
				Item.GetRoom().GetRoomItemHandler().HopperCount++;
				using (IQueryAdapter queryreactor = MercuryEnvironment.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:BjkGkh,项目名称:Mercury,代码行数:25,代码来源:InteractorHopper.cs

示例6: AvatarEffectsInventoryComponent

		internal AvatarEffectsInventoryComponent(uint UserId, GameClient Client, UserData Data)
		{
			this.UserId = UserId;
			this.Session = Client;
			this.Effects = new List<AvatarEffect>();
			foreach (AvatarEffect current in Data.effects)
			{
				if (!current.HasExpired)
				{
					this.Effects.Add(current);
				}
				else
				{
					using (IQueryAdapter queryreactor = MercuryEnvironment.GetDatabaseManager().getQueryreactor())
					{
						queryreactor.runFastQuery(string.Concat(new object[]
						{
							"DELETE FROM user_effects WHERE user_id = ",
							UserId,
							" AND effect_id = ",
							current.EffectId,
							"; "
						}));
					}
				}
			}
		}
开发者ID:BjkGkh,项目名称:Mercury,代码行数:27,代码来源:AvatarEffectsInventoryComponent.cs

示例7: OnRemove

		public void OnRemove(GameClient Session, RoomItem Item)
		{
			if (Item.ExtraData == "-1")
			{
				Item.ExtraData = "0";
			}
		}
开发者ID:BjkGkh,项目名称:Mercury,代码行数:7,代码来源:InteractorDice.cs

示例8: Compose

		internal static ServerMessage Compose(GameClient Session, Quest Quest)
		{
			int amountOfQuestsInCategory = MercuryEnvironment.GetGame().GetQuestManager().GetAmountOfQuestsInCategory(Quest.Category);
			int i = (Quest == null) ? amountOfQuestsInCategory : Quest.Number;
			int i2 = (Quest == null) ? 0 : Session.GetHabbo().GetQuestProgress(Quest.Id);
			ServerMessage serverMessage = new ServerMessage(Outgoing.QuestCompletedMessageComposer);
			serverMessage.AppendString(Quest.Category);
			serverMessage.AppendInt32(i);
			serverMessage.AppendInt32(Quest.Name.Contains("xmas2012") ? 1 : amountOfQuestsInCategory);
			serverMessage.AppendInt32((Quest == null) ? 3 : Quest.RewardType);
			serverMessage.AppendUInt((Quest == null) ? 0u : Quest.Id);
			serverMessage.AppendBoolean(Quest != null && Session.GetHabbo().CurrentQuestId == Quest.Id);
			serverMessage.AppendString((Quest == null) ? string.Empty : Quest.ActionName);
			serverMessage.AppendString((Quest == null) ? string.Empty : Quest.DataBit);
			serverMessage.AppendInt32((Quest == null) ? 0 : Quest.Reward);
			serverMessage.AppendString((Quest == null) ? string.Empty : Quest.Name);
			serverMessage.AppendInt32(i2);
			serverMessage.AppendUInt((Quest == null) ? 0u : Quest.GoalData);
			serverMessage.AppendInt32((Quest == null) ? 0 : Quest.TimeUnlock);
			serverMessage.AppendString("");
			serverMessage.AppendString("");
			serverMessage.AppendBoolean(true);
			serverMessage.AppendBoolean(true);
			return serverMessage;
		}
开发者ID:BjkGkh,项目名称:Mercury,代码行数:25,代码来源:QuestCompletedComposer.cs

示例9: OnTrigger

		public 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.GetX, Item.GetY, roomUser.X, roomUser.Y))
			{
				if (Item.ExtraData != "-1")
				{
					if (Request == -1)
					{
						Item.ExtraData = "0";
						Item.UpdateState();
						return;
					}
					Item.ExtraData = "-1";
					Item.UpdateState(false, true);
					Item.ReqUpdate(4, true);
					return;
				}
			}
			else
			{
				roomUser.MoveTo(Item.SquareInFront);
			}
		}
开发者ID:BjkGkh,项目名称:Mercury,代码行数:32,代码来源:InteractorDice.cs

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

示例11: OnTrigger

		public void OnTrigger(GameClient Session, RoomItem Item, int Request, bool HasRights)
		{
			if (!HasRights)
			{
				return;
			}
			int num = 0;
			int.TryParse(Item.ExtraData, out num);
			checked
			{
				if (Request == 1)
				{
					if (Item.pendingReset && num > 0)
					{
						num = 0;
						Item.pendingReset = false;
					}
					else
					{
						num += 60;
						Item.UpdateNeeded = false;
					}
				}
				else
				{
					if (Request == 2)
					{
						Item.UpdateNeeded = !Item.UpdateNeeded;
						Item.pendingReset = true;
					}
				}
				Item.ExtraData = num.ToString();
				Item.UpdateState();
			}
		}
开发者ID:BjkGkh,项目名称:Mercury,代码行数:35,代码来源:InteractorScoreboard.cs

示例12: SerializeQuest

		internal static void SerializeQuest(ServerMessage Message, GameClient Session, Quest Quest, string Category)
		{
			if (Message == null || Session == null)
			{
				return;
			}
			int amountOfQuestsInCategory = MercuryEnvironment.GetGame().GetQuestManager().GetAmountOfQuestsInCategory(Category);
			checked
			{
				int num = (Quest == null) ? amountOfQuestsInCategory : (Quest.Number - 1);
				int num2 = (Quest == null) ? 0 : Session.GetHabbo().GetQuestProgress(Quest.Id);
				if (Quest != null && Quest.IsCompleted(num2))
				{
					num++;
				}
				Message.AppendString(Category);
				Message.AppendInt32((Quest == null) ? 0 : (Quest.Category.Contains("xmas2012") ? 0 : num));
				Message.AppendInt32((Quest == null) ? 0 : (Quest.Category.Contains("xmas2012") ? 0 : amountOfQuestsInCategory));
				Message.AppendInt32((Quest == null) ? 3 : Quest.RewardType);
				Message.AppendUInt((Quest == null) ? 0u : Quest.Id);
				Message.AppendBoolean(Quest != null && Session.GetHabbo().CurrentQuestId == Quest.Id);
				Message.AppendString((Quest == null) ? string.Empty : Quest.ActionName);
				Message.AppendString((Quest == null) ? string.Empty : Quest.DataBit);
				Message.AppendInt32((Quest == null) ? 0 : Quest.Reward);
				Message.AppendString((Quest == null) ? string.Empty : Quest.Name);
				Message.AppendInt32(num2);
				Message.AppendUInt((Quest == null) ? 0u : Quest.GoalData);
				Message.AppendInt32((Quest == null) ? 0 : Quest.TimeUnlock);
				Message.AppendString("");
				Message.AppendString("");
				Message.AppendBoolean(true);
			}
		}
开发者ID:BjkGkh,项目名称:Mercury,代码行数:33,代码来源:QuestListComposer.cs

示例13: OnPlace

 public void OnPlace(GameClient Session, RoomItem Item)
 {
     if (Item.team == Team.none)
         return;
     Item.ExtraData = Item.GetRoom().GetGameManager().Points[(int)Item.team].ToString();
     Item.UpdateState(false, true);
 }
开发者ID:BjkGkh,项目名称:Mercury,代码行数:7,代码来源:InteractorBanzaiScoreCounter.cs

示例14: InventoryComponent

		internal InventoryComponent(uint UserId, GameClient Client, UserData UserData)
		{
			this.mClient = Client;
			this.UserId = UserId;
			this.floorItems = new HybridDictionary();
			this.wallItems = new HybridDictionary();
			this.discs = new HybridDictionary();
			foreach (UserItem current in UserData.inventory)
			{
				if (current.GetBaseItem().InteractionType == InteractionType.musicdisc)
				{
					this.discs.Add(current.Id, current);
				}
				if (current.isWallItem)
				{
					this.wallItems.Add(current.Id, current);
				}
				else
				{
					this.floorItems.Add(current.Id, current);
				}
			}
			this.InventoryPets = new SafeDictionary<uint, Pet>(UserData.pets);
			this.InventoryBots = new SafeDictionary<uint, RoomBot>(UserData.Botinv);
			this.mAddedItems = new HybridDictionary();
			this.mRemovedItems = new HybridDictionary();
			this.isUpdated = false;
		}
开发者ID:BjkGkh,项目名称:Mercury,代码行数:28,代码来源:InventoryComponent.cs

示例15: HelperSession

 internal HelperSession(GameClient Helper, GameClient Requester, string Question)
 {
     this.Helper = Helper;
     this.Requester = Requester;
     this.Chats = new List<string>();
     this.Chats.Add(Question);
     this.Response(Requester, Question);
 }
开发者ID:BjkGkh,项目名称:Mercury,代码行数:8,代码来源:HelperSession.cs


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