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


C# GameClient.SendNotifWithScroll方法代码示例

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


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

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

示例2: GetInfo

        private static bool GetInfo(GameClient session, IReadOnlyList<string> pms)
        {
            string type = pms[0];

            RoomUser user =
                session.GetHabbo()
                    .CurrentRoom.GetRoomUserManager()
                    .GetRoomUserByHabbo(session.GetHabbo().UserName);
            StringBuilder text = new StringBuilder();
            switch (type)
            {
                case "cache":
                {
                    text.AppendLine("Displaying info of all cached data avaible");
                    text.Append("Users: " + Yupi.UsersCached.Count + '\r');
                    text.Append("Rooms: " + Yupi.GetGame().GetRoomManager().LoadedRooms.Count + '\r');
                    text.Append("Rooms Data: " + Yupi.GetGame().GetRoomManager().LoadedRoomData.Count + '\r');
                    text.Append("Groups: " + Yupi.GetGame().GetGroupManager().Groups.Count + '\r');
                    text.Append("Items: " + Yupi.GetGame().GetItemManager().CountItems() + '\r');
                    text.Append("Catalog Items: " + Yupi.GetGame().GetCatalog().Offers.Count + '\r');

                    session.SendNotifWithScroll(text.ToString());
                    break;
                }
                case "users":
                {
                    text.AppendLine("Displaying info of all users of this room");

                    foreach (RoomUser roomUser in session.GetHabbo().CurrentRoom.GetRoomUserManager().GetRoomUsers())
                        AppendUserInfo(roomUser, text);

                    session.SendNotifWithScroll(text.ToString());
                    break;
                }
                case "user":
                {
                    RoomUser roomUser =
                        session.GetHabbo()
                            .CurrentRoom.GetRoomUserManager()
                            .GetRoomUserByHabbo(session.GetHabbo().LastSelectedUser);
                    if (roomUser == null || roomUser.IsBot || roomUser.GetClient() == null)
                        text.Append("User not found");
                    else AppendUserInfo(roomUser, text);

                    session.SendNotifWithScroll(text.ToString());
                    break;
                }
                case "items":
                {
                    text.AppendLine(
                        $"Displaying info of coordinates: (X/Y)  {user.LastSelectedX}/{user.LastSelectedY}");

                    foreach (
                        RoomItem item in
                            session.GetHabbo()
                                .CurrentRoom.GetGameMap()
                                .GetAllRoomItemForSquare(user.LastSelectedX, user.LastSelectedY))
                    {
                        text.Append($"## itemId: {item.Id}  itemBaseId: {item.GetBaseItem().ItemId} \r");
                        text.Append(
                            $"itemName: {item.GetBaseItem().Name}  itemSpriteId: {item.GetBaseItem().SpriteId} \r");
                        text.Append($"itemInteraction: {item.GetBaseItem().InteractionType} \r");
                        text.Append($"itemInteractionCount: {item.GetBaseItem().Modes} \r");
                        text.Append($"itemPublicName: {item.GetBaseItem().PublicName} \r");
                        text.Append($"X/Y/Z/Rot:  {item.X}/{item.Y}/{item.Z}/{item.Rot}  Height: {item.Height} \r");
                        if (item.GetBaseItem().StackMultipler)
                            text.Append("Heights: " + string.Join("  -  ", item.GetBaseItem().ToggleHeight) + '\r');
                        text.AppendLine(
                            $"Can: {(item.GetBaseItem().Walkable ? "walk" : string.Empty)}  {(item.GetBaseItem().IsSeat ? "sit" : string.Empty)}  {(item.GetBaseItem().Stackable ? "stack" : string.Empty)}");
                    }

                    session.SendNotifWithScroll(text.ToString());
                    break;
                }
            }

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


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