fCraft.MaintenanceCommands.FixRealms C# (CSharp) Method

FixRealms() private static method

private static FixRealms ( Player player, Command cmd ) : void
player Player
cmd Command
return void
        private static void FixRealms( Player player, Command cmd )
        {
            int Count = 0;
            player.Message( "Managing worlds..." );
            new System.Threading.Thread( new System.Threading.ThreadStart( delegate {
                foreach ( World w in WorldManager.Worlds ) {
                    foreach ( PlayerInfo p in PlayerDB.PlayerInfoList ) {
                        if ( p == null || w == null )
                            return;
                        if ( p.Name == w.Name ) {
                            w.IsHidden = false;
                            w.IsRealm = true;
                            Count++;
                        }
                    }
                }
            } ) ).Start();
            player.Message( "Converted {0} worlds to Realms", Count.ToString(CultureInfo.InvariantCulture) );
        }