|
|
@ -76,11 +76,11 @@ public class ProtoOut |
|
|
|
commit(); // Make it so! |
|
|
|
} |
|
|
|
|
|
|
|
synchronized public void giveUserListing(String username, String names[]) throws IOException |
|
|
|
synchronized public void giveUserListing(String username, ArrayList<String> names) throws IOException |
|
|
|
{ |
|
|
|
out.writeByte(ProtoID.LISTING.b); |
|
|
|
// I can recognize bad code when I write it, and this is bad code. |
|
|
|
out.writeInt(Arrays.asList(names).stream().collect(Collectors.summingInt((s) -> s.getBytes().length))); |
|
|
|
out.writeInt(names.stream().collect(Collectors.summingInt((s) -> s.getBytes().length))); |
|
|
|
writeUserName(username); |
|
|
|
for (String n : names) |
|
|
|
{ |
|
|
|