本文整理汇总了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 );
}
}
}
}
示例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 );
}
}
示例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 );
}
示例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 );
}
}