성능 개선을 좀 해보자
void ClientPacketHandler::Handle_S_TEST(BYTE* buffer, int32 len)
{
BufferReader br(buffer, len);
if (len < sizeof(PKT_S_TEST))
return;
// buffer에 이미 복사된 패킷인데 또 다시 꺼내서 써야할까?
PKT_S_TEST pkt;
br >> pkt;
개선해보자
void ClientPacketHandler::Handle_S_TEST(BYTE* buffer, int32 len)
{
BufferReader br(buffer, len);
// buffer를 그냥 그대로 쓴다
PKT_S_TEST* pkt = reinterpret_cast<PKT_S_TEST*>(buffer);
if (pkt->Validate() == false)
return;
//cout << "ID: " << id << " HP : " << hp << " ATT : " << attack << endl;
PKT_S_TEST::BuffsList buffs = pkt->GetBuffsList();
cout << "BufCount : " << buffs.Count() << endl;
for (int32 i = 0; i < buffs.Count(); i++)
{
cout << "BufInfo : " << buffs[i].buffId << " " << buffs[i].remainTime << endl;
}