landsandboat/settings/default/network.lua

128 lines
4 KiB
Lua
Raw Permalink Normal View History

-----------------------------------
-- NETWORK SETTINGS
-----------------------------------
-- All settings are attached to the `xi.settings` object. This is published globally, and be accessed from C++ and any script.
--
-- This file is concerned mainly with networking between the database, client, and server executables.
-----------------------------------
xi = xi or {}
xi.settings = xi.settings or {}
xi.settings.network =
{
SQL_HOST = '127.0.0.1',
SQL_PORT = 3306,
SQL_LOGIN = 'root',
SQL_PASSWORD = 'root',
SQL_DATABASE = 'xidb',
LOGIN_DATA_IP = '0.0.0.0',
LOGIN_DATA_PORT = 54230,
LOGIN_VIEW_IP = '0.0.0.0',
LOGIN_VIEW_PORT = 54001,
LOGIN_AUTH_IP = '0.0.0.0',
LOGIN_AUTH_PORT = 54231,
LOGIN_CONF_IP = '0.0.0.0',
LOGIN_CONF_PORT = 51220,
MAP_PORT = 54230,
SEARCH_PORT = 54002,
-- DB queries will attempt each query once, and reconnect and retry up to `SQL_QUERY_RETRY_COUNT` times.
SQL_QUERY_RETRY_COUNT = 1,
ENABLE_HTTP = false,
HTTP_HOST = 'localhost',
HTTP_PORT = 8088,
-- Central message server settings
ZMQ_TRANSPORT = 'tcp',
ZMQ_IP = '127.0.0.1',
ZMQ_PORT = 54003,
Update TCP/UDP Settings to Reside in the new network.lua file (#2348) * Moving all packet configuration into the network.lua file + to differentiate between the two sets I've added either UDP_ or TCP_ to the key name + all items have been provided along with the comments specified + for IP rules, the TCP_ALLOW, TCP_DENY keys have been updated to contain lists + default is empty string (no-op) in the code during setup + each entry must be separated with a 'comma' character - removed old configuration files (no longer referenced) + all settings now consistent across project * updating dockerfile for readability + format changes, no logical changes * Adding use of the new settings get<T>() method for all configuration items. + added two new booleans (udp_debug, and tcp_debug) to differentiate between them (not yet used) + connect_check_() method for loops updated to leverage the range for loop to simplify the code and for more readabilty using the new entry element each loop + access_ipmask() updated to allow for emtpy strings which equate to a no-op + adding new methods to leverage the new settings get<T> method + get_access_list() takes the parsed access list string "entry,entry,..." and provides a list of AccessControl objects that have been successfully parsed, all issues with the entries will be shown in an error message. + socket_udp_setup() method added to setup our UDP socket (only fetches the debug setting right now) + socket_tcp_setup() method added to setup the TCP socket settings. Much simpler with the new get<T>() method. Only issue I had was with the list of allow and deny IP addresses as we would need to extend the get<T>() method to allow LUA lists { "a", "b" }. All other properties are straight forward using the get<T>() method. The only option that is not carried over is the "import" command (not sure this is used anymore). - socket_config_read() now deprecated + socket_init_tcp() method updated to leverage new TCP setup method, some formatting for readability + socket_init_udp() levearging new UDP setup method * Moved handling of empty strings for access/deny strings to where the access list is collected + moved handling of empty strings from access_ipmask() to get_access_list() + adding more log information of what was parsed in the new socket_tcp_setup() function * adding some helpful critical messages when nav meshes can not be loaded during boot * Adding all options for TCP_ORDER setting, more examples for ALLOW and DENY * Reverting dockerfile back to original to make merge easier * Corrected proper formating to the file * Have added a helpful note to signify the settings that should be left alone + most options can render your instance unusable unless you know what you are doing.
2022-07-20 08:34:35 -05:00
-- ===========================
-- NOTE: The settings that follow will not necessarily need to be modified
-- in any way for the server to work out of the box. This should only
-- be modified by those who understand networking. Modifying these
-- values could potentially make it so that you can not log in to your
-- server.
-- ===========================
-- ===========================
-- UDP Sockets Configuration
-- ===========================
-- Display debug reports (When something goes wrong during the report, the report is saved.)
UDP_DEBUG = false,
-- ===========================
-- TCP Sockets Configuration
-- ===========================
-- Display debug reports (When something goes wrong during the report, the report is saved.)
TCP_DEBUG = false,
-- How long can a socket stall before closing the connection (in seconds)
TCP_STALL_TIME = 60,
-- ===========================
-- IP Rules Settings
-- ===========================
-- If IP's are checked when connecting. This also enables DDoS protection.
TCP_ENABLE_IP_RULES = true,
-- Order of the checks
-- deny,allow : Checks deny rules, then allow rules. Allows if no rules match.
-- allow,deny : Checks allow rules, then deny rules. Allows if no rules match.
-- mutual-failure : Allows only if an allow rule matches and no deny rules match.
-- (default is deny,allow)
TCP_ORDER = 'deny,allow',
--TCP_ORDER = 'allow,deny',
--TCP_ORDER = 'mutual-failure',
Update TCP/UDP Settings to Reside in the new network.lua file (#2348) * Moving all packet configuration into the network.lua file + to differentiate between the two sets I've added either UDP_ or TCP_ to the key name + all items have been provided along with the comments specified + for IP rules, the TCP_ALLOW, TCP_DENY keys have been updated to contain lists + default is empty string (no-op) in the code during setup + each entry must be separated with a 'comma' character - removed old configuration files (no longer referenced) + all settings now consistent across project * updating dockerfile for readability + format changes, no logical changes * Adding use of the new settings get<T>() method for all configuration items. + added two new booleans (udp_debug, and tcp_debug) to differentiate between them (not yet used) + connect_check_() method for loops updated to leverage the range for loop to simplify the code and for more readabilty using the new entry element each loop + access_ipmask() updated to allow for emtpy strings which equate to a no-op + adding new methods to leverage the new settings get<T> method + get_access_list() takes the parsed access list string "entry,entry,..." and provides a list of AccessControl objects that have been successfully parsed, all issues with the entries will be shown in an error message. + socket_udp_setup() method added to setup our UDP socket (only fetches the debug setting right now) + socket_tcp_setup() method added to setup the TCP socket settings. Much simpler with the new get<T>() method. Only issue I had was with the list of allow and deny IP addresses as we would need to extend the get<T>() method to allow LUA lists { "a", "b" }. All other properties are straight forward using the get<T>() method. The only option that is not carried over is the "import" command (not sure this is used anymore). - socket_config_read() now deprecated + socket_init_tcp() method updated to leverage new TCP setup method, some formatting for readability + socket_init_udp() levearging new UDP setup method * Moved handling of empty strings for access/deny strings to where the access list is collected + moved handling of empty strings from access_ipmask() to get_access_list() + adding more log information of what was parsed in the new socket_tcp_setup() function * adding some helpful critical messages when nav meshes can not be loaded during boot * Adding all options for TCP_ORDER setting, more examples for ALLOW and DENY * Reverting dockerfile back to original to make merge easier * Corrected proper formating to the file * Have added a helpful note to signify the settings that should be left alone + most options can render your instance unusable unless you know what you are doing.
2022-07-20 08:34:35 -05:00
-- ===========================
-- IP rules
-- ===========================
-- allow : Accepts connections from the ip range (even if flagged as DDoS)
-- deny : Rejects connections from the ip range
-- The rules are processed in order, the first matching rule of each list
-- (allow and deny) is used
TCP_ALLOW = '',
--TCP_ALLOW = '127.0.0.1,192.168.0.0/16',
--TCP_ALLOW = '127.0.0.1'
--TCP_ALLOW = '192.168.0.0/16'
--TCP_ALLOW = '10.0.0.0/255.0.0.0'
--TCP_ALLOW = 'all'
TCP_DENY = '',
--TCP_DENY = '10.0.0.0/8,192.168.0.0/16',
--TCP_DENY = '127.0.0.1',
--TCP_DENY = '10.0.0.0/255.0.0.0',
Update TCP/UDP Settings to Reside in the new network.lua file (#2348) * Moving all packet configuration into the network.lua file + to differentiate between the two sets I've added either UDP_ or TCP_ to the key name + all items have been provided along with the comments specified + for IP rules, the TCP_ALLOW, TCP_DENY keys have been updated to contain lists + default is empty string (no-op) in the code during setup + each entry must be separated with a 'comma' character - removed old configuration files (no longer referenced) + all settings now consistent across project * updating dockerfile for readability + format changes, no logical changes * Adding use of the new settings get<T>() method for all configuration items. + added two new booleans (udp_debug, and tcp_debug) to differentiate between them (not yet used) + connect_check_() method for loops updated to leverage the range for loop to simplify the code and for more readabilty using the new entry element each loop + access_ipmask() updated to allow for emtpy strings which equate to a no-op + adding new methods to leverage the new settings get<T> method + get_access_list() takes the parsed access list string "entry,entry,..." and provides a list of AccessControl objects that have been successfully parsed, all issues with the entries will be shown in an error message. + socket_udp_setup() method added to setup our UDP socket (only fetches the debug setting right now) + socket_tcp_setup() method added to setup the TCP socket settings. Much simpler with the new get<T>() method. Only issue I had was with the list of allow and deny IP addresses as we would need to extend the get<T>() method to allow LUA lists { "a", "b" }. All other properties are straight forward using the get<T>() method. The only option that is not carried over is the "import" command (not sure this is used anymore). - socket_config_read() now deprecated + socket_init_tcp() method updated to leverage new TCP setup method, some formatting for readability + socket_init_udp() levearging new UDP setup method * Moved handling of empty strings for access/deny strings to where the access list is collected + moved handling of empty strings from access_ipmask() to get_access_list() + adding more log information of what was parsed in the new socket_tcp_setup() function * adding some helpful critical messages when nav meshes can not be loaded during boot * Adding all options for TCP_ORDER setting, more examples for ALLOW and DENY * Reverting dockerfile back to original to make merge easier * Corrected proper formating to the file * Have added a helpful note to signify the settings that should be left alone + most options can render your instance unusable unless you know what you are doing.
2022-07-20 08:34:35 -05:00
-- ===========================
-- Connection Limit Settings
-- ===========================
-- If connect_count connection request are made within connect_interval
-- msec, it blocks it
-- Consecutive attempts interval (msec)
-- (default is 3000 msecs, 3 seconds)
TCP_CONNECT_INTERVAL = 3000,
-- Consecutive attempts trigger
-- (default is 10 attempts)
TCP_CONNECT_COUNT = 10,
-- The time interval after which the connection lockout is lifted. (msec)
-- After this amount of time, the connection restrictions are lifted.
-- (default is 600000 msecs, 10 minutes)
TCP_CONNECT_LOCKOUT = 600000
}
Update TCP/UDP Settings to Reside in the new network.lua file (#2348) * Moving all packet configuration into the network.lua file + to differentiate between the two sets I've added either UDP_ or TCP_ to the key name + all items have been provided along with the comments specified + for IP rules, the TCP_ALLOW, TCP_DENY keys have been updated to contain lists + default is empty string (no-op) in the code during setup + each entry must be separated with a 'comma' character - removed old configuration files (no longer referenced) + all settings now consistent across project * updating dockerfile for readability + format changes, no logical changes * Adding use of the new settings get<T>() method for all configuration items. + added two new booleans (udp_debug, and tcp_debug) to differentiate between them (not yet used) + connect_check_() method for loops updated to leverage the range for loop to simplify the code and for more readabilty using the new entry element each loop + access_ipmask() updated to allow for emtpy strings which equate to a no-op + adding new methods to leverage the new settings get<T> method + get_access_list() takes the parsed access list string "entry,entry,..." and provides a list of AccessControl objects that have been successfully parsed, all issues with the entries will be shown in an error message. + socket_udp_setup() method added to setup our UDP socket (only fetches the debug setting right now) + socket_tcp_setup() method added to setup the TCP socket settings. Much simpler with the new get<T>() method. Only issue I had was with the list of allow and deny IP addresses as we would need to extend the get<T>() method to allow LUA lists { "a", "b" }. All other properties are straight forward using the get<T>() method. The only option that is not carried over is the "import" command (not sure this is used anymore). - socket_config_read() now deprecated + socket_init_tcp() method updated to leverage new TCP setup method, some formatting for readability + socket_init_udp() levearging new UDP setup method * Moved handling of empty strings for access/deny strings to where the access list is collected + moved handling of empty strings from access_ipmask() to get_access_list() + adding more log information of what was parsed in the new socket_tcp_setup() function * adding some helpful critical messages when nav meshes can not be loaded during boot * Adding all options for TCP_ORDER setting, more examples for ALLOW and DENY * Reverting dockerfile back to original to make merge easier * Corrected proper formating to the file * Have added a helpful note to signify the settings that should be left alone + most options can render your instance unusable unless you know what you are doing.
2022-07-20 08:34:35 -05:00
-- EOF