本文整理汇总了C#中fCraft.Player.MessageMuted方法的典型用法代码示例。如果您正苦于以下问题:C# Player.MessageMuted方法的具体用法?C# Player.MessageMuted怎么用?C# Player.MessageMuted使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类fCraft.Player
的用法示例。
在下文中一共展示了Player.MessageMuted方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SayHandler
static void SayHandler(Player player, CommandReader cmd)
{
if (player.Info.IsMuted)
{
player.MessageMuted();
return;
}
if (player.DetectChatSpam()) return;
if (player.Can(Permission.Say))
{
string msg = cmd.NextAll().Trim();
if (msg.Length > 0)
{
Chat.SendSay(player, msg);
}
else
{
CdSay.PrintUsage(player);
}
}
else
{
player.MessageNoAccess(Permission.Say);
}
}
示例2: BRB
internal static void BRB(Player player, Command cmd)
{
StreamReader streamReader = new StreamReader("plugins/brbMessage.txt");
string message = streamReader.ReadToEnd();
streamReader.Close();
string msg = cmd.NextAll().Trim();
if (player.Info.IsMuted)
{
player.MessageMuted();
return;
}
if (msg.Length > 0)
{
Server.Message("{0}&S &EWill Brb &9({1})",
player.ClassyName, msg);
player.IsAway = true;
return;
}
else
{
Server.Players.Message("&S{0} &EWill Brb &9(" + message + ")", player.ClassyName);
player.IsAway = true;
}
}
示例3: StaffHandler
static void StaffHandler( Player player, Command cmd ) {
if( player.Info.IsMuted ) {
player.MessageMuted();
return;
}
if( player.DetectChatSpam() ) return;
string message = cmd.NextAll().Trim();
if( message.Length > 0 ) {
Chat.SendStaff( player, message );
}
}
示例4: StaffHandler
static void StaffHandler( Player player, Command cmd ) {
if( player.Info.IsMuted ) {
player.MessageMuted();
return;
}
if( player.DetectChatSpam() ) return;
string message = cmd.NextAll().Trim();
if( message.Length > 0 ) {
if( player.Can( Permission.UseColorCodes ) && message.Contains( "%" ) ) {
message = Color.ReplacePercentCodes( message );
}
Chat.SendStaff( player, message );
}
}
示例5: SayHandler
static void SayHandler( Player player, Command cmd ) {
if( player.Info.IsMuted ) {
player.MessageMuted();
return;
}
if( player.DetectChatSpam() ) return;
if( player.Can( Permission.Say ) ) {
string msg = cmd.NextAll().Trim();
if( player.Can( Permission.UseColorCodes ) && msg.Contains( "%" ) ) {
msg = Color.ReplacePercentCodes( msg );
}
if( msg.Length > 0 ) {
Chat.SendSay( player, msg );
} else {
CdSay.PrintUsage( player );
}
} else {
player.MessageNoAccess( Permission.Say );
}
}
示例6: Review
internal static void Review(Player player, Command cmd)
{
if (player.Info.IsMuted)
{
player.MessageMuted();
return;
}
var recepientList = Server.Players.Can(Permission.ReadStaffChat)
.NotIgnoring(player)
.Union(player);
string message = String.Format("{0}&6 would like staff to check their build", player.ClassyName);
recepientList.Message(message);
var ReviewerNames = Server.Players
.CanBeSeen(player)
.Where(r => r.Can(Permission.Promote, player.Info.Rank));
if (ReviewerNames.Count() > 0)
{
player.Message("&WOnline players who can review you: {0}", ReviewerNames.JoinToString(r => String.Format("{0}&S", r.ClassyName)));
return;
}
else
player.Message("&WThere are no players online who can review you. A member of staff needs to be online.");
}
示例7: Away
internal static void Away(Player player, Command cmd)
{
string msg = cmd.NextAll().Trim();
if (player.Info.IsMuted)
{
player.MessageMuted();
return;
}
if (msg.Length > 0)
{
Server.Message("{0}&S &Eis away &9({1})",
player.ClassyName, msg);
player.IsAway = true;
return;
}
else
{
Server.Players.Message("&S{0} &Eis away &9(Away From Keyboard)", player.ClassyName);
player.IsAway = true;
}
}
示例8: GHandler
static void GHandler(Player player, Command cmd)
{
string message = cmd.NextAll();
if (message == "connect")
{
if (player.Can(Permission.ReadAdminChat))
{
if (GlobalChat.GlobalThread.isConnected)
{
player.Message("&c{0}&c is already connected to the LegendCraft Global Chat Network!", ConfigKey.ServerName.GetString());
return;
}
GlobalChat.GlobalThread.GCReady = true;
Server.Message("&eAttempting to connect to LegendCraft Global Chat Network. This may take up to two minutes.");
GlobalChat.Init();
GlobalChat.Start();
return;
}
else
{
player.Message("&eYou don't have the required permissions to do that!");
return;
}
}
if (!GlobalChat.GlobalThread.GCReady)
{
player.Message("&cGlobal Chat is not connected.");
return;
}
var SendList = Server.Players.Where(p => p.GlobalChatAllowed && !p.IsDeaf);
if (message == "disconnect")
{
if (player.Can(Permission.ReadAdminChat))
{
Server.Message("&e{0}&e disconnected {1}&e from the LegendCraft Global Chat Network.", player.ClassyName, ConfigKey.ServerName.GetString());
GlobalChat.GlobalThread.SendChannelMessage("&i" + ConfigKey.ServerName.GetString() + "&i has disconnected from the LegendCraft Global Chat Network.");
GlobalChat.GlobalThread global = new GlobalChat.GlobalThread();
global.DisconnectThread();
return;
}
else
{
player.Message("&eYou don't have the required permissions to do that!");
return;
}
}
if (message == "ignore")
{
if (player.GlobalChatIgnore)
{
player.Message("You are already ignoring global chat!");
return;
}
else
{
player.Message("&eYou are now ignoring global chat. To return to global chat, type /global unignore.");
player.GlobalChatIgnore = true;
return;
}
}
if (message == "unignore")
{
if (player.GlobalChatIgnore)
{
player.Message("You are no longer ignoring global chat.");
player.GlobalChatIgnore = false;
return;
}
else
{
player.Message("&cYou are not currently ignoring global chat!");
return;
}
}
else if (message == "help")
{
player.Message("_LegendCraft GlobalChat Network Help_\n" +
"Ignore: Usage is '/global ignore'. Allows a user to ignore and stop using global chat. Type /global unignore to return to global chat. \n" +
"Unignore: Usage is '/global unignore.' Allows a user to return to global chat. \n" +
"Connect: For admins only. Usage is /global connect. Connects your server to the LegendCraft GlobalChat Network. \n" +
"Disconnect: For admins only. Usage is /global disconnect. Disconnects your server from the LegendCraft GlobalChat Network. \n" +
"Message: Usage is '/global <your message here>'. Will send your message to the rest of the servers connected to GlobalChat.");
return;
}
if (player.Info.IsMuted)
{
player.MessageMuted();
return;
}
else if (!player.GlobalChatAllowed)
{
player.Message("Global Chat Rules: By using global chat, you automatically agree to these terms and conditions. Failure to agree may result in a global chat kick or ban. \n" +
"1) No Spamming or deliberate insulting. \n" +
"2) No advertising of any server or other minecraft related/unrelated service or product. \n" +
"3) No discussion of illegal or partially illegal tasks is permitted. \n" +
"4) Connecting bots to the Global Chat Network is not permitted, unless approved by the LegendCraft Team. \n" +
"&aYou are now permitted to use /global on this server.");
//.........这里部分代码省略.........
示例9: WarningHandler
private static void WarningHandler(Player player, CommandReader cmd) {
if (player.Info.IsMuted) {
player.MessageMuted();
return;
}
if (player.DetectChatSpam())
return;
string searchplayer = cmd.Next();
string warning = cmd.NextAll().Trim();
Player other = Server.FindPlayerOrPrintMatches(player, searchplayer, SearchOptions.Default);
if (other == player) {
player.Message("Cannot warn yourself");
return;
}
if (!(cmd.Count <= 2) && cmd.IsConfirmed) {
Server.Players.Message("&f{0} &chas warned &f{1} &cto &4{2}", player.ClassyName, other.ClassyName, warning);
return;
}
if (other != null) {
player.Confirm(cmd, "Your warning will display as: \"&f{0} &chas warned &f{1} &cto &4{2}\"", player.ClassyName, other.ClassyName, warning);
}
}
示例10: TimerHandler
static void TimerHandler( Player player, Command cmd ) {
string param = cmd.Next();
// List timers
if( param == null ) {
ChatTimer[] list = ChatTimer.TimerList.OrderBy( timer => timer.TimeLeft ).ToArray();
if( list.Length == 0 ) {
player.Message( "No timers running." );
} else {
player.Message( "There are {0} timers running:", list.Length );
foreach( ChatTimer timer in list ) {
player.Message( " #{0} \"{1}&S\" (started by {2}, {3} left)",
timer.Id, timer.Message, timer.StartedBy, timer.TimeLeft.ToMiniString() );
}
}
return;
}
// Abort a timer
if( param.Equals( "abort", StringComparison.OrdinalIgnoreCase ) ) {
int timerId;
if( cmd.NextInt( out timerId ) ) {
ChatTimer timer = ChatTimer.FindTimerById( timerId );
if( timer == null || !timer.IsRunning ) {
player.Message( "Given timer (#{0}) does not exist.", timerId );
} else {
timer.Stop();
string abortMsg = String.Format( "&Y(Timer) {0}&Y aborted a timer with {1} left: {2}",
player.ClassyName, timer.TimeLeft.ToMiniString(), timer.Message );
Chat.SendSay( player, abortMsg );
}
} else {
CdTimer.PrintUsage( player );
}
return;
}
// Start a timer
if( player.Info.IsMuted ) {
player.MessageMuted();
return;
}
if( player.DetectChatSpam() ) return;
TimeSpan duration;
if( !param.TryParseMiniTimespan( out duration ) ) {
CdTimer.PrintUsage( player );
return;
}
if( duration > DateTimeUtil.MaxTimeSpan ) {
player.MessageMaxTimeSpan();
return;
}
if( duration < ChatTimer.MinDuration ) {
player.Message( "Timer: Must be at least 1 second." );
return;
}
string sayMessage;
string message = cmd.NextAll();
if( String.IsNullOrEmpty( message ) ) {
sayMessage = String.Format( "&Y(Timer) {0}&Y started a {1} timer",
player.ClassyName,
duration.ToMiniString() );
} else {
sayMessage = String.Format( "&Y(Timer) {0}&Y started a {1} timer: {2}",
player.ClassyName,
duration.ToMiniString(),
message );
}
Chat.SendSay( player, sayMessage );
ChatTimer.Start( duration, message, player.Name );
}
示例11: MeHandler
static void MeHandler( Player player, Command cmd ) {
if( player.Info.IsMuted ) {
player.MessageMuted();
return;
}
if( player.DetectChatSpam() ) return;
string msg = cmd.NextAll().Trim();
if( msg.Length > 0 ) {
Chat.SendMe( player, msg );
} else {
CdMe.PrintUsage( player );
}
}
示例12: GHandler
static void GHandler(Player player, Command cmd)
{
string Msg = cmd.NextAll();
if (!ConfigKey.GCKey.Enabled()){
player.Message("Global Chat is disabled on this server");
return;
}
if (!GlobalChat.GlobalThread.GCReady){
player.Message("Global Chat is not connected for this server");
return;
}
var SendList = Server.Players.Where(p => p.GlobalChat && !p.IsDeaf);
if (Msg.Length < 1){
if (player.GlobalChat){
player.GlobalChat = false;
GlobalChat.GlobalThread.SendChannelMessage(player.ClassyName + " &Shas disabled the Global Chat (Left)");
SendList.Message(player.ClassyName + " &Shas disabled the Global Chat (Left)");
player.Message("&SYou left the 800Craft Global Chat");
return;
}
if (!player.GlobalChat){
player.GlobalChat = true;
player.Message(" &WRules: No spamming, no advertising. Your Servers chat rules apply here (staff will mute / kick you)\n" +
"&9By using the Global Chat, you automatically accept these conditions.");
GlobalChat.GlobalThread.SendChannelMessage(player.ClassyName + " &Shas enabled the Global Chat (Joined)");
SendList.Message(player.ClassyName + " &Shas enabled the Global Chat (Joined)");
return;
}
}
if (!player.GlobalChat)
{
player.Message("&WGlobal chat is disabled for you. Type /Global to enable it");
return;
}
if (player.Info.IsMuted)
{
player.MessageMuted();
return;
}
string pMsg = player.ClassyName + Color.White + ": " + Msg;
Msg = player.ClassyName + Color.Black + ": " + Msg;
SendList.Message("&i(Global) " + pMsg); //send the white message to Server
Msg = Color.ToIRCColorCodes(Msg);
Msg = Color.ReplacePercentCodes(Msg);
GlobalChat.GlobalThread.SendChannelMessage(Msg); //send the black message to GC
}
示例13: SwearHandler
private static void SwearHandler(Player player, CommandReader cmd) {
string param = cmd.Next();
if (param == null) {
CdSwear.PrintUsage(player);
return;
}
switch (param.ToLower()) {
case "r":
case "d":
case "remove":
case "delete":
int fId;
bool removed = false;
Filter fRemove = null;
if (cmd.NextInt(out fId)) {
foreach (Filter f in Chat.Filters) {
if (f.Id == fId) {
Server.Message("&Y[Filters] {0}&Y removed the filter \"{1}\" -> \"{2}\"",
player.ClassyName, f.Word, f.Replacement);
fRemove = f;
removed = true;
}
}
if (fRemove != null) {
fRemove.removeFilter();
}
if (!removed) {
player.Message("Given filter (#{0}) does not exist.", fId);
}
} else {
CdSwear.PrintUsage(player);
}
break;
case "a":
case "add":
case "create":
Filter fCreate = new Filter();
if (player.Info.IsMuted) {
player.MessageMuted();
return;
}
string word = cmd.Next();
string replacement = cmd.NextAll();
if ("".Equals(word) || "".Equals(replacement)) {
CdSwear.PrintUsage(player);
break;
}
bool exists = false;
foreach (Filter f in Chat.Filters) {
if (f.Word.ToLower().Equals(word.ToLower())) {
exists = true;
}
}
if (!exists) {
Server.Message("&Y[Filters] \"{0}\" is now replaced by \"{1}\"", word, replacement);
fCreate.addFilter(getNewFilterId(), word, replacement);
} else {
player.Message("A filter with that world already exists!");
}
break;
default:
CdSwear.PrintUsage(player);
break;
}
}
示例14: TimerHandler
static void TimerHandler(Player player, CommandReader cmd)
{
string param = cmd.Next();
// List timers
if (param == null)
{
ChatTimer[] list = ChatTimer.TimerList.OrderBy(timer => timer.TimeLeft).ToArray();
if (list.Length == 0)
{
player.Message("No timers running.");
}
else
{
player.Message("There are {0} timers running:", list.Length);
foreach (ChatTimer timer in list)
{
if (timer.Message.Equals(""))
{
player.Message(" #{0} \"&7*CountDown*&s\" (started by {2}, {3} left)",
timer.ID, timer.Message, timer.StartedBy, timer.TimeLeft.ToMiniString());
}
else
{
player.Message(" #{0} \"{1}&s\" (started by {2}, {3} left)",
timer.ID, timer.Message, timer.StartedBy, timer.TimeLeft.ToMiniString());
}
}
}
return;
}
// Abort a timer
if (param.Equals("abort", StringComparison.OrdinalIgnoreCase))
{
int timerId;
if (cmd.NextInt(out timerId))
{
ChatTimer timer = ChatTimer.FindTimerById(timerId);
if (timer == null || !timer.IsRunning)
{
player.Message("Given timer (#{0}) does not exist.", timerId);
}
else
{
timer.Abort();
string abortMsg = "";
string abortircMsg = "";
if (timer.Message.Equals(""))
{
abortMsg = String.Format("&S{0}&S aborted a &7CountDown&S with {1} left",
player.ClassyName, timer.TimeLeft.ToMiniString());
abortircMsg = String.Format("\u212C&S{0}&S aborted a &7CountDown&S with {1} left",
player.ClassyName, timer.TimeLeft.ToMiniString());
}
else
{
abortMsg = String.Format("&S{0}&S aborted a &7Timer&S with {1} left: &7{2}",
player.ClassyName, timer.TimeLeft.ToMiniString(), timer.Message);
abortircMsg = String.Format( "\u212C&S{0}&S aborted a &7Timer&S with {1} left: \u211C{2}",
player.ClassyName, timer.TimeLeft.ToMiniString(), timer.Message);
}
Server.Players.Message(abortMsg);
IRC.SendChannelMessage(abortircMsg);
}
}
else
{
CdTimer.PrintUsage(player);
}
return;
}
// Start a timer
if (player.Info.IsMuted)
{
player.MessageMuted();
return;
}
if (player.DetectChatSpam()) return;
TimeSpan duration;
if (!param.TryParseMiniTimespan(out duration))
{
CdTimer.PrintUsage(player);
return;
}
if (duration > DateTimeUtil.MaxTimeSpan)
{
player.MessageMaxTimeSpan();
return;
}
if (duration < ChatTimer.MinDuration)
{
player.Message("Timer: Must be at least 1 second.");
return;
}
string sayMessage;
string ircMessage;
string message = cmd.NextAll();
//.........这里部分代码省略.........
示例15: TrollHandler
//.........这里部分代码省略.........
break;
case "st":
case "staff":
string SName = cmd.Next();
string msgSc = cmd.NextAll().Trim();
if (Player.IsInValidName(SName) || msgSc == null)
{
player.Message("Player not found. Please specify valid name.");
return;
}
Player target4 = Server.FindPlayerOrPrintMatches(player, SName, true, true);
if (target4 == null)
{
player.Message("Please enter a valid name.");
return;
}
if (msgSc.Length < 1)
{
player.Message("Error: Please enter a message for {0}.", target4.ClassyName);
return;
}
else
{
Chat.SendStaff(target4, msgSc);
}
break;
case "i":
case "impersonate":
case "msg":
case "message":
case "m":
string name = cmd.Next();
if (player.Info.IsMuted)
{
player.MessageMuted();
return;
}
if (Player.IsInValidName(name) || name == null)
{
player.Message("Player not found. Please specify valid name.");
return;
}
if (player.Can(Permission.Chat))
{
string msg2 = cmd.NextAll().Trim();
Player target5 = Server.FindPlayerOrPrintMatches(player, name, true, true);
if (target5 == null)
{
player.Message("Please enter a valid name.");
return;
}
if (msg2.Length > 0)
{
Server.Message("{0}&S&F: {1}",
target5.ClassyName, msg2);
return;
}
else
{
player.Message("&SYou need to enter a message");
return;
}
} break;
case "leave":
case "disconnect":
case "gtfo":
string elol = cmd.Next();
if (elol == null)
{ player.Message("Nope"); return; }
if (Player.IsInValidName(elol))
{
player.Message("Player not found. Please specify valid name.");
return;
}
else
{
Player target6 = Server.FindPlayerOrPrintMatches(player, elol, true, true);
if (target6 == null)
{
player.Message("Please enter a valid name.");
return;
}
Server.Players.Message("&SPlayer {0}&S left the server.", target6.ClassyName);
}
break;
default: player.Message("Invalid option. Please choose st, ac, pm, message or leave");
break;
}
}