Example #1
0
        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]", )
        }
Example #2
0
 public static int CountLoadedWorlds()
 {
     return(Worlds.Count(world => world.IsLoaded));
 }