You should do some simple packet capturing, because this looks recursive to me. This is the reason:
Code:
sending_stat :=1;
packet.SendPacket(member);
You're sending the same packet back out, which causes the same packet hook to again be called - and they work critical. If it weren't for the maximum call depth thing, this packet hook would freeze your shard.
With a party of two, you won't get your error because of the code at the top that checks for the sending_stat global var:
Code:
// sent by this script.
if ( sending_stat )
sending_stat := 0;
return 0;
endif
But look closer: That code also sets sending_stat back to 0. So with the third and subsequent player, the packet hook WILL run again, causing recursion that only ends when the maximum call depth is exceeded.
Packet hooks run critical, in a single 'process'. Check the script profiles some time and you'll see that only one copy of doPlayerStatus.ecl is ever executed.