Log in

View Full Version : Corpse::become_npc - Purpose?


Drajor
06-11-2014, 02:25 AM
Hiyas just wondering if anyone knows what purpose Corpse::become_npc has? I noticed that it is only ever assigned as false. Perhaps it is part of some unfinished feature?

EDIT:

Also Corpse::loot_cooldown_timer .. At the moment is appears to stop anyone (even valid looters) from looting any items off the corpse within 10 ms of the corpse being created. No comments on why this is the case and I am curious.

Uleat
06-11-2014, 02:36 PM
The cool-down timer is likely to prevent desyncs/exploits/crashes.

No idea on the become_npc thing..unless there's a spell that let's you reanimate corpses :)

demonstar55
06-11-2014, 02:57 PM
I'm assuming it's related to the GM/guide command /becomenpc, but that doesn't really work that well sadly.

Drajor
06-11-2014, 11:53 PM
Thanks I will have a look at /becomenpc. The 10ms delay is really strange because I don't even get that low latency running a server locally. Tonight I might try to dig back through the svn history to discover when it was added.

lerxst2112
06-12-2014, 12:18 AM
I'd guess there is/was a race condition somewhere and the delay changed the timing enough to hide it.

Drajor
06-12-2014, 04:20 AM
It was introduced by KimmySprite in rev 957 (here (https://code.google.com/p/projecteqemu/source/detail?r=957&path=/trunk/EQEmuServer/zone/PlayerCorpse.h)) as 'Anti-cheat stuff.' and at that point a 200ms delay.
Changed to 100ms in rev 1357 by DerisionEQ with no explanation.
Changed to 10ms in rev 1498 by KimmySprite with no explanation.

I feel like a detective but now I know where it came from at least.

demonstar55
06-12-2014, 01:16 PM
You're not a real detective until you start reading through CVS commits!

Uleat
06-12-2014, 03:28 PM
It's not likely that you can use the interface to achieve a less than 10ms transaction..but, people using MQ2 certainly can.

KLS
06-12-2014, 10:09 PM
People had MQ addons that looted everything automatically instantly. Which is why we introduced the delay. Later we found that the delay was causing problems with auto loot functions in the newer clients (it was just too long) and reduced it.

Becomenpc hasn't worked for a long time, most of the code is horribly broken/removed but some still lingers.

Drajor
06-13-2014, 07:36 AM
MQ... Makes sense. Thanks for clearing it up KLS.