mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
added ipban support
commands: /#ipban <nick> /#ipunban <ip>
This commit is contained in:
parent
371af9c241
commit
5784c14ab7
11 changed files with 271 additions and 1 deletions
21
src/server.h
21
src/server.h
|
@ -29,6 +29,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||
#include "map.h"
|
||||
#include "inventory.h"
|
||||
#include "auth.h"
|
||||
#include "ban.h"
|
||||
|
||||
/*
|
||||
Some random functions
|
||||
|
@ -455,6 +456,23 @@ public:
|
|||
g_settings.updateConfigFile(m_configpath.c_str());
|
||||
}
|
||||
|
||||
void setIpBanned(std::string ip)
|
||||
{
|
||||
m_banmanager.add(ip);
|
||||
return;
|
||||
}
|
||||
|
||||
void unsetIpBanned(std::string ip)
|
||||
{
|
||||
m_banmanager.remove(ip);
|
||||
return;
|
||||
}
|
||||
|
||||
con::Peer* getPeerNoEx(u16 peer_id)
|
||||
{
|
||||
return m_con.GetPeerNoEx(peer_id);
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
// con::PeerHandler implementation.
|
||||
|
@ -566,6 +584,9 @@ private:
|
|||
|
||||
// User authentication
|
||||
AuthManager m_authmanager;
|
||||
|
||||
// Bann checking
|
||||
BanManager m_banmanager;
|
||||
|
||||
/*
|
||||
Threads
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue