More accurate ping and handling all packet types properly
This commit is contained in:
+11
-2
@@ -868,7 +868,12 @@ public class LocalTeamspeakClientSocket
|
|||||||
map.put("clid", Integer.toString(clientId));
|
map.put("clid", Integer.toString(clientId));
|
||||||
return new Client(map);
|
return new Client(map);
|
||||||
}).get();
|
}).get();
|
||||||
return clients.iterator().next();
|
|
||||||
|
Iterator<Client> iterator = clients.iterator();
|
||||||
|
if (iterator.hasNext())
|
||||||
|
return iterator.next();
|
||||||
|
else
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Channel getChannelInfo(int channelId)
|
public Channel getChannelInfo(int channelId)
|
||||||
@@ -879,7 +884,11 @@ public class LocalTeamspeakClientSocket
|
|||||||
new CommandSingleParameter("cid", Integer.toString(channelId))
|
new CommandSingleParameter("cid", Integer.toString(channelId))
|
||||||
);
|
);
|
||||||
|
|
||||||
return executeCommand(command, x -> new Channel(x.toMap())).get().iterator().next();
|
Iterator<Channel> iterator = executeCommand(command, x -> new Channel(x.toMap())).get().iterator();
|
||||||
|
if (iterator.hasNext())
|
||||||
|
return iterator.next();
|
||||||
|
else
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void disconnect()
|
public void disconnect()
|
||||||
|
|||||||
Reference in New Issue
Block a user