当前位置: 首页>>代码示例>>C#>>正文


C# fCraft.PlayerInfo类代码示例

本文整理汇总了C#中fCraft.PlayerInfo的典型用法代码示例。如果您正苦于以下问题:C# PlayerInfo类的具体用法?C# PlayerInfo怎么用?C# PlayerInfo使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


PlayerInfo类属于fCraft命名空间,在下文中一共展示了PlayerInfo类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Player

 // This constructor is used to create dummy players (such as Console and /dummy)
 // It will soon be replaced by a generic Entity class
 internal Player( World world, string name ) {
     if( name == null ) throw new ArgumentNullException( "name" );
     World = world;
     Info = new PlayerInfo( name, RankManager.HighestRank, true, RankChangeType.AutoPromoted );
     spamBlockLog = new Queue<DateTime>( Info.Rank.AntiGriefBlocks );
     ResetAllBinds();
 }
开发者ID:fragmer,项目名称:fCraft,代码行数:9,代码来源:Player.cs

示例2: Create

 public void Create( BoundingBox bounds, PlayerInfo createdBy ) {
     if( bounds == null ) throw new ArgumentNullException( "bounds" );
     if( createdBy == null ) throw new ArgumentNullException( "createdBy" );
     CreatedDate = DateTime.UtcNow;
     Bounds = bounds;
     CreatedBy = createdBy;
 }
开发者ID:fragmer,项目名称:fCraft,代码行数:7,代码来源:Zone.cs

示例3: Player

 // This constructor is used to create dummy players (such as Console and /dummy)
 // It will soon be replaced by a generic Entity class
 internal Player( World _world, string _name )
 {
     world = _world;
     name = _name;
     nick = name;
     info = new PlayerInfo( _name, ClassList.highestClass );
 }
开发者ID:asiekierka,项目名称:afCraft,代码行数:9,代码来源:Player.cs

示例4: AddUnrecognizedPlayer

 /// <summary> Adds a new PlayerInfo entry for a player who has never been online, by name. </summary>
 /// <returns> A newly-created PlayerInfo entry. </returns>
 public PlayerInfo AddUnrecognizedPlayer( string name, Rank startingRank, RankChangeType rankChangeType ) {
     if( name == null ) throw new ArgumentNullException( "name" );
     if( startingRank == null ) throw new ArgumentNullException( "startingRank" );
     int id = GetNextID();
     PlayerInfo info = new PlayerInfo( id, name, startingRank, rankChangeType, false );
     trie.Add( name, info );
     return info;
 }
开发者ID:fragmer,项目名称:fCraft,代码行数:10,代码来源:FlatfilePlayerDBProvider.cs

示例5: AddPlayer

 /// <summary> Adds a new PlayerInfo entry for an actual, logged-in player. </summary>
 /// <returns> A newly-created PlayerInfo entry. </returns>
 public PlayerInfo AddPlayer( string name, Rank startingRank, RankChangeType rankChangeType, IPAddress address ) {
     if( name == null ) throw new ArgumentNullException( "name" );
     if( address == null ) throw new ArgumentNullException( "address" );
     int id = GetNextID();
     PlayerInfo info = new PlayerInfo( id, name, startingRank, rankChangeType, address );
     trie.Add( name, info );
     return info;
 }
开发者ID:fragmer,项目名称:fCraft,代码行数:10,代码来源:FlatfilePlayerDBProvider.cs

示例6: Player

 // Normal constructor
 internal Player( World _world, string _name, Session _session, Position _pos ) {
     world = _world;
     name = _name;
     nick = name;
     session = _session;
     pos = _pos;
     info = world.db.FindPlayerInfo( this );
 }
开发者ID:fragmer,项目名称:fCraft,代码行数:9,代码来源:Player.cs

示例7: CanRevoke

 public bool CanRevoke( PlayerInfo player ) {
     PermissionLimits limits = GetLimit( player );
     if( limits == null ) {
         return false;
     } else {
         return limits.CanRevoke;
     }
 }
开发者ID:fragmer,项目名称:fCraft,代码行数:8,代码来源:PermissionController.cs

示例8: AddSuperPlayer

 internal static PlayerInfo AddSuperPlayer( ReservedPlayerID id, [NotNull] string name, [NotNull] Rank rank ) {
     if( name == null ) throw new ArgumentNullException( "name" );
     CheckIfLoaded();
     PlayerInfo newInfo = new PlayerInfo( (int)id, name, rank, RankChangeType.AutoPromoted, true ) {
         RaisePropertyChangedEvents = true
     };
     return newInfo;
 }
