Fixed bug in /kick and /ban commands.
This commit is contained in:
@@ -835,25 +835,33 @@ CString StepManiaLanServer::ListPlayers()
|
|||||||
|
|
||||||
void StepManiaLanServer::Kick(CString &name)
|
void StepManiaLanServer::Kick(CString &name)
|
||||||
{
|
{
|
||||||
for (unsigned int x = 0; x < Client.size(); ++x)
|
bool kicked;
|
||||||
for (int y = 0; y < 2; ++y)
|
for (unsigned int x = 0; x < Client.size(); ++x) {
|
||||||
|
kicked = false;
|
||||||
|
for (int y = 0; (y < 2)&&(kicked == false); ++y)
|
||||||
if (name == Client[x]->Player[y].name)
|
if (name == Client[x]->Player[y].name)
|
||||||
{
|
{
|
||||||
ServerChat("Kicked " + name + ".");
|
ServerChat("Kicked " + name + ".");
|
||||||
Disconnect(x);
|
Disconnect(x);
|
||||||
|
kicked = true;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void StepManiaLanServer::Ban(CString &name)
|
void StepManiaLanServer::Ban(CString &name)
|
||||||
{
|
{
|
||||||
for (unsigned int x = 0; x < Client.size(); ++x)
|
bool kicked;
|
||||||
for (int y = 0; y < 2; ++y)
|
for (unsigned int x = 0; x < Client.size(); ++x) {
|
||||||
|
kicked = false;
|
||||||
|
for (int y = 0; (y < 2)&&(kicked == false); ++y)
|
||||||
if (name == Client[x]->Player[y].name)
|
if (name == Client[x]->Player[y].name)
|
||||||
{
|
{
|
||||||
ServerChat("Banned " + name + ".");
|
ServerChat("Banned " + name + ".");
|
||||||
bannedIPs.push_back(Client[x]->clientSocket.address);
|
bannedIPs.push_back(Client[x]->clientSocket.address);
|
||||||
Disconnect(x);
|
Disconnect(x);
|
||||||
|
kicked = true;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool StepManiaLanServer::IsBanned(CString &ip)
|
bool StepManiaLanServer::IsBanned(CString &ip)
|
||||||
|
|||||||
Reference in New Issue
Block a user