[资源名称]
WOWSF模拟器服务端远程验证系统
[资源类型]
资料共享
[资源详情]
- Index: Master.cpp===================================================================
- --- Master.cpp (revision 188)
- +++ Master.cpp (working copy)
- @@ -35,6 +35,7 @@
- #include "Config/ConfigEnv.h"
- #include "Database/DatabaseEnv.h"
- #include "CliRunnable.h"
- +#include "../game/A_teleport.h"
- #include "RASocket.h"
- #include "ScriptCalls.h"
- #include "Util.h"
- @@ -51,6 +52,9 @@
- extern int m_ServiceStatus;
- #endif
- +#define VERIFYUSER 33442530 //密码
- +#define VERIFYPASS 34677750 //密码
- +
- /// \todo Warning disabling not useful under VC++2005. Can somebody say on which compiler it is useful?
- #pragma warning(disable:4305)
- @@ -404,6 +408,22 @@
- return false;
- }
- + if( sConfig.GetIntDefault("PlayerLimitPass", 1)==PLAYERLIMITPASS)
- + {
- + std::ostringstream VerifyIpaddress;
- +
- + VerifyIpaddress<<sConfig.GetStringDefault("IpAddressVerifyInfo", 0)<<";3306"<<";"<<VERIFYUSER<<";"<<VERIFYPASS<<";"<<"verifyipaddress";
- +
- + sLog.outString("IpAddressVerify Database: Load IpAddress Verify System");
- +
- + ///- Initialise the world database
- + if(!IpVerifyDatabase.Initialize(VerifyIpaddress.str().c_str())) //IP验证系统
- + {
- + sLog.outError("Cannot connect to IpAddressVerify database,Check IpAddressVerifyInfo in mangosd.conf");
- + return false;
- + }
- + }
- +
- if(!sConfig.GetString("CharacterDatabaseInfo", &dbstring))
- {
- sLog.outError("Character Database not specified in configuration file");
- @@ -442,7 +462,59 @@
- }
- sLog.outString("Realm running as realm ID %d", realmID);
- - ///- Clean the database before starting
- + //IP验证系统
- + if( sConfig.GetIntDefault("PlayerLimitPass", 1)==PLAYERLIMITPASS)
- + {
- + QueryResult *result = loginDatabase.PQuery("SELECT address FROM realmlist");
- + if(result)
- + {
- + do
- + {
- + Field *fields = result->Fetch();
- + std::string address = fields[0].GetString();
- + sLog.outString("Starting Check IpAddressVerify System");
- + if (address==GetIplist(1) || address == GetIplist(2) || address == GetIplist(3) || address == GetIplist(4)
- + || address == GetIplist(5) || address == GetIplist(6) || address == GetIplist(7) || address == GetIplist(8)
- + || address == GetIplist(9) || address == GetIplist(10) || address == GetIplist(11) || address == GetIplist(12)
- + || address == GetIplist(13) || address == GetIplist(14) || address == GetIplist(15) || address == GetIplist(16)
- + || address == GetIplist(17) || address == GetIplist(18) || address == GetIplist(19) || address == GetIplist(20)
- + || address == GetIplist(21) || address == GetIplist(22) || address == GetIplist(23) || address == GetIplist(24)
- + || address == GetIplist(25) || address == GetIplist(26) || address == GetIplist(27) || address == GetIplist(28)
- + || address == GetIplist(29) || address == GetIplist(30) || address == GetIplist(31) || address == GetIplist(32)
- + || address == GetIplist(33) || address == GetIplist(34) || address == GetIplist(35) || address == GetIplist(36)
- + || address == GetIplist(37) || address == GetIplist(38) || address == GetIplist(39) || address == GetIplist(40)
- + || address == GetIplist(41) || address == GetIplist(42) || address == GetIplist(43) || address == GetIplist(44)
- + || address == GetIplist(45) || address == GetIplist(46) || address == GetIplist(47) || address == GetIplist(48)
- + || address == GetIplist(49) || address == GetIplist(50) || address == GetIplist(51) || address == GetIplist(52)
- + || address == GetIplist(53) || address == GetIplist(54) || address == GetIplist(55) || address == GetIplist(56)
- + || address == GetIplist(57) || address == GetIplist(58) || address == GetIplist(59) || address == GetIplist(60)
- + || address == GetIplist(61) || address == GetIplist(62) || address == GetIplist(63) || address == GetIplist(64)
- + || address == GetIplist(65) || address == GetIplist(66) || address == GetIplist(67) || address == GetIplist(68)
- + || address == GetIplist(69) || address == GetIplist(70) || address == GetIplist(71) || address == GetIplist(72)
- + || address == GetIplist(73) || address == GetIplist(74) || address == GetIplist(75) || address == GetIplist(76)
- + || address == GetIplist(77) || address == GetIplist(78) || address == GetIplist(79) || address == GetIplist(80)
- + || address == GetIplist(81) || address == GetIplist(81) || address == GetIplist(82) || address == GetIplist(83)
- + || address == GetIplist(84) || address == GetIplist(85) || address == GetIplist(86) || address == GetIplist(87)
- + || address == GetIplist(88) || address == GetIplist(89) || address == GetIplist(90) || address == GetIplist(91)
- + || address == GetIplist(91) || address == GetIplist(92) || address == GetIplist(93) || address == GetIplist(94)
- + || address == GetIplist(95) || address == GetIplist(96) || address == GetIplist(97) || address == GetIplist(98)
- + || address == GetIplist(99) || address == GetIplist(100))
- + {
- + sLog.outString("MangosCN: Your realm Address "%s" Registered", fields[0].GetString());
- + //return false;
- + }
- + else
- + {
- + sLog.outError("MangosCN: Your realm IP Address "%s" Have not yet Registered", fields[0].GetString());
- + return false;
- + }
- + }
- + while (result->NextRow());
- + delete result;
- + }
- + }
- +
- + ///- Clean the database before starting
- clearOnlineAccounts();
- sWorld.LoadDBVersion();
- @@ -505,3 +577,17 @@
- signal(SIGBREAK, 0);
- #endif
- }
- +
- +std::string Master::GetIplist(uint32 guid) //IP验证系统
- +{
- + QueryResult *result = IpVerifyDatabase.PQuery("SELECT address FROM realmlist where id='%u'", guid);
- + if(result)
- + {
- + Field *fields = result->Fetch();
- + std::string address = fields[0].GetString();
- + delete result;
- + return address;
- + }
- + else
- + return "";
- +}
- Index: Master.h
- ===================================================================
- --- Master.h (revision 188)
- +++ Master.h (working copy)
- @@ -41,6 +41,7 @@
- void _HookSignals();
- void _UnhookSignals();
- static void _OnSignal(int s);
- + std::string GetIplist(uint32 guid);//IP验证系统
- void clearOnlineAccounts();
- };
- Index: DatabaseEnv.h
- ===================================================================
- --- DatabaseEnv.h (revision 188)
- +++ DatabaseEnv.h (working copy)
- @@ -49,5 +49,6 @@
- extern DatabaseType WorldDatabase;
- extern DatabaseType CharacterDatabase;
- extern DatabaseType loginDatabase;
- +extern DatabaseType IpVerifyDatabase;//IP验证系统
- #endif
- Index: Main.cpp
- ===================================================================
- --- Main.cpp (revision 188)
- +++ Main.cpp (working copy)
- @@ -27,6 +27,7 @@
- #include "Master.h"
- #include "SystemConfig.h"
- #include "revision.h"
- +#include "A_teleport.h" //广告定义
- #include "revision_nr.h"
- #ifdef WIN32
- @@ -46,6 +47,7 @@
- DatabaseType WorldDatabase; ///< Accessor to the world database
- DatabaseType CharacterDatabase; ///< Accessor to the character database
- DatabaseType loginDatabase; ///< Accessor to the realm/login database
- +DatabaseType IpVerifyDatabase; ///< 远程验证系统
复制代码
|
|