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


C# GameClient.SendMessage方法代码示例

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


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

示例1: GiveBadge

        /// <summary>
        ///     Gives the badge.
        /// </summary>
        /// <param name="badge">The badge.</param>
        /// <param name="inDatabase">if set to <c>true</c> [in database].</param>
        /// <param name="session">The session.</param>
        /// <param name="wiredReward">if set to <c>true</c> [wired reward].</param>
        internal void GiveBadge(string badge, bool inDatabase, GameClient session, bool wiredReward = false)
        {
            if (wiredReward)
                session.SendMessage(SerializeBadgeReward(!HasBadge(badge)));

            if (HasBadge(badge))
                return;

            if (inDatabase)
            {
                using (IQueryAdapter queryReactor = Yupi.GetDatabaseManager().GetQueryReactor())
                {
                    queryReactor.SetQuery(
                        string.Concat("INSERT INTO users_badges (user_id,badge_id,badge_slot) VALUES (", _userId,
                            ",@badge,", 0, ")"));

                    queryReactor.AddParameter("badge", badge);
                    queryReactor.RunQuery();
                }
            }

            BadgeList.Add(badge, new Badge(badge, 0));

            session.SendMessage(SerializeBadge(badge));
            session.SendMessage(Update(badge));
        }
开发者ID:AngelRmz,项目名称:Yupi,代码行数:33,代码来源:UserBadgeManager.cs

示例2: Execute

        public override bool Execute(GameClient client, string[] pms)
        {
            ServerMessage message =
                new ServerMessage(LibraryParser.OutgoingRequest("SuperNotificationMessageComposer"));

            message.AppendString("Yupi");
            message.AppendInteger(4);
            message.AppendString("title");
            message.AppendString("Yupi");
            message.AppendString("message");
            StringBuilder info = new StringBuilder();
            info.Append("<h5><b>Yupi - Based on Azure Emulator</b><h5></br></br>");
            info.Append("<br />");
            info.AppendFormat(
                "<b><br />Developed by:</b> <br />Kessiler Rodrigues (Kessiler)<br />Claudio Santoro (sant0ro/bi0s) <br />Rafael Oliveira (iPlezier) <br /><br /> ");
            info.AppendFormat(
                "<b>Thanks to:</b> <br />Jamal, Mike Santifort, Martinmine, Rockster, The old Azure Team, Bruna F., and to all people that uses Yupi.<br /> <br /> ");
            info.AppendFormat("<b>Warning:</b><br />1. This emulator was planned to be used for ManiaHotel (maniahotel.com.br)  <br />2. Please don't sell this emulator or earn money with it<br />3. All rights reserved to Sulake Corporation Oy<br />4. All Emulator rights for Mania Dev<br />");
            message.AppendString(info.ToString());
            message.AppendString("linkUrl");
            message.AppendString("event:");
            message.AppendString("linkTitle");
            message.AppendString("ok");
            client.SendMessage(message);

            return true;
        }
开发者ID:sgf,项目名称:Yupi,代码行数:27,代码来源:About.cs

示例3: Execute

 public override bool Execute(GameClient session, string[] pms)
 {
     Room room = session.GetHabbo().CurrentRoom;
     foreach (
         Pet pet in
             room.GetRoomUserManager().GetPets().Where(pet => pet.OwnerId == session.GetHabbo().Id))
     {
         session.GetHabbo().GetInventoryComponent().AddPet(pet);
         room.GetRoomUserManager().RemoveBot(pet.VirtualId, false);
     }
     session.SendMessage(session.GetHabbo().GetInventoryComponent().SerializePetInventory());
     return true;
 }
开发者ID:sgf,项目名称:Yupi,代码行数:13,代码来源:PickPets.cs

示例4: OnUserWalk

        public override void OnUserWalk(GameClient session, RoomItem item, RoomUser user)
        {
            if (item == null || user == null)
                return;

            string[] data = item.ExtraData.Split(Convert.ToChar(9));

            if (item.ExtraData == "" || data.Length < 4)
                return;

            ServerMessage message = new ServerMessage(LibraryParser.OutgoingRequest("InternalLinkMessageComposer"));

            message.AppendString(data[3]);
            session.SendMessage(message);
        }
