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


C# PlayerInfo.GetClassyName方法代码示例

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


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

示例1: PrintPlayerInfo

        public static void PrintPlayerInfo( Player player, PlayerInfo info ) {
            Player target = Server.FindPlayerExact( info.Name );

            // hide online status when hidden
            if( target != null && !player.CanSee( target ) ) {
                target = null;
            }

            if( info.LastIP.Equals( IPAddress.None ) ) {
                player.Message( "About {0}&S: Never seen before.", info.GetClassyName() );

            } else {
                if( target != null ) {
                    if( target.IsHidden ) {
                        if( player.Can( Permission.ViewPlayerIPs ) ) {
                            player.Message( "About {0}&S: HIDDEN. Online from {1}",
                                            info.GetClassyName(),
                                            info.LastIP );
                        } else {
                            player.Message( "About {0}&S: HIDDEN.",
                                            info.GetClassyName() );
                        }
                    } else {
                        if( player.Can( Permission.ViewPlayerIPs ) ) {
                            player.Message( "About {0}&S: Online now from {1}",
                                            info.GetClassyName(),
                                            info.LastIP );
                        } else {
                            player.Message( "About {0}&S: Online now.",
                                            info.GetClassyName() );
                        }
                    }
                } else {
                    if( player.Can( Permission.ViewPlayerIPs ) ) {
                        player.Message( "About {0}&S: Last seen {1} ago from {2}",
                                        info.GetClassyName(),
                                        info.TimeSinceLastSeen.ToMiniString(),
                                        info.LastIP );
                    } else {
                        player.Message( "About {0}&S: Last seen {1} ago.",
                                        info.GetClassyName(),
                                        info.TimeSinceLastSeen.ToMiniString() );
                    }
                }
                // Show login information
                player.Message( "  Logged in {0} time(s) since {1:d MMM yyyy}.",
                                info.TimesVisited,
                                info.FirstLoginDate );
            }


            // Show ban information
            IPBanInfo ipBan = IPBanList.Get( info.LastIP );
            if( ipBan != null && info.Banned ) {
                player.Message( "  Both name and IP are {0}BANNED&S. See &H/baninfo", Color.Red );
            } else if( ipBan != null ) {
                player.Message( "  IP is {0}BANNED&S (but nick isn't). See &H/baninfo", Color.Red );
            } else if( info.Banned ) {
                player.Message( "  Nick is {0}BANNED&S (but IP isn't). See &H/baninfo", Color.Red );
            }


            if( info.LastIP.ToString() != IPAddress.None.ToString() ) {
                // Show alts
                List<PlayerInfo> altNames = new List<PlayerInfo>();
                int bannedAltCount = 0;
                foreach( PlayerInfo playerFromSameIP in PlayerDB.FindPlayers( info.LastIP, 25 ) ) {
                    if( playerFromSameIP != info ) {
                        altNames.Add( playerFromSameIP );
                        if( playerFromSameIP.Banned ) {
                            bannedAltCount++;
                        }
                    }
                }

                if( altNames.Count > 0 ) {
                    if( bannedAltCount > 0 ) {
                        player.Message( "  {0} accounts ({1} banned) share this IP: {2}",
                                        altNames.Count,
                                        bannedAltCount,
                                        altNames.ToArray().JoinToClassyString() );
                    } else {
                        player.Message( "  {0} accounts share this IP: {1}",
                                        altNames.Count,
                                        altNames.ToArray().JoinToClassyString() );
                    }
                }
            }


            // Stats
            if( info.BlocksDrawn > 500000000 ) {
                player.Message( "  Built {0} and deleted {1} blocks, drew {2}M blocks, wrote {3} messages.",
                                info.BlocksBuilt,
                                info.BlocksDeleted,
                                info.BlocksDrawn / 1000000,
                                info.LinesWritten );
            } else if( info.BlocksDrawn > 500000 ) {
                player.Message( "  Built {0} and deleted {1} blocks, drew {2}K blocks, wrote {3} messages.",
                                info.BlocksBuilt,
//.........这里部分代码省略.........
开发者ID:fragmer,项目名称:fCraft,代码行数:101,代码来源:InfoCommands.cs


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