Implementation of Dedicated Server in Isolation#498
Implementation of Dedicated Server in Isolation#498kuwacom wants to merge 7 commits intosmartcmd:mainfrom
Conversation
- Introduced `ServerMain.cpp` for the dedicated server logic, handling command-line arguments, server initialization, and network management. - Created `postbuild_server.ps1` script for post-build tasks, including copying necessary resources and DLLs for the dedicated server. - Added `CopyServerAssets.cmake` to manage the copying of server assets during the build process, ensuring required files are available for the dedicated server. - Defined project filters in `Minecraft.Server.vcxproj.filters` for better organization of server-related files.
- Introduced ServerLogger for logging startup steps and world I/O operations. - Implemented ServerProperties for loading and saving server configuration from `server.properties`. - Added WorldManager to handle world loading and creation based on server properties. - Updated ServerMain to integrate server properties loading and world management. - Enhanced project files to include new source and header files for the server components.
|
I hadn’t been merging upstream changes while implementing, so I’m in the middle of merging them now... |
# Conflicts: # Minecraft.Client/Common/Network/PlatformNetworkManagerStub.cpp # Minecraft.Client/Windows64/Network/WinsockNetLayer.cpp # Minecraft.Client/Windows64/Network/WinsockNetLayer.h
|
Some things have changed in the past day-ish, watch out for incompatibilities/redundant re-implementations of these:
|
|
So
|
Since 31881af56936aeef38ff322b975fd0 , `skinHud.swf` for 720 is not included in `MediaWindows64.arc`, the app crashes unless the virtual screen is set to HD.
|
It was partially affected by #495, but I was able to merge it without any issues. |
|
is it still only LAN multiplayer only? or can worlds be opened up to more people? |
|
It can be accessed from anywhere if you have a suitable network that can be accessed from the global internet (a network line that can open the specified TCP port). In short, it's a regular server app. |
|
oh damn. so i could run this on a vps? |
|
Yes, but since it still uses a lot of Windows API internally (to maintain compatibility), it requires a Windows system or a system that includes Windows API to run. I would like to eventually release a Linux version and put it into Docker. |
|
i mean, i've tried it on linux and it works fine. i could try and create a docker image if you'd like |
You can run it fine on Linux without a GUI launcher via umu |
seriously! |
|
wine also works really well. tried lutris and has similar results to umu |
|
Which one has a smaller image size? |
|
wine iirc |
Description
This PR introduces a Windows64 Dedicated Server executable (
Minecraft.Server) and related runtime/build support.It enables headless hosting with configurable bind IP/port, world bootstrap via
server.properties.Minecraft.Clientchanges are intentionally minimal and limited to dedicated-server startup compatibility.#65
Changes
New Behavior
Minecraft.Server/Windows64/ServerMain.cppMinecraft.Server/Minecraft.Server.vcxproj(+ filters)ServerProperties(server.propertiesload/normalize/save forlevel-name/level-id)WorldManager(load existing world bylevel-id, fallback to create new world)ServerLogger(log levels:debug|info|warn|error)CMakeLists.txt: newMinecraftServertarget and post-build asset copycmake/CopyServerAssets.cmake: minimal required server assets onlyMinecraftConsoles.sln,COMPILE.md,.gitignoreupdates-port,-ip/-bind,-name,-seed,-loglevel,-helpMinecraft.Client Changes (Minimum Scope)
Only the following
Minecraft.Clientfiles were changed, strictly for dedicated-server bridge behavior:Minecraft.Client/MinecraftServer.hNetworkGameInitData::dedicatedNoLocalHostPlayer.Minecraft.Client/Common/Network/GameNetworkManager.cppClientConnectioncreation when hosting as dedicated server.Minecraft.Client/Common/Network/PlatformNetworkManagerStub.cppMinecraft.Client/Windows64/Network/WinsockNetLayer.hHostGame(const char* bindIp, int port)overload.Minecraft.Client/Windows64/Network/WinsockNetLayer.cppHostGame(int port)as wrapper for compatibility.0.0.0.0(from loopback) for dedicated listening.