@@ -57,7 +57,12 @@ def show_dialog(headline, choices, stop=False):
57
57
58
58
pull_server_data ()
59
59
60
- features = {0 : "Normal" , 1 : "Secure-Core" , 2 : "Tor" , 4 : "P2P" }
60
+ features = {
61
+ 1 : "Secure-Core" ,
62
+ 2 : "Tor" ,
63
+ 4 : "P2P" ,
64
+ 8 : "Streaming" ,
65
+ }
61
66
server_tiers = {0 : "F" , 1 : "B" , 2 : "P" }
62
67
63
68
servers = get_servers ()
@@ -76,8 +81,14 @@ def show_dialog(headline, choices, stop=False):
76
81
country_features = []
77
82
for server in countries [country ]:
78
83
feat = int (get_server_value (server , "Features" , servers ))
79
- if not features [feat ] in country_features :
80
- country_features .append (features [feat ])
84
+ for bit_flag in features :
85
+ if (feat & bit_flag ) != 0 :
86
+ if not features [bit_flag ] in country_features :
87
+ country_features .append (features [bit_flag ])
88
+
89
+ if len (country_features ) == 0 :
90
+ country_features .append ("Normal" )
91
+
81
92
choices .append ((country , " | " .join (sorted (country_features ))))
82
93
83
94
country = show_dialog ("Choose a country:" , choices )
@@ -96,16 +107,21 @@ def show_dialog(headline, choices, stop=False):
96
107
get_server_value (servername , "Load" , servers )
97
108
).rjust (3 , " " )
98
109
99
- feature = features [
100
- get_server_value (servername , 'Features' , servers )
101
- ]
110
+ servers_features = []
111
+ feat = int (get_server_value (servername , 'Features' , servers ))
112
+ for bit_flag in features :
113
+ if (feat & bit_flag ) != 0 :
114
+ servers_features .append (features [bit_flag ])
115
+
116
+ if len (servers_features ) == 0 :
117
+ servers_features .append ("Normal" )
102
118
103
119
tier = server_tiers [
104
120
get_server_value (servername , "Tier" , servers )
105
121
]
106
122
107
123
choices .append ((servername , "Load: {0}% | {1} | {2}" .format (
108
- load , tier , feature
124
+ load , tier , ", " . join ( servers_features )
109
125
)))
110
126
111
127
server_result = show_dialog ("Choose the server to connect:" , choices )
0 commit comments