ports/155268: warsow 0.6 does not work as dedicated server
Alexander A. MAslennikov
alexander.a.maslennikov at gmail.com
Fri Mar 4 14:50:08 UTC 2011
>Number: 155268
>Category: ports
>Synopsis: warsow 0.6 does not work as dedicated server
>Confidential: no
>Severity: non-critical
>Priority: medium
>Responsible: freebsd-ports-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: sw-bug
>Submitter-Id: current-users
>Arrival-Date: Fri Mar 04 14:50:08 UTC 2011
>Closed-Date:
>Last-Modified:
>Originator: Alexander A. MAslennikov
>Release: RELENG_8.2
>Organization:
>Environment:
FreeBSD ns1.kuteam.com 8.2-RELEASE FreeBSD 8.2-RELEASE #4: Fri Mar 4 12:54:49 MSK 2011 asterisk at ns1.kuteam.com:/usr/obj/usr/src/sys/SERVER amd64
>Description:
After installing warsow from ports on FreeBSD 8.2/AMD64, got some issues:
# cd /usr/ports/games/warsow
# make config
# make install clean
wsw_server
- angel script initialization -
Loading angelwrap module.
Loading angelwrap failed
Game running at 62 fps. Server transmit at 20 pps
Added new master server #0 at 64.22.107.125:27950
Added new master server #1 at 69.59.212.88:27950
Added new master server #2 at 92.62.40.73:27950
====== Warsow Initialized ======
Opening UDP/IP socket: 78.107.255.10:44400
Opening UDP/IPv6 socket: *:44400
Error: Couldn't open UDP6 socket: socket: Unknown error
==== G_Init ====
- Server Initialization -
SpawnServer: wdm1
-
Initalizing 'ca' gametype
loading configs/server/gametypes/ca.cfg
ca.cfg executed
G_asInitializeGametypeScript: Angelscript API unavailable
Failed to initialize gametype: 'progs/gametypes/ca.gt'.
: AI Navigation Initialized.
-
>How-To-Repeat:
# cd /usr/ports/games/warsow
# make config (select SERVER)
# make install clean
wsw_server
>Fix:
Looks like angelwrap library is missing in my system
Then i try to compile game and angelwrap library from source
# cd /usr/ports/distfiles/warsow/source
# gmake game
> *********************************************************
> * Building game
> *********************************************************
> Compiling game/g_ascript.c
> Compiling game/g_awards.c
> Compiling game/g_callvotes.c
> Compiling game/g_chase.c
> Compiling game/g_clip.c
> Compiling game/g_cmds.c
> Compiling game/g_combat.c
> Compiling game/g_frame.c
> Compiling game/g_func.c
> Compiling game/g_gameteams.c
> Compiling game/g_gametypes.c
> Compiling game/g_items.c
> Compiling game/g_main.c
> Compiling game/g_misc.c
> Compiling game/g_mm.c
> Compiling game/g_phys.c
> Compiling game/g_spawn.c
> Compiling game/g_spawnpoints.c
> Compiling game/g_svcmds.c
> Compiling game/g_syscalls.c
> Compiling game/g_target.c
> Compiling game/g_trigger.c
> Compiling game/g_utils.c
> Compiling game/g_weapon.c
> Compiling game/p_client.c
> Compiling game/p_hud.c
> Compiling game/p_view.c
> Compiling game/p_weapon.c
> Compiling game/ai/AStar.c
> Compiling game/ai/ai_class_dmbot.c
> Compiling game/ai/ai_common.c
> Compiling game/ai/ai_dropnodes.c
> Compiling game/ai/ai_items.c
> Compiling game/ai/ai_links.c
> Compiling game/ai/ai_main.c
> Compiling game/ai/ai_movement.c
> Compiling game/ai/ai_navigation.c
> Compiling game/ai/ai_nodes.c
> Compiling game/ai/ai_tools.c
> Compiling game/ai/bot_spawn.c
> Compiling gameshared/gs_gameteams.c
> Compiling gameshared/gs_items.c
> Compiling gameshared/gs_misc.c
> Compiling gameshared/gs_players.c
> Compiling gameshared/gs_pmove.c
> Compiling gameshared/gs_slidebox.c
> Compiling gameshared/gs_weapondefs.c
> Compiling gameshared/gs_weapons.c
> Compiling gameshared/q_math.c
> Compiling gameshared/q_shared.c
> Linking release/basewsw/game_freebsd_amd64.so
seems ok.. Next
gmake angelwrap
> *********************************************************
> * Building angelwrap
> *********************************************************
rm: ../libsrcs/angelscript/angelSVN/sdk/angelscript/lib/libangelscript.a: No such file or directory
gmake: [message-angelwrap] Error 1 (ignored)
> * Building Angelscript library first
Error expanding embedded variable.
gmake: *** [../libsrcs/angelscript/angelSVN/sdk/angelscript/lib/libangelscript.a] Error 2
Hmm
after editing Makefile
- @CXX=$(CXX) AR=$(AR) RANLIB=$(RANLIB) CXXFLAGS="$(CFLAGS)" make -C $(ANGELSCRIPT_PROJECT_DIR)
+ @CXX=$(CXX) AR=$(AR) RANLIB=$(RANLIB) CXXFLAGS="$(CFLAGS)" gmake -C $(ANGELSCRIPT_PROJECT_DIR)
:
- @CXX=$(CXX) make -C $(ANGELSCRIPT_PROJECT_DIR) clean
+ @CXX=$(CXX) gmake -C $(ANGELSCRIPT_PROJECT_DIR) clean
gmake angelwrap
> *********************************************************
> * Building angelwrap
> *********************************************************
rm: ../libsrcs/angelscript/angelSVN/sdk/angelscript/lib/libangelscript.a: No such file or directory
gmake: [message-angelwrap] Error 1 (ignored)
> * Building Angelscript library first
gmake[1]: Entering directory `/usr/ports/distfiles/warsow/libsrcs/angelscript/angelSVN/sdk/angelscript/projects/gnuc'
g++ -g -Wall -fPIC -o obj/as_arrayobject.o -c ../../source/as_arrayobject.cpp
g++ -g -Wall -fPIC -o obj/as_atomic.o -c ../../source/as_atomic.cpp
g++ -g -Wall -fPIC -o obj/as_builder.o -c ../../source/as_builder.cpp
g++ -g -Wall -fPIC -o obj/as_bytecode.o -c ../../source/as_bytecode.cpp
g++ -g -Wall -fPIC -o obj/as_callfunc.o -c ../../source/as_callfunc.cpp
g++ -g -Wall -fPIC -o obj/as_callfunc_mips.o -c ../../source/as_callfunc_mips.cpp
g++ -g -Wall -fPIC -o obj/as_callfunc_ppc.o -c ../../source/as_callfunc_ppc.cpp
g++ -g -Wall -fPIC -o obj/as_callfunc_ppc_64.o -c ../../source/as_callfunc_ppc_64.cpp
g++ -g -Wall -fPIC -o obj/as_callfunc_sh4.o -c ../../source/as_callfunc_sh4.cpp
g++ -g -Wall -fPIC -o obj/as_callfunc_x86.o -c ../../source/as_callfunc_x86.cpp
g++ -g -Wall -fPIC -o obj/as_callfunc_x64_gcc.o -c ../../source/as_callfunc_x64_gcc.cpp
g++ -g -Wall -fPIC -o obj/as_compiler.o -c ../../source/as_compiler.cpp
g++ -g -Wall -fPIC -o obj/as_context.o -c ../../source/as_context.cpp
g++ -g -Wall -fPIC -o obj/as_configgroup.o -c ../../source/as_configgroup.cpp
g++ -g -Wall -fPIC -o obj/as_datatype.o -c ../../source/as_datatype.cpp
g++ -g -Wall -fPIC -o obj/as_generic.o -c ../../source/as_generic.cpp
g++ -g -Wall -fPIC -o obj/as_gc.o -c ../../source/as_gc.cpp
g++ -g -Wall -fPIC -o obj/as_memory.o -c ../../source/as_memory.cpp
g++ -g -Wall -fPIC -o obj/as_module.o -c ../../source/as_module.cpp
g++ -g -Wall -fPIC -o obj/as_objecttype.o -c ../../source/as_objecttype.cpp
g++ -g -Wall -fPIC -o obj/as_outputbuffer.o -c ../../source/as_outputbuffer.cpp
g++ -g -Wall -fPIC -o obj/as_parser.o -c ../../source/as_parser.cpp
g++ -g -Wall -fPIC -o obj/as_restore.o -c ../../source/as_restore.cpp
g++ -g -Wall -fPIC -o obj/as_scriptcode.o -c ../../source/as_scriptcode.cpp
g++ -g -Wall -fPIC -o obj/as_scriptengine.o -c ../../source/as_scriptengine.cpp
./../source/as_scriptengine.cpp: In member function 'void* asCScriptEngine::CallGlobalFunctionRetPtr(asSSystemFunctionInterface*, asCScriptFunction*)':
./../source/as_scriptengine.cpp:3079: warning: 'stdcall' attribute ignored
./../source/as_scriptengine.cpp:3079: warning: 'stdcall' attribute ignored
./../source/as_scriptengine.cpp: In member function 'void asCScriptEngine::CallGlobalFunction(void*, void*, asSSystemFunctionInterface*, asCScriptFunction*)':
./../source/as_scriptengine.cpp:3159: warning: 'stdcall' attribute ignored
./../source/as_scriptengine.cpp:3159: warning: 'stdcall' attribute ignored
./../source/as_scriptengine.cpp: In member function 'bool asCScriptEngine::CallGlobalFunctionRetBool(void*, void*, asSSystemFunctionInterface*, asCScriptFunction*)':
./../source/as_scriptengine.cpp:3179: warning: 'stdcall' attribute ignored
./../source/as_scriptengine.cpp:3179: warning: 'stdcall' attribute ignored
g++ -g -Wall -fPIC -o obj/as_scriptfunction.o -c ../../source/as_scriptfunction.cpp
g++ -g -Wall -fPIC -o obj/as_scriptnode.o -c ../../source/as_scriptnode.cpp
g++ -g -Wall -fPIC -o obj/as_scriptstruct.o -c ../../source/as_scriptstruct.cpp
g++ -g -Wall -fPIC -o obj/as_string.o -c ../../source/as_string.cpp
g++ -g -Wall -fPIC -o obj/as_string_util.o -c ../../source/as_string_util.cpp
g++ -g -Wall -fPIC -o obj/as_thread.o -c ../../source/as_thread.cpp
./../source/as_thread.cpp: In member function 'int asCThreadManager::CleanupLocalData()':
./../source/as_thread.cpp:124: error: cast from 'pthread*' to 'asDWORD' loses precision
./../source/as_thread.cpp: In member function 'asCThreadLocalData* asCThreadManager::GetLocalData()':
./../source/as_thread.cpp:195: error: cast from 'pthread*' to 'asDWORD' loses precision
gmake[1]: *** [obj/as_thread.o] Error 1
gmake[1]: Leaving directory `/usr/ports/distfiles/warsow/libsrcs/angelscript/angelSVN/sdk/angelscript/projects/gnuc'
gmake: *** [../libsrcs/angelscript/angelSVN/sdk/angelscript/lib/libangelscript.a] Error 2
Then I found some patches
# cd /usr/ports/games/warsow/work/libsrcs/angelscript/angelSVN/sdk/angelscript/source
# fetch ftp://ftp2.za.freebsd.org/pub/FreeBSD/ports/games/rigsofrods/files/patch-dependencies-angelscript-source-as_thread.cpp
# fetch ftp://ftp2.za.freebsd.org/pub/FreeBSD/ports/games/rigsofrods/files/patch-dependencies-angelscript-source-as_thread.h
# fetch ftp://ftp2.za.freebsd.org/pub/FreeBSD/ports/games/rigsofrods/files/patch-dependencies-angelscript-source-as_config.h
After some editing patch files:
# patch <patch-dependencies-angelscript-source-as_thread.h
# patch <patch-dependencies-angelscript-source-as_config.h
# patch <patch-dependencies-angelscript-source-as_thread.cpp
Now return to build angelwrap
# cd /usr/ports/games/warsow/work/source
# gmake angelwrap
# gmake game
# gmake ded
When i ran wsw_server
- angel script initialization -
Loading angelwrap module.
Initializing Angel Script
Initialization of angelwrap successful
Game running at 62 fps. Server transmit at 20 pps
Added new master server #0 at 64.22.107.125:27950
Added new master server #1 at 69.59.212.88:27950
Added new master server #2 at 92.62.40.73:27950
====== Warsow Initialized ======
Opening UDP/IP socket: 78.107.255.10:44400
Opening UDP/IPv6 socket: *:44400
Error: Couldn't open UDP6 socket: socket: Unknown error
==== G_Init ====
- Server Initialization -
SpawnServer: wdm1
-
Initalizing 'ca' gametype
loading configs/server/gametypes/ca.cfg
ca.cfg executed
* Initializing gametype scripts
* angelscript library with AS_MAX_PORTABILITY detected
* Initializing Game module syntax
* Loaded script section 'progs/shared/constants.as'
* Loaded script section 'progs/shared/files.as'
* Loaded script section 'progs/gametypes/generic/playerclasses.as'
* Loaded script section 'progs/gametypes/generic/matchstates.as'
* Loaded script section 'progs/gametypes/generic/bots.as'
* Loaded script section 'progs/gametypes/ca.as'
* Loaded script section 'progs/gametypes/legacy/quake1.as'
********************
ERROR: Received signal 11
********************
==== G_Shutdown ====
WARNING: Spawning entity before map entities have been spawned
Error: Received signal 11
Now we get an error: Received signal 11
I designed all the changes as patches to the port
/usr/ports/games/warsow/files/patch-as_thread.cpp
--- /usr/ports/games/warsow/work/libsrcs/angelscript/angelSVN/sdk/angelscript/source/as_thread.cpp.bak
+++ /usr/ports/games/warsow/work/libsrcs/angelscript/angelSVN/sdk/angelscript/source/as_thread.cpp
97c97
< asSMapNode<asDWORD,asCThreadLocalData*> *cursor = 0;
---
> asSMapNode<pthread_t,asCThreadLocalData*> *cursor = 0;
124c124
< asDWORD id = (asDWORD)pthread_self();
---
> pthread_t id = pthread_self();
131c131
< asSMapNode<asDWORD,asCThreadLocalData*> *cursor = 0;
---
> asSMapNode<pthread_t,asCThreadLocalData*> *cursor = 0;
166c166
< asCThreadLocalData *asCThreadManager::GetLocalData(asDWORD threadId)
---
> asCThreadLocalData *asCThreadManager::GetLocalData(pthread_t threadId)
172c172
< asSMapNode<asDWORD,asCThreadLocalData*> *cursor = 0;
---
> asSMapNode<pthread_t,asCThreadLocalData*> *cursor = 0;
181c181
< void asCThreadManager::SetLocalData(asDWORD threadId, asCThreadLocalData *tld)
---
> void asCThreadManager::SetLocalData(pthread_t threadId, asCThreadLocalData *tld)
195c195
< asDWORD id = (asDWORD)pthread_self();
---
> pthread_t id = pthread_self();
/usr/ports/games/warsow/files/patch-as_thread.h
--- /usr/ports/games/warsow/work/libsrcs/angelscript/angelSVN/sdk/angelscript/source/as_thread.h.bak
+++ /usr/ports/games/warsow/work/libsrcs/angelscript/angelSVN/sdk/angelscript/source/as_thread.h
69,70c69,70
< asCThreadLocalData *GetLocalData(asDWORD threadId);
< void SetLocalData(asDWORD threadId, asCThreadLocalData *tld);
---
> asCThreadLocalData *GetLocalData(pthread_t threadId);
> void SetLocalData(pthread_t threadId, asCThreadLocalData *tld);
72c72
< asCMap<asDWORD,asCThreadLocalData*> tldMap;
---
> asCMap<pthread_t,asCThreadLocalData*> tldMap;
100a101
>
And patch for port Makefile to build angelwrap with dedicated server:
Makefile.bak
31a32
> WSWLIBDIR= libs
59c60
< ALL_TARGET+= ded
---
> ALL_TARGET+= ded angelwrap
110c111
< s|-O2 -fno-strict-aliasing -ffast-math -funroll-loops ||' \
---
> s|-O2 -fno-strict-aliasing -ffast-math -funroll-loops || ; s|make -C|gmake -C|' \
133c134
<
---
> cd ${RELEASEDIR} && ${COPYTREE_SHARE} "${WSWLIBDIR}" ${DATADIR}
Patch attached with submission follows:
# New ports collection makefile for: Warsow
# Date created: 31 May 2006
# Whom: Alexey Dokuchaev <danfe at FreeBSD.org>
#
# $FreeBSD: ports/games/warsow/Makefile,v 1.22 2011/02/07 10:59:53 danfe Exp $
#
PORTNAME= warsow
PORTVERSION= 0.6
CATEGORIES= games
MASTER_SITES= http://www.zcdn.org/dl/ \
http://www.derchris.eu/warsow/
DISTNAME= ${PORTNAME}_${PORTVERSION}_sdk
DIST_SUBDIR= ${PORTNAME}
MAINTAINER= danfe at FreeBSD.org
COMMENT= A fast paced first person shooter game
LICENSE= GPLv2
LIB_DEPENDS= curl.6:${PORTSDIR}/ftp/curl
RUN_DEPENDS= ${DATADIR}/basewsw/data0_06.pk3:${PORTSDIR}/games/warsow-data
ONLY_FOR_ARCHS= i386 amd64
USE_GMAKE= yes
USE_ZIP= yes
WRKSRC= ${WRKDIR}/source
ALL_TARGET= game
RELEASEDIR= ${WRKSRC}/release
WSWSUBDIR= basewsw
WSWLIBDIR= libs
OPTIONS= CLIENT "Build client executable" on \
SERVER "Build dedicated server executable" on \
QF "Build Qf sound module" on \
OPENAL "Build OpenAL sound module" on \
IRC "Build IRC client module" on \
TV_SRV "Build Warsow TV server" on
.include <bsd.port.pre.mk>
.if defined(WITHOUT_CLIENT) && defined(WITHOUT_SERVER)
IGNORE= requires at least one of CLIENT or SERVER options
.endif
.if !defined(WITHOUT_CLIENT)
LIB_DEPENDS+= jpeg.11:${PORTSDIR}/graphics/jpeg
USE_GL= yes
USE_SDL= yes
USE_XORG= xinerama xxf86dga
ALL_TARGET+= cgame ui client
WSWBIN+= warsow
PLIST_SUB+= CLIENT=""
.else
PLIST_SUB+= CLIENT="@comment "
.endif
.if !defined(WITHOUT_SERVER)
ALL_TARGET+= ded angelwrap
WSWBIN+= wsw_server
PLIST_SUB+= SERVER=""
.else
PLIST_SUB+= SERVER="@comment "
.endif
.if !(defined(WITHOUT_QF) && defined(WITHOUT_OPENAL))
LIB_DEPENDS+= vorbisfile.6:${PORTSDIR}/audio/libvorbis
.endif
.if !(defined(WITHOUT_QF) && defined(WITHOUT_OPENAL) && defined(WITHOUT_IRC))
WSWSUBDIR+= libs
.endif
.if !defined(WITHOUT_QF)
USE_SDL= yes
ALL_TARGET+= qf
PLIST_SUB+= QF=""
.else
PLIST_SUB+= QF="@comment "
.endif
.if !defined(WITHOUT_OPENAL)
USE_OPENAL= al
ALL_TARGET+= openal
PLIST_SUB+= OPENAL=""
.else
PLIST_SUB+= OPENAL="@comment "
.endif
.if !defined(WITHOUT_IRC)
ALL_TARGET+= irc
PLIST_SUB+= IRC=""
.else
PLIST_SUB+= IRC="@comment "
.endif
.if !defined(WITHOUT_TV_SRV)
ALL_TARGET+= tv_server
WSWBIN+= wswtv_server
PLIST_SUB+= TVSERVER=""
.else
PLIST_SUB+= TVSERVER="@comment "
.endif
PLIST_SUB+= ARCH=${ARCH}
post-patch: .SILENT
# Unmute build and link commands, respect CFLAGS
${REINPLACE_CMD} -e 's|@$$(DO_CC|$$(DO_CC| ; /> Linking $$@/d ; \
s|-O2 -fno-strict-aliasing -ffast-math -funroll-loops || ; s|make -C|gmake -C|' \
${WRKSRC}/Makefile
# Search directory provided by warsow-data port instead of current. Doing
# so allows us not to install any wrapper scripts.
${REINPLACE_CMD} -e 's|path", "\.|path", "${DATADIR}|' \
${WRKSRC}/qcommon/files.c
# Adjust architecture names, get rid of ``freebsd_'' prefix
${REINPLACE_CMD} -e 's/x86_64/amd64/ ; s/freebsd_//' \
${WRKSRC}/gameshared/q_arch.h
# Resolve name collision with jpeg-8
${REINPLACE_CMD} -e 's|jpeg_mem_src|local_jpeg_mem_src|' \
${WRKSRC}/ref_gl/r_image.c
# Add missing #include's
${REINPLACE_CMD} -e '24s|^|#include <sys/socket.h>|' \
${WRKSRC}/qcommon/net.c
${REINPLACE_CMD} -e '19s|^|#include <stdint.h>|' \
${WRKSRC}/unix/unix_xpm.c
do-install:
.for b in ${WSWBIN}
${INSTALL_PROGRAM} ${RELEASEDIR}/${b}.${ARCH} ${PREFIX}/bin/${b}
.endfor
cd ${RELEASEDIR} && ${COPYTREE_SHARE} "${WSWSUBDIR}" ${DATADIR}
cd ${RELEASEDIR} && ${COPYTREE_SHARE} "${WSWLIBDIR}" ${DATADIR}
.include <bsd.port.post.mk>
--- /usr/ports/games/warsow/work/libsrcs/angelscript/angelSVN/sdk/angelscript/source/as_thread.h.bak
+++ /usr/ports/games/warsow/work/libsrcs/angelscript/angelSVN/sdk/angelscript/source/as_thread.h
69,70c69,70
< asCThreadLocalData *GetLocalData(asDWORD threadId);
< void SetLocalData(asDWORD threadId, asCThreadLocalData *tld);
---
> asCThreadLocalData *GetLocalData(pthread_t threadId);
> void SetLocalData(pthread_t threadId, asCThreadLocalData *tld);
72c72
< asCMap<asDWORD,asCThreadLocalData*> tldMap;
---
> asCMap<pthread_t,asCThreadLocalData*> tldMap;
100a101
>
--- /usr/ports/games/warsow/work/libsrcs/angelscript/angelSVN/sdk/angelscript/source/as_thread.cpp.bak
+++ /usr/ports/games/warsow/work/libsrcs/angelscript/angelSVN/sdk/angelscript/source/as_thread.cpp
97c97
< asSMapNode<asDWORD,asCThreadLocalData*> *cursor = 0;
---
> asSMapNode<pthread_t,asCThreadLocalData*> *cursor = 0;
124c124
< asDWORD id = (asDWORD)pthread_self();
---
> pthread_t id = pthread_self();
131c131
< asSMapNode<asDWORD,asCThreadLocalData*> *cursor = 0;
---
> asSMapNode<pthread_t,asCThreadLocalData*> *cursor = 0;
166c166
< asCThreadLocalData *asCThreadManager::GetLocalData(asDWORD threadId)
---
> asCThreadLocalData *asCThreadManager::GetLocalData(pthread_t threadId)
172c172
< asSMapNode<asDWORD,asCThreadLocalData*> *cursor = 0;
---
> asSMapNode<pthread_t,asCThreadLocalData*> *cursor = 0;
181c181
< void asCThreadManager::SetLocalData(asDWORD threadId, asCThreadLocalData *tld)
---
> void asCThreadManager::SetLocalData(pthread_t threadId, asCThreadLocalData *tld)
195c195
< asDWORD id = (asDWORD)pthread_self();
---
> pthread_t id = pthread_self();
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-ports-bugs
mailing list