public void Setup() { //DbClient = new MongoClient(connectionString); //DbServer = DbClient.GetServer(); //foreach(var cred in DbClient.Settings.Credentials) { // log.InfoFormat("credentials = {0}:{1} [red]", cred.Username, cred.Password); //} //Database = DbServer.GetDatabase(GameServerSettings.Default.DatabaseName); Worlds = m_App.defaultDatabase.GetCollection <WorldDocument>(GameServerSettings.Default.WorldCollection); worldStates = m_App.defaultDatabase.GetCollection <WorldState>(GameServerSettings.Default.WorldStateCollectionName); log.InfoFormat("world count = {0} [red]", Worlds.Count()); //log.InfoFormat("world count: {0} [red]", ) }
public static int CountLoadedWorlds() { return(Worlds.Count(world => world.IsLoaded)); }