mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-10-23 13:12:49 +00:00
feat: bind_ip setting for the server sockets
bind_ip in sharedconfig.ini picks the local IPv4 address every server's RakNet sockets listen on (auth, chat, master, world, the dashboard's connection to master), separate from external_ip, the address players are sent. Empty or 0.0.0.0 keeps listening on all interfaces; localhost means 127.0.0.1. Anything that isn't an IPv4 address stops the server with an error, and each server logs what it bound to. Fixes #225 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -153,6 +153,12 @@ namespace GeneralUtils {
|
||||
|
||||
std::vector<std::string> GetSqlFileNamesFromFolder(const std::string_view folder);
|
||||
|
||||
/**
|
||||
* Reads a bind address setting (bind_ip). Returns the IPv4 address to bind to, an empty string for all
|
||||
* interfaces (empty, "*" or "0.0.0.0"), "127.0.0.1" for "localhost", or nullopt when the value isn't an IPv4 address.
|
||||
*/
|
||||
[[nodiscard]] std::optional<std::string> ParseBindAddress(const std::string_view value);
|
||||
|
||||
/**
|
||||
* Transparent string hasher - used to allow string_view key lookups for maps storing std::string keys
|
||||
* https://www.reddit.com/r/cpp_questions/comments/12xw3sn/find_stdstring_view_in_unordered_map_with/jhki225/
|
||||
|
||||
Reference in New Issue
Block a user