reimplement srv record support, add server motd

This commit is contained in:
DrPerkyLegit committed 2026-11-24 22:22:14 -05:00
1 parent dd36e52221
commit 3ebbf6f243
10 files changed
+168 -49

No files matched your search

@@ -69,6 +69,7 @@ struct DedicatedServerConfig
{
int port;
char bindIP[256];
char description[1024];
char name[17];
int maxPlayers;
int worldSize;
@@ -316,6 +317,11 @@ static void ApplyServerPropertiesToDedicatedConfig(const ServerPropertiesConfig
sizeof(config->name),
serverProperties.serverName.empty() ? "DedicatedServer" : serverProperties.serverName.c_str(),
_TRUNCATE);
strncpy_s(
config->description,
sizeof(config->description),
serverProperties.description.empty() ? "A Minecraft Server" : serverProperties.description.c_str(),
_TRUNCATE);
config->maxPlayers = serverProperties.maxPlayers;
config->worldSize = serverProperties.worldSize;
config->worldSizeChunks = serverProperties.worldSizeChunks;
@@ -365,6 +371,7 @@ int main(int argc, char **argv)
DedicatedServerConfig config;
config.port = WIN64_NET_DEFAULT_PORT;
strncpy_s(config.bindIP, sizeof(config.bindIP), "0.0.0.0", _TRUNCATE);
strncpy_s(config.description, sizeof(config.description), "", _TRUNCATE);
strncpy_s(config.name, sizeof(config.name), "DedicatedServer", _TRUNCATE);
config.maxPlayers = MINECRAFT_NET_MAX_PLAYERS;
config.worldSize = e_worldSize_Classic;
@@ -430,6 +437,7 @@ int main(int argc, char **argv)
g_Win64DedicatedServer = true;
g_Win64DedicatedServerPort = config.port;
strncpy_s(g_Win64DedicatedServerBindIP, sizeof(g_Win64DedicatedServerBindIP), config.bindIP, _TRUNCATE);
strncpy_s(g_Win64DedicatedServerDescription, sizeof(g_Win64DedicatedServerDescription), config.description, _TRUNCATE);
g_Win64DedicatedServerLanAdvertise = serverProperties.lanAdvertise;
LogStartupStep("initializing server log manager");
ServerRuntime::ServerLogManager::Initialize();