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


C# GameClient.SendMessage方法代码示例

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


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

示例1: 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 = CyberEnvironment.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:kessiler,项目名称:habboServer,代码行数:30,代码来源:BadgeComponent.cs

示例2: GetCurrentQuest

		internal void GetCurrentQuest(GameClient Session, ClientMessage Message)
		{
			if (!Session.GetHabbo().InRoom)
			{
				return;
			}
			Quest quest = this.GetQuest(Session.GetHabbo().LastQuestCompleted);
			Quest nextQuestInSeries = this.GetNextQuestInSeries(quest.Category, checked(quest.Number + 1));
			if (nextQuestInSeries == null)
			{
				return;
			}
			using (IQueryAdapter queryreactor = CyberEnvironment.GetDatabaseManager().getQueryReactor())
			{
				queryreactor.runFastQuery(string.Concat(new object[]
				{
					"REPLACE INTO user_quests(user_id,quest_id) VALUES (",
					Session.GetHabbo().Id,
					", ",
					nextQuestInSeries.Id,
					")"
				}));
				queryreactor.runFastQuery(string.Concat(new object[]
				{
					"UPDATE user_stats SET quest_id = ",
					nextQuestInSeries.Id,
					" WHERE id = ",
					Session.GetHabbo().Id
				}));
			}
			Session.GetHabbo().CurrentQuestId = nextQuestInSeries.Id;
			this.GetList(Session, null);
			Session.SendMessage(QuestStartedComposer.Compose(Session, nextQuestInSeries));
		}
开发者ID:kessiler,项目名称:habboServer,代码行数:34,代码来源:QuestManager.cs

示例3: ActivateQuest

		internal void ActivateQuest(GameClient Session, ClientMessage Message)
		{
			Quest quest = this.GetQuest(Message.PopWiredUInt());
			if (quest == null)
			{
				return;
			}
			using (IQueryAdapter queryreactor = CyberEnvironment.GetDatabaseManager().getQueryReactor())
			{
				queryreactor.runFastQuery(string.Concat(new object[]
				{
					"REPLACE INTO user_quests(user_id,quest_id) VALUES (",
					Session.GetHabbo().Id,
					", ",
					quest.Id,
					")"
				}));
				queryreactor.runFastQuery(string.Concat(new object[]
				{
					"UPDATE user_stats SET quest_id = ",
					quest.Id,
					" WHERE id = ",
					Session.GetHabbo().Id
				}));
			}
			Session.GetHabbo().CurrentQuestId = quest.Id;
			this.GetList(Session, null);
			Session.SendMessage(QuestStartedComposer.Compose(Session, quest));
		}
开发者ID:kessiler,项目名称:habboServer,代码行数:29,代码来源:QuestManager.cs

示例4: GetList

		internal void GetList(GameClient Session, ClientMessage Message)
		{
			Session.SendMessage(QuestListComposer.Compose(Session, this.quests.Values.ToList<Quest>(), Message != null));
		}
开发者ID:kessiler,项目名称:habboServer,代码行数:4,代码来源:QuestManager.cs

