File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -13,7 +13,18 @@ public static class InfrastructureParser
13
13
public static List < Building > GetBuildings ( Account acc , HtmlAgilityPack . HtmlDocument htmlDoc )
14
14
{
15
15
List < Building > buildings = new List < Building > ( ) ;
16
- var villMap = htmlDoc . GetElementbyId ( "villageContent" ) ;
16
+ HtmlAgilityPack . HtmlNode villMap = null ;
17
+ switch ( acc . AccInfo . ServerVersion )
18
+ {
19
+ case Classificator . ServerVersionEnum . T4_5 :
20
+ villMap = htmlDoc . GetElementbyId ( "villageContent" ) ;
21
+ break ;
22
+
23
+ case Classificator . ServerVersionEnum . T4_4 :
24
+ villMap = htmlDoc . GetElementbyId ( "village_map" ) ;
25
+ break ;
26
+ }
27
+
17
28
if ( villMap == null ) return buildings ;
18
29
19
30
var fields = villMap . ChildNodes . Where ( x => x . Name == "div" ) . ToList ( ) ;
You can’t perform that action at this time.
0 commit comments