mirror of
https://github.com/EQEmu/Server.git
synced 2026-09-04 18:46:37 +00:00
clang-tidy modernize-use-auto
This commit is contained in:
+25
-19
@@ -271,8 +271,9 @@ namespace RoF2
|
||||
if (opcode == 8) {
|
||||
AltCurrencyPopulate_Struct *populate = (AltCurrencyPopulate_Struct*)emu_buffer;
|
||||
|
||||
EQApplicationPacket *outapp = new EQApplicationPacket(OP_AltCurrency, sizeof(structs::AltCurrencyPopulate_Struct)
|
||||
+ sizeof(structs::AltCurrencyPopulateEntry_Struct) * populate->count);
|
||||
auto outapp = new EQApplicationPacket(
|
||||
OP_AltCurrency, sizeof(structs::AltCurrencyPopulate_Struct) +
|
||||
sizeof(structs::AltCurrencyPopulateEntry_Struct) * populate->count);
|
||||
structs::AltCurrencyPopulate_Struct *out_populate = (structs::AltCurrencyPopulate_Struct*)outapp->pBuffer;
|
||||
|
||||
out_populate->opcode = populate->opcode;
|
||||
@@ -290,7 +291,7 @@ namespace RoF2
|
||||
dest->FastQueuePacket(&outapp, ack_req);
|
||||
}
|
||||
else {
|
||||
EQApplicationPacket *outapp = new EQApplicationPacket(OP_AltCurrency, sizeof(AltCurrencyUpdate_Struct));
|
||||
auto outapp = new EQApplicationPacket(OP_AltCurrency, sizeof(AltCurrencyUpdate_Struct));
|
||||
memcpy(outapp->pBuffer, emu_buffer, sizeof(AltCurrencyUpdate_Struct));
|
||||
dest->FastQueuePacket(&outapp, ack_req);
|
||||
}
|
||||
@@ -1120,7 +1121,8 @@ namespace RoF2
|
||||
{
|
||||
//Log.LogDebugType(Logs::General, Logs::Netcode, "[ERROR] Group Leave, yourname = %s, membername = %s", gjs->yourname, gjs->membername);
|
||||
|
||||
EQApplicationPacket *outapp = new EQApplicationPacket(OP_GroupDisbandYou, sizeof(structs::GroupGeneric_Struct));
|
||||
auto outapp =
|
||||
new EQApplicationPacket(OP_GroupDisbandYou, sizeof(structs::GroupGeneric_Struct));
|
||||
|
||||
structs::GroupGeneric_Struct *ggs = (structs::GroupGeneric_Struct*)outapp->pBuffer;
|
||||
memcpy(ggs->name1, gjs->yourname, sizeof(ggs->name1));
|
||||
@@ -1138,7 +1140,8 @@ namespace RoF2
|
||||
//if(gjs->action == groupActLeave)
|
||||
// Log.LogDebugType(Logs::General, Logs::Netcode, "[ERROR] Group Leave, yourname = %s, membername = %s", gjs->yourname, gjs->membername);
|
||||
|
||||
EQApplicationPacket *outapp = new EQApplicationPacket(OP_GroupDisbandOther, sizeof(structs::GroupGeneric_Struct));
|
||||
auto outapp =
|
||||
new EQApplicationPacket(OP_GroupDisbandOther, sizeof(structs::GroupGeneric_Struct));
|
||||
|
||||
structs::GroupGeneric_Struct *ggs = (structs::GroupGeneric_Struct*)outapp->pBuffer;
|
||||
memcpy(ggs->name1, gjs->yourname, sizeof(ggs->name1));
|
||||
@@ -1175,7 +1178,7 @@ namespace RoF2
|
||||
|
||||
//Log.LogDebugType(Logs::General, Logs::Netcode, "[ERROR] Leadername is %s", gu2->leadersname);
|
||||
|
||||
EQApplicationPacket *outapp = new EQApplicationPacket(OP_GroupUpdateB, PacketLength);
|
||||
auto outapp = new EQApplicationPacket(OP_GroupUpdateB, PacketLength);
|
||||
|
||||
char *Buffer = (char *)outapp->pBuffer;
|
||||
|
||||
@@ -1241,7 +1244,8 @@ namespace RoF2
|
||||
|
||||
memcpy(eq->membername, emu->membername, sizeof(eq->membername));
|
||||
|
||||
EQApplicationPacket *outapp = new EQApplicationPacket(OP_GroupLeadershipAAUpdate, sizeof(GroupLeadershipAAUpdate_Struct));
|
||||
auto outapp =
|
||||
new EQApplicationPacket(OP_GroupLeadershipAAUpdate, sizeof(GroupLeadershipAAUpdate_Struct));
|
||||
GroupLeadershipAAUpdate_Struct *GLAAus = (GroupLeadershipAAUpdate_Struct*)outapp->pBuffer;
|
||||
|
||||
GLAAus->NPCMarkerID = emu->NPCMarkerID;
|
||||
@@ -1712,7 +1716,7 @@ namespace RoF2
|
||||
PacketSize += sizeof(structs::MercenaryStance_Struct) * emu->Mercs[r].StanceCount;
|
||||
}
|
||||
|
||||
EQApplicationPacket *outapp = new EQApplicationPacket(OP_MercenaryDataResponse, PacketSize);
|
||||
auto outapp = new EQApplicationPacket(OP_MercenaryDataResponse, PacketSize);
|
||||
Buffer = (char *)outapp->pBuffer;
|
||||
|
||||
VARSTRUCT_ENCODE_TYPE(uint32, Buffer, emu->MercTypeCount);
|
||||
@@ -2109,7 +2113,7 @@ namespace RoF2
|
||||
|
||||
uint32 PacketSize = 40000; // Calculate this later
|
||||
|
||||
EQApplicationPacket *outapp = new EQApplicationPacket(OP_PlayerProfile, PacketSize);
|
||||
auto outapp = new EQApplicationPacket(OP_PlayerProfile, PacketSize);
|
||||
|
||||
outapp->WriteUInt32(0); // Checksum, we will update this later
|
||||
outapp->WriteUInt32(0); // Checksum size, we will update this later
|
||||
@@ -2792,7 +2796,7 @@ namespace RoF2
|
||||
|
||||
Log.Out(Logs::General, Logs::Netcode, "[STRUCTS] Player Profile Packet is %i bytes", outapp->GetWritePosition());
|
||||
|
||||
unsigned char *NewBuffer = new unsigned char[outapp->GetWritePosition()];
|
||||
auto NewBuffer = new unsigned char[outapp->GetWritePosition()];
|
||||
memcpy(NewBuffer, outapp->pBuffer, outapp->GetWritePosition());
|
||||
safe_delete_array(outapp->pBuffer);
|
||||
outapp->pBuffer = NewBuffer;
|
||||
@@ -2814,7 +2818,7 @@ namespace RoF2
|
||||
unsigned char * __emu_buffer = inapp->pBuffer;
|
||||
RaidCreate_Struct *raid_create = (RaidCreate_Struct*)__emu_buffer;
|
||||
|
||||
EQApplicationPacket *outapp_create = new EQApplicationPacket(OP_RaidUpdate, sizeof(structs::RaidGeneral_Struct));
|
||||
auto outapp_create = new EQApplicationPacket(OP_RaidUpdate, sizeof(structs::RaidGeneral_Struct));
|
||||
structs::RaidGeneral_Struct *general = (structs::RaidGeneral_Struct*)outapp_create->pBuffer;
|
||||
|
||||
general->action = 8;
|
||||
@@ -2837,7 +2841,7 @@ namespace RoF2
|
||||
{
|
||||
RaidAddMember_Struct* in_add_member = (RaidAddMember_Struct*)__emu_buffer;
|
||||
|
||||
EQApplicationPacket *outapp = new EQApplicationPacket(OP_RaidUpdate, sizeof(structs::RaidAddMember_Struct));
|
||||
auto outapp = new EQApplicationPacket(OP_RaidUpdate, sizeof(structs::RaidAddMember_Struct));
|
||||
structs::RaidAddMember_Struct *add_member = (structs::RaidAddMember_Struct*)outapp->pBuffer;
|
||||
|
||||
add_member->raidGen.action = in_add_member->raidGen.action;
|
||||
@@ -2857,7 +2861,8 @@ namespace RoF2
|
||||
else if (raid_gen->action == 35)
|
||||
{
|
||||
RaidMOTD_Struct *inmotd = (RaidMOTD_Struct *)__emu_buffer;
|
||||
EQApplicationPacket *outapp = new EQApplicationPacket(OP_RaidUpdate, sizeof(structs::RaidMOTD_Struct) + strlen(inmotd->motd) + 1);
|
||||
auto outapp = new EQApplicationPacket(OP_RaidUpdate, sizeof(structs::RaidMOTD_Struct) +
|
||||
strlen(inmotd->motd) + 1);
|
||||
structs::RaidMOTD_Struct *outmotd = (structs::RaidMOTD_Struct *)outapp->pBuffer;
|
||||
|
||||
outmotd->general.action = inmotd->general.action;
|
||||
@@ -2868,7 +2873,8 @@ namespace RoF2
|
||||
else if (raid_gen->action == 14 || raid_gen->action == 30)
|
||||
{
|
||||
RaidLeadershipUpdate_Struct *inlaa = (RaidLeadershipUpdate_Struct *)__emu_buffer;
|
||||
EQApplicationPacket *outapp = new EQApplicationPacket(OP_RaidUpdate, sizeof(structs::RaidLeadershipUpdate_Struct));
|
||||
auto outapp =
|
||||
new EQApplicationPacket(OP_RaidUpdate, sizeof(structs::RaidLeadershipUpdate_Struct));
|
||||
structs::RaidLeadershipUpdate_Struct *outlaa = (structs::RaidLeadershipUpdate_Struct *)outapp->pBuffer;
|
||||
|
||||
outlaa->action = inlaa->action;
|
||||
@@ -2881,7 +2887,7 @@ namespace RoF2
|
||||
{
|
||||
RaidGeneral_Struct* in_raid_general = (RaidGeneral_Struct*)__emu_buffer;
|
||||
|
||||
EQApplicationPacket *outapp = new EQApplicationPacket(OP_RaidUpdate, sizeof(structs::RaidGeneral_Struct));
|
||||
auto outapp = new EQApplicationPacket(OP_RaidUpdate, sizeof(structs::RaidGeneral_Struct));
|
||||
structs::RaidGeneral_Struct *raid_general = (structs::RaidGeneral_Struct*)outapp->pBuffer;
|
||||
strn0cpy(raid_general->leader_name, in_raid_general->leader_name, 64);
|
||||
strn0cpy(raid_general->player_name, in_raid_general->player_name, 64);
|
||||
@@ -3315,7 +3321,7 @@ namespace RoF2
|
||||
return;
|
||||
}
|
||||
|
||||
EQApplicationPacket *outapp = new EQApplicationPacket(OP_ChangeSize, sizeof(ChangeSize_Struct));
|
||||
auto outapp = new EQApplicationPacket(OP_ChangeSize, sizeof(ChangeSize_Struct));
|
||||
|
||||
ChangeSize_Struct *css = (ChangeSize_Struct *)outapp->pBuffer;
|
||||
|
||||
@@ -3549,7 +3555,7 @@ namespace RoF2
|
||||
|
||||
in->SetReadPosition(0);
|
||||
|
||||
EQApplicationPacket *outapp = new EQApplicationPacket(OP_TaskHistoryReply, OutboundPacketSize);
|
||||
auto outapp = new EQApplicationPacket(OP_TaskHistoryReply, OutboundPacketSize);
|
||||
|
||||
outapp->WriteUInt32(in->ReadUInt32()); // Task index
|
||||
outapp->WriteUInt32(in->ReadUInt32()); // Activity count
|
||||
@@ -3936,7 +3942,7 @@ namespace RoF2
|
||||
|
||||
int Count = wars->playercount;
|
||||
|
||||
EQApplicationPacket *outapp = new EQApplicationPacket(OP_WhoAllResponse, in->size + (Count * 4));
|
||||
auto outapp = new EQApplicationPacket(OP_WhoAllResponse, in->size + (Count * 4));
|
||||
|
||||
char *OutBuffer = (char *)outapp->pBuffer;
|
||||
|
||||
@@ -4122,7 +4128,7 @@ namespace RoF2
|
||||
SpawnSize = 3;
|
||||
}
|
||||
|
||||
EQApplicationPacket *outapp = new EQApplicationPacket(OP_ZoneEntry, PacketSize);
|
||||
auto outapp = new EQApplicationPacket(OP_ZoneEntry, PacketSize);
|
||||
Buffer = (char *)outapp->pBuffer;
|
||||
BufferStart = Buffer;
|
||||
VARSTRUCT_ENCODE_STRING(Buffer, emu->name);
|
||||
|
||||
Reference in New Issue
Block a user