mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-19 17:38:26 +00:00
Remove trailing whitespace
This commit is contained in:
+46
-46
@@ -47,11 +47,11 @@ ClientList::~ClientList() {
|
||||
|
||||
|
||||
void ClientList::Process() {
|
||||
|
||||
|
||||
if (CLStale_timer.Check())
|
||||
CLCheckStale();
|
||||
|
||||
|
||||
|
||||
|
||||
LinkedListIterator<Client*> iterator(list);
|
||||
|
||||
iterator.Reset();
|
||||
@@ -167,13 +167,13 @@ void ClientList::GetCLEIP(uint32 iIP) {
|
||||
|
||||
// If the number of connections exceeds the lower limit
|
||||
if (IPInstances > (RuleI(World, MaxClientsPerIP))) {
|
||||
|
||||
|
||||
// If MaxClientsSetByStatus is set to True, override other IP Limit Rules
|
||||
if (RuleB(World, MaxClientsSetByStatus)) {
|
||||
|
||||
// The IP Limit is set by the status of the account if status > MaxClientsPerIP
|
||||
if (IPInstances > countCLEIPs->Admin()) {
|
||||
|
||||
|
||||
if(RuleB(World, IPLimitDisconnectAll)) {
|
||||
DisconnectByIP(iIP);
|
||||
return;
|
||||
@@ -273,7 +273,7 @@ ClientListEntry* ClientList::FindCLEByAccountID(uint32 iAccID) {
|
||||
|
||||
ClientListEntry* ClientList::FindCLEByCharacterID(uint32 iCharID) {
|
||||
LinkedListIterator<ClientListEntry*> iterator(clientlist);
|
||||
|
||||
|
||||
iterator.Reset();
|
||||
while(iterator.MoreElements()) {
|
||||
if (iterator.GetData()->CharID() == iCharID) {
|
||||
@@ -428,9 +428,9 @@ ClientListEntry* ClientList::CheckAuth(const char* iName, const char* iPassword)
|
||||
iterator.Advance();
|
||||
}
|
||||
int16 tmpadmin;
|
||||
|
||||
|
||||
_log(WORLD__ZONELIST,"Login with '%s' and '%s'", iName, iPassword);
|
||||
|
||||
|
||||
uint32 accid = database.CheckLogin(iName, iPassword, &tmpadmin);
|
||||
if (accid) {
|
||||
ClientListEntry* tmp = new ClientListEntry(GetNextCLEID(), accid, iName, tmpMD5, tmpadmin);
|
||||
@@ -531,16 +531,16 @@ void ClientList::SendWhoAll(uint32 fromid,const char* to, int16 admin, Who_All_S
|
||||
const char* tmpZone = database.GetZoneName(countcle->zone());
|
||||
if (
|
||||
(countcle->Online() >= CLE_Status_Zoning) &&
|
||||
(!countcle->GetGM() || countcle->Anon() != 1 || admin >= countcle->Admin()) &&
|
||||
(!countcle->GetGM() || countcle->Anon() != 1 || admin >= countcle->Admin()) &&
|
||||
(whom == 0 || (
|
||||
((countcle->Admin() >= 80 && countcle->GetGM()) || whom->gmlookup == 0xFFFF) &&
|
||||
(whom->lvllow == 0xFFFF || (countcle->level() >= whom->lvllow && countcle->level() <= whom->lvlhigh && (countcle->Anon()==0 || admin > countcle->Admin()))) &&
|
||||
(whom->wclass == 0xFFFF || (countcle->class_() == whom->wclass && (countcle->Anon()==0 || admin > countcle->Admin()))) &&
|
||||
((countcle->Admin() >= 80 && countcle->GetGM()) || whom->gmlookup == 0xFFFF) &&
|
||||
(whom->lvllow == 0xFFFF || (countcle->level() >= whom->lvllow && countcle->level() <= whom->lvlhigh && (countcle->Anon()==0 || admin > countcle->Admin()))) &&
|
||||
(whom->wclass == 0xFFFF || (countcle->class_() == whom->wclass && (countcle->Anon()==0 || admin > countcle->Admin()))) &&
|
||||
(whom->wrace == 0xFFFF || (countcle->race() == whom->wrace && (countcle->Anon()==0 || admin > countcle->Admin()))) &&
|
||||
(whomlen == 0 || (
|
||||
(tmpZone != 0 && strncasecmp(tmpZone, whom->whom, whomlen) == 0) ||
|
||||
strncasecmp(countcle->name(),whom->whom, whomlen) == 0 ||
|
||||
(strncasecmp(guild_mgr.GetGuildName(countcle->GuildID()), whom->whom, whomlen) == 0) ||
|
||||
(tmpZone != 0 && strncasecmp(tmpZone, whom->whom, whomlen) == 0) ||
|
||||
strncasecmp(countcle->name(),whom->whom, whomlen) == 0 ||
|
||||
(strncasecmp(guild_mgr.GetGuildName(countcle->GuildID()), whom->whom, whomlen) == 0) ||
|
||||
(admin >= 100 && strncasecmp(countcle->AccountName(), whom->whom, whomlen) == 0)
|
||||
))
|
||||
))
|
||||
@@ -607,20 +607,20 @@ void ClientList::SendWhoAll(uint32 fromid,const char* to, int16 admin, Who_All_S
|
||||
int idx=-1;
|
||||
while(iterator.MoreElements()) {
|
||||
cle = iterator.GetData();
|
||||
|
||||
|
||||
const char* tmpZone = database.GetZoneName(cle->zone());
|
||||
if (
|
||||
(cle->Online() >= CLE_Status_Zoning) &&
|
||||
(!cle->GetGM() || cle->Anon() != 1 || admin >= cle->Admin()) &&
|
||||
(!cle->GetGM() || cle->Anon() != 1 || admin >= cle->Admin()) &&
|
||||
(whom == 0 || (
|
||||
((cle->Admin() >= 80 && cle->GetGM()) || whom->gmlookup == 0xFFFF) &&
|
||||
(whom->lvllow == 0xFFFF || (cle->level() >= whom->lvllow && cle->level() <= whom->lvlhigh && (cle->Anon()==0 || admin>cle->Admin()))) &&
|
||||
(whom->wclass == 0xFFFF || (cle->class_() == whom->wclass && (cle->Anon()==0 || admin>cle->Admin()))) &&
|
||||
((cle->Admin() >= 80 && cle->GetGM()) || whom->gmlookup == 0xFFFF) &&
|
||||
(whom->lvllow == 0xFFFF || (cle->level() >= whom->lvllow && cle->level() <= whom->lvlhigh && (cle->Anon()==0 || admin>cle->Admin()))) &&
|
||||
(whom->wclass == 0xFFFF || (cle->class_() == whom->wclass && (cle->Anon()==0 || admin>cle->Admin()))) &&
|
||||
(whom->wrace == 0xFFFF || (cle->race() == whom->wrace && (cle->Anon()==0 || admin>cle->Admin()))) &&
|
||||
(whomlen == 0 || (
|
||||
(tmpZone != 0 && strncasecmp(tmpZone, whom->whom, whomlen) == 0) ||
|
||||
strncasecmp(cle->name(),whom->whom, whomlen) == 0 ||
|
||||
(strncasecmp(guild_mgr.GetGuildName(cle->GuildID()), whom->whom, whomlen) == 0) ||
|
||||
(tmpZone != 0 && strncasecmp(tmpZone, whom->whom, whomlen) == 0) ||
|
||||
strncasecmp(cle->name(),whom->whom, whomlen) == 0 ||
|
||||
(strncasecmp(guild_mgr.GetGuildName(cle->GuildID()), whom->whom, whomlen) == 0) ||
|
||||
(admin >= 100 && strncasecmp(cle->AccountName(), whom->whom, whomlen) == 0)
|
||||
))
|
||||
))
|
||||
@@ -676,7 +676,7 @@ void ClientList::SendWhoAll(uint32 fromid,const char* to, int16 admin, Who_All_S
|
||||
formatstring=5023;//display guild
|
||||
else if(cle->Anon()==2 && admin>=cle->Admin() && admin>0)
|
||||
formatstring=5022;//display everything
|
||||
|
||||
|
||||
//war* wars2 = (war*)pack2->pBuffer;
|
||||
|
||||
uint32 plclass_=0;
|
||||
@@ -695,20 +695,20 @@ void ClientList::SendWhoAll(uint32 fromid,const char* to, int16 admin, Who_All_S
|
||||
zonestring=5006;
|
||||
plzone=cle->zone();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
if(admin>=cle->Admin() && admin>0)
|
||||
unknown80[0]=cle->Admin();
|
||||
else
|
||||
unknown80[0]=0xFFFFFFFF;
|
||||
unknown80[1]=0xFFFFFFFF;//1035
|
||||
|
||||
|
||||
|
||||
//char plstatus[20]={0};
|
||||
//sprintf(plstatus, "Status %i",cle->Admin());
|
||||
char plname[64]={0};
|
||||
strcpy(plname,cle->name());
|
||||
|
||||
|
||||
char placcount[30]={0};
|
||||
if(admin>=cle->Admin() && admin>0)
|
||||
strcpy(placcount,cle->AccountName());
|
||||
@@ -803,7 +803,7 @@ void ClientList::SendFriendsWho(ServerFriendsWho_Struct *FriendsWho, WorldTCPCon
|
||||
try{
|
||||
ClientListEntry* cle;
|
||||
int FriendsOnline = FriendsCLEs.size();
|
||||
int PacketLength = sizeof(WhoAllReturnStruct) + (47 * FriendsOnline) + TotalLength;
|
||||
int PacketLength = sizeof(WhoAllReturnStruct) + (47 * FriendsOnline) + TotalLength;
|
||||
ServerPacket* pack2 = new ServerPacket(ServerOP_WhoAllReply, PacketLength);
|
||||
memset(pack2->pBuffer,0,pack2->size);
|
||||
uchar *buffer=pack2->pBuffer;
|
||||
@@ -833,7 +833,7 @@ void ClientList::SendFriendsWho(ServerFriendsWho_Struct *FriendsWho, WorldTCPCon
|
||||
for(int CLEEntry = 0; CLEEntry < FriendsOnline; CLEEntry++) {
|
||||
|
||||
cle = FriendsCLEs[CLEEntry];
|
||||
|
||||
|
||||
char GuildName[67]={0};
|
||||
if (cle->GuildID() != GUILD_NONE && cle->GuildID()>0)
|
||||
sprintf(GuildName,"<%s>", guild_mgr.GetGuildName(cle->GuildID()));
|
||||
@@ -855,11 +855,11 @@ void ClientList::SendFriendsWho(ServerFriendsWho_Struct *FriendsWho, WorldTCPCon
|
||||
PlayerRace=cle->race();
|
||||
ZoneMSGID=5006; // 5006 ZONE: %1
|
||||
PlayerZone=cle->zone();
|
||||
}
|
||||
}
|
||||
|
||||
char PlayerName[64]={0};
|
||||
strcpy(PlayerName,cle->name());
|
||||
|
||||
|
||||
WhoAllPlayerPart1* WAPP1 = (WhoAllPlayerPart1*)bufptr;
|
||||
|
||||
WAPP1->FormatMSGID = FormatMSGID;
|
||||
@@ -895,7 +895,7 @@ void ClientList::SendFriendsWho(ServerFriendsWho_Struct *FriendsWho, WorldTCPCon
|
||||
pack2->Deflate();
|
||||
SendPacket(FriendsWho->FromName,pack2);
|
||||
safe_delete(pack2);
|
||||
}
|
||||
}
|
||||
catch(...){
|
||||
_log(WORLD__ZONELIST_ERR,"Unknown error in world's SendFriendsWho (probably mem error), ignoring...");
|
||||
return;
|
||||
@@ -1000,20 +1000,20 @@ void ClientList::ConsoleSendWhoAll(const char* to, int16 admin, Who_All_Struct*
|
||||
if (
|
||||
(cle->Online() >= CLE_Status_Zoning)
|
||||
&& (whom == 0 || (
|
||||
((cle->Admin() >= 80 && cle->GetGM()) || whom->gmlookup == 0xFFFF) &&
|
||||
(whom->lvllow == 0xFFFF || (cle->level() >= whom->lvllow && cle->level() <= whom->lvlhigh)) &&
|
||||
(whom->wclass == 0xFFFF || cle->class_() == whom->wclass) &&
|
||||
(whom->wrace == 0xFFFF || cle->race() == whom->wrace) &&
|
||||
((cle->Admin() >= 80 && cle->GetGM()) || whom->gmlookup == 0xFFFF) &&
|
||||
(whom->lvllow == 0xFFFF || (cle->level() >= whom->lvllow && cle->level() <= whom->lvlhigh)) &&
|
||||
(whom->wclass == 0xFFFF || cle->class_() == whom->wclass) &&
|
||||
(whom->wrace == 0xFFFF || cle->race() == whom->wrace) &&
|
||||
(whomlen == 0 || (
|
||||
(tmpZone != 0 && strncasecmp(tmpZone, whom->whom, whomlen) == 0) ||
|
||||
strncasecmp(cle->name(),whom->whom, whomlen) == 0 ||
|
||||
(strncasecmp(guild_mgr.GetGuildName(cle->GuildID()), whom->whom, whomlen) == 0) ||
|
||||
(tmpZone != 0 && strncasecmp(tmpZone, whom->whom, whomlen) == 0) ||
|
||||
strncasecmp(cle->name(),whom->whom, whomlen) == 0 ||
|
||||
(strncasecmp(guild_mgr.GetGuildName(cle->GuildID()), whom->whom, whomlen) == 0) ||
|
||||
(admin >= 100 && strncasecmp(cle->AccountName(), whom->whom, whomlen) == 0)
|
||||
))
|
||||
))
|
||||
) {
|
||||
line[0] = 0;
|
||||
// MYRA - use new (5.x) Status labels in who for telnet connection
|
||||
// MYRA - use new (5.x) Status labels in who for telnet connection
|
||||
if (cle->Admin() >=250)
|
||||
strcpy(tmpgm, "* GM-Impossible * ");
|
||||
else if (cle->Admin() >= 200)
|
||||
@@ -1046,7 +1046,7 @@ void ClientList::ConsoleSendWhoAll(const char* to, int16 admin, Who_All_Struct*
|
||||
strcpy(tmpgm, "* Steward * ");
|
||||
else
|
||||
tmpgm[0] = 0;
|
||||
// end Myra
|
||||
// end Myra
|
||||
|
||||
if (guild_mgr.GuildExists(cle->GuildID())) {
|
||||
snprintf(tmpguild, 36, " <%s>", guild_mgr.GetGuildName(cle->GuildID()));
|
||||
@@ -1180,7 +1180,7 @@ void ClientList::ZoneBootup(ZoneServer* zs) {
|
||||
while(iterator.MoreElements())
|
||||
{
|
||||
if (iterator.GetData()->WaitingForBootup()) {
|
||||
if (iterator.GetData()->GetZoneID() == zs->GetZoneID()
|
||||
if (iterator.GetData()->GetZoneID() == zs->GetZoneID()
|
||||
&& iterator.GetData()->GetInstanceID() == zs->GetInstanceID()) {
|
||||
iterator.GetData()->EnterWorld(false);
|
||||
}
|
||||
@@ -1236,7 +1236,7 @@ bool ClientList::SendPacket(const char* to, ServerPacket* pack) {
|
||||
|
||||
void ClientList::SendGuildPacket(uint32 guild_id, ServerPacket* pack) {
|
||||
set<uint32> zone_ids;
|
||||
|
||||
|
||||
LinkedListIterator<ClientListEntry*> iterator(clientlist);
|
||||
|
||||
iterator.Reset();
|
||||
@@ -1246,7 +1246,7 @@ void ClientList::SendGuildPacket(uint32 guild_id, ServerPacket* pack) {
|
||||
}
|
||||
iterator.Advance();
|
||||
}
|
||||
|
||||
|
||||
//now we know all the zones, send it to each one... this is kinda a shitty way to do this
|
||||
//since its basically O(n^2)
|
||||
set<uint32>::iterator cur, end;
|
||||
@@ -1279,7 +1279,7 @@ int ClientList::GetClientCount() {
|
||||
void ClientList::GetClients(const char *zone_name, vector<ClientListEntry *> &res) {
|
||||
LinkedListIterator<ClientListEntry *> iterator(clientlist);
|
||||
iterator.Reset();
|
||||
|
||||
|
||||
if(zone_name[0] == '\0') {
|
||||
while(iterator.MoreElements()) {
|
||||
ClientListEntry* tmp = iterator.GetData();
|
||||
|
||||
Reference in New Issue
Block a user