PDA

View Full Version : Help me pls)))



maxdamage99
29th October 2014, 15:10
Hello, I am a complete NOOB in libcod, could you help me figure out who is not hard to please, do step by step instructions for installing "libcod" my cod2 server. Preferably with explanations that I imagined that in general such "libcod".
Thanks in advance.

Mitch
29th October 2014, 15:14
Let's start with:
- Where are you running it on? (Linux? Windows?)
- Do you have access to your startup line or ftp?
- Which cod2 version?

You can download recompiled versions from: http://killtube.org/downloads/libcod/2014_05_22/
(my builds are available at http://znation.nl/libcod/)

Script functions documentation is available at http://znation.nl/cod4script/.

Start up line example:


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 +set dedicated "2"

IzNoGoD
29th October 2014, 16:34
I found that for some (maybe most) systems the LD_LIBRARY_PATH is not needed if libcod is compiled on said system, as the gcc/clang linker will automatically find the correct files and remove the need for LD_LIBRARY_PATH. Furthermore, you should be able to put the remaining two lines into a single one, removing the needs for any export. This is also why i would advise anyone to just locally compile a libcod version.

My startup script:


LD_PRELOAD="path_to_libcod.so" path_to_cod2_lnxded +set dedicated "2"

maxdamage99
29th October 2014, 17:18
Mitch, iznoGod Thank you very much.
My server is running on the VDS, I have access to FTP, and others, including the .ssh. Version cod2 1.0
Operating System: CentOS-6-amd64. I do not know what it is, or linux windows.
Thx advance)

Mitch
29th October 2014, 18:10
My server is running on the VDS, I have access to FTP, and others, including the .ssh. Version cod2 1.0
Operating System: CentOS-6-amd64. I do not know what it is, or linux windows.

I think you will need 'mysql-devel.i386 (https://www.centos.org/forums/viewtopic.php?t=29620)' or 'mysql-devel.i686' for mysql support in libcod. (CentOS is linux, yum install ...)

Building libcod from source


