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


C# GameClient.GetHabbo方法代码示例

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


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

示例1: SerializeQuest

		internal static void SerializeQuest(ServerMessage Message, GameClient Session, Quest Quest, string Category)
		{
			if (Message == null || Session == null)
			{
				return;
			}
			int amountOfQuestsInCategory = CyberEnvironment.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:kessiler,项目名称:habboServer,代码行数:33,代码来源:QuestListComposer.cs

示例2: Compose

		internal static ServerMessage Compose(GameClient Session, Quest Quest)
		{
			int amountOfQuestsInCategory = CyberEnvironment.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:kessiler,项目名称:habboServer,代码行数:25,代码来源:QuestCompletedComposer.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 (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

示例4: UpdateUser

		internal void UpdateUser(GameClient client)
		{
			this.client = client;
			if (client != null && client.GetHabbo() != null)
			{
				this.currentRoom = client.GetHabbo().CurrentRoom;
			}
		}
开发者ID:kessiler,项目名称:habboServer,代码行数:8,代码来源:MessengerBuddy.cs

示例5: OnTrigger

 public void OnTrigger(GameClient Session, RoomItem Item, int Request, bool HasRights)
 {
     if (Session == null || Session.GetHabbo() == null || Item.InteractingUser > 0U)
         return;
     string pName = Session.GetHabbo().Username;
     RoomUser roomUserByHabbo = Item.GetRoom().GetRoomUserManager().GetRoomUserByHabbo(pName);
     roomUserByHabbo.GoalX = Item.GetX;
     roomUserByHabbo.GoalY = Item.GetY;
     if (roomUserByHabbo.team != Team.none)
         roomUserByHabbo.throwBallAtGoal = true;
 }
开发者ID:kessiler,项目名称:habboServer,代码行数:11,代码来源:InteractorFreezeTile.cs

示例6: Compose

		internal static ServerMessage Compose(GameClient Session, List<Quest> Quests, bool Send)
		{
			Dictionary<string, int> dictionary = new Dictionary<string, int>();
			Dictionary<string, Quest> dictionary2 = new Dictionary<string, Quest>();
			foreach (Quest current in Quests)
			{
				if (!current.Category.Contains("xmas2012"))
				{
					if (!dictionary.ContainsKey(current.Category))
					{
						dictionary.Add(current.Category, 1);
						dictionary2.Add(current.Category, null);
					}
					if (current.Number >= dictionary[current.Category])
					{
						int questProgress = Session.GetHabbo().GetQuestProgress(current.Id);
						if (Session.GetHabbo().CurrentQuestId != current.Id && (long)questProgress >= (long)((ulong)current.GoalData))
						{
							dictionary[current.Category] = checked(current.Number + 1);
						}
					}
				}
			}
			foreach (Quest current2 in Quests)
			{
				foreach (KeyValuePair<string, int> current3 in dictionary)
				{
					if (!current2.Category.Contains("xmas2012") && current2.Category == current3.Key && current2.Number == current3.Value)
					{
						dictionary2[current3.Key] = current2;
						break;
					}
				}
			}
			ServerMessage serverMessage = new ServerMessage(Outgoing.QuestListMessageComposer);
			serverMessage.AppendInt32(dictionary2.Count);
			foreach (KeyValuePair<string, Quest> current4 in dictionary2)
			{
				if (current4.Value != null)
				{
					QuestListComposer.SerializeQuest(serverMessage, Session, current4.Value, current4.Key);
				}
			}
			foreach (KeyValuePair<string, Quest> current5 in dictionary2)
			{
				if (current5.Value == null)
				{
					QuestListComposer.SerializeQuest(serverMessage, Session, current5.Value, current5.Key);
				}
			}
			serverMessage.AppendBoolean(Send);
			return serverMessage;
		}
开发者ID:kessiler,项目名称:habboServer,代码行数:53,代码来源:QuestListComposer.cs

示例7: GiveCredits

		internal static void GiveCredits(GameClient Client, int amount)
		{
			if (Client == null || Client.GetHabbo() == null)
			{
				return;
			}
			double arg_12_0 = (double)CyberEnvironment.GetUnixTimestamp();
			checked
			{
				Client.GetHabbo().Credits += amount;
				Client.GetHabbo().UpdateCreditsBalance();
			}
		}
开发者ID:kessiler,项目名称:habboServer,代码行数:13,代码来源:CreditManager.cs

示例8: TryProgressAchievement

		internal void TryProgressAchievement(GameClient Session, string ACHGroup, int MinimumRequirement, int Requirement)
		{
			if (Requirement == 0 || Session == null)
			{
				return;
			}
			Achievement achievement = null;
			this.Achievements.TryGetValue(ACHGroup, out achievement);
			if (achievement == null)
			{
				return;
			}
			UserAchievement achievementData = Session.GetHabbo().GetAchievementData(ACHGroup);
			if (achievementData == null)
			{
				this.ProgressUserAchievement(Session, ACHGroup, MinimumRequirement, false);
				return;
			}
			checked
			{
				int requirement = achievement.Levels[achievementData.Level + 1].Requirement;
				if (requirement < Requirement)
				{
					return;
				}
				this.ProgressUserAchievement(Session, ACHGroup, requirement - Requirement, false);
			}
		}
开发者ID:kessiler,项目名称:habboServer,代码行数:28,代码来源:AchievementManager.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:kessiler,项目名称:habboServer,代码行数:32,代码来源:InteractorDice.cs

示例10: OnTrigger

		public void OnTrigger(GameClient Session, RoomItem Item, int Request, bool HasRights)
		{
			if (Session == null)
			{
				return;
			}
			RoomUser roomUserByHabbo = Item.GetRoom().GetRoomUserManager().GetRoomUserByHabbo(Session.GetHabbo().Id);
			if (Item.InteractingUser2 != roomUserByHabbo.UserID)
			{
				Item.InteractingUser2 = roomUserByHabbo.UserID;
			}
			if (roomUserByHabbo == null)
			{
				return;
			}
			if (roomUserByHabbo.Coordinate != Item.SquareInFront && roomUserByHabbo.CanWalk)
			{
				roomUserByHabbo.MoveTo(Item.SquareInFront);
				return;
			}
			if (!Item.GetRoom().GetGameMap().ValidTile(Item.SquareBehind.X, Item.SquareBehind.Y) || !Item.GetRoom().GetGameMap().CanWalk(Item.SquareBehind.X, Item.SquareBehind.Y, false, 0u) || !Item.GetRoom().GetGameMap().SquareIsOpen(Item.SquareBehind.X, Item.SquareBehind.Y, false))
			{
				return;
			}
			checked
			{
				if (roomUserByHabbo.LastInteraction - CyberEnvironment.GetUnixTimestamp() < 0 && roomUserByHabbo.InteractingGate && roomUserByHabbo.GateId == Item.Id)
				{
					roomUserByHabbo.InteractingGate = false;
					roomUserByHabbo.GateId = 0u;
				}
				{
					if (!Item.GetRoom().GetGameMap().CanWalk(Item.SquareBehind.X, Item.SquareBehind.Y, roomUserByHabbo.AllowOverride, 0u))
					{
						return;
					}
					if (Item.InteractingUser == 0u)
					{
						roomUserByHabbo.InteractingGate = true;
						roomUserByHabbo.GateId = Item.Id;
						Item.InteractingUser = roomUserByHabbo.HabboId;
						roomUserByHabbo.CanWalk = false;
						if (roomUserByHabbo.IsWalking && (roomUserByHabbo.GoalX != Item.SquareInFront.X || roomUserByHabbo.GoalY != Item.SquareInFront.Y))
						{
							roomUserByHabbo.ClearMovement(true);
						}

						roomUserByHabbo.InteractingGate = false;
						roomUserByHabbo.GateId = 0u;
						return;
					}
					return;
				}
			}
		}
开发者ID:kessiler,项目名称:habboServer,代码行数:55,代码来源:InteractorOneWayGate.cs

示例11: CreateGroup

		internal void CreateGroup(string Name, string Desc, uint RoomId, string Badge, GameClient Session, int Colour1, int Colour2, out Guild Group)
		{
			using (IQueryAdapter queryreactor = CyberEnvironment.GetDatabaseManager().getQueryReactor())
			{
				queryreactor.setQuery(string.Concat(new object[]
				{
					"INSERT INTO groups (`name`, `desc`,`badge`,`owner_id`,`created`,`room_id`,`colour1`,`colour2`) VALUES(@name, @desc, @badge, ",
					Session.GetHabbo().Id,
					", UNIX_TIMESTAMP(), ",
					RoomId,
					",'",
					Colour1,
					"','",
					Colour2,
					"')"
				}));
				queryreactor.addParameter("name", Name);
				queryreactor.addParameter("desc", Desc);
				queryreactor.addParameter("badge", Badge);
				uint num = checked((uint)queryreactor.insertQuery());
				queryreactor.runFastQuery(string.Concat(new object[]
				{
					"UPDATE rooms SET group_id=",
					num,
					" WHERE id=",
					RoomId,
					" LIMIT 1"
				}));
				Dictionary<uint, GroupUser> dictionary = new Dictionary<uint, GroupUser>();
				dictionary.Add(Session.GetHabbo().Id, new GroupUser(Session.GetHabbo().Id, num, 2));
				this.Groups.Add(num, new Guild(num, Name, Desc, RoomId, Badge, CyberEnvironment.GetUnixTimestamp(), Session.GetHabbo().Id, Colour1, Colour2, dictionary, new List<uint>(), new Dictionary<uint, GroupUser>(), 0u, 1u, false, Name, Desc, 0, 0.0, 0, "", 0));

				queryreactor.runFastQuery(string.Concat(new object[]
				{
					"INSERT INTO group_memberships (group_id, user_id, rank) VALUES (",
					num,
					", ",
					Session.GetHabbo().Id,
					", '2')"
				}));
				Group = this.GetGroup(num);
                GroupUser User = new GroupUser(Session.GetHabbo().Id, num, 2);
                Session.GetHabbo().UserGroups.Add(User);
                Group.Admins.Add(Session.GetHabbo().Id, User);
				queryreactor.runFastQuery(string.Concat(new object[]
				{
					"UPDATE user_stats SET favourite_group=",
					num,
					" WHERE id= ",
					Session.GetHabbo().Id,
					" LIMIT 1"
				}));
				queryreactor.runFastQuery("DELETE FROM room_rights WHERE room_id=" + RoomId);
			}
		}
开发者ID:kessiler,项目名称:habboServer,代码行数:55,代码来源:GroupManager.cs

示例12: LevelIsCompleted

		internal bool LevelIsCompleted(GameClient Session, int TalentLevel)
		{
			foreach (Talent current in this.GetTalents(TalentLevel))
			{
				if (Session.GetHabbo().GetAchievementData(current.AchievementGroup) == null)
				{
					return false;
				}
			}
			return true;
		}
开发者ID:kessiler,项目名称:habboServer,代码行数:11,代码来源:TalentManager.cs

示例13: OnTrigger

		public void OnTrigger(GameClient Session, RoomItem Item, int Request, bool HasRights)
		{
			if (Item.ExtraData != "1" && Item.GetBaseItem().VendingIds.Count >= 1 && Item.InteractingUser == 0u && Session != null)
			{
				RoomUser roomUserByHabbo = Item.GetRoom().GetRoomUserManager().GetRoomUserByHabbo(Session.GetHabbo().Id);
				if (roomUserByHabbo == null)
				{
					return;
				}
				if (!Gamemap.TilesTouching(roomUserByHabbo.X, roomUserByHabbo.Y, Item.GetX, Item.GetY))
				{
					roomUserByHabbo.MoveTo(Item.SquareInFront);
					return;
				}
				Item.InteractingUser = Session.GetHabbo().Id;
				roomUserByHabbo.CanWalk = false;
				roomUserByHabbo.ClearMovement(true);
                roomUserByHabbo.SetRot(PathFinder.CalculateRotation(roomUserByHabbo.X, roomUserByHabbo.Y, Item.GetX, Item.GetY));
				Item.ReqUpdate(2, true);
				Item.ExtraData = "1";
				Item.UpdateState(false, true);
			}
		}
开发者ID:kessiler,项目名称:habboServer,代码行数:23,代码来源:InteractorVendor.cs

示例14: OnTrigger

		public void OnTrigger(GameClient Session, RoomItem Item, int Request, bool HasRights)
		{
			checked
			{
				int num = Item.GetBaseItem().Modes - 1;
				if (Session == null || !HasRights || num <= 0 || Item.GetBaseItem().InteractionType == InteractionType.pinata)
				{
					return;
				}
				CyberEnvironment.GetGame().GetQuestManager().ProgressUserQuest(Session, QuestType.FURNI_SWITCH, 0u);
				int num2 = 0;
				int.TryParse(Item.ExtraData, out num2);
				int num3;
				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(WiredItemType.TriggerToggleFurni, new object[]
				{
					Item.GetRoom().GetRoomUserManager().GetRoomUserByHabbo(Session.GetHabbo().Id),
					Item
				});
				if (Item.GetBaseItem().StackMultipler)
				{
					Room room = Item.GetRoom();
					foreach (RoomUser current in room.GetRoomUserManager().UserList.Values)
					{
						if (current.Statusses.ContainsKey("sit"))
						{
							room.GetRoomUserManager().UpdateUserStatus(current, true);
						}
					}
				}
			}
		}
开发者ID:kessiler,项目名称:habboServer,代码行数:48,代码来源:InteractorGenericSwitch.cs

示例15: OnTrigger

		public void OnTrigger(GameClient Session, RoomItem Item, int Request, bool HasRights)
		{
			checked
			{
				int num = Item.GetBaseItem().Modes - 1;
				if (!HasRights)
				{
					return;
				}
				if (num <= 0)
				{
					Item.UpdateState(false, true);
				}
				int num2 = 0;
				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.GetX, Item.GetY))
				{
					return;
				}
				Item.ExtraData = num3.ToString();
				Item.UpdateState();
				Item.GetRoom().GetGameMap().updateMapForItem(Item);
				Item.GetRoom().GetWiredHandler().ExecuteWired(WiredItemType.TriggerToggleFurni, new object[]
				{
					Item.GetRoom().GetRoomUserManager().GetRoomUserByHabbo(Session.GetHabbo().Id),
					Item
				});
			}
		}
开发者ID:kessiler,项目名称:habboServer,代码行数:45,代码来源:InteractorGate.cs


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