- Home /
Question by
erenaydin · Feb 08, 2012 at 10:17 PM ·
playernetworkdisconnect
Disconnecting a specified client?
Hi. Let's say I'm server, I'm waiting a verify information from connected players when they are connecting. But it is not my client, probably a spam or hacker. How can I disconnect it from server?
I make a picture for it
Comment
Best Answer
Answer by asafsitner · Feb 08, 2012 at 10:43 PM
`Network.CloseConnection();` is what you are looking for.
Presuming you're using Unity's native networking, that is. If you're running your own server that's something else entirely, but for Unity the server knows all the IP addresses of all clients and can terminate connection to a specific IP address.
Sadly it's not possible to disallow a client to connect to the server, you can only close a connection after it's been made.
Your answer