开发者ID:sgf,项目名称:Yupi,代码行数:15,代码来源:InteractorWalkInternalLink.cs

示例5: Execute

        public override bool Execute(GameClient session, string[] pms)
        {
            if (ServerExtraSettings.NewPageCommands)
            {
                session.SendMessage(StaticMessage.NewWayToOpenCommandsList);
                return true;
            }

            string commandList;
            if (pms.Length == 0)
            {
                commandList =
                    CommandsManager.CommandsDictionary.Where(
                        command => CommandsManager.CanUse(command.Value.MinRank, session))
                        .Aggregate(string.Empty,
                            (current, command) =>
                                current + command.Value.Usage + " - " + command.Value.Description + "\n");
            }
            else
            {
                if (pms[0].Length == 1)
                {
                    commandList =
                        CommandsManager.CommandsDictionary.Where(
                            command =>
                                command.Key.StartsWith(pms[0]) && CommandsManager.CanUse(command.Value.MinRank, session))
                            .Aggregate(string.Empty,
                                (current, command) =>
                                    current + command.Value.Usage + " - " + command.Value.Description + "\n");
                }
                else
                {
                    commandList =
                        CommandsManager.CommandsDictionary.Where(
                            command =>
                                command.Key.Contains(pms[0]) && CommandsManager.CanUse(command.Value.MinRank, session))
                            .Aggregate(string.Empty,
                                (current, command) =>
                                    current + command.Value.Usage + " - " + command.Value.Description + "\n");
                }
            }
            session.SendNotifWithScroll(commandList);

            return true;
        }
开发者ID:weslley17w,项目名称:Yupi,代码行数:45,代码来源:CommandList.cs

示例6: Execute

        public override bool Execute(GameClient session, string[] pms)
        {
            GameClient client = Yupi.GetGame().GetClientManager().GetClientByUserName(pms[0]);
            if (client == null || client.GetHabbo() == null)
            {
                session.SendWhisper(Yupi.GetLanguage().GetVar("user_not_found"));
                return true;
            }
            if (client.GetHabbo().CurrentRoom == null ||
                client.GetHabbo().CurrentRoom == session.GetHabbo().CurrentRoom)
                return false;
            ServerMessage roomFwd =
                new ServerMessage(LibraryParser.OutgoingRequest("RoomForwardMessageComposer"));
            roomFwd.AppendInteger(client.GetHabbo().CurrentRoom.RoomId);
            session.SendMessage(roomFwd);

            return true;
        }
开发者ID:sgf,项目名称:Yupi,代码行数:18,代码来源:FollowUser.cs

示例7: GenerateMessage

        internal static void GenerateMessage(Pet pet, Dictionary<uint, PetCommand> totalPetCommands, Dictionary<uint, PetCommand> petCommands, GameClient owner)
        {
            ServerMessage serverMessage = new ServerMessage(LibraryParser.OutgoingRequest("PetTrainerPanelMessageComposer"));

            serverMessage.AppendInteger(pet.PetId);

            serverMessage.AppendInteger(totalPetCommands.Count);

            foreach (uint sh in totalPetCommands.Keys)
                serverMessage.AppendInteger(sh);

            serverMessage.AppendInteger(petCommands.Count);

            foreach (uint sh in petCommands.Keys)
                serverMessage.AppendInteger(sh);

            owner.SendMessage(serverMessage);
        }
开发者ID:bblackv,项目名称:Yupi,代码行数:18,代码来源:PetCommandPanelComposer.cs

