本文整理汇总了C#中MCLawl.Player类的典型用法代码示例。如果您正苦于以下问题:C# Player类的具体用法?C# Player怎么用?C# Player使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Player类属于MCLawl命名空间,在下文中一共展示了Player类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: 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:dekema2,项目名称:MCDek,代码行数:27,代码来源:CmdImport.cs
示例2: Blockchange1
public void Blockchange1(Player p, ushort x, ushort y, ushort z, byte type)
{
p.ClearBlockchange();
CatchPos cpos = (CatchPos)p.blockchangeObject;
cpos.message = cpos.message.Replace("'", "\\'");
DataTable Messages = MySQL.fillData("SELECT * FROM `Messages" + p.level.name + "` WHERE X=" + (int)x + " AND Y=" + (int)y + " AND Z=" + (int)z);
Messages.Dispose();
if (Messages.Rows.Count == 0)
{
MySQL.executeQuery("INSERT INTO `Messages" + p.level.name + "` (X, Y, Z, Message) VALUES (" + (int)x + ", " + (int)y + ", " + (int)z + ", '" + cpos.message + "')");
}
else
{
MySQL.executeQuery("UPDATE `Messages" + p.level.name + "` SET Message='" + cpos.message + "' WHERE X=" + (int)x + " AND Y=" + (int)y + " AND Z=" + (int)z);
}
Player.SendMessage(p, "Message block placed.");
p.level.Blockchange(p, x, y, z, cpos.type);
p.SendBlockchange(x, y, z, cpos.type);
if (p.staticCommands) p.Blockchange += new Player.BlockchangeEventHandler(Blockchange1);
}
开发者ID:Jack1312,项目名称:Evolve,代码行数:25,代码来源:CmdMessageBlock.cs
示例3: ExitChange
public void ExitChange(Player p, ushort x, ushort y, ushort z, byte type)
{
p.ClearBlockchange();
byte b = p.level.GetTile(x, y, z);
p.SendBlockchange(x, y, z, b);
portalPos bp = (portalPos)p.blockchangeObject;
foreach (portPos pos in bp.port)
{
DataTable Portals = MySQL.fillData("SELECT * FROM `Portals" + pos.portMapName + "` WHERE EntryX=" + (int)pos.x + " AND EntryY=" + (int)pos.y + " AND EntryZ=" + (int)pos.z);
Portals.Dispose();
if (Portals.Rows.Count == 0)
{
MySQL.executeQuery("INSERT INTO `Portals" + pos.portMapName + "` (EntryX, EntryY, EntryZ, ExitMap, ExitX, ExitY, ExitZ) VALUES (" + (int)pos.x + ", " + (int)pos.y + ", " + (int)pos.z + ", '" + p.level.name + "', " + (int)x + ", " + (int)y + ", " + (int)z + ")");
}
else
{
MySQL.executeQuery("UPDATE `Portals" + pos.portMapName + "` SET ExitMap='" + p.level.name + "', ExitX=" + (int)x + ", ExitY=" + (int)y + ", ExitZ=" + (int)z + " WHERE EntryX=" + (int)pos.x + " AND EntryY=" + (int)pos.y + " AND EntryZ=" + (int)pos.z);
}
//DB
if (pos.portMapName == p.level.name) p.SendBlockchange(pos.x, pos.y, pos.z, bp.type);
}
Player.SendMessage(p, "&3Exit" + Server.DefaultColor + " block placed");
if (p.staticCommands) { bp.port.Clear(); p.blockchangeObject = bp; p.Blockchange += new Player.BlockchangeEventHandler(EntryChange); }
}
开发者ID:dekema2,项目名称:MCDek,代码行数:29,代码来源:CmdPortal.cs
示例4: Use
public override void Use(Player p, string message)
{
if (message == "" || message.IndexOf(' ') == -1) { Help(p); return; }
string foundBlah = Command.all.FindShort(message.Split(' ')[0]);
Command foundCmd;
if (foundBlah == "") foundCmd = Command.all.Find(message.Split(' ')[0]);
else foundCmd = Command.all.Find(foundBlah);
if (foundCmd == null) { Player.SendMessage(p, "Could not find command entered"); return; }
if (p != null && !p.group.CanExecute(foundCmd)) { Player.SendMessage(p, "This command is higher than your rank."); return; }
LevelPermission newPerm = Level.PermissionFromName(message.Split(' ')[1]);
if (newPerm == LevelPermission.Null) { Player.SendMessage(p, "Could not find rank specified"); return; }
if (p != null && newPerm > p.group.Permission) { Player.SendMessage(p, "Cannot set to a rank higher than yourself."); return; }
GrpCommands.rankAllowance newCmd = GrpCommands.allowedCommands.Find(rA => rA.commandName == foundCmd.name);
newCmd.lowestRank = newPerm;
GrpCommands.allowedCommands[GrpCommands.allowedCommands.FindIndex(rA => rA.commandName == foundCmd.name)] = newCmd;
GrpCommands.Save(GrpCommands.allowedCommands);
GrpCommands.fillRanks();
Player.GlobalMessage("&d" + foundCmd.name + Server.DefaultColor + "'s permission was changed to " + Level.PermissionToName(newPerm));
}
开发者ID:dekema2,项目名称:MCDek,代码行数:25,代码来源:CmdCmdSet.cs
示例5: Use
public override void Use(Player p, string message)
{
if (message.ToLower() == "empty")
{
Boolean Empty = true;
foreach (Level l in Server.levels)
{
Empty = true;
Player.players.ForEach(delegate(Player pl)
{
if (pl.level == l) Empty = false;
});
if (Empty == true && l.unload)
{
l.Unload();
return;
}
}
Player.SendMessage(p, "No levels were empty.");
return;
}
Level level = Level.Find(message);
if (level != null)
{
if (!level.Unload()) Player.SendMessage(p, "You cannot unload the main level.");
return;
}
Player.SendMessage(p, "There is no level \"" + message + "\" loaded.");
}
开发者ID:dekema2,项目名称:MCDek,代码行数:34,代码来源:CmdUnload.cs
示例6: Blockchange2
public void Blockchange2(Player p, ushort x, ushort y, ushort z, byte type)
{
p.ClearBlockchange();
byte b = p.level.GetTile(x, y, z);
p.SendBlockchange(x, y, z, b);
CatchPos cpos = (CatchPos)p.blockchangeObject;
unchecked { if (cpos.type != (byte)-1) { type = cpos.type; } }
List<Pos> buffer = new List<Pos>();
for (ushort xx = Math.Min(cpos.x, x); xx <= Math.Max(cpos.x, x); ++xx)
{
for (ushort yy = Math.Min(cpos.y, y); yy <= Math.Max(cpos.y, y); ++yy)
{
for (ushort zz = Math.Min(cpos.z, z); zz <= Math.Max(cpos.z, z); ++zz)
{
if (p.level.GetTile(xx, yy, zz) == type) { BufferAdd(buffer, xx, yy, zz); }
}
}
}
if (buffer.Count > p.group.maxBlocks)
{
Player.SendMessage(p, "You tried to replace " + buffer.Count + " blocks.");
Player.SendMessage(p, "You cannot replace more than " + p.group.maxBlocks + ".");
return;
}
Player.SendMessage(p, buffer.Count.ToString() + " blocks.");
buffer.ForEach(delegate(Pos pos)
{
p.level.Blockchange(p, pos.x, pos.y, pos.z, cpos.type2); //update block for everyone
});
if (p.staticCommands) p.Blockchange += new Player.BlockchangeEventHandler(Blockchange1);
}
开发者ID:303i,项目名称:MCDek,代码行数:35,代码来源:CmdReplace.cs
示例7: Blockchange2
public void Blockchange2(Player p, ushort x, ushort y, ushort z, byte type)
{
p.ClearBlockchange();
byte b = p.level.GetTile(x, y, z);
p.SendBlockchange(x, y, z, b);
CatchPos cpos = (CatchPos)p.blockchangeObject;
Level.Zone Zn;
Zn.smallX = Math.Min(cpos.x, x);
Zn.smallY = Math.Min(cpos.y, y);
Zn.smallZ = Math.Min(cpos.z, z);
Zn.bigX = Math.Max(cpos.x, x);
Zn.bigY = Math.Max(cpos.y, y);
Zn.bigZ = Math.Max(cpos.z, z);
Zn.Owner = cpos.Owner;
p.level.ZoneList.Add(Zn);
//DB
MySQL.executeQuery("INSERT INTO `Zone" + p.level.name + "` (SmallX, SmallY, SmallZ, BigX, BigY, BigZ, Owner) VALUES (" + Zn.smallX + ", " + Zn.smallY + ", " + Zn.smallZ + ", " + Zn.bigX + ", " + Zn.bigY + ", " + Zn.bigZ + ", '" + Zn.Owner + "')");
//DB
Player.SendMessage(p, "Added zone for &b" + cpos.Owner);
}
开发者ID:303i,项目名称:MCDek,代码行数:25,代码来源:CmdZone.cs
示例8: Use
public override void Use(Player p, string message)
{
if (message.IndexOf(' ') == -1 || message.Split(' ').Length > 2) { Help(p); return; }
byte b1, b2;
b1 = Block.Byte(message.Split(' ')[0]);
b2 = Block.Byte(message.Split(' ')[1]);
if (b1 == Block.Zero || b2 == Block.Zero) { Player.SendMessage(p, "Could not find specified blocks."); return; }
ushort x, y, z; int currentBlock = 0;
List<Pos> stored = new List<Pos>(); Pos pos;
foreach (byte b in p.level.blocks)
{
if (b == b1)
{
p.level.IntToPos(currentBlock, out x, out y, out z);
pos.x = x; pos.y = y; pos.z = z;
stored.Add(pos);
}
currentBlock++;
}
if (stored.Count > (p.group.maxBlocks * 2)) { Player.SendMessage(p, "Cannot replace more than " + (p.group.maxBlocks * 2) + " blocks."); return; }
Player.SendMessage(p, stored.Count + " blocks out of " + currentBlock + " are " + Block.Name(b1));
foreach (Pos Pos in stored)
{
p.level.Blockchange(p, Pos.x, Pos.y, Pos.z, b2);
}
Player.SendMessage(p, "&4/replaceall finished!");
}
开发者ID:Jack1312,项目名称:Evolve,代码行数:35,代码来源:CmdReplaceAll.cs
示例9: Use
public override void Use(Player p, string message)
{
if (message == "") { Help(p); return; }
try
{
if (message.ToLower() == "all")
{
for (int i = 0; i < PlayerBot.playerbots.Count; i++)
{
if (PlayerBot.playerbots[i].level == p.level)
{
// PlayerBot.playerbots.Remove(PlayerBot.playerbots[i]);
PlayerBot Pb = PlayerBot.playerbots[i];
Pb.removeBot();
i--;
}
}
}
else
{
PlayerBot who = PlayerBot.Find(message);
if (who == null) { Player.SendMessage(p, "There is no bot " + who + "!"); return; }
if (p.level != who.level) { Player.SendMessage(p, who.name + " is in a different level."); return; }
who.removeBot();
Player.SendMessage(p, "Removed bot.");
}
}
catch (Exception e) { Server.ErrorLog(e); Player.SendMessage(p, "Error caught"); }
}
开发者ID:dekema2,项目名称:MCDek,代码行数:29,代码来源:CmdBotRemove.cs
示例10: Help
public override void Help(Player p)
{
Player.SendMessage(p, "/tcolor <player> [color] - Gives <player> the title color of [color].");
Player.SendMessage(p, "If no [color] is specified, title color is removed.");
Player.SendMessage(p, "&0black &1navy &2green &3teal &4maroon &5purple &6gold &7silver");
Player.SendMessage(p, "&8gray &9blue &alime &baqua &cred &dpink &eyellow &fwhite");
}
开发者ID:303i,项目名称:MCDek,代码行数:7,代码来源:CmdTColor.cs
示例11: Use
public override void Use(Player p, string message)
{
if (message == "") { Help(p); return; }
string[] args = message.Split(' ');
Player who = Player.Find(args[0]);
if (who == null)
{
Player.SendMessage(p, "Could not find player.");
return;
}
if (args.Length == 1)
{
who.titlecolor = "";
Player.GlobalChat(who, who.color + who.name + Server.DefaultColor + " had their title color removed.", false);
MySQL.executeQuery("UPDATE Players SET title_color = '' WHERE Name = '" + who.name + "'");
who.SetPrefix();
return;
}
else
{
string color = c.Parse(args[1]);
if (color == "") { Player.SendMessage(p, "There is no color \"" + args[1] + "\"."); return; }
else if (color == who.titlecolor) { Player.SendMessage(p, who.name + " already has that title color."); return; }
else
{
MySQL.executeQuery("UPDATE Players SET title_color = '" + c.Name(color) + "' WHERE Name = '" + who.name + "'");
Player.GlobalChat(who, who.color + who.name + Server.DefaultColor + " had their title color changed to " + color + c.Name(color) + Server.DefaultColor + ".", false);
who.titlecolor = color;
who.SetPrefix();
}
}
}
开发者ID:303i,项目名称:MCDek,代码行数:32,代码来源:CmdTColor.cs
示例12: highlightStuff
public void highlightStuff(string[] fileContent, Int64 seconds, Player p)
{
Player.UndoPos Pos;
for (int i = fileContent.Length / 7; i >= 0; i--)
{
try
{
if (Convert.ToDateTime(fileContent[(i * 7) + 4].Replace('&', ' ')).AddSeconds(seconds) >= DateTime.Now)
{
Level foundLevel = Level.Find(fileContent[i * 7]);
if (foundLevel != null && foundLevel == p.level)
{
Pos.mapName = foundLevel.name;
Pos.x = Convert.ToUInt16(fileContent[(i * 7) + 1]);
Pos.y = Convert.ToUInt16(fileContent[(i * 7) + 2]);
Pos.z = Convert.ToUInt16(fileContent[(i * 7) + 3]);
Pos.type = foundLevel.GetTile(Pos.x, Pos.y, Pos.z);
if (Pos.type == Convert.ToByte(fileContent[(i * 7) + 6]) || Block.Convert(Pos.type) == Block.water || Block.Convert(Pos.type) == Block.lava)
{
if (Pos.type == Block.air || Block.Convert(Pos.type) == Block.water || Block.Convert(Pos.type) == Block.lava)
p.SendBlockchange(Pos.x, Pos.y, Pos.z, Block.red);
else p.SendBlockchange(Pos.x, Pos.y, Pos.z, Block.green);
}
}
}
else break;
}
catch { }
}
}
开发者ID:303i,项目名称:MCDek,代码行数:33,代码来源:CmdHighlight.cs
示例13: 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:coolguy24,项目名称:CapereCraft,代码行数:33,代码来源:CmdAfk.cs
示例14: 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:Jack1312,项目名称:Evolve,代码行数:7,代码来源:CmdPaint.cs
示例15: 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:dekema2,项目名称:MCDek,代码行数:34,代码来源:CmdJail.cs
示例16: placeBlock
public static void placeBlock(Level l, Player p, ushort x, ushort y, ushort z, byte type)
{
if (p == null)
l.Blockchange(x, y, z, type);
else
l.Blockchange(p, x, y, z, type);
}
开发者ID:KDY9111,项目名称:fatuous_Test_MCDark,代码行数:7,代码来源:FindReference.cs
示例17: 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:KDY9111,项目名称:fatuous_Test_MCDark,代码行数:27,代码来源:CmdHasirc.cs
示例18: Use
public override void Use(Player p, string message)
{
if (message != "")
{
Help(p);
return;
}
if (p.possess != "")
{
Player.SendMessage(p, "Stop your current possession first.");
return;
}
p.hidden = !p.hidden;
if (p.hidden)
{
Player.GlobalDie(p, true);
Player.GlobalChat(p, "&c- " + p.color + p.prefix + p.name + Server.DefaultColor + " disconnected.", false);
Player.SendMessage(p, "You're now &finvisible&e.");
}
else
{
Player.GlobalSpawn(p, p.pos[0], p.pos[1], p.pos[2], p.rot[0], p.rot[1], false);
Player.GlobalChat(p, "&a+ " + p.color + p.prefix + p.name + Server.DefaultColor + " joined the game.", false);
Player.SendMessage(p, "You're now &8visible&e.");
}
}
开发者ID:Jack1312,项目名称:Evolve,代码行数:26,代码来源:CmdXHide.cs
示例19: Use
public override void Use(Player p, string message)
{
p.staticCommands = !p.staticCommands;
p.ClearBlockchange();
p.BlockAction = 0;
Player.SendMessage(p, "Static mode: &a" + p.staticCommands.ToString());
try
{
if (message != "")
{
if (message.IndexOf(' ') == -1)
{
if (p.group.CanExecute(Command.all.Find(message)))
Command.all.Find(message).Use(p, "");
else
Player.SendMessage(p, "Cannot use that command.");
}
else
{
if (p.group.CanExecute(Command.all.Find(message.Split(' ')[0])))
Command.all.Find(message.Split(' ')[0]).Use(p, message.Substring(message.IndexOf(' ') + 1));
else
Player.SendMessage(p, "Cannot use that command.");
}
}
}
catch { Player.SendMessage(p, "Could not find specified command"); }
}
开发者ID:dekema2,项目名称:MCDek,代码行数:30,代码来源:CmdStatic.cs
示例20: Use
public override void Use(Player p, string message)
{
if (message == "") { Help(p); return; }
Group foundGroup = Group.Find(message);
if (foundGroup == null)
{
Player.SendMessage(p, "Could not find group");
return;
}
string totalList = "";
foreach (string s in foundGroup.playerList.All())
{
totalList += ", " + s;
}
if (totalList == "")
{
Player.SendMessage(p, "No one has the rank of " + foundGroup.color + foundGroup.name);
return;
}
Player.SendMessage(p, "People with the rank of " + foundGroup.color + foundGroup.name + ":");
Player.SendMessage(p, totalList.Remove(0, 2));
}
开发者ID:303i,项目名称:MCDek,代码行数:26,代码来源:CmdViewRanks.cs
注:本文中的MCLawl.Player类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论