开发者ID:fragmer,项目名称:fCraft,代码行数:8,代码来源:PlayerDB.cs

示例9: CheckKickReason

 // Throws a PlayerOpException if reason is required but missing.
 internal static void CheckKickReason( [CanBeNull] string reason, [NotNull] Player player, PlayerInfo targetInfo ) {
     if( player == null ) throw new ArgumentNullException( "player" );
     if( ConfigKey.RequireKickReason.Enabled() && String.IsNullOrEmpty( reason ) ) {
         const string msg = "Please specify a kick reason.";
         const string colorMsg = "&S" + msg;
         throw new PlayerOpException( player, targetInfo, PlayerOpExceptionCode.ReasonRequired, msg, colorMsg );
     }
 }
开发者ID:fragmer,项目名称:fCraft,代码行数:9,代码来源:PlayerOpException.cs

示例10: GetPlayerLimit

 PermissionLimits GetPlayerLimit( PlayerInfo player ) {
     PermissionLimits limiter;
     if( playerInclusions.TryGetValue( player.Name, out limiter ) ) {
         return limiter;
     } else if( Parent != null ) {
         return Parent.GetPlayerLimit( player );
     } else {
         return null;
     }
 }
开发者ID:fragmer,项目名称:fCraft,代码行数:10,代码来源:PermissionController.cs

示例11: Can

 public bool Can( PlayerInfo player, int quantity ) {
     if( ( Node.Flags & PermissionFlags.NeedsQuantity ) == 0 ) {
         throw new PermissionCheckException( "Quantity limit is not applicable to " + Node.Name );
     }
     PermissionLimits limits = GetLimit( player );
     if( limits == null ) {
         return false;
     } else {
         return ( limits.MaxQuantity <= quantity );
     }
 }
开发者ID:fragmer,项目名称:fCraft,代码行数:11,代码来源:PermissionController.cs

示例12: GetPlayerScoreEntry

 //Function to format and return a player's score entry. Returns null if no score found
 public static String GetPlayerScoreEntry( PlayerInfo player )
 {
     string toReturn = null;
     foreach ( String s in PlayerKillScores ) {
         if ( s.Contains( '$' ) ) {
             if ( s.Split( '$' )[0] == player.Name ) {
                 toReturn = s;
             }
         }
     }
     return toReturn;
 }
开发者ID:Jonty800,项目名称:Guilds,代码行数:13,代码来源:Cache.cs

示例13: PlayerOpException

 public PlayerOpException( [NotNull] Player player, PlayerInfo target,
                           PlayerOpExceptionCode errorCode,
                           [NotNull] string message, [NotNull] string messageColored )
     : base( message ) {
     if( player == null ) throw new ArgumentNullException( "player" );
     if( message == null ) throw new ArgumentNullException( "message" );
     if( messageColored == null ) throw new ArgumentNullException( "messageColored" );
     Player = player;
     Target = target;
     ErrorCode = errorCode;
     MessageColored = messageColored;
 }
开发者ID:fragmer,项目名称:fCraft,代码行数:12,代码来源:PlayerOpException.cs

示例14: CheckRankChangeReason

 // Throws a PlayerOpException if reason is required but missing.
 internal static void CheckRankChangeReason( [CanBeNull] string reason, [NotNull] Player player, PlayerInfo targetInfo, bool promoting ) {
     if( player == null ) throw new ArgumentNullException( "player" );
     if( ConfigKey.RequireRankChangeReason.Enabled() && String.IsNullOrEmpty( reason ) ) {
         string msg;
         if( promoting ) {
             msg = "Please specify a promotion reason.";
         } else {
             msg = "Please specify a demotion reason.";
         }
         string colorMsg = "&S" + msg;
         throw new PlayerOpException( player, targetInfo, PlayerOpExceptionCode.ReasonRequired, msg, colorMsg );
     }
 }
开发者ID:fragmer,项目名称:fCraft,代码行数:14,代码来源:PlayerOpException.cs

示例15: FindPlayerInfo

 public PlayerInfo FindPlayerInfo( Player player ) {
     if( player == null ) return null;
     
     locker.EnterWriteLock();
     PlayerInfo info = tree.Get( player.name );
     if( info == null ) {
         info = new PlayerInfo( world, player );
         tree.Add( player.name, info );
         list.Add( info );
     }
     locker.ExitWriteLock();
     return info;
 }
开发者ID:fragmer,项目名称:fCraft,代码行数:13,代码来源:PlayerDB.cs


注:本文中的fCraft.PlayerInfo类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。