It will be better overall to use this function to pre-calculate the hit box's instead of calling it everytime. Like
PHP Code:
temp.box = {2,4,1,1};
player.hbox = null;
for (temp.i=0;temp.i<4;temp.i++){
player.hbox.add(getHitBox(temp.i,0,0,temp.box));
}
Later I'll redo the function for exactly that.
This way the function adds almost zero time to finding players in the box serverside.