Advertisement
Guest User

Untitled

a guest
Apr 20th, 2019
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. import java.io.*;
  2.  
  3. public class ServerPlayerCount {
  4.  
  5. public int ServerPlayerCount(String server) {
  6. ByteArrayOutputStream b = new ByteArrayOutputStream();
  7. DataOutputStream out = new DataOutputStream(b);
  8. ByteArrayInputStream i = new ByteArrayInputStream(b.toByteArray());
  9. DataInputStream in = new DataInputStream(i);
  10. try {
  11. out.writeUTF("PlayerCount");
  12. out.writeUTF(server);
  13. int playercount = in.readInt();
  14. return playercount;
  15. } catch (IOException e) { e.printStackTrace(); return -1; }
  16. }
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement