LUA threading

Discussion for Bani's Tournament Mod

Moderators: Forum moderators, developers

Post Reply
-W0kk3L-
Posts: 46
Joined: Sun Jun 20, 2004 12:28 pm

LUA threading

Post by -W0kk3L- »

Ive recently added a multi-server banning system using LUA to our ET servers. This works all very nice, however some lagg occurs when new users join and need to be checked by the system.

So, my question is:
Is there a possibility to perhaps add threading to some LUA callbacks or implement some sort of postback that I can call from the underlying OS.
Function to check used: function et_ClientConnect( clientNum, firstTime, isBot )
Game on at CREW-NEXUS... running more than 25 gameservers @ 100mbit! Visit: http://www.crew-nexus.net/servers for connection info!!!
User avatar
bani
Site Admin
Posts: 2780
Joined: Sun Jul 21, 2002 3:58 am
Contact:

Post by bani »

multithreading lua won't help. when the engine asks for ClientConnect, it needs the answer immediately.

you need to make your checks more efficient. perhaps you should think about caching your database.
User avatar
=FF=im2good4u
Posts: 3821
Joined: Wed Feb 05, 2003 7:30 am
Location: The Netherlands, HOLLAND
Contact:

Post by =FF=im2good4u »

or lust let the client connect and do the checks afterwards then u can still disconnect him if needed

this should only take a few secs sohe wont even beable todo anythnig becase hes still loading the map
-W0kk3L-
Posts: 46
Joined: Sun Jun 20, 2004 12:28 pm

Post by -W0kk3L- »

But isnt it possible to create a thread using that LUA function?
For example: et.CreateThread( LuaFunction, Params)
On which LuaFunction gets executed with params (and no results return)
In that function I can then safely check the required information and add a console command to the back of the queue.
Game on at CREW-NEXUS... running more than 25 gameservers @ 100mbit! Visit: http://www.crew-nexus.net/servers for connection info!!!
User avatar
ReyalP
Posts: 1663
Joined: Fri Jul 25, 2003 11:44 am

Post by ReyalP »

-W0kk3L- wrote:But isnt it possible to create a thread using that LUA function?
For example: et.CreateThread( LuaFunction, Params)
On which LuaFunction gets executed with params (and no results return)
In that function I can then safely check the required information and add a console command to the back of the queue.
Allowing threads to asynchronously interact with ET would be very hard. ET is entirely single threaded, and the gamecode dll (where all etpro and LUA resides) gets reloaded frequently.

I'd suggest optimizing your ban queries instead. Without any information on how it works, I can't offer any specific suggestions, but it's hard to imagine you can't have it all cached in RAM somewhere. You could do this by loading it into a lua table once at map start, for example.
send lawyers, guns and money
Hendrek'
Posts: 6
Joined: Tue Sep 13, 2005 5:22 am
Location: Czech Republic
Contact:

Post by Hendrek' »

I also created LUA module for banning cheaters. Currently it loads banlist with over 100 records and doesn't cause lags to players. You could download this module here and banlist example here.
User avatar
Luk4ward
Posts: 236
Joined: Sun Jul 30, 2006 1:55 pm
Location: Poland
Contact:

Post by Luk4ward »

Hendrek' wrote:I also created LUA module for banning cheaters. Currently it loads banlist with over 100 records and doesn't cause lags to players. You could download this module here and banlist example here.
You should post this on wiki, is it only loading a banlist?

@-W0kk3L-
Forum :: [ET] Ban and unban board :: NeXuS takes new steps against cheaters wrote: - Range Bans
We now have the option to ban entire IP ranges or DNS subnets. This means that we can now easily ban users that used to change their IP just to annoy us.
View the Range Bans list here.
Note: Only myself and W0kk3L can add ranges here, so no need to worry.

- Trusts
Serveradmins can add a Trust to an account. This means that the user can still connect, even if his IP range is banned.
how u have done this? I meant how u can ban mask for example 83.10 and still allow a player with 83.10.5, can any1 explain me this on the forum or via priv msg? I would be appreciated,

regards
wolFTeam.pl
Post Reply