Jump to content
MakeWebGames

MCcodes v2.0 problem


MarFur93

Recommended Posts

Guest Anonymous

Re: MCcodes v2.0 problem

 

Fatal error: SUHOSIN - Use of eval is forbidden by configuration in /home/marfur93/public_html/docrime.php(21) : eval()'d code on line 21

Pretty self explanatory really...

suhosin is configured to prevent the use of the eval() function.

You will have to either manipulate the php.ini file itself, to toggle this nature or rewrite the crime formula evaluation routines.

See: http://www.hardened-php.net/suhosin/con ... sable_eval

Link to comment
Share on other sites

Re: MCcodes v2.0 problem

I've seen that crime equation and it's crap.

You could easily achieve the same thing by changing the equation over from using that eval statement into being hard coded. You'll need two columns though instead of the one in the database. Since you have to parts to that equation, and you would be storing just the number that is the "modifier". One is a crime level modifier, and the other one I think is a will modifier.

Link to comment
Share on other sites

Guest Anonymous

Re: MCcodes v2.0 problem

Or of course write your own expression evaluator... For example, one formula I noticed was:

 

((WILL10)/185)+((IQ-10)/10000)+((AGIL-10)/10000)

 

Now this is a simple expression to evaluate using preg_replace.

Stage #1 - replace the constants WILL, IQ, AGIL etc with their current values

Stage #2 - Evaluate and replace all bracket expressions (number operator number)

Stage #3 - Strip simple brackets (number)

Stage #4 - Repeat until only a simple number left.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...