• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Lua Will it cause a lot of delay?

OTcreator

Active Member
Joined
Feb 14, 2022
Messages
426
Solutions
1
Reaction score
44
Hi,
Will checking a position for players and IPs cause long delays in global events?
Checked every 10 seconds?

Lua:
if not count[ip] or ip == 0 or player:getPosition():isInRange(Position(598, 872, 5), Position(615, 897, 10)) then
 
You are doing this check for all players in game right? Nevertheless, it won't cause reasonable delays. As long as you not looping 100k objects and not querying heavily database you are more than fine to check every 10 seconds or even less.
 
Hi,
Will checking a position for players and IPs cause long delays in global events?
Checked every 10 seconds?

Lua:
if not count[ip] or ip == 0 or player:getPosition():isInRange(Position(598, 872, 5), Position(615, 897, 10)) then
This particular line of code will execute extremely quickly(< 1ms). No problem to do this every 10 seconds, even in a loop of players. I'm guessing you're just kicking afk players, which if so, you should probably increase to every 60 seconds anyway, unless you have a specific reason to do this every 10 seconds (not that it really matters)
 
Back
Top