belstgut
-
Posts
31 -
Joined
-
Last visited
-
Days Won
2
Content Type
Forums
Profiles
Events
Gallery
Downloads
Articles
Posts posted by belstgut
-
-
sure there are more callbacks. I mean every lua script which has the et_ClientConnect function gets called when a player connects.
-
having threads in lua should not be a problem, since u can just bind a C module anyway.
But I would like to return a ~= nil value based on the result of the request in the et_ClientConnect callback. how would I do that? I mean even if I fork the networking into a seperate thread, the function would still have to wait for that thread to finish, so I could return sth. I almost think that this would not be possible.
So probably just always return nil and then kick based on the result.
Still, this could be done more beautifully like calling every callback in its own thread and collecting the return values in an array. when all callbacks are finished, iterate over the results instead of calling the callbacks in a loop.
-
So I got everything working now.
One problem though,
using luasocket http is blocking.
Since I am using this in et_clientConnect (not always though) everytime I do the http request the server lags until the request has finished. I return nil or a string based on the result of the request.
Is there any way I could make this callback nonblocking? (like let it execute for more than 1 server frame, the client has to wait for the result though)?
-
Nvm. I got it working. Dunno what changed But I compiled luasocket again and now it works. odd
-
Does noone has any more ideas? Or maybe its not even a problem with luasockets but with my take on it.
Can someone try and check if it works for you?
-
check the wiki. pretty much everything is documented there: http://mygamingtalk.com/wiki/SilEnT_Mod
-
Curl works though. So sockets seem to be working. I tried lcurl which links against libcurl and it worked. I dont like the callback structure of curl though. So if anyone has a wrapper around that
-
"libstdc++.so.6: cannot open shared object file: No such file or directory"
thats exactly your problem. I think u are missing the 32 bit version of libc and libstdc++
-
Btw, luasockets work in the systemwide lua interpreter. (5.3.1 32bit)
Lua 5.3.1 Copyright © 1994-2015 Lua.org, PUC-Rio> http = require'socket.http'> print(http.request('http://127.0.0.1'))Hi there200 table: 0x80c1600 HTTP/1.1 200 OK/usr/bin/lua5.3: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux.so.2, for GNU/Linux 2.6.32, BuildID[sha1]=5c238fe30c288fab06fd2c3e25bbffb575a48700, stripped -
-
that seemed to be working.
Lua 5.3.1 with -DLUA_32BITS -DLUA_USE_C89
still cant send stuff over a socket though
-
yes. I have compiled it in a 32 chroot.
gs@server1 ~/wolfet % file /usr/lib/i386-linux-gnu/liblua.so.5.3/usr/lib/i386-linux-gnu/liblua.so.5.3: ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), dynamically linked, BuildID[sha1]=e7f186a10367b9209c168d910c84ed19199f6c40, not strippedFull ELF info: -
http://www.lua.org/manual/5.3/manual.html#luaL_checkversion since this is the call which raises the error, I assume, the lua versions are NOT the same.
-
I am using 5.3.3 I'll try with 5.3.1
edit: same with 5.3.1
-
I'll get that panic before any lua module gets loaded.
log: https://ptpb.pw/xB9r
ET Legacy v2.74-507-gdc7379e linux-i386 Jan 4 2016
Zone megs: 24
----- FS_Startup -----
Current search path:
/home/gs/wolfet/.testserver/testsilent
/home/gs/wolfet/testsilent
/home/gs/wolfet/testsilent/testsilent-0.9.0.pk3 (528 files)
/home/gs/wolfet/.testserver/etmain
/home/gs/wolfet/.testserver/etmain/warbell.pk3 (242 files)
/home/gs/wolfet/.testserver/etmain/venice.pk3 (330 files)
/home/gs/wolfet/.testserver/etmain/trmfght_beta2.pk3 (197 files)
/home/gs/wolfet/.testserver/etmain/tc_base.pk3 (63 files)
/home/gs/wolfet/.testserver/etmain/sw_oasis_b3.pk3 (45 files)
/home/gs/wolfet/.testserver/etmain/supplydepot2.pk3 (46 files)
/home/gs/wolfet/.testserver/etmain/sp_delivery_te.pk3 (51 files)
/home/gs/wolfet/.testserver/etmain/reactor_final.pk3 (115 files)
/home/gs/wolfet/.testserver/etmain/pirates.pk3 (154 files)
/home/gs/wolfet/.testserver/etmain/parisbastille_b3.pk3 (116 files)
/home/gs/wolfet/.testserver/etmain/mlb_temple.pk3 (83 files)
/home/gs/wolfet/.testserver/etmain/missile_b4.pk3 (89 files)
/home/gs/wolfet/.testserver/etmain/karsiah_te2.pk3 (41 files)
/home/gs/wolfet/.testserver/etmain/italyfp2.pk3 (325 files)
/home/gs/wolfet/.testserver/etmain/goldrush-ga.pk3 (36 files)
/home/gs/wolfet/.testserver/etmain/frostbite.pk3 (99 files)
/home/gs/wolfet/.testserver/etmain/Fata_Morgana.pk3 (73 files)
/home/gs/wolfet/.testserver/etmain/et_mor2_night_final.pk3 (92 files)
/home/gs/wolfet/.testserver/etmain/et_ice.pk3 (61 files)
/home/gs/wolfet/.testserver/etmain/et_carentan_b2.pk3 (130 files)
/home/gs/wolfet/.testserver/etmain/et_beach.pk3 (177 files)
/home/gs/wolfet/.testserver/etmain/erdenberg_t1.pk3 (77 files)
/home/gs/wolfet/.testserver/etmain/element_skye.pk3 (27 files)
/home/gs/wolfet/.testserver/etmain/dubrovnik_final.pk3 (186 files)
/home/gs/wolfet/.testserver/etmain/caen2.pk3 (83 files)
/home/gs/wolfet/.testserver/etmain/bremen_final.pk3 (100 files)
/home/gs/wolfet/.testserver/etmain/braundorf_final.pk3 (76 files)
/home/gs/wolfet/.testserver/etmain/bergen.pk3 (181 files)
/home/gs/wolfet/.testserver/etmain/baserace_desert.pk3 (154 files)
/home/gs/wolfet/.testserver/etmain/axislab_final.pk3 (172 files)
/home/gs/wolfet/.testserver/etmain/adlernest_2.pk3 (120 files)
/home/gs/wolfet/etmain
/home/gs/wolfet/etmain/pak0.pk3 (3725 files)
----------------------
7994 files in pk3 files
execing default.cfg
couldn't exec autoexec.cfg
Hunk_Clear: reset the hunk ok
Not logging server attacks to disk.
Found high quality video and fast CPU
SQLite3 libversion 3.9.2 - database URL 'etl.db' - in-memory
... reading existing database '/home/gs/wolfet/.testserver/etl.db'
... database file '/home/gs/wolfet/.testserver/etl.db' loaded
SQLite3 ET: L database '/home/gs/wolfet/.testserver/etl.db' init
--- Common Initialization Complete ---
IP: 127.0.0.1
IP: 94.23.7.172
IP: 10.8.0.1
Opening IP socket: 0.0.0.0:13337
Network initialized.
execing testserver.cfg
sv_maxclients will be changed upon restarting.
g_gametype will be changed upon restarting.
execing mapvote.cfg
------ Server Initialization ------
Server: sw_oasis_b3
Hunk_Clear: reset the hunk ok
...IRC: connecting to server irc.quakenet.org
----- FS_Startup -----
...Connected to IRC server
Current search path:
/home/gs/wolfet/.testserver/testsilent
/home/gs/wolfet/testsilent
/home/gs/wolfet/testsilent/testsilent-0.9.0.pk3 (528 files)
/home/gs/wolfet/.testserver/etmain
/home/gs/wolfet/.testserver/etmain/warbell.pk3 (242 files)
/home/gs/wolfet/.testserver/etmain/venice.pk3 (330 files)
/home/gs/wolfet/.testserver/etmain/trmfght_beta2.pk3 (197 files)
/home/gs/wolfet/.testserver/etmain/tc_base.pk3 (63 files)
/home/gs/wolfet/.testserver/etmain/sw_oasis_b3.pk3 (45 files)
/home/gs/wolfet/.testserver/etmain/supplydepot2.pk3 (46 files)
/home/gs/wolfet/.testserver/etmain/sp_delivery_te.pk3 (51 files)
/home/gs/wolfet/.testserver/etmain/reactor_final.pk3 (115 files)
/home/gs/wolfet/.testserver/etmain/pirates.pk3 (154 files)
/home/gs/wolfet/.testserver/etmain/parisbastille_b3.pk3 (116 files)
/home/gs/wolfet/.testserver/etmain/mlb_temple.pk3 (83 files)
/home/gs/wolfet/.testserver/etmain/missile_b4.pk3 (89 files)
/home/gs/wolfet/.testserver/etmain/karsiah_te2.pk3 (41 files)
/home/gs/wolfet/.testserver/etmain/italyfp2.pk3 (325 files)
/home/gs/wolfet/.testserver/etmain/goldrush-ga.pk3 (36 files)
/home/gs/wolfet/.testserver/etmain/frostbite.pk3 (99 files)
/home/gs/wolfet/.testserver/etmain/Fata_Morgana.pk3 (73 files)
/home/gs/wolfet/.testserver/etmain/et_mor2_night_final.pk3 (92 files)
/home/gs/wolfet/.testserver/etmain/et_ice.pk3 (61 files)
/home/gs/wolfet/.testserver/etmain/et_carentan_b2.pk3 (130 files)
/home/gs/wolfet/.testserver/etmain/et_beach.pk3 (177 files)
/home/gs/wolfet/.testserver/etmain/erdenberg_t1.pk3 (77 files)
/home/gs/wolfet/.testserver/etmain/element_skye.pk3 (27 files)
/home/gs/wolfet/.testserver/etmain/dubrovnik_final.pk3 (186 files)
/home/gs/wolfet/.testserver/etmain/caen2.pk3 (83 files)
/home/gs/wolfet/.testserver/etmain/bremen_final.pk3 (100 files)
/home/gs/wolfet/.testserver/etmain/braundorf_final.pk3 (76 files)
/home/gs/wolfet/.testserver/etmain/bergen.pk3 (181 files)
/home/gs/wolfet/.testserver/etmain/baserace_desert.pk3 (154 files)
/home/gs/wolfet/.testserver/etmain/axislab_final.pk3 (172 files)
/home/gs/wolfet/.testserver/etmain/adlernest_2.pk3 (120 files)
/home/gs/wolfet/etmain
/home/gs/wolfet/etmain/pak0.pk3 (3725 files)
----------------------
7994 files in pk3 files
Sys_LoadDll(/home/gs/wolfet/.testserver/testsilent/qagame.mp.i386.so)... failed: "/home/gs/wolfet/.testserver/testsilent/qagame.mp.i386.so: cannot open
shared object file: No such file or directory"
Sys_LoadDll(/home/gs/wolfet/testsilent/qagame.mp.i386.so)... succeeded
Sys_LoadDll(testsilent/qagame) found vmMain function at 0xe8f26d80
------- Game Initialization -------
gamename: silEnT
gamedate: Nov 22 2015
*=====Server Installation Check
* Inspecting menu files
Menu files are Ok
* Inspecting assets
Asset files are Ok
* Inspecting server cvars
*=====Server Installation Checked and Found Ok
424 cvars in use.
*===== SCREENSHOTS IN USE
file not found: scripts/our.campaign
------------------------------------------------------------
InitGame: \sv_sac\1\omnibot_playing\0\mod_url\http://mygamingtalk.com/\mod_version\0.9.0\g_axismaxlives\0\g_alliedmaxlives\0\g_maxlivesRespawnPenalty\0
\voteFlags\0\g_balancedteams\0\g_maxGameClients\0\g_bluelimbotime\20000\g_redlimbotime\30000\gamename\silEnT\g_tyranny\1\g_damageXPLevel\70\g_damageXP\
2\g_maxConnsPerIP\4\g_heavyWeaponRestriction\100\g_antilagDelay\0\omnibot_enable\0\g_antilag\1\g_voteFlags\0\g_minGameClients\0\g_needpass\0\g_maxlives
\0\g_friendlyFire\0\sv_floodProtect\1\sv_maxPing\0\sv_minPing\0\sv_dlRate\100\sv_maxRate\50000\sv_maxclients\34\sv_minRate\0\sv_hostname\sKy-e.Beginner
s XPSave\sv_privateClients\2\mapname\sw_oasis_b3\protocol\82\g_gametype\6\timelimit\0\version\ET 2.60b linux-i386 May 8 2006
Start of warmup.
Cheat logfile open: cheat.log
readconfig: loaded 17 levels, 420 bans, 85 subnet bans, 61 commands, 0 warnings and 1 custom votes
Loading Dynamic Server Modules
* Could not load module configuration file "modules.cfg".
Execing default.cfg mapconfig for 0 players.
* Execing commands for player amount between 0 - 12.
* Execed total of 24 commands from the config file.
Execing sw_oasis_b3.cfg mapconfig for 0 players.
* Config file "mapconfigs/sw_oasis_b3.cfg" was not found.
Gametype changed, clearing session data.
serverstats: loaded 45 mapstats
banners: loaded 6 banners
*=====INITIALISING USER DATABASE
* Opening user database file userdb.db.
* Opening user database file userxdb.db.
* User database files open. Caching database.
1 players cached from the user database.
No additional user records in the user database.
* Reading aliases database.
Read total of 1 aliases for 1 players.
*=====DATABASE READY FOR USE
Enable spawning!
Disable spawning!
1 teams with 1 entities
-----------------------------------
Setting MOTD...
Disabling sv_floodprotect
]PANIC: unprotected error in call to Lua API (core and library have incompatible numeric types)
----- Server Shutdown -----
Resolving etmaster.idsoftware.com (IPv4)
etmaster.idsoftware.com resolved to 192.246.40.60:27950
Sending heartbeat to etmaster.idsoftware.com
Resolving master.etlegacy.com (IPv4)
master.etlegacy.com resolved to 5.135.27.11:27950
Sending heartbeat to master.etlegacy.com
Resolving master0.etmaster.net (IPv4)
master0.etmaster.net resolved to 91.220.53.121:27950
Sending heartbeat to master0.etmaster.net
=== ShutdownGame -------------------------------------------
*=====CLOSING DATABASE
Buffers cleaned.
Big Memory Cache cleaned.
*=====DATABASE IS CLOSED
Unloading Dynamic Server Modules
Dynamic Server Modules Unloaded
ShutdownGame: done. Closing log.
------------------------------------------------------------
---------------------------
Sys_Exit warning - PID file doesn't exist /home/gs/wolfet/.testserver/testsilent/etlegacy_server.pid
Network shutdown. -
Currently trying it with the dynamic_lua qagame.
but I get the following:
PANIC: unprotected error in call to Lua API (core and library have incompatible numeric types)
I am using the lib from: http://packages.ubuntu.com/xenial/i386/liblua5.3-0
-
Am I blind or is there really no edit function for posts?
well anyway,
Now the module loads and works and stuff, BUT I cant do http requests.
It always times out.
tcpdump shows a successful TCP Handshake
and after the timeout (eg 10s)
I can see the TCP FIN "handshake"
But I do NOT see any actual packages transmitted.
any ideas?
EDIT: hmm odd. I can edit this post, but not the other one.
well after a bit of investigating I came to the conclusion, that while a socket:connect() works (tcp handshake and so on)
nothing happens with a socket:send('some data')
it just times out.
So the problem is not related to the http.lua module. but already at the lowerlevel tcp module.
-
woah thanks. linking it to the qagame shared object worked. I was trying to link it against liblua53.so.
setting MOON_DLFIX_LIBNAME to qagame.i386.so worked
thanks
-
Hi,
I am currently trying to get luasocket working in one of my luascripts.
I got luasocket compiled against the 32bit liblua53 and moved it to silent/lualibs.
I still got following problem though. It seems like silent lua extension does NOT reexport modules like lua_gettop
I get: socket/core.so: undefined symbol: lua_gettop
i found this: https://github.com/siffiejoe/lua-moon/
I am not sure if I just failed to compile it correctly but after requireing sofix in my lua module I still get the same error. (the require works though.)
-
matchmaking is probably nessesary for ETlive anyway
-
yeh i mainly meant the pdf
nice to hear that you are implementing this
can we also expect some kind of matchmaking system? that would be awesome ^^
-
there is no point in reading this unless you really know your statistics and propability mathematics
-
Maybe take a look at the TrueSkill Algorithm by microsoft for upcoming versions. TrueSkill also provides logic for matchmaking and balancing teams.
http://www.moserware.com/2010/03/computing-your-skill.html
http://dl.dropbox.com/u/1083108/Moserware/Skill/The%20Math%20Behind%20TrueSkill.pdf
C# Implementation: https://github.com/moserware/Skills
Online Calculator: http://research.microsoft.com/en-us/projects/trueskill/calculators.aspx
-
just tested about half an hour today. Distribution: Ubuntu 12.04 LTS 64 bit
didnt encountered any problems.
using luasocket in a luascript
in Enemy Territory Modding
Posted
Since I got this running now, I wanted to share on how to do it.
u need https://github.com/siffiejoe/lua-moon/blob/master/examples/sofix.c compiled as shared Object with
-DMOON_DLFIX_LIBNAME=/path/to/silent/qagame.mp.i386.so
example: gcc -DMOON_DLFIX_LIBNAME='"/home/gs/wolfet/silent/qagame.mp.i386.so"' -m32 -Wall -Wextra -I.. -fpic -shared -Os -o sofix.so sofix.c
Luasocket (precompiled for 32bit): https://ptpb.pw/gyb_.zip
Copas: https://github.com/keplerproject/copas/tree/master/src
copy/extract luasocket, sofix.so and copas to: silent/lualibs/
after that create your luamodule. example:
I am currently using a structure like that and haven't experienced any lags till now.