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


C# GameClient.SendMessage方法代码示例

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


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

示例1: SellItem

        internal static void SellItem(GameClient Session, uint ItemId, int SellingPrice)
        {
            UserItem item = Session.GetHabboDataContainer().GetInventoryComponent().GetItem(ItemId);

            if (item == null || SellingPrice > 10000 || !CanSellItem(item))
            {
                ServerMessage message = PacketHandelingManager.GetRecycledItem(OutputCode.MarketplaceMakeOfferResult);
                message.AddInt32(0);
                Session.SendMessage(message);
            }
            else
            {
                int comissionPrice = CalculateComissionPrice(SellingPrice);
                int totalPrice = SellingPrice + comissionPrice;
                int itemType = (item.GetBaseItem().Type == 'i') ? 2 : 1;

                using (IQueryAdapter dbClient = ButterflyEnvironment.GetDatabaseManager().getQueryreactor())
                {
                    dbClient.setQuery("INSERT INTO catalog_marketplace_offers (item_id,user_id,asking_price,total_price,public_name,sprite_id,item_type,timestamp,extra_data) VALUES (" + item.BaseItemID + "," + Session.GetHabbo().Id + "," + SellingPrice + "," + totalPrice + ",@public_name," + item.GetBaseItem().SpriteId + "," + itemType + "," + ButterflyEnvironment.GetUnixTimestamp() + ",@extra_data)");
                    dbClient.addParameter("public_name", item.GetBaseItem().PublicName);
                    dbClient.addParameter("extra_data", item.extraData);
                    dbClient.runQuery();
                }

                Session.GetHabboDataContainer().GetInventoryComponent().RemoveItem(ItemId, true);
                Session.GetHabboDataContainer().GetInventoryComponent().RunDBUpdate();

                ServerMessage message = PacketHandelingManager.GetRecycledItem(OutputCode.MarketplaceMakeOfferResult);
                message.AddInt32(1);
                Session.SendMessage(message);
            }
        }
开发者ID:BjkGkh,项目名称:R106,代码行数:32,代码来源:Marketplace.cs

示例2: DoTrigger

          protected override void DoTrigger(GameClient Session, RoomItem Item, int Request, bool UserHasRights)
          {
              ServerMessage message = PacketHandelingManager.GetRecycledItem(OutputCode.WiredFurniActionEvent);
              message.AddBoolean(false);
              message.AddInt32(0);
              message.AddInt32(0);
              message.AddInt32(Item.GetBaseItem().SpriteId);
              message.AddUInt32(Item.Id);

              if (Item.wiredHandler != null)
              {
                  Kick handler = (Kick)Item.wiredHandler;
                  message.AddString(handler.message);
              }
              else
              {
                  message.AddString(string.Empty);
              }

              message.AddInt32(0);
              message.AddInt32(0);
              message.AddInt32(7);
              message.AddInt32(0);
              message.AddInt32(0);
              message.AddString(string.Empty);

              Session.SendMessage(message);
          }
开发者ID:BjkGkh,项目名称:R106,代码行数:28,代码来源:ActionKickUserWired.cs

示例3: TryRedeemVoucher

        internal static void TryRedeemVoucher(GameClient Session, string Code)
        {
            if (!IsValidCode(Code))
            {
                ServerMessage Error = new ServerMessage(213);
                Error.AppendRawInt32(1);
                Session.SendMessage(Error);
                return;
            }

            int Value = GetVoucherValue(Code);

            TryDeleteVoucher(Code);

            Session.GetHabbo().Credits += Value;
            Session.GetHabbo().UpdateCreditsBalance();

            Session.SendMessage(new ServerMessage(212));
        }
开发者ID:habb0,项目名称:Bfly,代码行数:19,代码来源:VoucherHandler.cs

示例4: SendChatMessage

 private static void SendChatMessage(GameClient GetClient, string Message, int Type)
 {
     ServerMessage TellMsg = PacketHandelingManager.GetRecycledItem(OutputCode.WhisperMessageEvent);
     TellMsg.AddInt32(GetClient.GetHabbo().CurrentRoom.GetRoomUserManager().GetRoomUserByHabbo(GetClient.GetHabbo().Username).VirtualId);
     TellMsg.AddString(Message);
     TellMsg.AddInt32(0);
     TellMsg.AddInt32(0);
     TellMsg.AddInt32(Type);
     TellMsg.AddInt32(0);
     GetClient.SendMessage(TellMsg);
 }
