clang-modernize -use-auto convert for world/clientlist.cpp

This commit is contained in:
Michael Cook (mackal) 2015-01-09 03:05:13 -05:00
parent bb37dd1b16
commit 81a48cac6c

View File

@ -116,7 +116,8 @@ void ClientList::EnforceSessionLimit(uint32 iLSAccountID) {
// If we have a char name, they are in a zone, so send a kick to the zone server
if(strlen(ClientEntry->name())) {
ServerPacket* pack = new ServerPacket(ServerOP_KickPlayer, sizeof(ServerKickPlayer_Struct));
auto pack =
new ServerPacket(ServerOP_KickPlayer, sizeof(ServerKickPlayer_Struct));
ServerKickPlayer_Struct* skp = (ServerKickPlayer_Struct*) pack->pBuffer;
strcpy(skp->adminname, "SessionLimit");
strcpy(skp->name, ClientEntry->name());
@ -223,7 +224,7 @@ void ClientList::DisconnectByIP(uint32 iIP) {
countCLEIPs = iterator.GetData();
if ((countCLEIPs->GetIP() == iIP)) {
if(strlen(countCLEIPs->name())) {
ServerPacket* pack = new ServerPacket(ServerOP_KickPlayer, sizeof(ServerKickPlayer_Struct));
auto pack = new ServerPacket(ServerOP_KickPlayer, sizeof(ServerKickPlayer_Struct));
ServerKickPlayer_Struct* skp = (ServerKickPlayer_Struct*) pack->pBuffer;
strcpy(skp->adminname, "SessionLimit");
strcpy(skp->name, countCLEIPs->name());
@ -328,7 +329,7 @@ void ClientList::SendCLEList(const int16& admin, const char* to, WorldTCPConnect
void ClientList::CLEAdd(uint32 iLSID, const char* iLoginName, const char* iLoginKey, int16 iWorldAdmin, uint32 ip, uint8 local) {
ClientListEntry* tmp = new ClientListEntry(GetNextCLEID(), iLSID, iLoginName, iLoginKey, iWorldAdmin, ip, local);
auto tmp = new ClientListEntry(GetNextCLEID(), iLSID, iLoginName, iLoginKey, iWorldAdmin, ip, local);
clientlist.Append(tmp);
}
@ -430,7 +431,7 @@ ClientListEntry* ClientList::CheckAuth(const char* iName, const char* iPassword)
if (accid) {
uint32 lsid = 0;
database.GetAccountIDByName(iName, &tmpadmin, &lsid);
ClientListEntry* tmp = new ClientListEntry(GetNextCLEID(), lsid, iName, tmpMD5, tmpadmin, 0, 0);
auto tmp = new ClientListEntry(GetNextCLEID(), lsid, iName, tmpMD5, tmpadmin, 0, 0);
clientlist.Append(tmp);
return tmp;
}
@ -470,7 +471,7 @@ void ClientList::SendOnlineGuildMembers(uint32 FromID, uint32 GuildID)
Iterator.Reset();
ServerPacket* pack = new ServerPacket(ServerOP_OnlineGuildMembersResponse, PacketLength);
auto pack = new ServerPacket(ServerOP_OnlineGuildMembersResponse, PacketLength);
char *Buffer = (char *)pack->pBuffer;
@ -572,7 +573,7 @@ void ClientList::SendWhoAll(uint32 fromid,const char* to, int16 admin, Who_All_S
unknown44[1]=0;
uint32 unknown52=totalusers;
uint32 unknown56=1;
ServerPacket* pack2 = new ServerPacket(ServerOP_WhoAllReply,64+totallength+(49*totalusers));
auto pack2 = new ServerPacket(ServerOP_WhoAllReply, 64 + totallength + (49 * totalusers));
memset(pack2->pBuffer,0,pack2->size);
uchar *buffer=pack2->pBuffer;
uchar *bufptr=buffer;
@ -801,7 +802,7 @@ void ClientList::SendFriendsWho(ServerFriendsWho_Struct *FriendsWho, WorldTCPCon
ClientListEntry* cle;
int FriendsOnline = FriendsCLEs.size();
int PacketLength = sizeof(WhoAllReturnStruct) + (47 * FriendsOnline) + TotalLength;
ServerPacket* pack2 = new ServerPacket(ServerOP_WhoAllReply, PacketLength);
auto pack2 = new ServerPacket(ServerOP_WhoAllReply, PacketLength);
memset(pack2->pBuffer,0,pack2->size);
uchar *buffer=pack2->pBuffer;
uchar *bufptr=buffer;
@ -931,7 +932,7 @@ void ClientList::SendLFGMatches(ServerLFGMatchesRequest_Struct *smrs) {
}
Iterator.Advance();
}
ServerPacket* Pack = new ServerPacket(ServerOP_LFGMatches, (sizeof(ServerLFGMatchesResponse_Struct) * Matches) + 4);
auto Pack = new ServerPacket(ServerOP_LFGMatches, (sizeof(ServerLFGMatchesResponse_Struct) * Matches) + 4);
char *Buf = (char *)Pack->pBuffer;
// FromID is the Entity ID of the player doing the search.