Guest User

Untitled

a guest
Jan 22nd, 2018
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.84 KB | None | 0 0
  1. public boolean newPlayerClient(Client client1)
  2. {
  3. int slot = -1;
  4. for(int i = 1; i < Config.MAX_PLAYERS; i++) {
  5. if(players[i] == null || players[i].disconnected) {
  6. slot = i;
  7. break;
  8. }
  9. }
  10. if(slot == -1)
  11. return false;
  12. client1.handler = this;
  13. client1.playerId = slot;
  14. players[slot] = client1;
  15. players[slot].isActive = true;
  16. players[slot].connectedFrom = ((InetSocketAddress) client1.getSession().getRemoteAddress()).getAddress().getHostAddress();
  17. if(Config.SERVER_DEBUG)
  18. Misc.println("Player Slot "+slot+" slot 0 "+players[0]+" Player Hit "+players[slot]);//does nothing.... ;;players dont give the right amount of playesr? i am getting the right amount why not me? logout log inand u wont get the right
  19. return true;
  20. }
Add Comment
Please, Sign In to add comment