Don't allow an account to have multiple characters logged in at the same time unless admin status > 100
This commit is contained in:
parent
ac15c6b9f7
commit
aa70c950b8
@ -583,7 +583,7 @@ int32 LoginServer::DetermineCharacterLoginRequest ( UsertoWorldRequest_Struct* u
|
|||||||
else
|
else
|
||||||
status = database.GetCharacterAdminStatus ( utwr->lsaccountid , utwr->char_id );
|
status = database.GetCharacterAdminStatus ( utwr->lsaccountid , utwr->char_id );
|
||||||
|
|
||||||
if(status < 100 && zone_list.ClientConnected(utwr->lsaccountid))
|
if(status < 100 && zone_list.ClientConnected(utwr->lsaccountid, utwr->char_id))
|
||||||
status = -9;
|
status = -9;
|
||||||
if(status < 0){
|
if(status < 0){
|
||||||
LogWrite(WORLD__ERROR, 0, "World", "Login Rejected based on PLAY_ERROR (UserStatus) (MinStatus: %i), UserStatus: %i, CharID: %i",loginserver.minLockedStatus,status,utwr->char_id );
|
LogWrite(WORLD__ERROR, 0, "World", "Login Rejected based on PLAY_ERROR (UserStatus) (MinStatus: %i), UserStatus: %i, CharID: %i",loginserver.minLockedStatus,status,utwr->char_id );
|
||||||
@ -592,7 +592,7 @@ int32 LoginServer::DetermineCharacterLoginRequest ( UsertoWorldRequest_Struct* u
|
|||||||
response = PLAY_ERROR_CHAR_NOT_LOADED;
|
response = PLAY_ERROR_CHAR_NOT_LOADED;
|
||||||
break;
|
break;
|
||||||
case -9:
|
case -9:
|
||||||
response = 0;//PLAY_ERROR_ACCOUNT_IN_USE;
|
response = PLAY_ERROR_ACCOUNT_IN_USE;
|
||||||
break;
|
break;
|
||||||
case -8:
|
case -8:
|
||||||
response = PLAY_ERROR_LOADING_ERROR;
|
response = PLAY_ERROR_LOADING_ERROR;
|
||||||
|
@ -1280,7 +1280,7 @@ int32 ZoneList::GetZonesPlayersCount() {
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ZoneList::ClientConnected(int32 account_id){
|
bool ZoneList::ClientConnected(int32 account_id, int32 char_id){
|
||||||
bool ret = false;
|
bool ret = false;
|
||||||
map<string, Client*>::iterator itr;
|
map<string, Client*>::iterator itr;
|
||||||
MClientList.lock();
|
MClientList.lock();
|
||||||
@ -1294,7 +1294,9 @@ bool ZoneList::ClientConnected(int32 account_id){
|
|||||||
if(client_map.size() > 0){
|
if(client_map.size() > 0){
|
||||||
itr=client_map.begin();
|
itr=client_map.begin();
|
||||||
if(itr == client_map.end()){
|
if(itr == client_map.end()){
|
||||||
if(itr->second && itr->second->GetAccountID() == account_id && (itr->second->GetPlayer()->GetActivityStatus() & ACTIVITY_STATUS_LINKDEAD) == 0)
|
if(itr->second && itr->second->GetAccountID() == account_id && itr->second->GetCharacterID() != char_id)
|
||||||
|
ret = true;
|
||||||
|
if(itr->second && itr->second->GetAccountID() == account_id && itr->second->GetCharacterID() == char_id && ((itr->second->GetPlayer()->GetActivityStatus() & ACTIVITY_STATUS_LINKDEAD) == 0))
|
||||||
ret = true;
|
ret = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -532,7 +532,7 @@ class ZoneList {
|
|||||||
client_map.erase(name);
|
client_map.erase(name);
|
||||||
MClientList.unlock();
|
MClientList.unlock();
|
||||||
}
|
}
|
||||||
bool ClientConnected(int32 account_id);
|
bool ClientConnected(int32 account_id, int32 char_id);
|
||||||
void RemoveClientZoneReference(ZoneServer* zone);
|
void RemoveClientZoneReference(ZoneServer* zone);
|
||||||
void ReloadClientQuests();
|
void ReloadClientQuests();
|
||||||
bool DepopFinished();
|
bool DepopFinished();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user