示例5: OnTrigger

		public void OnTrigger(GameClient Session, RoomItem Item, int Request, bool HasRights)
		{
			if (Session == null || Item == null)
			{
				return;
			}
			if (!HasRights)
			{
				return;
			}
			string ExtraInfo = "";
			bool flag = false;
			int i = 0;
			List<RoomItem> list = new List<RoomItem>();
			string ExtraString = "";
			string ExtraString2 = "";
			using (IQueryAdapter queryreactor = CyberEnvironment.GetDatabaseManager().getQueryReactor())
			{
				queryreactor.setQuery("SELECT * FROM wired_items WHERE [email protected] LIMIT 1");
				queryreactor.addParameter("id", Item.Id);
				DataRow row = queryreactor.getRow();
				if (row != null)
				{
					ExtraInfo = row["string"].ToString();
					i = (int)row["delay"] / 500;
					flag = (row["bool"].ToString() == "1");
					ExtraString = row["extra_string"].ToString();
					ExtraString2 = row["extra_string_2"].ToString();
					string[] array = row["items"].ToString().Split(new char[]
					{
						';'
					});
					for (int j = 0; j < array.Length; j++)
					{
						string s = array[j];
						uint pId = 0u;
						if (uint.TryParse(s, out pId))
						{
							RoomItem item = Item.GetRoom().GetRoomItemHandler().GetItem(pId);
							if (item != null && !list.Contains(item))
							{
								list.Add(item);
							}
						}
					}
				}
			}
			switch (Item.GetBaseItem().InteractionType)
			{
			case InteractionType.triggertimer:
			{
				ServerMessage serverMessage = new ServerMessage(Outgoing.WiredTriggerMessageComposer);
				serverMessage.AppendBoolean(false);
				serverMessage.AppendInt32(5);
				serverMessage.AppendInt32(list.Count);
				foreach (RoomItem current in list)
				{
					serverMessage.AppendUInt(current.Id);
				}
				serverMessage.AppendInt32(Item.GetBaseItem().SpriteId);
				serverMessage.AppendUInt(Item.Id);
				serverMessage.AppendString(ExtraInfo);
				serverMessage.AppendInt32(1);
				serverMessage.AppendInt32(1);
				serverMessage.AppendInt32(1);
				serverMessage.AppendInt32(3);
				serverMessage.AppendInt32(0);
				serverMessage.AppendInt32(0);
				Session.SendMessage(serverMessage);
				return;
			}
			case InteractionType.triggerroomenter:
			{
				ServerMessage serverMessage2 = new ServerMessage(Outgoing.WiredTriggerMessageComposer);
				serverMessage2.AppendBoolean(false);
				serverMessage2.AppendInt32(0);
				serverMessage2.AppendInt32(list.Count);
				foreach (RoomItem current2 in list)
				{
					serverMessage2.AppendUInt(current2.Id);
				}
				serverMessage2.AppendInt32(Item.GetBaseItem().SpriteId);
				serverMessage2.AppendUInt(Item.Id);
				serverMessage2.AppendString(ExtraInfo);
				serverMessage2.AppendInt32(0);
				serverMessage2.AppendInt32(0);
				serverMessage2.AppendInt32(7);
				serverMessage2.AppendInt32(0);
				serverMessage2.AppendInt32(0);
				serverMessage2.AppendInt32(0);
				Session.SendMessage(serverMessage2);
				return;
			}
			case InteractionType.triggergameend:
			{
				ServerMessage serverMessage3 = new ServerMessage(Outgoing.WiredTriggerMessageComposer);
				serverMessage3.AppendBoolean(false);
				serverMessage3.AppendInt32(0);
				serverMessage3.AppendInt32(list.Count);
				foreach (RoomItem current3 in list)
//.........这里部分代码省略.........
开发者ID:kessiler,项目名称:habboServer,代码行数:101,代码来源:InteractorWired.cs

示例6: SerializeGroupInfo

		internal void SerializeGroupInfo(Guild Group, ServerMessage Response, GameClient Session, Room Room, bool NewWindow = false)
		{
            if (Room == null) { return; }
			DateTime dateTime = new DateTime(1970, 1, 1, 0, 0, 0, 0);
			DateTime dateTime2 = dateTime.AddSeconds((double)Group.CreateTime);
			Response.Init(Outgoing.GroupDataMessageComposer);
			Response.AppendUInt(Group.Id);
			Response.AppendBoolean(true);
			Response.AppendUInt(Group.State);
			Response.AppendString(Group.Name);
			Response.AppendString(Group.Description);
			Response.AppendString(Group.Badge);
			Response.AppendUInt(Group.RoomId);
			Response.AppendString((CyberEnvironment.GetGame().GetRoomManager().GenerateRoomData(Group.RoomId) == null) ? "No room found.." : CyberEnvironment.GetGame().GetRoomManager().GenerateRoomData(Group.RoomId).Name);
			Response.AppendInt32((Group.CreatorId == Session.GetHabbo().Id) ? 3 : (Group.Requests.Contains(Session.GetHabbo().Id) ? 2 : (Group.Members.ContainsKey(Session.GetHabbo().Id) ? 1 : 0)));
			Response.AppendInt32(Group.Members.Count);
			Response.AppendBoolean(Session.GetHabbo().FavouriteGroup == Group.Id);
			Response.AppendString(string.Concat(new object[]
			{
				dateTime2.Day,
				"-",
				dateTime2.Month,
				"-",
				dateTime2.Year
			}));
			Response.AppendBoolean(Group.CreatorId == Session.GetHabbo().Id);
			Response.AppendBoolean(Group.Admins.ContainsKey(Session.GetHabbo().Id));
			Response.AppendString((CyberEnvironment.getHabboForId(Group.CreatorId) == null) ? "" : CyberEnvironment.getHabboForId(Group.CreatorId).Username);
			Response.AppendBoolean(NewWindow);
			Response.AppendBoolean(Group.AdminOnlyDeco == 0u);
			Response.AppendInt32(Group.Requests.Count);
			Response.AppendBoolean(Group.HasForum);
			if (Room != null)
			{
				Room.SendMessage(Response);
				return;
			}
			if (Session != null)
			{
				Session.SendMessage(Response);
			}
		}
开发者ID:kessiler,项目名称:habboServer,代码行数:42,代码来源:GroupManager.cs

示例7: HandlePurchase


//.........这里部分代码省略.........
                        {
                            if (item.Name.Contains("MONTH"))
                            {
                                double num4 = double.Parse(array[3]);
                                dayLength = Math.Ceiling((num4 * 31) - 0.205);
                            }
                            else
                            {
                                if (item.Name.Contains("YEAR"))
                                {
                                    double num5 = double.Parse(array[3]);
                                    dayLength = (num5 * 31 * 12);
                                }
                                else
                                {
                                    dayLength = 31;
                                }
                            }
                        }
                        Session.GetHabbo().GetSubscriptionManager().AddSubscription(dayLength);
                        return;
                    }
                }

                if (item.Name == "room_ad_plus_badge")
                {
                    return;
                }

                if (item.ClubOnly && !Session.GetHabbo().GetSubscriptionManager().HasSubscription)
                {
                    ServerMessage serverMessage = new ServerMessage(Outgoing.CatalogPurchaseNotAllowedMessageComposer);
                    serverMessage.AppendInt32(1);
                    Session.SendMessage(serverMessage);
                    return;
                }
                else if (item.Name.Contains("guild_forum"))
                {
                    uint GroupId;
                    if (!uint.TryParse(ExtraData, out GroupId))
                    {
                        Session.SendNotif("Your group forum couldn't be created by an unknown error. Please report it.");
                        return;
                    }
                    else
                    {
                        Guild Grap = CyberEnvironment.GetGame().GetGroupManager().GetGroup(GroupId);
                        if (Grap == null)
                        {
                            Session.SendNotif("Your group forum couldn't be created by an unknown error. Please report it");
                            return;
                        }
                        else if (!Grap.HasForum && Grap.CreatorId == Session.GetHabbo().Id)
                        {
                            Grap.HasForum = true;
                            CyberEnvironment.GetGame().GetClientManager().SendSuperNotif("Congratulations!", "You successfully purchased a Forum for your group.", "admin", Session, "event:groupforum/" + Grap.Id, "Enter my new Group Forum", false, false);
                            Grap.UpdateForum();
                        }
                        else if (Grap.CreatorId != Session.GetHabbo().Id && !Grap.HasForum)
                        {
                            Session.SendNotif("Uhm, looks like you're not the owner of the group. Anyway, you received a Group Forum Terminal, which would work only when the owner of the group buys a forum.");
                        }
                    }
                }
                bool flag = false;
                foreach (uint current in item.Items.Keys)
开发者ID:kessiler,项目名称:habboServer,代码行数:67,代码来源:Catalog.cs

示例8: SaveWired


//.........这里部分代码省略.........

                    case InteractionType.conditionhowmanyusersinroom:
                    case InteractionType.conditionnegativehowmanyusers:
                        {
                            Request.PopWiredInt32();
                            int Minimum = Request.PopWiredInt32();
                            int Maximum = Request.PopWiredInt32();

                            string EI = Minimum + "," + Maximum;
                            WiredItem wired12 = wiredHandler.GetWired(Item);
                            wired12.Items = new List<RoomItem>();
                            wired12.OtherString = EI;
                            wiredHandler.ReloadWired(wired12);
                            break;
                        }

                    case InteractionType.conditionusernotwearingeffect:
                    case InteractionType.conditionuserwearingeffect:
                        {
                            Request.PopWiredInt32();
                            int Effect = Request.PopWiredInt32();
                            WiredItem wired12 = wiredHandler.GetWired(Item);
                            wired12.Items = new List<RoomItem>();
                            wired12.OtherString = Effect.ToString();
                            wiredHandler.ReloadWired(wired12);
                            break;
                        }

                    case InteractionType.conditionuserwearingbadge:
                    case InteractionType.conditionusernotwearingbadge:
                        {
                            Request.PopWiredInt32();
                            string badge = Request.PopFixedString();
                            WiredItem wired12 = wiredHandler.GetWired(Item);
                            wired12.Items = new List<RoomItem>();
                            wired12.OtherString = badge;
                            wiredHandler.ReloadWired(wired12);
                            break;
                        }

                    case InteractionType.conditiondaterangeactive:
                        {
                            Request.PopWiredInt32();
                            int startDate = Request.PopWiredInt32();
                            int endDate = Request.PopWiredInt32();//timestamps

                            WiredItem wired12 = wiredHandler.GetWired(Item);
                            wired12.Items = new List<RoomItem>();
                            wired12.OtherString = startDate + "," + endDate;
                            
                            if (startDate == 0)
                            {
                                wired12.OtherString = "";
                                Session.SendNotif(@"Para poder guardar la fecha debes introducirlo así: <b>YYYY/MM/dd hh:mm</b> o bien <b>dd/MM/YYYY hh:mm</b><br />No especifiques fecha de término si no hay. La hora y los minutos son opcionales. Anímate a arreglarlo.<br /><br /><br />Con cariño,<br /><b>Finn</b>");
                            }

                            wiredHandler.ReloadWired(wired12);
                            break;
                        }

                    case InteractionType.conditionfurnishaveusers:
                    case InteractionType.conditiontriggeronfurni:
                    case InteractionType.conditionfurnihasfurni:
                    case InteractionType.conditionfurnitypematches:
                    case InteractionType.conditionfurnishavenotusers:
                    case InteractionType.conditiontriggerernotonfurni:
                    case InteractionType.conditionfurnihasnotfurni:
                    case InteractionType.conditionfurnitypedontmatch:
                        {
                            Request.PopWiredInt32();
                            Request.PopFixedString();
                            List<RoomItem> furniItems8 = WiredSaver.GetFurniItems(Request, room);
                            WiredItem wired12 = wiredHandler.GetWired(Item);
                            wired12.Items = furniItems8;
                            wiredHandler.ReloadWired(wired12);
                            break;
                        }

                    case InteractionType.actiongivescore:
                        {
                            Request.PopWiredInt32();
                            int ScoreToGive = Request.PopWiredInt32();
                            int MaxTimesPerGame = Request.PopWiredInt32();

                            string NewExtraInfo = (ScoreToGive + "," + MaxTimesPerGame);

                            List<RoomItem> furniItems8 = WiredSaver.GetFurniItems(Request, room);
                            WiredItem wired12 = wiredHandler.GetWired(Item);
                            wired12.Items = furniItems8;
                            wired12.OtherString = NewExtraInfo;
                            wiredHandler.ReloadWired(wired12);
                            break;
                        }


                }
                
                Session.SendMessage(new ServerMessage(Outgoing.SaveWiredMessageComposer));
            }
        }
