本文整理汇总了C#中MCSong.Player类的典型用法代码示例。如果您正苦于以下问题:C# Player类的具体用法?C# Player怎么用?C# Player使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Player类属于MCSong命名空间,在下文中一共展示了Player类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: Use
public override void Use(Player p, string message)
{
Player pl = Player.Find(message);
if (message == "") { Help(p); return; }
if (p == null)
{
if (pl == null) { Player.SendMessage(p, "Player \"" + message + "\"not found!"); return; }
if (!pl.warned) { Player.SendMessage(p, pl.color + pl.name + Server.DefaultColor + " has not been warned!"); return; }
pl.warned = false;
Player.SendMessage(pl, "Unwarned by &cConsole");
Player.GlobalMessageOps("To Ops" + c.white + " - " + pl.color + pl.name + c.white + " was unwarned by &aConsole");
Server.s.Log(pl.name + " was unwarned by Console");
}
else
{
if (pl == null) { Player.SendMessage(p, "Player \"" + message + "\"not found!"); return; }
if (pl == p) { Player.SendMessage(p, "You cannot unwarn yourself!"); return; }
if (p.warned) { Player.SendMessage(p, "You cannot unwarn a player if you are warned!"); return; }
if (p.group.Permission <= pl.group.Permission) { Player.SendMessage(p, "You can't unwarn a player of an equal or higher rank!"); return; }
if (!pl.warned) { Player.SendMessage(p, pl.color + pl.name + Server.DefaultColor + " has not been warned!"); return; }
pl.warned = false;
Player.SendMessage(pl, "Unwarned by " + p.color + p.name);
Player.GlobalMessageOps("To Ops" + c.white + " - " + pl.color + pl.name + c.white + " was unwarned by " + p.color + p.name);
Server.s.Log(pl.name + " was unwarned by " + p.name);
if (p.group.Permission < Server.opchatperm)
{
Player.SendMessage(p, pl.color + pl.name + c.white + "was unwarned by " + p.color + p.name);
}
}
}
开发者ID:727021,项目名称:OLD-MCSong,代码行数:30,代码来源:CmdUnwarn.cs
示例2: Use
public override void Use(Player p, string message)
{
string[] parameters = message.Split(' ');
ushort[] click = p.lastClick;
if (message.IndexOf(' ') != -1)
{
if (parameters.Length != 3)
{
Help(p);
return;
}
else
{
for (int value = 0; value < 3; value++)
{
if (parameters[value].ToLower() == "x" || parameters[value].ToLower() == "y" || parameters[value].ToLower() == "z")
click[value] = p.lastClick[value];
else if (isValid(parameters[value], value, p))
click[value] = ushort.Parse(parameters[value]);
else
{
Player.SendMessage(p, "\"" + parameters[value] + "\" was not valid");
return;
}
}
}
}
p.manualChange(click[0], click[1], click[2], 0, Block.rock);
Player.SendMessage(p, "Clicked &b(" + click[0] + ", " + click[1] + ", " + click[2] + ")");
}
开发者ID:727021,项目名称:OLD-MCSong,代码行数:32,代码来源:CmdClick.cs
示例3: Use
public override void Use(Player p, string message)
{
if (p == null) { Player.SendMessage(p, "Command not useable from console"); return; }
if (p.level != Level.FindExact(p.name)) { Player.SendMessage(p, "You must be at your home to use this command"); return; }
Player pl = Player.Find(message.Split(' ')[0]);
Level lvl = Level.FindExact(p.name);
if (message.Split(' ')[1].Trim().ToLower() == "del")
{
if (pl == p) { Player.SendMessage(p, "You cannot disallow yourself from building in your home!"); return; }
p.level.ZoneList.ForEach(delegate(Level.Zone Zn)
{
if (Zn.Owner.Trim().ToLower() == Player.Find(message).name.Trim().ToLower())
{
MySQL.executeQuery("DELETE FROM `Zone" + lvl.name + "` WHERE Owner='" + Zn.Owner + "' AND SmallX='" + Zn.smallX + "' AND SMALLY='" + Zn.smallY + "' AND SMALLZ='" + Zn.smallZ + "' AND BIGX='" + Zn.bigX + "' AND BIGY='" + Zn.bigY + "' AND BIGZ='" + Zn.bigZ + "'");
lvl.ZoneList.Remove(Zn);
Player.SendMessage(p, "Removed zone for " + pl.name);
}
});
return;
}
Level.Zone zn;
zn.smallX = 0;
zn.smallY = 0;
zn.smallZ = 0;
zn.bigX = Convert.ToUInt16(lvl.width - 1);
zn.bigY = Convert.ToUInt16(lvl.height - 1);
zn.bigZ = Convert.ToUInt16(lvl.depth - 1);
zn.Owner = pl.name;
lvl.ZoneList.Add(zn);
MySQL.executeQuery("INSERT INTO `Zone" + lvl.name + "` (SmallX, SmallY, SmallZ, BigX, BigY, BigZ, Owner) VALUES (" + zn.smallX + ", " + zn.smallY + ", " + zn.smallZ + ", " + zn.bigX + ", " + zn.bigY + ", " + zn.bigZ + ", '" + zn.Owner + "')");
Player.SendMessage(p, "Zoned entire map for " + pl.name);
}
开发者ID:727021,项目名称:OLD-MCSong,代码行数:32,代码来源:CmdHallow.cs
示例4: Use
public override void Use(Player p, string message)
{
if (message == "") { Help(p); return; }
if (message.ToLower() == "all")
{
foreach (Player pl in Player.players)
{
if (pl.level == p.level && pl != p)
{
unchecked { pl.SendPos((byte)-1, p.pos[0], p.pos[1], p.pos[2], p.rot[0], 0); }
pl.SendMessage("You were summoned by " + p.color + p.name + Server.DefaultColor + ".");
}
}
return;
}
Player who = Player.Find(message);
if (who == null || who.hidden) { Player.SendMessage(p, "There is no player \"" + message + "\"!"); return; }
if (p.level != who.level)
{
if (p.level.locked) { Player.SendMessage(p, "You can't summon players to a locked map!"); return; }
Player.SendMessage(p, who.name + " is in a different level.");
Player.SendMessage(p, "Force-fetching has started...");
who.ignorePermission = true;
Command.all.Find("goto").Use(who, p.level.name);
who.ignorePermission = false;
unchecked { who.SendPos((byte)-1, p.pos[0], p.pos[1], p.pos[2], p.rot[0], 0); }
Player.SendMessage(who, "You were summoned by " + p.color + p.name + Server.DefaultColor + ".");
return;
}
unchecked { who.SendPos((byte)-1, p.pos[0], p.pos[1], p.pos[2], p.rot[0], 0); }
who.SendMessage("You were summoned by " + p.color + p.name + Server.DefaultColor + ".");
}
开发者ID:727021,项目名称:OLD-MCSong,代码行数:33,代码来源:CmdSummon.cs
示例5: Help
public override void Help(Player p)
{
Player.SendMessage(p, "/save - Saves the level you are currently in");
Player.SendMessage(p, "/save all - Saves all loaded levels.");
Player.SendMessage(p, "/save <map> - Saves the specified map.");
Player.SendMessage(p, "/save <map> <name> - Backups the map with a given restore name");
}
开发者ID:727021,项目名称:OLD-MCSong,代码行数:7,代码来源:CmdSave.cs
示例6: Use
public override void Use(Player p, string message)
{
if ((message.ToLower() == "create" || message.ToLower() == "") && p != null)
{
p.level.jailx = p.pos[0]; p.level.jaily = p.pos[1]; p.level.jailz = p.pos[2];
p.level.jailrotx = p.rot[0]; p.level.jailroty = p.rot[1];
Player.SendMessage(p, "Set Jail point.");
}
else
{
Player who = Player.Find(message);
if (who != null)
{
if (!who.jailed)
{
if (p != null) if (who.group.Permission >= p.group.Permission) { Player.SendMessage(p, "Cannot jail someone of equal or greater rank."); return; }
if (who.level != p.level) Command.all.Find("goto").Use(who, p.level.name);
Player.GlobalDie(who, false);
Player.GlobalSpawn(who, p.level.jailx, p.level.jaily, p.level.jailz, p.level.jailrotx, p.level.jailroty, true);
who.jailed = true;
Player.GlobalChat(null, who.color + who.name + Server.DefaultColor + " was &8jailed", false);
}
else
{
who.jailed = false;
Player.GlobalChat(null, who.color + who.name + Server.DefaultColor + " was &afreed" + Server.DefaultColor + " from jail", false);
}
}
else
{
Player.SendMessage(p, "Could not find specified player.");
}
}
}
开发者ID:727021,项目名称:OLD-MCSong,代码行数:34,代码来源:CmdJail.cs
示例7: Use
public override void Use(Player p, string message)
{
if (message == "") { Help(p); return; }
string fileName;
fileName = "extra/import/" + message + ".dat";
if (!Directory.Exists("extra/import")) Directory.CreateDirectory("extra/import");
if (!File.Exists(fileName))
{
Player.SendMessage(p, "Could not find .dat file");
return;
}
FileStream fs = File.OpenRead(fileName);
if (ConvertDat.Load(fs, message) != null)
{
Player.SendMessage(p, "Converted map!");
}
else
{
Player.SendMessage(p, "The map conversion failed.");
return;
}
fs.Close();
Command.all.Find("load").Use(p, message);
}
开发者ID:727021,项目名称:OLD-MCSong,代码行数:27,代码来源:CmdImport.cs
示例8: Use
public override void Use(Player p, string message)
{
if (message.Split(' ').Length > 1) { Help(p); return; }
if (p.BlockAction == 13 || p.BlockAction == 14)
{
p.BlockAction = 0; Player.SendMessage(p, "TNT mode is now &cOFF" + Server.DefaultColor + ".");
}
else if (message.ToLower() == "small" || message == "")
{
p.BlockAction = 13; Player.SendMessage(p, "TNT mode is now &aON" + Server.DefaultColor + ".");
}
else if (message.ToLower() == "big")
{
if (p.group.Permission > LevelPermission.AdvBuilder)
{
p.BlockAction = 14; Player.SendMessage(p, "TNT mode is now &aON" + Server.DefaultColor + ".");
}
else
{
Player.SendMessage(p, "This mode is reserved for OPs");
}
}
else
{
Help(p);
}
p.painting = false;
}
开发者ID:727021,项目名称:OLD-MCSong,代码行数:30,代码来源:CmdTnt.cs
示例9: Use
public override void Use(Player p, string message)
{
if (message == "") { Help(p); return; }
if (!PlayerBot.ValidName(message)) { Player.SendMessage(p, "bot name " + message + " not valid!"); return; }
PlayerBot.playerbots.Add(new PlayerBot(message, p.level, p.pos[0], p.pos[1], p.pos[2], p.rot[0], 0));
//who.SendMessage("You were summoned by " + p.color + p.name + "&e.");
}
开发者ID:727021,项目名称:OLD-MCSong,代码行数:7,代码来源:CmdBotAdd.cs
示例10: Use
public override void Use(Player p, string message)
{
if (message == "") { Help(p); return; }
Player who = Player.Find(message);
if (who == null)
{
Player.SendMessage(p, "Could not find player specified");
return;
}
ushort currentX = (ushort)(who.pos[0] / 32);
ushort currentY = (ushort)(who.pos[1] / 32);
ushort currentZ = (ushort)(who.pos[2] / 32);
ushort foundHeight = 0;
for (ushort yy = currentY; yy <= 1000; yy++)
{
if (!Block.Walkthrough(p.level.GetTile(currentX, yy, currentZ)) && p.level.GetTile(currentX, yy, currentZ) != Block.Zero)
{
foundHeight = (ushort)(yy - 1);
who.level.ChatLevel(who.color + who.name + Server.DefaultColor + " was slapped into the roof by " + p.color + p.name);
break;
}
}
if (foundHeight == 0)
{
who.level.ChatLevel(who.color + who.name + Server.DefaultColor + " was slapped sky high by " + p.color + p.name);
foundHeight = 1000;
}
unchecked { who.SendPos((byte)-1, who.pos[0], (ushort)(foundHeight * 32), who.pos[2], who.rot[0], who.rot[1]); }
}
开发者ID:727021,项目名称:OLD-MCSong,代码行数:35,代码来源:CmdSlap.cs
示例11: Use
public override void Use(Player p, string message)
{
if (message != "") { Help(p); return; }
p.painting = !p.painting; if (p.painting) { Player.SendMessage(p, "Painting mode: &aON" + Server.DefaultColor + "."); }
else { Player.SendMessage(p, "Painting mode: &cOFF" + Server.DefaultColor + "."); }
p.BlockAction = 0;
}
开发者ID:727021,项目名称:OLD-MCSong,代码行数:7,代码来源:CmdPaint.cs
示例12: Use
public override void Use(Player p, string message)
{
if (message != "")
{
Help(p);
return;
}
else
{
string hasirc;
string ircdetails = "";
if (Server.irc)
{
hasirc = "&aEnabled" + Server.DefaultColor + ".";
ircdetails = Server.ircServer + " > " + Server.ircChannel;
}
else
{
hasirc = "&cDisabled" + Server.DefaultColor + ".";
}
Player.SendMessage(p, "IRC is " + hasirc);
if (ircdetails != "")
{
Player.SendMessage(p, "Location: " + ircdetails);
}
}
}
开发者ID:727021,项目名称:OLD-MCSong,代码行数:27,代码来源:CmdHasirc.cs
示例13: Use
public override void Use(Player p, string message)
{
if (p == null) { Player.SendMessage(p, "Command not useable from console"); return; }
if (p.level != Level.FindExact(p.name)) { Player.SendMessage(p, "You must be at your home to use this command"); return; }
int totalFixed = 0;
for (int i = 0; i < p.level.blocks.Length; i++)
{
try
{
ushort x, y, z;
p.level.IntToPos(i, out x, out y, out z);
if (p.level.blocks[i] == Block.dirt)
{
if (Block.LightPass(p.level.blocks[p.level.IntOffset(i, 0, 1, 0)]))
{
p.level.Blockchange(p, x, y, z, Block.grass);
totalFixed++;
}
}
else if (p.level.blocks[i] == Block.grass)
{
if (!Block.LightPass(p.level.blocks[p.level.IntOffset(i, 0, 1, 0)]))
{
p.level.Blockchange(p, x, y, z, Block.dirt);
totalFixed++;
}
}
}
catch { }
}
Player.SendMessage(p, "Fixed " + totalFixed + " blocks.");
}
开发者ID:727021,项目名称:OLD-MCSong,代码行数:35,代码来源:CmdHfixgrass.cs
示例14: Use
public override void Use(Player p, string message)
{
if (message == "" || message.IndexOf(' ') == -1) { Help(p); return; }
Level foundLevel = Level.Find(message.Split(' ')[0]);
string newName = message.Split(' ')[1];
if (File.Exists("levels/" + newName)) { Player.SendMessage(p, "Level already exists."); return; }
if (foundLevel == Server.mainLevel) { Player.SendMessage(p, "Cannot rename the main level."); return; }
if (foundLevel != null) foundLevel.Unload();
try
{
File.Move("levels/" + foundLevel.name + ".lvl", "levels/" + newName + ".lvl");
try
{
File.Move("levels/level properties/" + foundLevel.name + ".properties", "levels/level properties/" + newName + ".properties");
}
catch { }
try
{
File.Move("levels/level properties/" + foundLevel.name, "levels/level properties/" + newName + ".properties");
}
catch { }
MySQL.executeQuery("RENAME TABLE `Block" + foundLevel.name.ToLower() + "` TO `Block" + newName.ToLower() +
"`, `Portals" + foundLevel.name.ToLower() + "` TO `Portals" + newName.ToLower() +
"`, `Messages" + foundLevel.name.ToLower() + "` TO Messages" + newName.ToLower() +
", `Zone" + foundLevel.name.ToLower() + "` TO `Zone" + newName.ToLower() + "`");
Player.GlobalMessage("Renamed " + foundLevel.name + " to " + newName);
}
catch (Exception e) { Player.SendMessage(p, "Error when renaming."); Server.ErrorLog(e); }
}
开发者ID:727021,项目名称:OLD-MCSong,代码行数:34,代码来源:CmdRenameLvl.cs
示例15: Use
public override void Use(Player p, string message)
{
if (Server.PCCounter == null)
{
Player.SendMessage(p, "Starting PCCounter...one second");
Server.PCCounter = new PerformanceCounter("Processor", "% Processor Time", "_Total");
Server.PCCounter.BeginInit();
Server.PCCounter.NextValue();
}
if (Server.ProcessCounter == null)
{
Player.SendMessage(p, "Starting ProcessCounter...one second");
Server.ProcessCounter = new PerformanceCounter("Process", "% Processor Time", Process.GetCurrentProcess().ProcessName);
Server.ProcessCounter.BeginInit();
Server.ProcessCounter.NextValue();
}
TimeSpan tp = Process.GetCurrentProcess().TotalProcessorTime;
TimeSpan up = (DateTime.Now - Process.GetCurrentProcess().StartTime);
//To get actual CPU% is OS dependant
string ProcessorUsage = "CPU Usage (Processes : All Processes):" + Server.ProcessCounter.NextValue() + " : " + Server.PCCounter.NextValue();
//Alternative Average?
//string ProcessorUsage = "CPU Usage is Not Implemented: So here is ProcessUsageTime/ProcessTotalTime:"+String.Format("00.00",(((tp.Ticks/up.Ticks))*100))+"%";
//reports Private Bytes because it is what the process has reserved for itself and is unsharable
string MemoryUsage = "Memory Usage: " + Math.Round((double)Process.GetCurrentProcess().PrivateMemorySize64 / 1048576).ToString() + " Megabytes";
string Uptime = "Uptime: " + up.Days + " Days " + up.Hours + " Hours " + up.Minutes + " Minutes " + up.Seconds + " Seconds";
string Threads = "Threads: " + Process.GetCurrentProcess().Threads.Count;
Player.SendMessage(p, Uptime);
Player.SendMessage(p, MemoryUsage);
Player.SendMessage(p, ProcessorUsage);
Player.SendMessage(p, Threads);
}
开发者ID:727021,项目名称:OLD-MCSong,代码行数:33,代码来源:CmdServerReport.cs
示例16: Use
public override void Use(Player p, string message)
{
if (message != "") { Help(p); return; }
p.deleteMode = !p.deleteMode;
Player.SendMessage(p, "Delete mode: &a" + p.deleteMode);
}
开发者ID:727021,项目名称:OLD-MCSong,代码行数:7,代码来源:CmdDelete.cs
示例17: Use
public override void Use(Player p, string message)
{
if (message == "") { Help(p); return; }
Player who = Player.Find(message);
if (who != null)
{
if (who.voice)
{
who.voice = false;
Player.SendMessage(p, "Removing voice status from " + who.name);
who.SendMessage("Your voice status has been revoked.");
who.voicestring = "";
}
else
{
who.voice = true;
Player.SendMessage(p, "Giving voice status to " + who.name);
who.SendMessage("You have received voice status.");
who.voicestring = "&f+";
}
}
else
{
Player.SendMessage(p, "There is no player online named \"" + message + "\"");
}
}
开发者ID:727021,项目名称:OLD-MCSong,代码行数:26,代码来源:CmdVoice.cs
示例18: Use
public override void Use(Player p, string message)
{
if (message != "list")
{
if (p.joker)
{
message = "";
}
if (!Server.afkset.Contains(p.name))
{
Server.afkset.Add(p.name);
if (p.muted)
{
message = "";
}
Player.GlobalMessage("-" + p.color + p.name + Server.DefaultColor + "- is AFK " + message);
IRCBot.Say(p.name + " is AFK " + message);
return;
}
else
{
Server.afkset.Remove(p.name);
Player.GlobalMessage("-" + p.color + p.name + Server.DefaultColor + "- is no longer AFK");
IRCBot.Say(p.name + " is no longer AFK");
return;
}
}
else
{
foreach (string s in Server.afkset) Player.SendMessage(p, s);
}
}
开发者ID:727021,项目名称:OLD-MCSong,代码行数:33,代码来源:CmdAfk.cs
示例19: Use
public override void Use(Player p, string message)
{
if (message != "") { Help(p); return; }
string devlist = "";
string temp;
foreach (string dev in Server.devs)
{
temp = dev.Substring(0, 1);
temp = temp.ToUpper() + dev.Remove(0, 1);
devlist += temp + ", ";
}
devlist = devlist.Remove(devlist.Length - 2);
Player.SendMessage(p, "&9MCSong Development Team: " + Server.DefaultColor + devlist);
if (Server.staff.Count > 0)
{
string stafflist = "";
string tmp;
foreach (string staff in Server.staff)
{
tmp = staff.Substring(0, 1);
tmp = tmp.ToUpper() + staff.Remove(0, 1);
stafflist += tmp + ", ";
}
stafflist = stafflist.Remove(stafflist.Length - 2);
Player.SendMessage(p, "&9MCSong Administration Team: " + Server.DefaultColor + stafflist);
}
}
开发者ID:727021,项目名称:OLD-MCSong,代码行数:27,代码来源:CmdDevs.cs
示例20: Use
public override void Use(Player p, string message)
{
Player.SendMessage(p, "\r\n");
Player.SendMessage(p, "\r\n");
Player.SendMessage(p, "\r\n");
Player.SendMessage(p, "\r\n");
Player.SendMessage(p, "\r\n");
Player.SendMessage(p, "\r\n");
Player.SendMessage(p, "\r\n");
Player.SendMessage(p, "\r\n");
Player.SendMessage(p, "\r\n");
Player.SendMessage(p, "\r\n");
Player.SendMessage(p, "\r\n");
Player.SendMessage(p, "\r\n");
Player.SendMessage(p, "\r\n");
Player.SendMessage(p, "\r\n");
Player.SendMessage(p, "\r\n");
Player.SendMessage(p, "\r\n");
Player.SendMessage(p, "\r\n");
Player.SendMessage(p, "\r\n");
Player.SendMessage(p, "\r\n");
Player.SendMessage(p, "\r\n");
Player.SendMessage(p, "\r\n");
Player.SendMessage(p, "\r\n");
Player.SendMessage(p, "\r\n");
Player.SendMessage(p, "\r\n");
}
开发者ID:MCSDFDBSWADZDSBL,项目名称:MCSDFDBSWADZBSBL,代码行数:27,代码来源:CmdClearchat.cs
注:本文中的MCSong.Player类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论