git clone https://github.com/kungfooman/libcod.git libcod
cd libcod
./doit.sh base
./doit.sh cod2_1_0
cp bin/*.so /path/to/libcod/libs/


Edit: you might need some development tools if you get errors. (yum groupinstall "Development Tools")

When you start your server with libcod it will say this:


> [INFO] Compiled for: CoD2 1.3
Compiled: Sep 4 2014 21:06:23
> [INFO] value of closer=081141ba
> [INFO] value of download=0808f940
> [PLUGIN LOADED]

maxdamage99
29th October 2014, 18:26
git clone https://github.com/kungfooman/libcod.git libcod
cd libcod
./doit.sh base
./doit.sh cod2_1_0
cp bin/*.so /path/to/libcod/libs/
==========================
this command are entered in Putty?
I simply do not understand you because of the language barrier

Plugins folder also need to libcod?

maxdamage99
29th October 2014, 19:35
Error:
=========================
./doit.sh base //////////////////////////
=======================
##### COMPILE GSC_ASTAR.CPP #####
./doit.sh: line 71: gcc: command not found
##### COMPILE GSC_MYSQL.CPP #####
./doit.sh: line 73: gcc: command not found
##### COMPILE SERVER.C #####
./doit.sh: line 75: gcc: command not found
##### COMPILE GSC_MEMORY.CPP #####
./doit.sh: line 77: gcc: command not found
##### COMPILE cracking.CPP #####
./doit.sh: line 79: gcc: command not found
##### COMPILE GSC_MATH.CPP #####
./doit.sh: line 81: gcc: command not found
##### COMPILE JAVA_EMBED.C #####
Ignore java_embed.c, because java_enable==false (e.g. because the dir $java_jdk=/root/helper/openjdk8 does not exist)
==================================================
./doit.sh cod2_1_0 ///////////////////////////////
=====================================
##### COMPILE cod2_1_0 LIBCOD.CPP #####
./doit.sh: line 154: gcc: command not found
##### COMPILE cod2_1_0 GSC.CPP #####
./doit.sh: line 156: gcc: command not found
##### COMPILE cod2_1_0 GSC_PLAYER.CPP #####
./doit.sh: line 158: gcc: command not found
##### COMPILE cod2_1_0 GSC_UTILS.CPP #####
./doit.sh: line 160: gcc: command not found
##### LINK libcod2_1_0.so #####
ls: cannot access objects_normal/*.opp: No such file or directory
ls: cannot access objects_cod2_1_0/*.opp: No such file or directory
./doit.sh: line 164: gcc: command not found
============================

IzNoGoD
29th October 2014, 20:04
Did you install the prerequisites as stated on the github page?

Mitch
29th October 2014, 20:06
./doit.sh base
./doit.sh: line 71: gcc: command not found


Edit: you might need some development tools if you get errors. (yum groupinstall "Development Tools")
Including gcc.

maxdamage99
29th October 2014, 20:18
Excuse me, was to blame the language barrier.

maxdamage99
29th October 2014, 20:25
Error:
----
./doit.sh base ///
-----
##### COMPILE GSC_ASTAR.CPP #####
In file included from /usr/include/features.h:385,
from /usr/include/stdio.h:28,
from gsc_astar.hpp:9,
from gsc_astar.cpp:1:
/usr/include/gnu/stubs.h:7:27: error: gnu/stubs-32.h: No such file or directory
##### COMPILE GSC_MYSQL.CPP #####
In file included from /usr/include/features.h:385,
from /usr/include/stdio.h:28,
from gsc_mysql.hpp:9,
from gsc_mysql.cpp:1:
/usr/include/gnu/stubs.h:7:27: error: gnu/stubs-32.h: No such file or directory
gsc_mysql.cpp: In function ‘void* mysql_async_query_handler(void*)’:
gsc_mysql.cpp:96: error: return-statement with no value, in function returning ‘void*’
gsc_mysql.cpp:104: error: return-statement with no value, in function returning ‘void*’
gsc_mysql.cpp: In function ‘void gsc_mysql_async_initializer()’:
gsc_mysql.cpp:312: error: return-statement with a value, in function returning 'void'
##### COMPILE SERVER.C #####
In file included from /usr/include/features.h:385,
from /usr/include/stdio.h:28,
from server.hpp:9,
from server.c:1:
/usr/include/gnu/stubs.h:7:27: error: gnu/stubs-32.h: No such file or directory
##### COMPILE GSC_MEMORY.CPP #####
In file included from /usr/include/features.h:385,
from /usr/include/stdio.h:28,
from gsc_memory.hpp:9,
from gsc_memory.cpp:1:
/usr/include/gnu/stubs.h:7:27: error: gnu/stubs-32.h: No such file or directory
##### COMPILE cracking.CPP #####
In file included from /usr/include/features.h:385,
from /usr/include/string.h:27,
from cracking.hpp:8,
from cracking.cpp:1:
/usr/include/gnu/stubs.h:7:27: error: gnu/stubs-32.h: No such file or directory
##### COMPILE GSC_MATH.CPP #####
In file included from /usr/include/features.h:385,
from /usr/include/stdio.h:28,
from gsc_math.hpp:9,
from gsc_math.cpp:1:
/usr/include/gnu/stubs.h:7:27: error: gnu/stubs-32.h: No such file or directory
##### COMPILE JAVA_EMBED.C #####
Ignore java_embed.c, because java_enable==false (e.g. because the dir $java_jdk=/root/helper/openjdk8 does not exist)
------
./doit.sh cod2_1_0 ////
-----------
##### COMPILE cod2_1_0 LIBCOD.CPP #####
In file included from /usr/include/features.h:385,
from /usr/include/stdio.h:28,
from libcod.cpp:1:
/usr/include/gnu/stubs.h:7:27: error: gnu/stubs-32.h: No such file or directory
##### COMPILE cod2_1_0 GSC.CPP #####
In file included from /usr/include/features.h:385,
from /usr/include/stdio.h:28,
from gsc.hpp:37,
from gsc.cpp:1:
/usr/include/gnu/stubs.h:7:27: error: gnu/stubs-32.h: No such file or directory
##### COMPILE cod2_1_0 GSC_PLAYER.CPP #####
In file included from /usr/include/features.h:385,
from /usr/include/stdio.h:28,
from gsc_player.hpp:9,
from gsc_player.cpp:1:
/usr/include/gnu/stubs.h:7:27: error: gnu/stubs-32.h: No such file or directory
##### COMPILE cod2_1_0 GSC_UTILS.CPP #####
In file included from /usr/include/features.h:385,
from /usr/include/stdio.h:28,
from gsc_utils.hpp:9,
from gsc_utils.cpp:1:
/usr/include/gnu/stubs.h:7:27: error: gnu/stubs-32.h: No such file or directory
##### LINK libcod2_1_0.so #####
ls: cannot access objects_normal/*.opp: No such file or directory
ls: cannot access objects_cod2_1_0/*.opp: No such file or directory
/usr/bin/ld: crti.o: No such file: No such file or directory
collect2: ld returned 1 exit status
I make install yum groupinstall "Development Tools"

Mitch
29th October 2014, 22:21
error: gnu/stubs-32.h: No such file or directory

yum install glibc-devel.i686 glibc-devel (equal to g++-multilib on Debian/Ubuntu)

http://www.cyberciti.biz/faq/x86_64-linux-error-gnustub-32h-missing-error-and-solution/



gsc_mysql.cpp:96: error: return-statement with no value, in function returning ‘void*’
gsc_mysql.cpp:104: error: return-statement with no value, in function returning ‘void*’
gsc_mysql.cpp:312: error: return-statement with a value, in function returning 'void'

96: change 'return' to 'return NULL'
104: change 'return' to 'return NULL'
312: change 'return NULL' to 'return'

maxdamage99
30th October 2014, 12:08
./doit.sh base
=======================

##### COMPILE GSC_ASTAR.CPP #####
##### COMPILE GSC_MYSQL.CPP #####
gsc_mysql.cpp: In function ‘void* mysql_async_query_handler(void*)’:
gsc_mysql.cpp:96: error: return-statement with no value, in function returning ‘void*’
gsc_mysql.cpp:104: error: return-statement with no value, in function returning ‘void*’
gsc_mysql.cpp: In function ‘void gsc_mysql_async_initializer()’:
gsc_mysql.cpp:312: error: return-statement with a value, in function returning 'void'
##### COMPILE SERVER.C #####
##### COMPILE GSC_MEMORY.CPP #####
##### COMPILE cracking.CPP #####
##### COMPILE GSC_MATH.CPP #####
##### COMPILE JAVA_EMBED.C #####
Ignore java_embed.c, because java_enable==false (e.g. because the dir $java_jdk=/root/helper/openjdk8 does not exist)
--------------------------------//////////////////---------------------------
./doit.sh cod2_1_0
===================================
##### COMPILE cod2_1_0 LIBCOD.CPP #####
##### COMPILE cod2_1_0 GSC.CPP #####
##### COMPILE cod2_1_0 GSC_PLAYER.CPP #####
##### COMPILE cod2_1_0 GSC_UTILS.CPP #####
##### LINK libcod2_1_0.so #####
/usr/bin/ld: cannot find -lmysqlclient
collect2: ld returned 1 exit status
Apparently something is wrong!?

Mitch
30th October 2014, 12:48
##### COMPILE GSC_MYSQL.CPP #####
gsc_mysql.cpp: In function ‘void* mysql_async_query_handler(void*)’:
gsc_mysql.cpp:96: error: return-statement with no value, in function returning ‘void*’
gsc_mysql.cpp:104: error: return-statement with no value, in function returning ‘void*’
gsc_mysql.cpp: In function ‘void gsc_mysql_async_initializer()’:
gsc_mysql.cpp:312: error: return-statement with a value, in function returning 'void'
##### LINK libcod2_1_0.so #####
/usr/bin/ld: cannot find -lmysqlclient
collect2: ld returned 1 exit status
Apparently something is wrong!?

For mysqlclient


I think you will need 'mysql-devel.i386 (https://www.centos.org/forums/viewtopic.php?t=29620)' or 'mysql-devel.i686' for mysql support in libcod. (CentOS is linux, yum install ...)


Also have you edited gsc_mysql.cpp according to http://killtube.org/showthread.php?2036-Help-me-pls)))&p=10679&viewfull=1#post10679

maxdamage99
30th October 2014, 13:19
Mitch, I do not understand, please tell what I need to fix, due to the fact that we all speak different languages​​, I have to Use the translater

Ni3ls
30th October 2014, 14:42
Where are you from? Maybe there is some native speaker here

maxdamage99
30th October 2014, 15:08
Я русский/i from russia :D

Mitch
30th October 2014, 15:17
Mitch, I do not understand, please tell what I need to fix, due to the fact that we all speak different languages​​, I have to Use the translater

yum install mysql-devel.i686 (for: /usr/bin/ld: cannot find -lmysqlclient)

nano gsc_mysql.cpp (or vi)
line 96: 'return' >> 'return NULL'
line 104: 'return' >> 'return NULL'
line 312: 'return NULL' >> 'return'

maxdamage99
30th October 2014, 15:33
Mitch, I need to go to the directory libcod/bin and then install, as I understand?
p.s: Please do me a user manual execution in subparagraphs

Mitch
30th October 2014, 17:01
Mitch, I need to go to the directory libcod/bin and then install, as I understand?
p.s: Please do me a user manual execution in subparagraphs

When you got your binary then copy it to your library directory that you use for your cod2 server.

Example
Your game directory: /home/user/server1/
Your library directory: /home/user/gamefiles/libs
cp /path/to/libcod/bin/*.so /home/user/gamefiles/libs/

Your start up line must now start with:

LD_PRELOAD="/home/user/gamefiles/libs/libcod_[version].so" ./cod2_lnxded +set dedicated "2"

maxdamage99
30th October 2014, 17:27
I seem to understand, but in the BIN folder there is nothing.

Mitch
30th October 2014, 17:35
I seem to understand, but in the BIN folder there is nothing.

What is the output of:


./doit.sh base
./doit.sh cod2_1_0

maxdamage99
30th October 2014, 18:32
I also wrote the top that says in "putty", if I enter these commands.791792

maxdamage99
30th October 2014, 19:12
I await your reply, I tried something else that:
ERROR: ld.so: object '/root/cod2/libcod/bin/libcod_1_0.so' from LD_PRELOAD cannot be preloaded: ignored.
CoD2 MP 1.0 build linux-i386 Oct 24 2005
----- FS_Startup -----
Current search path:
/root/.callofduty2/main
=====================================
tried to run, according to instructions.

kung foo man
31st October 2014, 00:37
I've fixed the error, just redownload it: https://github.com/kungfooman/libcod/archive/master.zip

Commit: https://github.com/kungfooman/libcod/commit/70279a790712f5570d9005edd42a57f700c68266

Mitch
31st October 2014, 10:13
This is a working manual for compiling libcod on CentOS.


yum install git
git clone https://github.com/kungfooman/libcod.git libcod
cd libcod
yum install gcc libgcc.i686 gcc-c++ glibc-devel.i686 mysql-server mysql-devel.i686
mkdir vendors
ln -s /usr/lib/mysql/ vendors/lib
./doit.sh base
./doit.sh cod2_1_0


Edit: 'ln -s /usr/lib/mysql/ vendors/lib' is no longer required since https://github.com/M-itch/libcod/commit/2195b490b5a7ac3dd93a7b84db0d20f2bbdf336b
Edit: for CentOS 7 you need: mariadb-server and mariadb-devel.i686.

maxdamage99
31st October 2014, 13:48
We have small differences.
here is the location of my directory
root/cod2/libcod/
above 'ROOT' nothing.

maxdamage99
31st October 2014, 14:27
ERROR: ld.so: object '/root/cod2/libcod/libcod_1_0.so' from LD_PRELOAD cannot be preloaded: ignored.
CoD2 MP 1.0 build linux-i386 Oct 24 2005
Note the location of my directories.
Look, I installed i686 version, and the version of 'Linux' I have i386

maxdamage99
31st October 2014, 16:34
I corrected, everything works as further work?
> [INFO] Compiled for: CoD2 1.0
Compiled: Oct 31 2014 07:11:39
> [INFO] value of closer=08111d32
> [INFO] value of download=0808e508
> [PLUGIN LOADED]
CoD2 MP 1.0 build linux-i386 Oct 24 2005

maxdamage99
1st November 2014, 11:14
I installed libcod to my game server. Please tell me how to start the work connected with libcod. And another question, how to check that the server is worth libcod ?? I'm just not sure that a restart launched plugin.
thanks in advance

Mitch
1st November 2014, 11:39
libcod adds custom function for using in your scripts.
Documentation: http://znation.nl/cod4script/

After you add libcod, it will be loaded each time you start or restart your server.

libcod also prevents people from downloading files that aren't iwds.

You can also do commands on chat messages.
http://killtube.org/showthread.php?1991-!Commands-with-new-version(-May-22-2014)

maxdamage99
1st November 2014, 14:47
Mitch, that's my team run the server:
LD_PRELOAD="/root/cod2/libcod/bin/libcod2_1_0.so" screen ./cod2_lnxded +set sv_maxclients 30 +set dedicated 2
I run through 'screen' precisely this is not enough space for a message, and I do not see the message:
"plugin loaded"
one more question:
because LIBCOD includes MYSQL, scripts I saw other people's data base MYSQL (Kung Fu Man). can precisely explain how to do that with MYSQL
----------///---------------------------///--------------------
my = mysql_real_connect(
my,
"127.0.0.1",
"kung",
"zetatest",
"kung_zeta",
3306,
NULL,
0
);

IzNoGoD
1st November 2014, 14:53
http://znation.nl/cod4script/mysql_real_connect.htm

maxdamage99
1st November 2014, 15:50
Write me an example please:
ip vds: 94.142.140.254
port server cod2: 28960
user: root
host: sftp://94.142.140.254
name base: i dont know))
////////////////---------------/////////////////
how to write

IzNoGoD
1st November 2014, 15:51
You just posted the example yourself.

maxdamage99
1st November 2014, 16:04
Имя базы дать мне)

IzNoGoD
1st November 2014, 16:07
Ye, cause posting russian is gonna help me understand you...

Edit: just used google translate for it.

For the database name you need to create a database first on your mysql server.

maxdamage99
1st November 2014, 16:17
Where to create a database mysql?

IzNoGoD
1st November 2014, 18:13
On your mysql server (i assume you have a mysql server)

maxdamage99
1st November 2014, 18:21
I have MySql software on VDS
Not any more.
help me pls. MYSQL!!!!!

Ni3ls
13th November 2015, 14:45
If I use your version and start the server

symbol lookup error: /home/olger/HIGHJUMP/voronlibcod2_1_0.so: undefined symbol: client_movement


Can you send me your precompiled libcod + lnxded because you have servers on 1.0 aswell right?