Bug 155268 - games/warsow 0.6 does not work as dedicated server
Summary: games/warsow 0.6 does not work as dedicated server
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Alexey Dokuchaev
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-03-04 14:50 UTC by Alexander A. Maslennikov
Modified: 2014-01-15 06:02 UTC (History)
0 users

See Also:


Attachments
file.txt (5.02 KB, text/plain)
2011-03-04 14:50 UTC, Alexander A. Maslennikov
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Alexander A. Maslennikov 2011-03-04 14:50:08 UTC
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.
-

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:
How-To-Repeat: # cd /usr/ports/games/warsow
# make config (select SERVER)
# make install clean 

wsw_server
Comment 1 Mark Linimon freebsd_committer freebsd_triage 2011-03-04 19:23:39 UTC
Responsible Changed
From-To: freebsd-ports-bugs->danfe

Fix synopsis and assign.
Comment 2 Alexey Dokuchaev freebsd_committer freebsd_triage 2011-11-23 10:08:28 UTC
State Changed
From-To: open->feedback

Port was updated to version 0.6.2 and angelwrap library should be built now.
Can you please test it and report of any issues?  Thank you.
Comment 3 Alexey Dokuchaev freebsd_committer freebsd_triage 2014-01-15 06:01:39 UTC
State Changed
From-To: feedback->closed

Feedback timeout (after over 2 years).