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


C# Room.SendMessage方法代码示例

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


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

示例1: Execute

        public void Execute(GameClients.GameClient Session, Room Room, string[] Params)
        {
            RoomUser RoomUser = Session.GetHabbo().CurrentRoom.GetRoomUserManager().GetRoomUserByHabbo(Session.GetHabbo().Id);
            if (RoomUser == null)
                return;

            if (!Room.PetMorphsAllowed)
            {
                Session.SendWhisper("The room owner has disabled the ability to use a pet morph in this room.");
                if (Session.GetHabbo().PetId > 0)
                {
                    Session.SendWhisper("Oops, you still have a morph, un-morphing you.");
                    //Change the users Pet Id.
                    Session.GetHabbo().PetId = 0;

                    //Quickly remove the old user instance.
                    Room.SendMessage(new UserRemoveComposer(RoomUser.VirtualId));

                    //Add the new one, they won't even notice a thing!!11 8-)
                    Room.SendMessage(new UsersComposer(RoomUser));
                }
                return;
            }

            if (Params.Length == 1)
            {
                Session.SendWhisper("Oops, you forgot to choose the type of pet you'd like to turn into! Use :pet list to see the availiable morphs!");
                return;
            }

            if (Params[1].ToString().ToLower() == "list")
            {
                Session.SendWhisper("Habbo, Dog, Cat, Terrier, Croc, Bear, Pig, Lion, Rhino, Spider, Turtle, Chick, Frog, Drag, Monkey, Horse, Bunny, Pigeon, Demon and Gnome.");
                return;
            }

            int TargetPetId = GetPetIdByString(Params[1].ToString());
            if (TargetPetId == 0)
            {
                Session.SendWhisper("Oops, couldn't find a pet by that name!");
                return;
            }

            //Change the users Pet Id.
            Session.GetHabbo().PetId = (TargetPetId == -1 ? 0 : TargetPetId);

            //Quickly remove the old user instance.
            Room.SendMessage(new UserRemoveComposer(RoomUser.VirtualId));

            //Add the new one, they won't even notice a thing!!11 8-)
            Room.SendMessage(new UsersComposer(RoomUser));

            //Tell them a quick message.
            if (Session.GetHabbo().PetId > 0)
                Session.SendWhisper("Use ':pet habbo' to turn back into a Habbo!");
        }
开发者ID:BjkGkh,项目名称:Boon,代码行数:56,代码来源:PetCommand.cs

示例2: EnteredRoom

    void EnteredRoom(Room centeredRoom)
    {
        enteringRoom = true;
        if ( currentRoom )
            currentRoom.SendMessage( "RoomLeft", player, SendMessageOptions.DontRequireReceiver );
        currentRoom = centeredRoom;
        AddRoomsToDepth( currentRoom, depthToPreGen );

        visited.Clear ();
        SetLayersOnTree (centeredRoom, 0);
        currentRoom.SendMessage( "RoomEntered", player, SendMessageOptions.DontRequireReceiver );
    }
开发者ID:EddieCameron,项目名称:ManyRoomsTemplate,代码行数:12,代码来源:LevelGen.cs


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