Insprill / dv-multiplayer

A Derail Valley mod adding multiplayer to the game.
Apache License 2.0
40 stars 20 forks source link

Dedicated server #28

Open Insprill opened 1 year ago

Insprill commented 1 year ago

Dedicated server support can be implemented by making use of SteamCMD. Once the game is installed on the host of choice, it can be started with the -batchmode and -nographics flags. This will prevent the game from trying to load a graphical environment. We can then check the arguments for one of our own, being which save to load, and from what user. If that argument is present, and the user and save are valid, we can automatically load into the session, which will then be ready for players to join.

IGBT-001 commented 9 months ago

Hello Insprill!

Thank you very much for developing the Multiplayer module for DV. It's very cool.

I have tried both LAN and intranet penetration solutions and have started the server normally. However, I am completely confused about my suggestion to use SteamCMD to implement a dedicated server solution. I don't know how to enter commands in SteamCMD to start the game correctly. I have read the online server development tutorial and found that most servers are set up by downloading the official server provided by the game. I haven't understood the DV solution for a long time, Can you provide a tutorial on how to set up a server?

Thank you!

Insprill 你好! 非常感谢你为DV开发的Multiplayer模组,它很酷。 我现在已经尝试过局域网方案和内网穿透方案,都已经正常开服,但是我对你建议使用SteamCMD来实现专属服务器方案完全看不明白,都不知道SteamCMD中如何输入指令才能正确启动游戏,我阅览了网上的开服教程,发现基本都是通过下载游戏官方提供的服务端来架设服务器,DV这个方案我看半天没有看明白,能提供一下如何开设服务器的教程吗? 谢谢!

AMacro commented 4 months ago

It appears if you launch the DV executable with the -batchmode and -nographics switches you will get a headless game. I think it would be possible for the mod to check the command line arguments, and if these are found, it could start a game without user interaction.

Thoughts on how that might be achieved:

Note when the -nographics switch is used, there will be no log file, so if you need logging you also need to add something along the lines of -logFile "%appdata%\..\LocalLow\Altfuture\Derail Valley\Player.log" to turn it back on.

Does this seem like a viable method to get a dedicated server up and running, or does an assembly need to be compiled from Unity Editor to do it "properly"?