Do they belong to you? Claim these comments.
Cal
Is this you? Claim Profile »
1 year ago
in Gareth Jones » Blog Archive » Replacing Python on a Battlefield 2 server on Gareth Jones
I 1. Replace the Battlefield 2 Python library (e.g. ‘bf2/bin/ia-32/libdice_py.so’) with the version of your choice. I just linked to my locally installed version ‘/usr/lib/libpython2.5.so’.
2. Replace the Python library path at runtime to use the new libraries, e.g. edit ‘bf2/python/bf2/__init__.py’ and putting the equivalent of ’sys.path = ['/usr/lib/python2.5/', '/usr/lib/python2.5/lib-dynload/', 'python', 'mods/bf2/python', 'admin']‘ after the ‘import sys’ line.
Is what I did, but I did substitute my version for 2.5. I used locate to find the directories for python. I run the 64 bit version of bf2.exe so I figured 64bit libs would be a proper replacement.
2. Replace the Python library path at runtime to use the new libraries, e.g. edit ‘bf2/python/bf2/__init__.py’ and putting the equivalent of ’sys.path = ['/usr/lib/python2.5/', '/usr/lib/python2.5/lib-dynload/', 'python', 'mods/bf2/python', 'admin']‘ after the ‘import sys’ line.
Is what I did, but I did substitute my version for 2.5. I used locate to find the directories for python. I run the 64 bit version of bf2.exe so I figured 64bit libs would be a proper replacement.
1 year ago
in Replacing Python on a Battlefield 2 server on Gareth Jones
I 1. Replace the Battlefield 2 Python library (e.g. ‘bf2/bin/ia-32/libdice_py.so’) with the version of your choice. I just linked to my locally installed version ‘/usr/lib/libpython2.5.so’.
2. Replace the Python library path at runtime to use the new libraries, e.g. edit ‘bf2/python/bf2/__init__.py’ and putting the equivalent of ’sys.path = ['/usr/lib/python2.5/', '/usr/lib/python2.5/lib-dynload/', 'python', 'mods/bf2/python', 'admin']‘ after the ‘import sys’ line.
Is what I did, but I did substitute my version for 2.5. I used locate to find the directories for python. I run the 64 bit version of bf2.exe so I figured 64bit libs would be a proper replacement.
2. Replace the Python library path at runtime to use the new libraries, e.g. edit ‘bf2/python/bf2/__init__.py’ and putting the equivalent of ’sys.path = ['/usr/lib/python2.5/', '/usr/lib/python2.5/lib-dynload/', 'python', 'mods/bf2/python', 'admin']‘ after the ‘import sys’ line.
Is what I did, but I did substitute my version for 2.5. I used locate to find the directories for python. I run the 64 bit version of bf2.exe so I figured 64bit libs would be a proper replacement.
1 year ago
in Gareth Jones » Blog Archive » Replacing Python on a Battlefield 2 server on Gareth Jones
I tried your method and when the server starts it crashes with "Import Error:" and flashes back to shell. I am using python2.4 and have changed the usr/lib/python2.5 to usr/lib64/python2.4 any clues?
1 year ago
in Replacing Python on a Battlefield 2 server on Gareth Jones
I tried your method and when the server starts it crashes with "Import Error:" and flashes back to shell. I am using python2.4 and have changed the usr/lib/python2.5 to usr/lib64/python2.4 any clues?
1 reply
garethj
What exactly have you changed? Have you replaced (or linked) the libdice_py.so in the Battlefield directory with your own and editing the __init__.py? If that's all done, there might be an issue with replacing a 32-bit Python with a 64-bit one (which is what your directory names suggest) so that could be the cause.
1 year ago
in Gareth Jones » Blog Archive » Replacing Python on a Battlefield 2 server on Gareth Jones
Yes. Thank you.
Originally I wanted to use post methods, but I now think a simple get is more efficent for my level of coding. It also means that I can use the standard python lib that comes with bf2.
I appreciate the help.
Originally I wanted to use post methods, but I now think a simple get is more efficent for my level of coding. It also means that I can use the standard python lib that comes with bf2.
I appreciate the help.
1 year ago
in Replacing Python on a Battlefield 2 server on Gareth Jones
Yes. Thank you.
Originally I wanted to use post methods, but I now think a simple get is more efficent for my level of coding. It also means that I can use the standard python lib that comes with bf2.
I appreciate the help.
Originally I wanted to use post methods, but I now think a simple get is more efficent for my level of coding. It also means that I can use the standard python lib that comes with bf2.
I appreciate the help.
1 year ago
in Gareth Jones » Blog Archive » Replacing Python on a Battlefield 2 server on Gareth Jones
Yep. Requests for webpages in the existing python return garbage results so far. I'd like to be able to have a python script call a webpage, parse the results, then display the results in game.
1 year ago
in Replacing Python on a Battlefield 2 server on Gareth Jones
Yep. Requests for webpages in the existing python return garbage results so far. I'd like to be able to have a python script call a webpage, parse the results, then display the results in game.
1 year ago
in Gareth Jones » Blog Archive » Replacing Python on a Battlefield 2 server on Gareth Jones
Well that is great news. Have you been able to get url calls working properly? I don't know much about python, but recoding our in game management system has been a fun experience. Right now, I'd like to use a url call to allow admins to register their keyhash via a php page and get a success or fail notification in game.
1 year ago
in Replacing Python on a Battlefield 2 server on Gareth Jones
Well that is great news. Have you been able to get url calls working properly? I don't know much about python, but recoding our in game management system has been a fun experience. Right now, I'd like to use a url call to allow admins to register their keyhash via a php page and get a success or fail notification in game.
1 year ago
in Gareth Jones » Blog Archive » Replacing Python on a Battlefield 2 server on Gareth Jones
So is this running in a stable manner for you? I have some url calls I would like to make in the game and this would be a welcome help.