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


C# CharData.Authorized方法代码示例

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


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

示例1: GodMode

        public static void GodMode(CharData ch, string[] str)
        {
            if( ch == null ) return;

            if (ch.IsNPC())
                return;

            if (!ch.Authorized("godmode"))
                return;

            if (ch.HasActionBit(PC.PLAYER_GODMODE))
            {
                ch.RemoveActionBit(PC.PLAYER_GODMODE);
                ch.SendText("God mode off.\r\n");
            }
            else
            {
                ch.SetActionBit(PC.PLAYER_GODMODE);
                ch.SendText("God mode on.\r\n");
            }

            return;
        }
开发者ID:ramseur,项目名称:ModernMUD,代码行数:23,代码来源:Command.cs

示例2: Fog

        /// <summary>
        /// Fog: Immortal command to turn combat vulnerability on or off.
        /// </summary>
        /// <param name="ch"></param>
        /// <param name="str"></param>
        public static void Fog(CharData ch, string[] str)
        {
            if( ch == null ) return;

            if (ch.IsNPC())
            {
                return;
            }
            if (!ch.Authorized("fog"))
            {
                return;
            }
            ch.ToggleActionBit(PC.PLAYER_FOG);
            if (ch.HasActionBit(PC.PLAYER_FOG))
            {
                ch.SendText("Fog is now on.\r\n");
            }
            else
            {
                ch.SendText("Fog is now off.\r\n");
            }
            return;
        }
开发者ID:ramseur,项目名称:ModernMUD,代码行数:28,代码来源:Command.cs

示例3: PlayerTell

        /// <summary>
        /// Command for gods to respond to the players.
        /// </summary>
        /// <param name="ch"></param>
        /// <param name="str"></param>
        public static void PlayerTell(CharData ch, string[] str)
        {
            if( ch == null ) return;

            if (!ch.Authorized("ptell"))
            {
                ch.SendText("&+LYou cannot respond to &+Bpetitions&+L.&n\r\n");
                return;
            }

            if (str.Length < 2)
            {
                ch.SendText("Tell what to who?\r\n");
            }

            /*
            * Can tell to PC's anywhere, but NPC's only in same room.
            */
            CharData victim = ch.GetCharWorld(str[0]);
            if (!victim)
            {
                ch.SendText("They aren't here.\r\n");
                return;
            }

            if (!victim.Socket)
            {
                SocketConnection.Act("$N&n is &+Llinkdead&n.", ch, null, victim, SocketConnection.MessageTarget.character);
                return;
            }

            string text = String.Join(" ", str, 1, (str.Length - 1));
            text = DrunkSpeech.MakeDrunk(text, ch);

            SocketConnection.Act("&n&+rYou tell $N&n&+r '&+R$t&n&+r'&n", ch, text, victim, SocketConnection.MessageTarget.character);
            int position = victim.CurrentPosition;
            victim.CurrentPosition = Position.standing;
            SocketConnection.Act("&n&+r$n&n&+r responds to your petition with '&+R$t&n&+r'&n", ch, text, victim, SocketConnection.MessageTarget.victim);
            string buf = String.Format("&+r{0} responds to {1}'s petition with '&+R{2}&n&+r'&n", ch.Name, victim.Name, text);
            ImmortalChat.SendImmortalChat(ch, ImmortalChat.IMMTALK_PETITION, Limits.LEVEL_AVATAR, buf);
            victim.CurrentPosition = position;
            victim.ReplyTo = ch;

            if (victim.HasActionBit(PC.PLAYER_AFK))
                SocketConnection.Act("Just so you know, $E is &+RAFK&n.", ch, null, victim, SocketConnection.MessageTarget.character);
            else if (victim.HasActionBit(PC.PLAYER_BOTTING))
                SocketConnection.Act("Just so you know, $E is a &+YBOT&n", ch, null, victim, SocketConnection.MessageTarget.character);

            return;
        }
开发者ID:ramseur,项目名称:ModernMUD,代码行数:55,代码来源:Command.cs

示例4: Peace

        /// <summary>
        /// Immortal commnand to stop all fights in the current room.
        /// </summary>
        /// <param name="ch"></param>
        /// <param name="str"></param>
        public static void Peace(CharData ch, string[] str)
        {
            if( ch == null ) return;

            ch = ch.GetChar();

            if (!ch.Authorized("peace"))
            {
                return;
            }

            foreach (CharData roomChar in ch.InRoom.People)
            {
                if (roomChar.Fighting)
                {
                    Combat.StopFighting(roomChar, true);
                }
                roomChar.StopHatingAll();
                Combat.StopHunting(roomChar);
                Combat.StopFearing(roomChar);
            }

            ch.SendText("Done.\r\n");
            return;
        }
开发者ID:ramseur,项目名称:ModernMUD,代码行数:30,代码来源:Command.cs

示例5: NameSucks

        public static void NameSucks(CharData ch, string[] str)
        {
            if( ch == null ) return;

            if (!ch.Authorized("namesucks"))
            {
                return;
            }

            if (str.Length == 0)
            {
                ch.SendText("Whose name sucks?\r\n");
                return;
            }

            if (MUDString.NameContainedIn(str[0], Database.SystemData.BannedNames))
            {
                ch.SendText("That name is already banned.\r\n");
                return;
            }

            Database.SystemData.BannedNames += str[0];
            Database.SystemData.BannedNames += " ";

            string buf = String.Format("{0} is now considered an illegal name.", str[0]);
            SocketConnection.Act(buf, ch, null, null, SocketConnection.MessageTarget.character);
            Log.Trace(ch.Name + ": " + buf);

            Sysdata.Save();
        }
开发者ID:ramseur,项目名称:ModernMUD,代码行数:30,代码来源:Command.cs

示例6: Invis

        /// <summary>
        /// Immortal invisibility command.
        /// </summary>
        /// <param name="ch"></param>
        /// <param name="str"></param>
        public static void Invis(CharData ch, string[] str)
        {
            if( ch == null ) return;

            if (ch.IsNPC())
                return;

            if (!ch.Authorized("wizinvis"))
                return;

            if (ch.HasActionBit(PC.PLAYER_WIZINVIS))
            {
                ch.RemoveActionBit(PC.PLAYER_WIZINVIS);
                ch.SendText("You slowly fade back into existence.\r\n");
                SocketConnection.Act("$n slowly fades into existence.", ch, null, null, SocketConnection.MessageTarget.room);
            }
            else
            {
                ch.SendText("You slowly vanish into thin air.\r\n");
                SocketConnection.Act("$n slowly fades into thin air.", ch, null, null, SocketConnection.MessageTarget.room);
                ch.SetActionBit(PC.PLAYER_WIZINVIS);
            }

            return;
        }
开发者ID:ramseur,项目名称:ModernMUD,代码行数:30,代码来源:Command.cs


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