This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

Store addresses in database
#4
You should store your table as a storage variable, not every client a separate variable:
Code:
t = {}
-- insert values into t
...
-- save to storage
storage.set('clients', t)

You should also check for disconnected clients, otherwise your table will be growing forever which will cause issues in the future. You can also use IP address as table key, so you can set and remove items without having to iterate through the table:
Code:
t[ ip1 ] = true -- client connected
t[ ip2 ] = nil -- client disconnected
Reply


Messages In This Thread
Store addresses in database - by hrebik - 01.06.2016, 09:15
RE: Store addresses in database - by admin - 01.06.2016, 09:20
RE: Store addresses in database - by hrebik - 01.06.2016, 09:31
RE: Store addresses in database - by admin - 01.06.2016, 09:55
RE: Store addresses in database - by hrebik - 01.06.2016, 10:05
RE: Store addresses in database - by admin - 01.06.2016, 11:22
RE: Store addresses in database - by admin - 03.08.2016, 06:24

Forum Jump: