WebCraft
WebCraft copied to clipboard
/kick not working for multiplayer
I have no idea why this is not working, but here is the code for the command:
else if ( msg.substr( 0, 5 ) == "/kick" && client.handshake.address.address == ADMIN_IP ) { var target = msg.substr( 6 ); target = server.findPlayerByName( target );
if ( target != null ) {
server.kick( target.socket, "Kicked by literal god" );
return true;
} else {
server.sendMessage( "Couldn't find that player!", client );
return false;
}
If someone could help me with this ASAP that would be great.
I know it has been two years since you have posted, but I have found the answer. first replace client.handshake.address.address with server.getIp(client) then find where ADMIN_IP is located and in the empty string write ::ffff:YOUR_IP_HERE sorry i'm a little late but good luck to you and future people who find this post :)
I know it has been two years since you have posted, but I have found the answer. first replace
client.handshake.address.addresswithserver.getIp(client)then find where ADMIN_IP is located and in the empty string write::ffff:YOUR_IP_HEREsorry i'm a little late but good luck to you and future people who find this post :)
there should be a badge for this lol :P