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


C# RoomUser.IsOwner方法代码示例

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


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

示例1: Handle

        public bool Handle(RoomUser user, Team team, RoomItem item)
        {
            if (user != null && !user.IsBot && user.GetClient() != null)
            {
                if (user.GetClient().GetHabbo().Rank >= 6) // staff can't be kicked
                    return false;

                if (user.IsOwner()) // can't kick room owner
                {
                    user.GetClient().SendillustrationMessage("admin.persistent", "WIRED REACTIE: Gebruiker wegsturen", "Je bent uit de kamer gestuurd door de Wired.<br><br><b>" + message + "</b>\r\r<i>De kamer eigenaar zal niet worden weggestuurd!");
                    return false;
                }

                GenericTriggerWithModes.DoAnimation(this.item);

                user.GetClient().SendillustrationMessage("admin.persistent", user.GetClient().GetHabbo().CurrentRoom.Name, "Je bent uit de kamer gestuurd door de Wired.<br><br><b>" + message);
                ButterflyEnvironment.GetGame().GetRoomManager().GetRoom(user.RoomId).GetRoomUserManager().RemoveUserFromRoom(user.GetClient(), true, false);
                handler.OnEvent(this.item.Id);

                return true;

            }
            return false;
        }
开发者ID:BjkGkh,项目名称:R106,代码行数:24,代码来源:Kick.cs

示例2: UserRoomTimeCycles

        internal void UserRoomTimeCycles(RoomUser roomUsers)
        {
            if (!roomUsers.IsAsleep && (roomUsers.IdleTime >= 600) && !roomUsers.IsBot && !roomUsers.IsPet)
            {
                roomUsers.IsAsleep = true;

                ServerMessage sleepEffectMessage = new ServerMessage(LibraryParser.OutgoingRequest("RoomUserIdleMessageComposer"));
                sleepEffectMessage.AppendInteger(roomUsers.VirtualId);
                sleepEffectMessage.AppendBool(true);
                _userRoom.SendMessage(sleepEffectMessage);
            }

            if (!roomUsers.IsOwner() && (roomUsers.IdleTime >= 300) && !roomUsers.IsBot && !roomUsers.IsPet)
            {
                try
                {
                    GameClient ownerAchievementMessage =
                        Yupi.GetGame().GetClientManager().GetClientByUserId((uint) _userRoom.RoomData.OwnerId);

                    if (ownerAchievementMessage != null)
                        Yupi.GetGame()
                            .GetAchievementManager()
                            .ProgressUserAchievement(ownerAchievementMessage, "ACH_RoomDecoHosting", 1, true);
                }
                catch (Exception)
                {
                    // ignored
                }
            }
        }
开发者ID:bblackv,项目名称:Yupi,代码行数:30,代码来源:RoomUserManager.cs

示例3: UserRoomTimeCycles

        internal void UserRoomTimeCycles(RoomUser RoomUsers)
        {
            if ((!RoomUsers.IsAsleep) && (RoomUsers.IdleTime >= 600) && (!RoomUsers.IsBot) && (!RoomUsers.IsPet))
            {
                RoomUsers.IsAsleep = true;

                ServerMessage SleepEffectMessage = new ServerMessage(LibraryParser.OutgoingRequest("RoomUserIdleMessageComposer"));
                SleepEffectMessage.AppendInteger(RoomUsers.VirtualId);
                SleepEffectMessage.AppendBool(true);
                UserRoom.SendMessage(SleepEffectMessage);

                SleepEffectMessage = null;
            }

            if ((!RoomUsers.IsOwner()) && (RoomUsers.UserTimeInCurrentRoom >= 300) && (!RoomUsers.IsBot) && (!RoomUsers.IsPet))
            {
                GameClient OwnerAchievementMessage = AzureEmulator.GetGame().GetClientManager().GetClientByUserId((uint)UserRoom.RoomData.OwnerId);
                AzureEmulator.GetGame().GetAchievementManager().ProgressUserAchievement(OwnerAchievementMessage, "ACH_RoomDecoHosting", 1, false);

                RoomUsers.UserTimeInCurrentRoom = 0;

                OwnerAchievementMessage = null;
            }
        }
开发者ID:BjkGkh,项目名称:Azure2,代码行数:24,代码来源:RoomUserManager.cs


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