本文整理汇总了C#中fCraft.Player类的典型用法代码示例。如果您正苦于以下问题:C# Player类的具体用法?C# Player怎么用?C# Player使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Player类属于fCraft命名空间,在下文中一共展示了Player类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: CModeWater
internal static void CModeWater(Player player, Command cmd)
{
if (!player.Can(Permissions.ControlPhysics))
{
player.NoAccessMessage(Permissions.ControlPhysics);
return;
}
string blockpar = cmd.Next();
string wmt = "";
int BlockAddr = -1;
try { BlockAddr = Convert.ToInt32(blockpar); }
catch
{
player.Message("Incorrect parameter!"); return;
}
if (BlockAddr < 3 && BlockAddr >= 0)
{
player.world.map.modeWater = BlockAddr;
switch (BlockAddr)
{
case 0: wmt = "'none'"; break;
case 1: wmt = "'infinite'"; break;
case 2: wmt = "'finite'"; break;
}
player.Message("Water mode set to " + wmt + ".");
}
}
开发者ID:asiekierka,项目名称:afCraft,代码行数:27,代码来源:MapCommands.cs
示例2: BlockUpdate
public BlockUpdate( Player origin, Vector3I coord, Block blockType ) {
Origin = origin;
X = (short)coord.X;
Y = (short)coord.Y;
Z = (short)coord.Z;
BlockType = blockType;
}
开发者ID:fragmer,项目名称:fCraft,代码行数:7,代码来源:BlockUpdate.cs
示例3: FuncDrawOperation
protected FuncDrawOperation(Player player, Command cmd)
: base(player)
{
string strFunc = cmd.Next();
if (string.IsNullOrWhiteSpace(strFunc))
{
player.Message("&WEmpty function expression");
return;
}
if (strFunc.Length < 3)
{
player.Message("&WExpression is too short (should be like z=f(x,y))");
return;
}
strFunc = strFunc.ToLower();
_vaxis = GetAxis(SimpleParser.PreparseAssignment(ref strFunc));
_expression = SimpleParser.Parse(strFunc, GetVarArray(_vaxis));
Player.Message("Expression parsed as "+_expression.Print());
string scalingStr=cmd.Next();
_scaler = new Scaler(scalingStr);
}
开发者ID:Eeyle,项目名称:LegendCraftSource,代码行数:25,代码来源:FuncDrawOperation.cs
示例4: 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;
}
}
开发者ID:FonGames,项目名称:BRB-Plugin--800Craft,代码行数:25,代码来源:Class1.cs
示例5: SetParamIteration
public static void SetParamIteration(Player p, CommandReader cmd)
{
string strParam = cmd.Next();
if (string.IsNullOrWhiteSpace(strParam))
{
p.Message("Error: missing param variable name");
return;
}
strParam = strParam.ToLower();
try
{
CheckParamVar(strParam);
double from = ReadDoubleParam(cmd, "lower bound");
double to = ReadDoubleParam(cmd, "upper bound");
double step = ReadDoubleParam(cmd, "step");
if (step == 0 ||
(to - from)/step < 0)
throw new ArgumentException("wrong iteration bounds/step combination");
p.Message("Iteration for " + strParam + " from " + from + " to " + to + " with step " + step + ". " +
((to - from)/step + 1) + " steps.");
GetPlayerParametrizationParamsStorage(p)[VarNameToIdx(strParam[0])] = new double[] {from, to, step};
}
catch (Exception e)
{
p.Message("Error: " + e.Message);
}
}
开发者ID:Magi1053,项目名称:ProCraft,代码行数:33,代码来源:PrepareParametrizedManifold.cs
示例6: 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);
}
}
开发者ID:Magi1053,项目名称:ProCraft,代码行数:27,代码来源:ChatCommands.cs
示例7: TrollHandler
static void TrollHandler(Player player, Command cmd)
{
string Name = cmd.Next();
if (Name == null)
{
player.Message("Player not found. Please specify valid name.");
return;
}
if (!Player.IsValidName(Name))
return;
Player target = Server.FindPlayerOrPrintMatches(player, Name, true, true);
if (target == null)
return;
string options = cmd.Next();
if (options == null)
{
CdTroll.PrintUsage(player);
return;
}
string Message = cmd.NextAll();
if (Message.Length < 1 && options.ToLower() != "leave")
{
player.Message("&WError: Please enter a message for {0}.", target.ClassyName);
return;
}
switch (options.ToLower())
{
case "pm":
if (player.Can(Permission.UseColorCodes) && Message.Contains("%"))
{
Message = Color.ReplacePercentCodes(Message);
}
Server.Players.Message("&Pfrom {0}: {1}",
target.Name, Message);
break;
case "ac":
Chat.SendAdmin(target, Message);
break;
case "st":
case "staff":
Chat.SendStaff(target, Message);
break;
case "i":
case "impersonate":
case "msg":
case "message":
case "m":
Server.Message("{0}&S&F: {1}",
target.ClassyName, Message);
break;
case "leave":
case "disconnect":
case "gtfo":
Server.Players.Message("&SPlayer {0}&S left the server.",
target.ClassyName);
break;
default: player.Message("Invalid option. Please choose st, ac, pm, message or leave");
break;
}
}
开发者ID:727021,项目名称:800craft,代码行数:60,代码来源:TrollPlugin.cs
示例8: 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
示例9: Alice
public Alice(Player player_)
{
player = player_;
myBot = new AIMLbot.Bot();
myUser = new User(player.Name, myBot);//y wont u set my name
Initialize();
}
开发者ID:tboxx,项目名称:800craft-1,代码行数:7,代码来源:BotChatHandler.cs
示例10: FeedData
public FeedData( Block _textType, Vector3I _pos, Bitmap Image, World world, Direction direction_, Player player_ )
{
direction = direction_;
Blocks = new ConcurrentDictionary<string, Vector3I>();
Init( Image, world );
Pos = _pos;
textType = ( byte )_textType;
bgType = ( byte )Block.Air;
FeedData.AddMessages();
MessageCount = 0;
Sentence = FeedData.Messages[MessageCount];
Id = System.Threading.Interlocked.Increment( ref feedCounter );
player = player_;
NormalBrush brush = new NormalBrush( Block.Wood );
DrawOperation Operation = new CuboidWireframeDrawOperation( player );
Operation.AnnounceCompletion = false;
Operation.Brush = brush;
Operation.Context = BlockChangeContext.Drawn;
if ( !Operation.Prepare( new Vector3I[] { StartPos, FinishPos } ) ) {
throw new Exception( "Unable to cubw frame." );
}
Operation.Begin();
AddFeedToList( this, world );
Start();
}
开发者ID:Jonty800,项目名称:800Craft-SMP,代码行数:28,代码来源:FeedData.cs
示例11: BlockUpdate
public BlockUpdate( Player _origin, int _x, int _y, int _h, byte _type ) {
origin = _origin;
x = _x;
y = _y;
h = _h;
type = _type;
}
开发者ID:fragmer,项目名称:fCraft,代码行数:7,代码来源:BlockUpdate.cs
示例12: PayHandler
static void PayHandler(Player player, Command cmd)
{
string targetName = cmd.Next();
string money = cmd.Next();
int amount;
if (money == null)
{
player.Message("&ePlease select the amount of bits you wish to send.");
return;
}
Player target = Server.FindPlayerOrPrintMatches(player, targetName, false, true);
if (target == null)
{
player.Message("&ePlease select a player to pay bits towards.");
return;
}
if (!int.TryParse(money, out amount))
{
player.Message("&ePlease select from a whole number.");
return;
}
PayHandler(player, new Command("/economy pay " + target + " " + money));
}
开发者ID:venofox,项目名称:AtomicCraft,代码行数:27,代码来源:Economy.cs
示例13: DoZone
void DoZone( Player player, Command cmd ) {
if( !player.Can( Permissions.SetSpawn ) ) {
world.NoAccessMessage( player );
return;
}
string name = cmd.Next();
if( name == null ) {
player.Message( "No zone name specified. See " + Color.Help + "/help zone" );
return;
}
if( !Player.IsValidName( name ) ) {
player.Message( "\"" + name + "\" is not a valid zone name" );
return;
}
Zone zone = new Zone();
zone.name = name;
string property = cmd.Next();
if( property == null ) {
player.Message( "No zone rank/whitelist/blacklist specified. See " + Color.Help + "/help zone" );
return;
}
PlayerClass minRank = world.classes.ParseClass( property );
if( minRank != null ) {
zone.buildRank = minRank.rank;
player.tag = zone;
player.marksExpected = 2;
player.marks.Clear();
player.markCount = 0;
player.selectionCallback = MakeZone;
}
}
开发者ID:fragmer,项目名称:fCraft,代码行数:34,代码来源:MapCommands.cs
示例14: SetParametrization
public static void SetParametrization(Player p, Command cmd)
{
string strFunc = cmd.Next();
if (string.IsNullOrWhiteSpace(strFunc))
{
p.Message("Error: empty parametrization expression");
return;
}
if (strFunc.Length < 3)
{
p.Message("Error: expression is too short (should be like x=f(t,u,v))");
return;
}
strFunc = strFunc.ToLower();
try
{
string coordVar = SimpleParser.PreparseAssignment(ref strFunc);
CheckCoordVar(coordVar);
Expression expression = SimpleParser.Parse(strFunc, new string[] { "t", "u", "v" });
p.Message("Expression parsed as " + coordVar + "=" + expression.Print());
GetPlayerParametrizationCoordsStorage(p)[VarNameToIdx(coordVar[0])] = expression;
}
catch (Exception e)
{
p.Message("Error: "+e.Message);
}
}
开发者ID:GMathioud,项目名称:MyCraft,代码行数:32,代码来源:PrepareParametrizedManifold.cs
示例15: FindMainWorld
public static World FindMainWorld( Player player ) {
World rankMain = player.Info.Rank.MainWorld;
if( rankMain != null && player.CanJoin( rankMain ) ) {
return rankMain;
} else {
return MainWorld;
}
}
开发者ID:fragmer,项目名称:fCraft,代码行数:8,代码来源:WorldManager.cs
示例16: Paint
void Paint( Player player, Command cmd ) {
player.replaceMode = !player.replaceMode;
if( player.replaceMode ){
player.Message( "Replacement mode: ON" );
} else {
player.Message( "Replacement mode: OFF" );
}
}
开发者ID:fragmer,项目名称:fCraft,代码行数:8,代码来源:BlockCommands.cs
示例17: CancelDraw
internal static void CancelDraw( Player player, Command command )
{
if( player.marksExpected > 0 ) {
player.marksExpected = 0;
} else {
player.Message( "There is currently nothing to cancel." );
}
}
开发者ID:asiekierka,项目名称:afCraft,代码行数:8,代码来源:DrawCommands.cs
示例18: Call
public bool Call( Player player, Command cmd, bool raiseEvent ) {
if( player == null ) throw new ArgumentNullException( "player" );
if( cmd == null ) throw new ArgumentNullException( "cmd" );
if( raiseEvent && CommandManager.RaiseCommandCallingEvent( cmd, this, player ) ) return false;
Handler( player, cmd );
if( raiseEvent ) CommandManager.RaiseCommandCalledEvent( cmd, this, player );
return true;
}
开发者ID:fragmer,项目名称:fCraft,代码行数:8,代码来源:CommandDescriptor.cs
示例19: PlayerBlowUpCheck
public static bool PlayerBlowUpCheck( Player player )
{
if ( !Failed.Contains( player ) ) {
Failed.Add( player );
return true;
}
return false;
}
开发者ID:GlennMR,项目名称:800craft,代码行数:8,代码来源:MineField.cs
示例20: PrintUsage
public void PrintUsage( Player player ) {
if( player == null ) throw new ArgumentNullException( "player" );
if( Usage != null ) {
player.Message( "Usage: &H{0}", Usage );
} else {
player.Message( "Usage: &H/{0}", Name );
}
}
开发者ID:fragmer,项目名称:fCraft,代码行数:8,代码来源:CommandDescriptor.cs
注:本文中的fCraft.Player类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论