开发者ID:kessiler,项目名称:habboServer,代码行数:101,代码来源:WiredSaver.cs

示例9: RemoveBadge

		internal void RemoveBadge(string Badge, GameClient Session)
		{
			if (!this.HasBadge(Badge))
			{
				return;
			}
			using (IQueryAdapter queryreactor = CyberEnvironment.GetDatabaseManager().getQueryReactor())
			{
				queryreactor.setQuery("DELETE FROM user_badges WHERE badge_id = @badge AND user_id = " + this.UserId + " LIMIT 1");
				queryreactor.addParameter("badge", Badge);
				queryreactor.runQuery();
			}
			this.Badges.Remove(this.GetBadge(Badge));
			Session.SendMessage(this.Serialize());
		}
开发者ID:kessiler,项目名称:habboServer,代码行数:15,代码来源:BadgeComponent.cs

示例10: GetDisks

		private static void GetDisks(GameClient Session, ClientMessage Message)
		{
			Session.SendMessage(JukeboxComposer.Compose(Session));
		}
开发者ID:kessiler,项目名称:habboServer,代码行数:4,代码来源:SongManager.cs

示例11: GetPlaylist

		private static void GetPlaylist(GameClient Session, ClientMessage Message)
		{
			Room currentRoom = Session.GetHabbo().CurrentRoom;
			if (currentRoom == null || !currentRoom.CheckRights(Session, true, false))
			{
				return;
			}
			Session.SendMessage(JukeboxComposer.Compose(currentRoom.GetRoomMusicController().PlaylistCapacity, currentRoom.GetRoomMusicController().Playlist.Values.ToList<SongInstance>()));
		}
开发者ID:kessiler,项目名称:habboServer,代码行数:9,代码来源:SongManager.cs

示例12: RemoveFromPlaylist

		private static void RemoveFromPlaylist(GameClient Session, ClientMessage Message)
		{
			Room currentRoom = Session.GetHabbo().CurrentRoom;
			if (currentRoom == null || !currentRoom.GotMusicController() || !currentRoom.CheckRights(Session, true, false))
			{
				return;
			}
			SongItem songItem = currentRoom.GetRoomMusicController().RemoveDisk(Message.PopWiredInt32());
			if (songItem == null)
			{
				return;
			}
			Session.GetHabbo().GetInventoryComponent().AddNewItem(songItem.itemID, songItem.baseItem.ItemId, songItem.songID.ToString(), 0u, true, true, 0, 0, "");
			Session.SendMessage(JukeboxComposer.Compose(Session));
			Session.SendMessage(JukeboxComposer.Compose(currentRoom.GetRoomMusicController().PlaylistCapacity, currentRoom.GetRoomMusicController().Playlist.Values.ToList<SongInstance>()));
		}
开发者ID:kessiler,项目名称:habboServer,代码行数:16,代码来源:SongManager.cs

示例13: AddToPlaylist

		private static void AddToPlaylist(GameClient Session, ClientMessage Message)
		{
			Room currentRoom = Session.GetHabbo().CurrentRoom;
			if (currentRoom == null || !currentRoom.CheckRights(Session, true, false) || !currentRoom.GotMusicController() || currentRoom.GetRoomMusicController().PlaylistSize >= currentRoom.GetRoomMusicController().PlaylistCapacity)
			{
				return;
			}
			UserItem item = Session.GetHabbo().GetInventoryComponent().GetItem(Message.PopWiredUInt());
			if (item == null || item.GetBaseItem().InteractionType != InteractionType.musicdisc)
			{
				return;
			}
			SongItem songItem = new SongItem(item);
			int num = currentRoom.GetRoomMusicController().AddDisk(songItem);
			if (num < 0)
			{
				return;
			}
			Session.GetHabbo().GetInventoryComponent().RemoveItem(songItem.itemID, true);
			Session.SendMessage(JukeboxComposer.Compose(currentRoom.GetRoomMusicController().PlaylistCapacity, currentRoom.GetRoomMusicController().Playlist.Values.ToList<SongInstance>()));
		}
开发者ID:kessiler,项目名称:habboServer,代码行数:21,代码来源:SongManager.cs

示例14: GetSongData

		private static void GetSongData(GameClient Session, ClientMessage Message)
		{
			int num = Message.PopWiredInt32();
			List<SongData> list = new List<SongData>();
			checked
			{
				for (int i = 0; i < num; i++)
				{
					SongData song = SongManager.GetSong(Message.PopWiredUInt());
					if (song != null)
					{
						list.Add(song);
					}
				}
				Session.SendMessage(JukeboxComposer.Compose(list));
			}
		}
开发者ID:kessiler,项目名称:habboServer,代码行数:17,代码来源:SongManager.cs

示例15: CancelQuest

		internal void CancelQuest(GameClient Session, ClientMessage Message)
		{
			Quest quest = this.GetQuest(Session.GetHabbo().CurrentQuestId);
			if (quest == null)
			{
				return;
			}
			using (IQueryAdapter queryreactor = CyberEnvironment.GetDatabaseManager().getQueryReactor())
			{
				queryreactor.runFastQuery(string.Concat(new object[]
				{
					"DELETE FROM user_quests WHERE user_id = ",
					Session.GetHabbo().Id,
					" AND quest_id = ",
					quest.Id,
					";UPDATE user_stats SET quest_id=0 WHERE id=",
					Session.GetHabbo().Id
				}));
			}
			Session.GetHabbo().CurrentQuestId = 0u;
			Session.SendMessage(QuestAbortedComposer.Compose());
			this.GetList(Session, null);
		}
开发者ID:kessiler,项目名称:habboServer,代码行数:23,代码来源:QuestManager.cs


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