PDA

View Full Version : How to use libcod with Open Game Panel (OGP)



Mitch
29th July 2014, 18:31
Edit: see post#3

The easiest way to use libcod with OGP is to edit the service agent to set the required exports.

First we need to disable the auto updater in ogp_agent_run:
(line 186) 'after run() {' change 'update' to '#update'.

ogp_agent.pl:
(line 754) change to:

$command = ". preload.sh ; ./$server_exe $startup_cmd";
(line 758) change to:

$command = ". preload.sh ; taskset -c $cpu ./$server_exe $startup_cmd";

Now create your preload.sh in the game directory with your own libcod export settings:


#!/bin/sh
export LD_LIBRARY_PATH="/path/to/cod2/libs/:/path/to/cod2/libs/mysql"
export LD_PRELOAD="/path/to/cod2/libs/libcod2_1_3.so"

kung foo man
30th July 2014, 04:12
Another way might be to replace the original lnxded-binary with a shell script and name the cod2lnxded-bin (just like in CoD4). Then forwarding the arguments to the script to the real lnxded.

http://stackoverflow.com/questions/4824590/propagate-all-arguments-in-a-bash-shell-script

Mitch
30th July 2014, 12:35
Another way might be to replace the original lnxded-binary with a shell script and name the cod2lnxded-bin (just like in CoD4). Then forwarding the arguments to the script to the real lnxded.

http://stackoverflow.com/questions/4824590/propagate-all-arguments-in-a-bash-shell-script

Thanks, this works even better. But you have to make sure that the line endings are unix. Otherwise you will get the 'bad interpreter' error:
http://stackoverflow.com/questions/2920416/configure-bin-shm-bad-interpreter

cod2_lnxded (without extension)


#!/bin/bash
export LD_LIBRARY_PATH="/path/to/cod2/libs/:/path/to/cod2/libs/mysql"
export LD_PRELOAD="/path/to/cod2/libs/libcod2_1_3.so"
./cod2_lnxded_1_3_nodelay_va_loc $@