示例8: OnTrigger

        public override void OnTrigger(GameClient session, RoomItem item, int request, bool hasRights)
        {
            Habbo user = session.GetHabbo();
            bool ishc = user.Vip;

            if (!ishc)
            {
                ServerMessage message = new ServerMessage(LibraryParser.OutgoingRequest("CustomUserNotificationMessageComposer"));
                message.AppendInteger(3);
                session.SendMessage(message);
                return;
            }

            if (item?.GetBaseItem() == null || item.GetBaseItem().InteractionType != Interaction.HcGate)
                return;

            uint modes = item.GetBaseItem().Modes - 1;

            if (modes <= 0)
                item.UpdateState(false, true);

            int currentMode;
            int.TryParse(item.ExtraData, out currentMode);
            int newMode;

            if (currentMode <= 0)
                newMode = 1;
            else if (currentMode >= modes)
                newMode = 0;
            else
                newMode = currentMode + 1;

            if (newMode == 0 && !item.GetRoom().GetGameMap().ItemCanBePlacedHere(item.X, item.Y))
                return;

            item.ExtraData = newMode.ToString();
            item.UpdateState();
            item.GetRoom().GetGameMap().UpdateMapForItem(item);
            item.GetRoom()
                .GetWiredHandler()
                .ExecuteWired(Interaction.TriggerStateChanged,
                    item.GetRoom().GetRoomUserManager().GetRoomUserByHabbo(session.GetHabbo().Id), item);
        }
开发者ID:sgf,项目名称:Yupi,代码行数:43,代码来源:InteractorHCGate.cs

示例9: DeliverItems


//.........这里部分代码省略.........
                            case Interaction.PetChick:
                            case Interaction.PetFrog:
                            case Interaction.PetDragon:
                            case Interaction.PetHorse:
                            case Interaction.PetMonkey:
                            case Interaction.PetGnomo:
                            case Interaction.PetMonsterPlant:
                            case Interaction.PetWhiteRabbit:
                            case Interaction.PetEvilRabbit:
                            case Interaction.PetLoveRabbit:
                            case Interaction.PetPigeon:
                            case Interaction.PetEvilPigeon:
                            case Interaction.PetDemonMonkey:
                                string[] petData = extraData.Split('\n');

                                Pet generatedPet = CreatePet(session.GetHabbo().Id, petData[0], item.Name, petData[1],
                                    petData[2]);

                                session.GetHabbo().GetInventoryComponent().AddPet(generatedPet);
                                break;

                            case Interaction.MusicDisc:
                                list.Add(session.GetHabbo()
                                    .GetInventoryComponent()
                                    .AddNewItem(0u, item.Name, extraData, 0u, true, false, 0, 0, songCode));
                                break;

                            case Interaction.PuzzleBox:
                                list.Add(session.GetHabbo()
                                    .GetInventoryComponent()
                                    .AddNewItem(0u, item.Name, extraData, 0u, true, false, limno, limtot));
                                break;

                            case Interaction.RoomBg:
                                UserItem userItem44 = session.GetHabbo()
                                    .GetInventoryComponent()
                                    .AddNewItem(0u, item.Name, extraData, 0u, true, false, 0, 0, string.Empty);
                                uint id44 = userItem44.Id;

                                list.Add(userItem44);

                                using (IQueryAdapter queryreactor3 = Yupi.GetDatabaseManager().GetQueryReactor())
                                    queryreactor3.RunFastQuery($"INSERT INTO items_toners VALUES ({id44},'0',0,0,0)");

                                break;

                            case Interaction.GuildItem:
                            case Interaction.GuildGate:
                            case Interaction.GroupForumTerminal:
                                list.Add(session.GetHabbo()
                                    .GetInventoryComponent()
                                    .AddNewItem(0u, item.Name, "0", Convert.ToUInt32(extraData), true, false, 0, 0,
                                        string.Empty));
                                break;

                            case Interaction.GuildForum:
                                uint groupId;

                                uint.TryParse(extraData, out groupId);

                                Group group = Yupi.GetGame().GetGroupManager().GetGroup(groupId);

                                if (group != null)
                                {
                                    if (group.CreatorId == session.GetHabbo().Id)
                                        group.UpdateForum(true);
                                    else
                                        session.SendNotif(Yupi.GetLanguage().GetVar("user_group_owner_error"));
                                }

                                list.Add(session.GetHabbo()
                                    .GetInventoryComponent()
                                    .AddNewItem(0u, item.Name, "0", Convert.ToUInt32(extraData), true, false, 0, 0,
                                        string.Empty));
                                break;

                            default:
                                list.Add(session.GetHabbo()
                                    .GetInventoryComponent()
                                    .AddNewItem(0u, item.Name, extraData, 0u, true, false, limno, limtot));
                                break;
                        }

                        i++;
                    }

                    return list;
                case 'e':
                    for (int j = 0; j < amount; j++)
                        session.GetHabbo().GetAvatarEffectsInventoryComponent().AddNewEffect(item.SpriteId, 7200, 0);
                    break;
                case 'r':
                    RoomBot bot = BotManager.CreateBotFromCatalog(item.Name, session.GetHabbo().Id);
                    session.GetHabbo().GetInventoryComponent().AddBot(bot);
                    session.SendMessage(session.GetHabbo().GetInventoryComponent().SerializeBotInventory());
                    break;
            }

            return list;
        }
开发者ID:ImNotSatan,项目名称:Yupi,代码行数:101,代码来源:CatalogManager.cs

示例10: EnableNewNavigator

        /// <summary>
        ///     Enables the new navigator.
        /// </summary>
        /// <param name="session">The session.</param>
        internal void EnableNewNavigator(GameClient session)
        {
            ServerMessage navigatorMetaDataParser = new ServerMessage(LibraryParser.OutgoingRequest("NavigatorMetaDataComposer"));

            navigatorMetaDataParser.AppendInteger(4);
            navigatorMetaDataParser.AppendString("official_view");
            navigatorMetaDataParser.AppendInteger(0);
            navigatorMetaDataParser.AppendString("hotel_view");
            navigatorMetaDataParser.AppendInteger(0);
            navigatorMetaDataParser.AppendString("roomads_view");
            navigatorMetaDataParser.AppendInteger(0);
            navigatorMetaDataParser.AppendString("myworld_view");
            navigatorMetaDataParser.AppendInteger(0);
            session.SendMessage(navigatorMetaDataParser);

            ServerMessage navigatorLiftedRoomsParser = new ServerMessage(LibraryParser.OutgoingRequest("NavigatorLiftedRoomsComposer"));
            navigatorLiftedRoomsParser.AppendInteger(NavigatorHeaders.Count);

            foreach (NavigatorHeader navHeader in NavigatorHeaders)
            {
                navigatorLiftedRoomsParser.AppendInteger(navHeader.RoomId);
                navigatorLiftedRoomsParser.AppendInteger(0);
                navigatorLiftedRoomsParser.AppendString(navHeader.Image);
                navigatorLiftedRoomsParser.AppendString(navHeader.Caption);
            }

            session.SendMessage(navigatorLiftedRoomsParser);

            ServerMessage collapsedCategoriesMessageParser = new ServerMessage(LibraryParser.OutgoingRequest("NavigatorCategorys"));

            collapsedCategoriesMessageParser.AppendInteger(FlatCatsCount + 4);

            foreach (PublicCategory flat in PrivateCategories.Values)
                collapsedCategoriesMessageParser.AppendString($"category__{flat.Caption}");

            collapsedCategoriesMessageParser.AppendString("recommended");
            collapsedCategoriesMessageParser.AppendString("new_ads");
            collapsedCategoriesMessageParser.AppendString("staffpicks");
            collapsedCategoriesMessageParser.AppendString("official");
            session.SendMessage(collapsedCategoriesMessageParser);

            ServerMessage searches = new ServerMessage(LibraryParser.OutgoingRequest("NavigatorSavedSearchesComposer"));

            searches.AppendInteger(session.GetHabbo().NavigatorLogs.Count);

            foreach (UserSearchLog navi in session.GetHabbo().NavigatorLogs.Values)
            {
                searches.AppendInteger(navi.Id);
                searches.AppendString(navi.Value1);
                searches.AppendString(navi.Value2);
                searches.AppendString("");
            }

            session.SendMessage(searches);

            ServerMessage packetName = new ServerMessage(LibraryParser.OutgoingRequest("NewNavigatorSizeMessageComposer"));
            UserPreferences pref = session.GetHabbo().Preferences;

            packetName.AppendInteger(pref.NewnaviX);
            packetName.AppendInteger(pref.NewnaviY);
            packetName.AppendInteger(pref.NewnaviWidth);
            packetName.AppendInteger(pref.NewnaviHeight);
            packetName.AppendBool(false);
            packetName.AppendInteger(1);

            session.SendMessage(packetName);
        }
