吾爱尚玩资源基地
标题:
M端ACE系统获得IP地址的参考代码
[打印本页]
作者:
admin
时间:
2016-4-19 22:53
标题:
M端ACE系统获得IP地址的参考代码
std::string address = fields[0].GetString(); sLog.outString(WORLD_START_CHECKSYS_CHECK);//IP列表已经载入成功,正在验证您的IP,可能需要几分钟
//std::string addressd = Utility::GetLocalAddress()
ACE_INET_Addr *the_addr_array;
size_t count = 0;
if (ACE::get_ip_interfaces (count , the_addr_array) != 0)
{
return false;
}
char addressd[INET6_ADDRSTRLEN];
ACE_INET_Addr *the_addr_array2 = the_addr_array;
while ( count-- )
{
the_addr_array2->addr_to_string(addressd, sizeof(addressd));
printf("%s ", addressd);
address += ":0";
if (addressd!=address)
{
sLog.outError(WORLD_START_NOT_LOCALADDRESS, fields[0].GetString());
break;
}
++the_addr_array2;
}
delete [] the_addr_array;
//ACE_INET_Addr local_address;
//char addressd[30];
//ACE_INET_Addr::addr_to_string(addressd,sizeof(local_address));
if (addressd!=address)//本地IP验证,检查是否是本地IP启动
{
作者:
爱上你的人
时间:
2016-12-9 03:04
吾爱尚玩免费服务端下载!每天20金币走起!
欢迎光临 吾爱尚玩资源基地 (http://bbs.523play.com/)
Powered by Discuz! X3.4