當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。