|
@@ -183,6 +183,10 @@ class ServerListViewModel(context: Context): ViewModel() {
|
|
|
serverData?.servers?.let { serversListAllGlobal.addAll(it) }
|
|
|
}
|
|
|
|
|
|
+ serversGroupListGlobal.forEachIndexed { index, serverDataGlobal ->
|
|
|
+ serverDataGlobal?.servers?.let { serversListAllGlobal.addAll(it) }
|
|
|
+ }
|
|
|
+
|
|
|
// serversListAllGlobal.forEachIndexed { index, serverData ->
|
|
|
// Log.d("test_serverDataAll", "$index: ${serverData.server_name} ${serverData.ping}")
|
|
|
// }
|
|
@@ -325,7 +329,7 @@ class ServerListViewModel(context: Context): ViewModel() {
|
|
|
}
|
|
|
|
|
|
// val data2 = ArrayList<Server>()
|
|
|
-
|
|
|
+//
|
|
|
// data.forEachIndexed { index, server ->
|
|
|
// calculatePing(server) {
|
|
|
// Log.d("serverInfo_ping", "All: ${server.server_name} $it")
|
|
@@ -546,8 +550,8 @@ class ServerListViewModel(context: Context): ViewModel() {
|
|
|
var isServerFound: Boolean = false
|
|
|
|
|
|
serverList.let {
|
|
|
- it.forEach {
|
|
|
- it.servers?.forEach { server ->
|
|
|
+ it?.forEach {
|
|
|
+ it?.servers?.forEach { server ->
|
|
|
tempList.add(server)
|
|
|
}
|
|
|
}
|
|
@@ -555,12 +559,16 @@ class ServerListViewModel(context: Context): ViewModel() {
|
|
|
|
|
|
for (i in tempList.indices) {
|
|
|
val obj = tempList[i]
|
|
|
+ Log.d("test_ServerProtocol", "${obj.server_name} ${obj.protocol}")
|
|
|
if (obj.server_name == serverObj.server_name && protocol.title.equals(obj.protocol, ignoreCase = true)) {
|
|
|
server = obj
|
|
|
isServerFound = true
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ Log.d("test_ServerProtocol", "is? ${server.server_name} $isServerFound")
|
|
|
+
|
|
|
+
|
|
|
return ServerProtocol(server, isServerFound)
|
|
|
}
|
|
|
|