java - How to get User by id and disconnect User -
this code. user = null
how user id , disconnect user?
zone zone = (zone)event.getparameter(sfseventparam.zone); user user = zone.getuserbyid(1); this.getapi().disconnectuser(user,clientdisconnectionreason.idle);
you getting user id = 1 , id may not valid , id sfs gives every user may vary , it's not array starts 0 , may change every time 1 connect or disconnect , when player connect sfs , takes id , when disconnect , 1 else may take , can user id :
collection<user> users = getparentextension().getparentzone().getuserlist(); while (users.iterator().hasnext()) { int id = users.iterator().next().getid(); }
and use disconnect function disconnect him or user user collection disconnect him.
Comments
Post a Comment