本文整理汇总了C#中fCraft.PlayerInfo类的典型用法代码示例。如果您正苦于以下问题:C# PlayerInfo类的具体用法?C# PlayerInfo怎么用?C# PlayerInfo使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
PlayerInfo类属于fCraft命名空间,在下文中一共展示了PlayerInfo类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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
示例16: FindPlayerInfo
public static bool FindPlayerInfo( string name, out PlayerInfo info )
{
if( name == null ) {
info = null;
return false;
}
bool noDupe;
locker.EnterWriteLock();
noDupe = tree.Get( name, out info );
locker.ExitWriteLock();
return noDupe;
}
开发者ID:asiekierka,项目名称:afCraft,代码行数:14,代码来源:PlayerDB.cs
示例17: Include
// returns the PREVIOUS state of the player
public PermissionOverride Include( PlayerInfo info ) {
if( info == null ) throw new ArgumentNullException( "info" );
lock( playerPermissionListLock ) {
if( includedPlayers.ContainsValue( info ) ) {
UpdatePlayerListCache();
return PermissionOverride.Allow;
} else if( excludedPlayers.ContainsValue( info ) ) {
excludedPlayers.Remove( info.Name.ToLower() );
UpdatePlayerListCache();
return PermissionOverride.Deny;
} else {
includedPlayers.Add( info.Name.ToLower(), info );
UpdatePlayerListCache();
return PermissionOverride.None;
}
}
}
开发者ID:fragmer,项目名称:fCraft,代码行数:18,代码来源:SecurityController.cs
示例18: Add
// Adds a name to the tree.
public bool Add( string name, PlayerInfo payload ) {
StringNode temp = root;
int code;
for( int i = 0; i < name.Length; i++ ) {
code = CharCode( name[i] );
if( temp.children[code] == null ) {
temp.children[code] = new StringNode();
}
if( temp.tag == EMPTY ) {
temp.tag = (byte)code;
} else {
temp.tag = MULTI;
}
temp = temp.children[code];
}
if( temp.payload != null )
return false;
temp.payload = payload;
count++;
return true;
}
开发者ID:fragmer,项目名称:fCraft,代码行数:22,代码来源:StringTree.cs
示例19: AddFakeEntry
public static PlayerInfo AddFakeEntry( string name, RankChangeType rankChangeType ) {
if( name == null ) throw new ArgumentNullException( "name" );
PlayerInfo info;
lock( AddLocker ) {
info = Trie.Get( name );
if( info != null ) throw new ArgumentException( "A PlayerDB entry already exists for this name." );
var e = new PlayerInfoCreatingEventArgs( name, IPAddress.None, RankManager.DefaultRank, true );
Server.RaisePlayerInfoCreatingEvent( e );
if( e.Cancel ) throw new OperationCanceledException( "Cancelled by a plugin." );
info = new PlayerInfo( name, e.StartingRank, false, rankChangeType );
List.Add( info );
Trie.Add( info.Name, info );
UpdateCache();
}
Server.RaisePlayerInfoCreatedEvent( info, false );
return info;
}
开发者ID:fragmer,项目名称:fCraft,代码行数:21,代码来源:PlayerDB.cs
示例20: Get
// Searches for players starting with namePart.
// Returns false if more than one name matched.
// Returns true and sets info to null if no names matched.
public bool Get( string namePart, out PlayerInfo info ) {
StringNode temp = root;
int code;
for( int i = 0; i < namePart.Length; i++ ) {
code = CharCode( namePart[i] );
if( temp.children[code] == null ) {
info = null;
return true; // early detection of no matches
}
temp = temp.children[code];
}
if( temp.payload != null ) {
info = temp.payload;
return true; // exact match
} else if( temp.tag == MULTI ) {
info = null;
return false; // multiple matches
}
for( ; temp.tag < MULTI; temp = temp.children[temp.tag] ) ;
info = temp.payload;
return true; // one autocompleted match
}
开发者ID:fragmer,项目名称:fCraft,代码行数:26,代码来源:StringTree.cs
注:本文中的fCraft.PlayerInfo类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论