HowTo: Turn On Fragalyzer in BF2

Started by Atomm · 19 posts · 2,162 views

  1. #1
    Here is a howto I found on it:

    ------------------------------------------------------------------
    Enabling the fragalizer is fairly easy, as it's python code.

    just create a folder in mods/bf2/ named 'Logs'
    then open the fragalizer_log.py in python/bf2/stats then modify the following


    (on line 22):

    Code:

    def init():
    host.registerHandler('ConsoleSendCommand', onSendCommand)

    to:
    Code:

    def init():
    enable()
    host.registerHandler('ConsoleSendCommand', onSendCommand)


    if you run linux like me you have to change another line to remove the
    dir formatting, (on line 49):
    Code:

    fileName = fileName.replace('/', '\')

    place an '#' in front of it ('#' is a comment sign in python, what it
    does it ignores the line from parsing)

    the line should read:
    Code:

    #fileName = fileName.replace('/', '\')


    That's it now you have logging.
  2. #2
    do you need any special program to open the python code?

    I am assuming that this tracks your stats locally?

    cool find.
  3. #3
    It does track all your stats locally. As of yet, there is no way to display them on our website. I can only hope that is around the corner.
  4. #4
    What does this do?
  5. #5
    It's a server hack that will allow me to turn on the stats and log them locally to the server. As soon as someone writes the code to parse the data, add it to a database and display it on a website, I will get it running.

    We had this ability with BF42 and it was very cool. Given all the details BF2 has, I thought it would be cool to see how we stack up to each other. :-)

    I also posted it so other server admins could find it.
  6. #6
    Atomm wrote:It's a server hack that will allow me to turn on the stats and log them locally to the server. As soon as someone writes the code to parse the data, add it to a database and display it on a website, I will get it running.

    We had this ability with BF42 and it was very cool. Given all the details BF2 has, I thought it would be cool how we stack up to each other. :-)

    I also posted it so other server admins could find it.


    Can you supply me with a sample of the data file, I have an idea. No promises though.
  7. #7
    I would Bubba, but I'm stuck waiting on the new server file. As soon as EA releases it and I have it running, I'll get you something.
  8. #8
    Atomm wrote:I would Bubba, but I'm stuck waiting on the new server file. As soon as EA releases it and I have it running, I'll get you something.


    sweet
  9. #9
    could this be enabled on client side as well so that I could log all of my stats?
  10. #10
    Nope. The python interpreter only runs on the client when it is in server mode. I ran into that problem with the automap.
  11. #11
    Just for clarification Atomm: Your code is for the server and not the client? Or does the client need to make the changes for the server to see them?
  12. #12
    Server only.
  13. #13
    I was looking in the C:Program FilesEA GAMESBattlefield 2pythonbf2stats stats.con file and not knowing anything about it, it looked as though it checked if you are on a ranked server and resets if you aren't - could that be tweaked to not reset and spit out a log file?
  14. #14
    According to the Linux server dev, the python interpreter does not run on the client side because of security reasons. However, if you run your system as a server, it will run the python interpreter. That may be what you are seeing.
  15. #16
    Cool. I'll look into it.
  16. #17
    Nope. This is still pulling the stats from BFHQ. Once again, someone is reinventing the same wheel that we keep seeing....

    However, I think I might be able to modify this to work with the unranked stats.

    Bubba, what languages do you know?
  17. #18
    Atomm wrote:Nope. This is still pulling the stats from BFHQ. Once again, someone is reinventing the same wheel that we keep seeing....

    However, I think I might be able to modify this to work with the unranked stats.

    Bubba, what languages do you know?


    Java, and some python, Enough VB for Hello World!