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


C# Player.MutedMessage方法代码示例

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


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

示例1: StaffChat

        internal static void StaffChat( Player player, Command cmd ) {
            if( player.Info.IsMuted ) {
                player.MutedMessage();
                return;
            }

            if( DateTime.UtcNow < player.Info.MutedUntil ) {
                player.Message( "You are muted for another {0:0} seconds.",
                                player.Info.MutedUntil.Subtract( DateTime.UtcNow ).TotalSeconds );
                return;
            }


            Player[] plist = Server.PlayerList;

            if( plist.Length > 0 ) player.Info.LinesWritten++;

            string message = cmd.NextAll();
            if( message != null && message.Trim().Length > 0 ) {
                message = message.Trim();
                if( player.Can( Permission.UseColorCodes ) && message.Contains( "%" ) ) {
                    message = Color.ReplacePercentCodes( message );
                }
                for( int i = 0; i < plist.Length; i++ ) {
                    if( (plist[i].Can( Permission.ReadStaffChat ) || plist[i] == player) && !plist[i].IsIgnoring( player.Info ) ) {
                        plist[i].Message( "{0}(staff){1}{0}: {2}", Color.PM, player.GetClassyName(), message );
                    }
                }
            }
        }
开发者ID:fragmer,项目名称:fCraft,代码行数:30,代码来源:ChatCommands.cs

示例2: Say

        internal static void Say( Player player, Command cmd ) {
            if( player.Info.IsMuted ) {
                player.MutedMessage();
                return;
            }

            if( player.Can( Permission.Say ) ) {
                string msg = cmd.NextAll();
                if( player.Can( Permission.UseColorCodes ) && msg.Contains( "%" ) ) {
                    msg = Color.ReplacePercentCodes( msg );
                }
                if( msg != null && msg.Trim().Length > 0 ) {
                    player.Info.LinesWritten++;
                    Server.SendToAllExceptIgnored( player, "&Y{0}", null, msg.Trim() );
                    IRC.SendAction( String.Format( "&Y{0}", msg.Trim() ) );
                } else {
                    cdSay.PrintUsage( player );
                }
            } else {
                player.NoAccessMessage( Permission.Say );
            }
        }
开发者ID:fragmer,项目名称:fCraft,代码行数:22,代码来源:ChatCommands.cs

示例3: Roll

        internal static void Roll( Player player, Command cmd ) {
            if( player.Info.IsMuted ) {
                player.MutedMessage();
                return;
            }

            Random rand = new Random();
            int min = 1, max = 100, t1;
            if( cmd.NextInt( out t1 ) ) {
                int t2;
                if( cmd.NextInt( out t2 ) ) {
                    if( t2 < t1 ) {
                        min = t2;
                        max = t1;
                    } else {
                        min = t1;
                        max = t2;
                    }
                } else if( t1 >= 1 ) {
                    max = t1;
                }
            }
            int num = rand.Next( min, max + 1 );
            Server.SendToAll( "{0}{1} rolled {2} ({3}...{4})",
                              player.GetClassyName(), Color.Silver, num, min, max );
        }
开发者ID:fragmer,项目名称:fCraft,代码行数:26,代码来源:ChatCommands.cs

示例4: Me

        internal static void Me( Player player, Command cmd ) {
            if( player.Info.IsMuted ) {
                player.MutedMessage();
                return;
            }

            string msg = cmd.NextAll().Trim();
            if( msg.Length > 0 ) {
                player.Info.LinesWritten++;
                if( player.Can( Permission.UseColorCodes ) && msg.Contains( "%" ) ) {
                    msg = Color.ReplacePercentCodes( msg );
                }
                string message = String.Format( "{0}*{1} {2}", Color.Me, player.Name, msg );
                Server.SendToAll( message );
                IRC.SendChannelMessage( message );
            }
        }
开发者ID:fragmer,项目名称:fCraft,代码行数:17,代码来源:ChatCommands.cs


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