View Single Post
  #24  
Old 09-23-2008, 01:35 PM
Derision
Developer
 
Join Date: Feb 2004
Location: UK
Posts: 1,540
Default

Quote:
Originally Posted by renoofturks1 View Post
doesn't that involve a call to MySQL to get the rule? Or does it store them somewhere else at start-up? So, every time someone make's a hit, it calls MySQL, checks the rule, then parses the DMGB code? Correct me if i am wrong?
I won't make any comment on whether you should use a rule in this particular case, but the rules are all setup when the zone loads, so there is no database access required once the zone is initialised.

Out of interest, I compiled zone with VC++ 2008 Express with optimise for speed selected, and used IDA to look at the code it generates when a boolean rule is checked. It is only 4 machine instructions:

Code:
    mov     edx, dword_A48964   ; Load Rule base pointer
    add     esp, 18h
    cmp     [edx+162h], bl      ; Compare Rule offset 0x162 to 0 (register bl is set to zero earlier in the code)
    jz      short loc_5F4950    ; Jump if Rule set to false
which would probably take a few microseconds to execute, so there wouldn't be any performance hit if you chose to implement this using a rule.

Last edited by Derision; 09-23-2008 at 09:37 PM..
Reply With Quote