/// <summary> /// Gets worlds list from database. /// </summary> /// <returns>Worlds list pre-cached data.</returns> public override WorldSummary[] Worlds_Cache() { MsSqlDataCommand msdc = new MsSqlDataCommand ( "[Worlds_Cache]", CommandType.StoredProcedure ); SetConnection(ref msdc, m_ActiveConnections.Next()); DataTable worlds = new DataTable(); WorldSummary[] array = new WorldSummary[0] { }; if ( msdc.Execute(ref worlds) && worlds.Rows.Count > 0 ) { array = new WorldSummary[worlds.Rows.Count]; for ( int i = 0; i < array.Length; i++ ) { DataRow row = worlds.Rows[i]; array[i] = new WorldSummary() { ID = ( byte )row["id"], Address = System.Net.IPAddress.Parse(( string )row["outer_ip"]).GetAddressBytes(), Port = ( int )row["port"], AccessLevel = ( byte )row["access_level"], UsersMax = ( short )row["max_users"], AgeLimit = ( byte )row["age_limit"], IsPvP = ( bool )row["is_pvp"], IsTestServer = ( bool )row["is_test"], ShowClock = ( bool )row["show_clock"], ShowBrackets = ( bool )row["show_brackets"] }; } } ReleaseCommand(msdc); return array; }