Hello elites,
as title says i wanna disconnect a spacific player how should i do that?
as title says i wanna disconnect a spacific player how should i do that?
for (int i =0; i < PlayersList.Count; i++)
{
if (PlayersList[i].CharName == ""Kardil") //example
PlayersList[i].Disconnect(); // call disconnect
}
var Player = PlayersList.Where(p => p.CharName == "Kardil"); Player.Disconnect();
PlayersList[i].Disconnect();
Socket.Close();?Quote:
Thanks alot, iam really use a list but seems i couldn't be obvious enough
iam asking about that part
The Disconnect function itself, how it works? i heard that it working with a socket and i have it but it's disconnecting everyone in the server, i mean i can't determine just one player to let that socket work on him only.PHP Code:PlayersList[i].Disconnect();
hope iam obvious this time.
Yes that's exactly what am trying to say/to do but i don't have an idea how to do thatQuote:
Socket.Close();?
And you need to create a new instance for every new connection for it to have it's own socket.
Find the player's instance's client socket and close it...Quote:
Yes that's exactly what am trying to say/to do but i don't have an idea how to do that
When i send that everyone disconnects not just the one i want
So any guide or good hint?