Updated Realmd to now accept both local and external connections

Thanks to Shauren and TrinityCore for the first implementation
This commit is contained in:
Foereaper 2015-04-12 22:15:37 +02:00
parent 85484cf2f9
commit 19851a0a6c
4 changed files with 26 additions and 2 deletions

@ -1 +1 @@
Subproject commit 86cbfcf877504485df94311b91d88cd932e7783a
Subproject commit 9c9e7ae7919e1cd5ce1f454520b9adf3316e2137

View File

@ -262,6 +262,21 @@ bool IsIPAddress(char const* ipaddress)
return ACE_OS::inet_addr(ipaddress) != INADDR_NONE;
}
std::string GetAddressString(ACE_INET_Addr const& addr)
{
char buf[ACE_MAX_FULLY_QUALIFIED_NAME_LEN + 16];
addr.addr_to_string(buf, ACE_MAX_FULLY_QUALIFIED_NAME_LEN + 16);
return buf;
}
bool IsIPAddrInNetwork(ACE_INET_Addr const& net, ACE_INET_Addr const& addr, ACE_INET_Addr const& subnetMask)
{
uint32 mask = subnetMask.get_ip_address();
if ((net.get_ip_address() & mask) == (addr.get_ip_address() & mask))
return true;
return false;
}
/// create PID file
uint32 CreatePIDFile(const std::string& filename)
{

View File

@ -26,6 +26,8 @@
#define MANGOS_H_UTIL
#include "Common/Common.h"
#include <ace/Null_Mutex.h>
#include <ace/INET_Addr.h>
#include <string>
#include <vector>
@ -700,6 +702,13 @@ void vutf8printf(FILE* out, const char* str, va_list* ap);
* @return bool
*/
bool IsIPAddress(char const* ipaddress);
/// Checks if address belongs to the a network with specified submask
bool IsIPAddrInNetwork(ACE_INET_Addr const& net, ACE_INET_Addr const& addr, ACE_INET_Addr const& subnetMask);
/// Transforms ACE_INET_Addr address into string format "dotted_ip:port"
std::string GetAddressString(ACE_INET_Addr const& addr);
/**
* @brief
*

View File

@ -27,5 +27,5 @@
#define REVISION_NR "21000"
#define REVISION_DB_CHARACTERS "required_21000_01_warden_action"
#define REVISION_DB_MANGOS "required_21000_08_warden_checks"
#define REVISION_DB_REALMD "required_20150412_warden_db_log"
#define REVISION_DB_REALMD "required_20150412_auth_realmlist"
#endif // __REVISION_H__