开发者ID:BjkGkh,项目名称:R106,代码行数:11,代码来源:ChatCommandHandler.cs

示例5: TryRedeemVoucher

        internal static void TryRedeemVoucher(GameClient Session, string Code)
        {
            if (!IsValidCode(Code))
            {
                ServerMessage Error = PacketHandelingManager.GetRecycledItem(OutputCode.RedeeminvalidcodeErrorMessageComposer);
                Error.AddString("1");
                Session.SendMessage(Error);
                return;
            }

            int Value = GetVoucherValue(Code);

            TryDeleteVoucher(Code);

            Session.GetHabbo().Diamonds += Value;
            Session.GetHabboDataContainer().StoreDiamondsNow();
            Session.GetHabboDataContainer().SynchronizeDiamondBalance();
            Session.GetHabboDataContainer().UpdateActivityPointsBalance();

            ServerMessage Succesfull = PacketHandelingManager.GetRecycledItem(OutputCode.RedeemSuccesfullMessageComposer);
            Succesfull.AddInt32(0);
            Session.SendMessage(Succesfull);
        }
开发者ID:BjkGkh,项目名称:R106,代码行数:23,代码来源:VoucherHandler.cs

示例6: GetList

 internal void GetList(GameClient Session, ClientMessage Message)
 {
     Session.SendMessage(AchievementListComposer.Compose(Session, Achievements.Values.ToList()));
 }
开发者ID:habb0,项目名称:Bfly,代码行数:4,代码来源:AchievementManager.cs

示例7: GetSongData

        private static void GetSongData(GameClient Session, ClientMessage Message)
        {
            int Amount = Message.PopWiredInt32();
            List<SongData> Songs = new List<SongData>();

            for (int i = 0; i < Amount; i++)
            {
                SongData Song = GetSong(Message.PopWiredUInt());

                if (Song == null)
                    continue;

                Songs.Add(Song);
            }

            Session.SendMessage(JukeboxComposer.Compose(Songs));
        }
开发者ID:habb0,项目名称:Bfly,代码行数:17,代码来源:SongManager.cs

示例8: OnTrigger

        internal override void OnTrigger(GameClient Session, RoomItem Item, int Request, bool UserHasRights)
        {
            if (Session == null || Item == null)
                return;

            if (!UserHasRights)
                return;

            switch (Item.GetBaseItem().InteractionType)
            {
                // TO-REVIEW
                #region Triggers

                case InteractionType.triggerwalkonfurni:
                    {
                        ServerMessage message = new ServerMessage(651);
                        message.AppendBoolean(false);
                        message.AppendInt32(5);
                        message.AppendBoolean(false);
                        message.AppendInt32(Item.GetBaseItem().SpriteId);
                        message.AppendUInt(Item.Id);
                        message.AppendByte(2);

                        message.AppendBoolean(false);
                        message.AppendInt32(8);
                        message.AppendBoolean(false);
                        message.AppendBoolean(false);
                        message.AppendBoolean(false);
                        message.AppendByte(2);

                        Session.SendMessage(message);
                        break;
                    }

                case InteractionType.triggergamestart:
                    {
                        ServerMessage Message = new ServerMessage(650);
                        Message.AppendInt32(0);
                        Message.AppendInt32(5);
                        Message.AppendInt32(0);
                        Message.AppendInt32(Item.GetBaseItem().SpriteId);
                        Message.AppendInt32((int)Item.Id);
                        Message.AppendStringWithBreak("HHPBH");
                        Session.SendMessage(Message);
                        /*
                        ServerMessage message = new ServerMessage(
                            );
                        message.AppendBoolean(false);
                        message.AppendBoolean(false);
                        message.AppendBoolean(false);
                        message.AppendInt32(Item.GetBaseItem().SpriteId);
                        message.AppendUInt(Item.Id);
                        message.AppendByte(2);
                        message.AppendBoolean(false);
                        message.AppendBoolean(false);
                        message.AppendInt32(8);
                        message.AppendBoolean(false);
                        message.AppendByte(2);

                        Session.SendMessage(message);*/
                        break;
                    }

                case InteractionType.triggerroomenter:
                    {
                        ServerMessage message = new ServerMessage(650);
                        message.AppendBoolean(false);
                        message.AppendBoolean(false);
                        message.AppendBoolean(false);
                        message.AppendInt32(Item.GetBaseItem().SpriteId);
                        message.AppendUInt(Item.Id);

                        message.AppendByte(2);
                        message.AppendBoolean(false);
                        message.AppendBoolean(false);
                        message.AppendInt32(7);
                        message.AppendBoolean(false);
                        message.AppendByte(2);

                        Session.SendMessage(message);
                        break;
                    }

                case InteractionType.triggergameend:
                    {
                        ServerMessage message = new ServerMessage(650);
                        message.AppendBoolean(false);
                        message.AppendBoolean(false);
                        message.AppendBoolean(false);
                        message.AppendInt32(Item.GetBaseItem().SpriteId);
                        message.AppendUInt(Item.Id);

                        message.AppendByte(2);
                        message.AppendBoolean(false);
                        message.AppendBoolean(false);
                        message.AppendInt32(8);
                        message.AppendBoolean(false);
                        message.AppendByte(2);

                        Session.SendMessage(message);
//.........这里部分代码省略.........
开发者ID:habb0,项目名称:Bfly,代码行数:101,代码来源:FurniInteractor.cs

示例9: AddUserToRoom

        internal void AddUserToRoom(GameClient Session, bool Spectator)
        {
            if (userCount >= room.UsersMax && Session.GetHabbo().Rank < 2)
            {
                ServerMessage message = PacketHandelingManager.GetRecycledItem(OutputCode.CantConnectMessageEvent);
                message.AddInt32(1);
                Session.SendMessage(message);

                message = PacketHandelingManager.GetRecycledItem(OutputCode.CloseConnectionMessageEvent);
                Session.SendMessage(message);
                return;
            }

            RoomUser user = new RoomUser(Session.GetHabbo().Id, Session.GetHabbo().Username, room.RoomId, primaryPrivateUserID++, room, Spectator);

            if (user == null || user.GetClient() == null)
                return; // added 01/10/15

            user.userID = Session.GetHabbo().Id;

            string username = Session.GetHabbo().Username;
            uint userID = user.userID;

            if (usersByUsername.ContainsKey(username.ToLower()))
                usersByUsername.Remove(username.ToLower());

            if (usersByUserID.ContainsKey(userID))
                usersByUserID.Remove(userID);

            usersByUsername.Add(Session.GetHabbo().Username.ToLower(), user);
            usersByUserID.Add(Session.GetHabbo().Id, user);

            user.InternalRoomID = AddRoomUser(user);

            Session.GetHabbo().CurrentRoomId = room.RoomId;

            if (user.GetClient().GetHabbo().Rank == 3)
                user.GetClient().GetHabboDataContainer().GetAvatarEffectsInventoryComponent().ApplyCustomEffect(178);
        }
开发者ID:BjkGkh,项目名称:R106,代码行数:39,代码来源:RoomUserManager.cs

示例10: ProgressUserQuest

        internal void ProgressUserQuest(GameClient Session, QuestType QuestType, uint EventData = 0)
        {
            if (Session == null || Session.GetHabbo() == null || Session.GetHabbo().CurrentQuestId <= 0)
                return;

            Quest UserQuest = GetQuest(Session.GetHabbo().CurrentQuestId);

            if (UserQuest == null || UserQuest.GoalType != QuestType)
                return;

            int CurrentProgress = Session.GetHabbo().GetQuestProgress(UserQuest.Id);
            int NewProgress = CurrentProgress;
            bool PassQuest = false;

            switch (QuestType)
            {
                default:

                    NewProgress++;

                    if (NewProgress >= UserQuest.GoalData)
                        PassQuest = true;

                    break;

                case QuestType.EXPLORE_FIND_ITEM:

                    if (EventData != UserQuest.GoalData)
                        return;

                    NewProgress = (int)UserQuest.GoalData;
                    PassQuest = true;
                    break;
            }

            using (IQueryAdapter dbClient = ButterflyEnvironment.GetDatabaseManager().getQueryreactor())
            {
                dbClient.runFastQuery("UPDATE user_quests SET progress = " + NewProgress + " WHERE user_id = " + Session.GetHabbo().Id + " AND quest_id =  " + UserQuest.Id);

                if (PassQuest)
                    dbClient.runFastQuery("UPDATE users SET currentquestid = 0 WHERE id = " + Session.GetHabbo().Id);
            }

            Session.GetHabbo().quests[Session.GetHabbo().CurrentQuestId] = NewProgress;
            Session.SendMessage(QuestStartedComposer.Compose(Session, UserQuest));

            if (PassQuest)
            {
                Session.GetHabbo().CurrentQuestId = 0;
                Session.GetHabbo().LastCompleted = UserQuest.Id;
                Session.SendMessage(QuestCompletedComposer.Compose(Session, UserQuest));
                Session.GetHabbo().ActivityPoints += UserQuest.Reward;
                Session.GetHabboDataContainer().UpdateActivityPointsBalance();
                GetList(Session, null);
            }
        }
开发者ID:BjkGkh,项目名称:R106,代码行数:56,代码来源:QuestManager.cs

示例11: GetCurrentQuest

        internal void GetCurrentQuest(GameClient Session, ClientMessage Message)
        {
            if (!Session.GetHabbo().InRoom)
                return;

            Quest UserQuest = GetQuest(Session.GetHabbo().LastCompleted);
            Quest NextQuest = GetNextQuestInSeries(UserQuest.Category, UserQuest.Number + 1);

            if (NextQuest == null)
                return;

            using (IQueryAdapter dbClient = ButterflyEnvironment.GetDatabaseManager().getQueryreactor())
            {
                dbClient.runFastQuery("REPLACE INTO user_quests VALUES (" + Session.GetHabbo().Id + ", " + NextQuest.Id + ", 0)");
                dbClient.runFastQuery("UPDATE users SET currentquestid = " + NextQuest.Id + " WHERE id = " + Session.GetHabbo().Id);
            }

            Session.GetHabbo().CurrentQuestId = NextQuest.Id;
            GetList(Session, null);
            Session.SendMessage(QuestStartedComposer.Compose(Session, NextQuest));
        }
开发者ID:BjkGkh,项目名称:R106,代码行数:21,代码来源:QuestManager.cs

示例12: GetList

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

示例13: SerializeRights

		internal void SerializeRights(GameClient session)
		{
			if (CheckRights(session, true))
			{
				ServerMessage message = PacketHandelingManager.GetRecycledItem(OutputCode.YouAreControllerMessageEvent);
				message.AddInt32(4);
				session.SendMessage(message);
				message = PacketHandelingManager.GetRecycledItem(OutputCode.YouAreOwnerMessageEvent);
				session.SendMessage(message);
			}
			else if (CheckRights(session))
			{
				ServerMessage message = PacketHandelingManager.GetRecycledItem(OutputCode.YouAreControllerMessageEvent);
				message.AddInt32(1);
				session.SendMessage(message);
			}
		}
开发者ID:BjkGkh,项目名称:R106,代码行数:17,代码来源:Room.cs

示例14: SerializeRoomLayout

		internal void SerializeRoomLayout(GameClient session)
		{
			ServerMessage message;

			if (Wallpaper != "0.0")
			{
				message = PacketHandelingManager.GetRecycledItem(OutputCode.RoomPropertyMessageEvent);
				message.AddString("wallpaper");
				message.AddString(Wallpaper);
				session.SendMessage(message);
			}

			if (Floor != "0.0")
			{
				message = PacketHandelingManager.GetRecycledItem(OutputCode.RoomPropertyMessageEvent);
				message.AddString("floor");
				message.AddString(Floor);
				session.SendMessage(message);
			}

			message = PacketHandelingManager.GetRecycledItem(OutputCode.RoomPropertyMessageEvent);
			message.AddString("landscape");
			message.AddString(Landscape);
			session.SendMessage(message);
		}
开发者ID:BjkGkh,项目名称:R106,代码行数:25,代码来源:Room.cs

示例15: GiveBadge

        internal void GiveBadge(int ID, string Badge, Boolean InDatabase, GameClient Session)
        {
            if (HasBadge(Badge))
                return;

            if (InDatabase)
            {
                using (IQueryAdapter dbClient = ButterflyEnvironment.GetDatabaseManager().getQueryreactor())
                {
                    dbClient.setQuery("INSERT INTO `user_badges` (user_id,badge_id,badge_slot) VALUES (" + UserId + ",@badge," + 0 + ")");
                    dbClient.addParameter("badge", Badge);
                    dbClient.runQuery();
                }
            }

            Badges.Add(new Badge(Badge, 0));

            Session.SendMessage(Serialize());
            UnseenBadge(ID, 1);
        }
开发者ID:BjkGkh,项目名称:R106,代码行数:20,代码来源:BadgeComponent.cs


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