diff --git a/ValheimServer/ValheimServer/MainWindow.xaml b/ValheimServer/ValheimServer/MainWindow.xaml index 8c38d0b..16cf4f7 100644 --- a/ValheimServer/ValheimServer/MainWindow.xaml +++ b/ValheimServer/ValheimServer/MainWindow.xaml @@ -75,5 +75,7 @@ + + diff --git a/ValheimServer/ValheimServer/Properties/Resources.Designer.cs b/ValheimServer/ValheimServer/Properties/Resources.Designer.cs index 3ac284a..d8bce35 100644 --- a/ValheimServer/ValheimServer/Properties/Resources.Designer.cs +++ b/ValheimServer/ValheimServer/Properties/Resources.Designer.cs @@ -78,6 +78,15 @@ public static string Port_Name { } } + /// + /// Looks up a localized string similar to Crossplay. + /// + public static string Server_Crossplay { + get { + return ResourceManager.GetString("Server_Crossplay", resourceCulture); + } + } + /// /// Looks up a localized string similar to Server Name:. /// diff --git a/ValheimServer/ValheimServer/Properties/Resources.resx b/ValheimServer/ValheimServer/Properties/Resources.resx index 7f8ff6f..4416d51 100644 --- a/ValheimServer/ValheimServer/Properties/Resources.resx +++ b/ValheimServer/ValheimServer/Properties/Resources.resx @@ -123,6 +123,9 @@ Port Number: + + Crossplay + Server Name: diff --git a/ValheimServer/ValheimServer/ViewModels/MainWindowViewModel.cs b/ValheimServer/ValheimServer/ViewModels/MainWindowViewModel.cs index c6aacd8..25a5af3 100644 --- a/ValheimServer/ValheimServer/ViewModels/MainWindowViewModel.cs +++ b/ValheimServer/ValheimServer/ViewModels/MainWindowViewModel.cs @@ -27,6 +27,7 @@ public partial class MainWindowViewModel : ObservableObject private string _passwordTextBox; private string _hiddenTextBox; private bool _serverVisibilityCheckBox = true; + private bool _serverCrossPlayCheckBox = false; /// /// Initializes a new instance of the class. @@ -190,6 +191,22 @@ public bool ServerVisibilityCheckBox } } + /// + /// Gets or Sets a value indicating whether the checkbox is visible. + /// + public bool ServerCrossPlayCheckBox + { + get + { + return _serverCrossPlayCheckBox; + } + + set + { + SetProperty(ref _serverCrossPlayCheckBox, value); + } + } + private int ServerVisibiltyCheck { get @@ -205,6 +222,21 @@ private int ServerVisibiltyCheck } } + private string ServerCrossPlayCheck + { + get + { + if (_serverCrossPlayCheckBox == true) + { + return "-crossplay"; + } + else + { + return " "; + } + } + } + [RelayCommand] private void SteamButtonClick() { @@ -254,7 +286,7 @@ private void ServerStartButtonClick() ProcessStartInfo startInfo = new ProcessStartInfo { FileName = "cmd.exe", - Arguments = $@"/K set SteamAppId=892970 && {_installFolder}\\valheim_server.exe -nographics -batchmode -name ""{_serverTextBox}"" -port {_portTextBox} -world ""{_worldTextBox}"" -password ""{_passwordTextBox}"" -public {ServerVisibiltyCheck}", + Arguments = $@"/K set SteamAppId=892970 && {_installFolder}\\valheim_server.exe -nographics -batchmode -name ""{_serverTextBox}"" -port {_portTextBox} -world ""{_worldTextBox}"" -password ""{_passwordTextBox}"" -public {ServerVisibiltyCheck} {ServerCrossPlayCheck}", UseShellExecute = false, };