forked from teamnwah/openmw-tes3coop
[Master] Add ban/unban functions
This commit is contained in:
parent
26324c2578
commit
fc8232f943
2 changed files with 15 additions and 0 deletions
|
@ -234,3 +234,15 @@ MasterServer::ServerMap *MasterServer::GetServers()
|
||||||
{
|
{
|
||||||
return &servers;
|
return &servers;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MasterServer::ban(const std::string &addr)
|
||||||
|
{
|
||||||
|
banned.push_back(addr);
|
||||||
|
}
|
||||||
|
|
||||||
|
void MasterServer::unban(const std::string &addr)
|
||||||
|
{
|
||||||
|
auto it = find(banned.begin(), banned.end(), addr);
|
||||||
|
if (it != banned.end())
|
||||||
|
banned.erase(it);
|
||||||
|
}
|
||||||
|
|
|
@ -31,6 +31,9 @@ public:
|
||||||
|
|
||||||
ServerMap* GetServers();
|
ServerMap* GetServers();
|
||||||
|
|
||||||
|
void ban(const std::string &addr);
|
||||||
|
void unban(const std::string &addr);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void Thread();
|
void Thread();
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue