November Source Bug/ Dupe Fix Release
#21


1 hour ago, Veni said:




better way is to first remove the wear position from the packet itself. the client does not need to send that info to the server, the server should check and determine that itself.



so in the end you should do something like this:



 




CItem* item = ch->m_inventory.getItem(packet->tab, packet->invenIndex);

int wearPos;
wearPos = item->m_itemProto->getItemWearing()

// change all packet->wearPos to the varaible like this

if (wearPos < 0 || wearPos >= MAX_WEARING)
{
CNetMsg::SP rmsg(new CNetMsg);
ResponseClient::ItemWearMsg(rmsg, ResponseClient::WEAR_ERR_INVALID_POS);
SEND_Q(rmsg, ch->m_desc);
return ;
}


Sure, you check if it's an "APet", but you dont check if its a normal pet. With this you also dont check if the item is an experience booster.



If you see code like this you should fix it properly and not just half of it




What about:

.
.
.
CItem* item = ch->m_inventory.getItem(packet->tab, packet->invenIndex); // ÀÔ´Â ¾ÆÀÌÅÛ

int wearPos;
wearPos = item->m_itemProto->getItemWearing();

if (packet->wearPos != WEARING_PET && item->IsAPet() || wearPos < 0 || wearPos >= MAX_WEARING)
{
CNetMsg::SP rmsg(new CNetMsg);
ResponseClient::ItemWearMsg(rmsg, ResponseClient::WEAR_ERR_INVALID_POS);
SEND_Q(rmsg, ch->m_desc);
return;
}
.
.
.

 



Messages In This Thread
[No subject] - by dethunter12 - 05-15-2021, 02:53 AM
[No subject] - by rondo157 - 05-15-2021, 03:16 AM
[No subject] - by dethunter12 - 05-15-2021, 04:21 AM
[No subject] - by BayBay - 05-15-2021, 04:26 AM
[No subject] - by Scura - 05-15-2021, 10:29 AM
[No subject] - by dethunter12 - 05-15-2021, 02:24 PM
[No subject] - by Reza - 05-15-2021, 03:07 PM
[No subject] - by BayBay - 05-15-2021, 09:37 PM
[No subject] - by dethunter12 - 05-16-2021, 03:41 AM
[No subject] - by BayBay - 05-16-2021, 03:43 AM
[No subject] - by dethunter12 - 05-16-2021, 03:48 AM
[No subject] - by BayBay - 05-16-2021, 04:11 AM
[No subject] - by Desarija - 05-16-2021, 08:19 AM
[No subject] - by Scura - 05-16-2021, 11:37 AM
[No subject] - by Reza - 05-16-2021, 01:49 PM
[No subject] - by BayBay - 05-16-2021, 09:05 PM
[No subject] - by dethunter12 - 05-16-2021, 09:09 PM
[No subject] - by WhosUrDaddi - 05-29-2021, 02:25 PM
[No subject] - by theDJ - 06-13-2021, 04:04 PM
[No subject] - by Veni - 06-13-2021, 04:34 PM
[No subject] - by Scura - 06-13-2021, 06:22 PM
[No subject] - by Veni - 06-13-2021, 06:32 PM
[No subject] - by Scura - 06-13-2021, 06:48 PM
[No subject] - by Veni - 06-13-2021, 07:13 PM
[No subject] - by theDJ - 06-13-2021, 07:15 PM
[No subject] - by Scura - 06-13-2021, 07:38 PM
[No subject] - by Dimaflash - 06-14-2021, 01:55 AM
[No subject] - by Scura - 06-14-2021, 09:16 AM
[No subject] - by Asylum - 11-16-2021, 03:34 PM
[No subject] - by dethunter12 - 11-16-2021, 05:48 PM
[No subject] - by Asylum - 11-16-2021, 06:49 PM
[No subject] - by nicolasg - 04-17-2022, 12:26 AM
[No subject] - by Tommy - 04-17-2022, 05:07 PM
[No subject] - by Scura - 04-20-2022, 01:12 PM
[No subject] - by Andrein95 - 04-27-2022, 09:07 AM

Forum Jump:


Users browsing this thread: 4 Guest(s)