本文整理汇总了C++中ZSList::CheckAuth方法的典型用法代码示例。如果您正苦于以下问题:C++ ZSList::CheckAuth方法的具体用法?C++ ZSList::CheckAuth怎么用?C++ ZSList::CheckAuth使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ZSList
的用法示例。
在下文中一共展示了ZSList::CheckAuth方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: HandleSendLoginInfoPacket
bool Client::HandleSendLoginInfoPacket(const EQApplicationPacket *app) {
if (app->size != sizeof(LoginInfo_Struct)) {
return false;
}
LoginInfo_Struct *li=(LoginInfo_Struct *)app->pBuffer;
// Quagmire - max len for name is 18, pass 15
char name[19] = {0};
char password[16] = {0};
strn0cpy(name, (char*)li->login_info,18);
strn0cpy(password, (char*)&(li->login_info[strlen(name)+1]), 15);
if (strlen(password) <= 1) {
// TODO: Find out how to tell the client wrong username/password
clog(WORLD__CLIENT_ERR,"Login without a password");
return false;
}
pZoning=(li->zoning==1);
#ifdef IPBASED_AUTH_HACK
struct in_addr tmpip;
tmpip.s_addr = ip;
#endif
uint32 id=0;
bool minilogin = loginserverlist.MiniLogin();
if(minilogin){
struct in_addr miniip;
miniip.s_addr = ip;
id = database.GetMiniLoginAccount(inet_ntoa(miniip));
}
else if(strncasecmp(name, "LS#", 3) == 0)
id=atoi(&name[3]);
else
id=atoi(name);
#ifdef IPBASED_AUTH_HACK
if ((cle = zoneserver_list.CheckAuth(inet_ntoa(tmpip), password)))
#else
if (loginserverlist.Connected() == false && !pZoning) {
clog(WORLD__CLIENT_ERR,"Error: Login server login while not connected to login server.");
return false;
}
if(minilogin)
client_list.CLEAdd(id, name, password, 0, ip, true);
if ((minilogin && (cle = client_list.CheckAuth(id,password,ip))) || (cle = client_list.CheckAuth(id, password)))
#endif
{
if (cle->AccountID() == 0 || (!minilogin && cle->LSID()==0)) {
clog(WORLD__CLIENT_ERR,"ID is 0. Is this server connected to minilogin?");
if(!minilogin)
clog(WORLD__CLIENT_ERR,"If so you forget the minilogin variable...");
else
clog(WORLD__CLIENT_ERR,"Could not find a minilogin account, verify ip address logging into minilogin is the same that is in your account table.");
return false;
}
cle->SetOnline();
clog(WORLD__CLIENT,"Logged in. Mode=%s",pZoning ? "(Zoning)" : "(CharSel)");
if(minilogin){
WorldConfig::DisableStats();
clog(WORLD__CLIENT,"MiniLogin Account #%d",cle->AccountID());
}
else {
clog(WORLD__CLIENT,"LS Account #%d",cle->LSID());
}
const WorldConfig *Config=WorldConfig::get();
if(Config->UpdateStats){
ServerPacket* pack = new ServerPacket;
pack->opcode = ServerOP_LSPlayerJoinWorld;
pack->size = sizeof(ServerLSPlayerJoinWorld_Struct);
pack->pBuffer = new uchar[pack->size];
memset(pack->pBuffer,0,pack->size);
ServerLSPlayerJoinWorld_Struct* join =(ServerLSPlayerJoinWorld_Struct*)pack->pBuffer;
strcpy(join->key,GetLSKey());
join->lsaccount_id = GetLSID();
loginserverlist.SendPacket(pack);
safe_delete(pack);
}
expansion = database.GetExpansion(cle->AccountID());
if(ClientVersionBit == 1)
{
SendApproveWorld();
SendEnterWorld(cle->name());
SendExpansionInfo();
SendCharInfo();
}
else
{
if (!pZoning && ClientVersionBit != 0)
SendGuildList();
SendLogServer();
SendApproveWorld();
//.........这里部分代码省略.........