开发者ID:sgf,项目名称:Yupi,代码行数:71,代码来源:HotelBrowserManager.cs

示例11: HandlePurchase

        /// <summary>
        ///     Handles the purchase.
        /// </summary>
        /// <param name="session">The session.</param>
        /// <param name="pageId">The page identifier.</param>
        /// <param name="itemId">The item identifier.</param>
        /// <param name="extraData">The extra data.</param>
        /// <param name="priceAmount">The price amount.</param>
        /// <param name="isGift">if set to <c>true</c> [is gift].</param>
        /// <param name="giftUser">The gift user.</param>
        /// <param name="giftMessage">The gift message.</param>
        /// <param name="giftSpriteId">The gift sprite identifier.</param>
        /// <param name="giftLazo">The gift lazo.</param>
        /// <param name="giftColor">Color of the gift.</param>
        /// <param name="undef">if set to <c>true</c> [undef].</param>
        /// <param name="theGroup">The theGroup.</param>
        internal void HandlePurchase(GameClient session, uint pageId, uint itemId, string extraData, uint priceAmount,
            bool isGift, string giftUser, string giftMessage, int giftSpriteId, int giftLazo, int giftColor, bool undef,
            uint theGroup)
        {
            priceAmount = priceAmount < 1 || priceAmount > 100 ? 1 : priceAmount;

            uint totalPrice = priceAmount, limitedId = 0, limtot = 0;

            if (priceAmount >= 6)
                totalPrice -= Convert.ToUInt32(Math.Ceiling(Convert.ToDouble(priceAmount)/6))*2 - 1;

            if (!Categories.Contains(pageId))
                return;

            CatalogPage catalogPage = GetPage(pageId);

            if (catalogPage == null || !catalogPage.Enabled || !catalogPage.Visible || session?.GetHabbo() == null || catalogPage.MinRank > session.GetHabbo().Rank || catalogPage.Layout == "sold_ltd_items")
                return;

            CatalogItem item = catalogPage.GetItem(itemId);

            if (item == null || session.GetHabbo().Credits < item.CreditsCost || session.GetHabbo().Duckets < item.DucketsCost || session.GetHabbo().Diamonds < item.DiamondsCost || item.Name == "room_ad_plus_badge")
                return;

            #region Habbo Club Purchase

            if (catalogPage.Layout == "vip_buy" || catalogPage.Layout == "club_buy" || HabboClubItems.Contains(item))
            {
                string[] array = item.Name.Split('_');

                double dayLength = 31;

                if (item.Name.Contains("DAY"))
                    dayLength = double.Parse(array[3]);
                else if (item.Name.Contains("MONTH"))
                    dayLength = Math.Ceiling(double.Parse(array[3])*31 - 0.205);
                else if (item.Name.Contains("YEAR"))
                    dayLength = double.Parse(array[3])*31*12;

                session.GetHabbo().GetSubscriptionManager().AddSubscription(dayLength);

                if (item.CreditsCost > 0)
                {
                    session.GetHabbo().Credits -= item.CreditsCost*totalPrice;
                    session.GetHabbo().UpdateCreditsBalance();
                }

                if (item.DucketsCost > 0)
                {
                    session.GetHabbo().Duckets -= item.DucketsCost*totalPrice;
                    session.GetHabbo().UpdateActivityPointsBalance();
                }

                if (item.DiamondsCost > 0)
                {
                    session.GetHabbo().Diamonds -= item.DiamondsCost*totalPrice;
                    session.GetHabbo().UpdateSeasonalCurrencyBalance();
                }

                return;
            }

            #endregion

            #region Is Only for Habbo Club users Check

            if (item.ClubOnly && !session.GetHabbo().GetSubscriptionManager().HasSubscription)
            {
                ServerMessage serverMessage = new ServerMessage(LibraryParser.OutgoingRequest("CatalogPurchaseNotAllowedMessageComposer"));
                serverMessage.AppendInteger(1);
                session.SendMessage(serverMessage);
                return;
            }

            #endregion

            #region Limited Items Purchase

            if (item.IsLimited)
            {
                totalPrice = 1;
                priceAmount = 1;

                if (item.LimitedSelled >= item.LimitedStack)
//.........这里部分代码省略.........
开发者ID:ImNotSatan,项目名称:Yupi,代码行数:101,代码来源:CatalogManager.cs

示例12: ProgressUserAchievement

        /// <summary>
        ///     Progresses the user achievement.
        /// </summary>
        /// <param name="session">The session.</param>
        /// <param name="achievementGroup">The achievement group.</param>
        /// <param name="progressAmount">The progress amount.</param>
        /// <param name="fromZero">if set to <c>true</c> [from zero].</param>
        /// <returns><c>true</c> if XXXX, <c>false</c> otherwise.</returns>
        internal bool ProgressUserAchievement(GameClient session, string achievementGroup, uint progressAmount,
            bool fromZero = false)
        {
            if (Achievements.ContainsKey(achievementGroup) && session?.GetHabbo() != null)
            {
                Achievement achievement = Achievements[achievementGroup];

                Habbo user = session.GetHabbo();

                // Get UserAchievementData, if the user doesn't has the Achievement, create a new.
                UserAchievement userAchievement = user.Achievements.ContainsKey(achievementGroup)
                    ? user.GetAchievementData(achievementGroup)
                    : new UserAchievement(achievementGroup, 0, 0);

                // If is a New Achievement is fromZero
                if (!user.Achievements.ContainsKey(achievementGroup))
                    fromZero = true;

                // If user hasn't the Achievement, after created the new, Must add in Collections.
                if (!user.Achievements.ContainsKey(achievementGroup))
                    user.Achievements.Add(achievementGroup, userAchievement);

                // Get Achievement 
                userAchievement = user.Achievements[achievementGroup];

                // Total Levels from this Achievement
                uint achievementLevelsCount = (uint) achievement.Levels.Count;

                // Get User Achievement Level
                uint achievementCurrentLevel = userAchievement.Level;

                // Get User Achievement Progress
                uint achievementCurrentProgress = userAchievement.Progress;

                // If the next Level is the last level must set to Levels.Count (Ex: 38 Levels => .Count = 37 (Max Level in the Array, but .Count 37 == 38, Soo need put Level - 1)
                uint achievementNextLevel = achievementCurrentLevel + 1 > achievementLevelsCount
                    ? achievementLevelsCount
                    : achievementCurrentLevel + 1;

                // Set Achievement Progress
                uint achievementProgress = achievementCurrentProgress + progressAmount;

                // If he has already the Max, something is wrong.
                if (achievementCurrentLevel == achievementLevelsCount)
                    return false;

                // Get Next Level Data
                AchievementLevel achievementNextLevelData = achievement.Levels[achievementNextLevel];

                // if progress isn't sufficient or, isn't new Achievement
                if (achievementProgress < achievementNextLevelData.Requirement || achievementCurrentLevel >= 1)
                    fromZero = false;

                // If progress is sufficient to next level, or is new Achievement
                if (achievementProgress >= achievementNextLevelData.Requirement || (achievementCurrentLevel < 1))
                    fromZero = true;

                // if is a new level (but level isn't 0)
                if (achievementProgress >= achievementNextLevelData.Requirement)
                    achievementProgress = 0;

                // If is new Level
                if (fromZero)
                {
                    // Set Level
                    userAchievement.SetLevel(achievementNextLevel);

                    // Set Progress
                    userAchievement.SetProgress(achievementProgress);

                    // Give Reward Points
                    user.AchievementPoints += achievementNextLevelData.RewardPoints;
                    user.NotifyNewPixels(achievementNextLevelData.RewardPixels);
                    user.Duckets += achievementNextLevelData.RewardPixels;

                    // Update Points Balance
                    user.UpdateActivityPointsBalance();

                    // Remove old Badge - (Is not problem if is First Level Badge, because if the user hasn't the badg, simply, will not remove.
                    user.GetBadgeComponent()
                        .RemoveBadge(Convert.ToString($"{achievementGroup}{achievementNextLevel - 1}"), session);

                    // Give new Badge
                    user.GetBadgeComponent().GiveBadge($"{achievementGroup}{achievementNextLevel}", true, session);

                    // Update in Database
                    using (IQueryAdapter queryReactor = Yupi.GetDatabaseManager().GetQueryReactor())
                        queryReactor.RunFastQuery(
                            $"REPLACE INTO users_achievements VALUES ('{user.Id}', '{achievementGroup}', '{achievementNextLevel}', '{achievementProgress}')");

                    // Send Unlocked Composer
                    session.SendMessage(AchievementUnlockedComposer.Compose(achievement, achievementNextLevel,
//.........这里部分代码省略.........
开发者ID:ImNotSatan,项目名称:Yupi,代码行数:101,代码来源:AchievementManager.cs

示例13: ActivateQuest

 /// <summary>
 ///     Activates the quest.
 /// </summary>
 /// <param name="session">The session.</param>
 /// <param name="message">The message.</param>
 internal void ActivateQuest(GameClient session, ClientMessage message)
 {
     var quest = GetQuest(message.GetInteger());
     if (quest == null)
         return;
     using (var queryReactor = Yupi.GetDatabaseManager().GetQueryReactor())
     {
         queryReactor.RunFastQuery(string.Concat("REPLACE INTO users_quests_data(user_id,quest_id) VALUES (",
             session.GetHabbo().Id, ", ", quest.Id, ")"));
         queryReactor.RunFastQuery(string.Concat("UPDATE users_stats SET quest_id = ", quest.Id, " WHERE id = ",
             session.GetHabbo().Id));
     }
     session.GetHabbo().CurrentQuestId = quest.Id;
     GetList(session, null);
     session.SendMessage(QuestStartedComposer.Compose(session, quest));
 }
开发者ID:sgf,项目名称:Yupi,代码行数:21,代码来源:QuestManager.cs

示例14: CompleteUserTalent

        /// <summary>
        ///     Completes the user talent.
        /// </summary>
        /// <param name="session">The session.</param>
        /// <param name="talent">The talent.</param>
        internal void CompleteUserTalent(GameClient session, Talent talent)
        {
            if (session?.GetHabbo() == null || session.GetHabbo().CurrentTalentLevel < talent.Level || session.GetHabbo().Talents.ContainsKey(talent.Id))
                return;

            if (!LevelIsCompleted(session, talent.Type, talent.Level))
                return;

            if (!string.IsNullOrEmpty(talent.Prize) && talent.PrizeBaseItem > 0u)
                Yupi.GetGame().GetCatalog().DeliverItems(session, Yupi.GetGame().GetItemManager().GetItem(talent.PrizeBaseItem), 1, string.Empty, 0, 0, string.Empty);

            session.GetHabbo().Talents.Add(talent.Id, new UserTalent(talent.Id, 1));

            using (IQueryAdapter queryReactor = Yupi.GetDatabaseManager().GetQueryReactor())
                queryReactor.RunFastQuery($"REPLACE INTO users_talents VALUES ('{session.GetHabbo().Id}', '{talent.Id}', '1');");

            session.SendMessage(AchievementTalentComposer.Compose(session, talent));

            if (talent.Type == "citizenship")
            {
                switch (talent.Level)
                {
                    case 3:
                        Yupi.GetGame().GetAchievementManager().ProgressUserAchievement(session, "ACH_Citizenship", 1);
                        break;
                    case 4:
                        session.GetHabbo().GetSubscriptionManager().AddSubscription(7);

                        using (IQueryAdapter queryReactor = Yupi.GetDatabaseManager().GetQueryReactor())
                            queryReactor.RunFastQuery($"UPDATE users SET talent_status = 'helper' WHERE id = '{session.GetHabbo().Id}'");
                        break;
                }
            }
        }
开发者ID:sgf,项目名称:Yupi,代码行数:39,代码来源:TalentManager.cs

示例15: GetList

 /// <summary>
 ///     Gets the list.
 /// </summary>
 /// <param name="session">The session.</param>
 /// <param name="message">The message.</param>
 internal void GetList(GameClient session, ClientMessage message)
     => session.SendMessage(AchievementListComposer.Compose(session, Achievements.Values.ToList()));
开发者ID:ImNotSatan,项目名称:Yupi,代码行数:7,代码来源:AchievementManager.cs


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