Skip to content

Commit

Permalink
Added workshop collection option
Browse files Browse the repository at this point in the history
  • Loading branch information
LambdaGaming committed Jun 9, 2021
1 parent 78f9bcf commit c31b08b
Show file tree
Hide file tree
Showing 8 changed files with 96 additions and 29 deletions.
3 changes: 3 additions & 0 deletions App.config
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@
<setting name="TokenPath" serializeAs="String">
<value />
</setting>
<setting name="CollectionID" serializeAs="String">
<value />
</setting>
</GMod_Server_Launcher_Console.Properties.Settings>
</userSettings>
</configuration>
49 changes: 43 additions & 6 deletions MainForm.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 19 additions & 3 deletions MainForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ public partial class MainForm : Form
public string LANEnabled = "";
public string Password = "";
public string SteamToken = "";
public string CollectionID = "";

public MainForm()
{
Expand All @@ -29,12 +30,14 @@ public MainForm()
mapselect.SelectedItem = Settings.Map;
passwordBox.Text = Settings.Password;
TokenEnable.Checked = Settings.TokenEnabled;
CollectionIDBox.Text = Settings.CollectionID;

mapselect.Enabled = consolecheck.Checked;
lancheck.Enabled = consolecheck.Checked;
maxplayers.Enabled = consolecheck.Checked;
gameselect.Enabled = consolecheck.Checked;
passwordBox.Enabled = consolecheck.Checked;
CollectionIDBox.Enabled = consolecheck.Checked;

StringBuilder path = new StringBuilder( label4.Text );
path.Append( Properties.Settings.Default.FilePath );
Expand Down Expand Up @@ -90,6 +93,8 @@ private void ConsoleCheck( object sender, EventArgs e )
lancheck.Enabled = consolecheck.Checked;
maxplayers.Enabled = consolecheck.Checked;
gameselect.Enabled = consolecheck.Checked;
passwordBox.Enabled = consolecheck.Checked;
CollectionIDBox.Enabled = consolecheck.Checked;
Properties.Settings.Default.Console = consolecheck.Checked;
}

Expand All @@ -100,12 +105,12 @@ private void MaxPlayersChanged( object sender, EventArgs e )

private void MapChanged( object sender, EventArgs e )
{
Properties.Settings.Default.Map = mapselect.SelectedItem.ToString();
Properties.Settings.Default.Map = mapselect.Text;
}

private void GamemodeChanged( object sender, EventArgs e )
{
Properties.Settings.Default.Gamemode = gameselect.SelectedItem.ToString();
Properties.Settings.Default.Gamemode = gameselect.Text;
}

private void ChangePathClick( object sender, EventArgs e )
Expand Down Expand Up @@ -174,7 +179,7 @@ private void StartButtonClick( object sender, EventArgs e )
UseShellExecute = true,
WorkingDirectory = Properties.Settings.Default.FilePath,
FileName = Properties.Settings.Default.FilePath + @"\srcds.exe",
Arguments = "+gamemode " + gameselect.Text.ToString() + ConsoleEnabled + LANEnabled + "+map " + mapselect.Text.ToString() + " +maxplayers " + maxplayers.Value + " +r_hunkalloclightmaps 0" + Password + SteamToken,
Arguments = "+gamemode " + gameselect.Text.ToString() + ConsoleEnabled + LANEnabled + "+map " + mapselect.Text.ToString() + " +maxplayers " + maxplayers.Value + " +r_hunkalloclightmaps 0" + Password + SteamToken + CollectionID,
};

try
Expand All @@ -188,5 +193,16 @@ private void StartButtonClick( object sender, EventArgs e )
if ( launcherror == DialogResult.OK ) Close();
}
}

private void CollectionIDBoxChanged( object sender, EventArgs e )
{
Properties.Settings.Default.CollectionID = CollectionIDBox.Text;
if ( string.IsNullOrWhiteSpace( CollectionIDBox.Text ) )
{
CollectionID = "";
return;
}
CollectionID = " +host_workshop_collection " + CollectionIDBox.Text;
}
}
}
6 changes: 3 additions & 3 deletions Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
[assembly: AssemblyConfiguration( "" )]
[assembly: AssemblyCompany( "" )]
[assembly: AssemblyProduct( "CityRP-Server-Launcher-UI" )]
[assembly: AssemblyCopyright( "Copyright © 2020" )]
[assembly: AssemblyCopyright( "Copyright © LambdaGaming 2021" )]
[assembly: AssemblyTrademark( "" )]
[assembly: AssemblyCulture( "" )]

Expand All @@ -32,5 +32,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion( "1.0.0.0" )]
[assembly: AssemblyFileVersion( "1.0.0.0" )]
[assembly: AssemblyVersion( "1.3" )]
[assembly: AssemblyFileVersion( "1.3" )]
14 changes: 13 additions & 1 deletion Properties/Settings.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions Properties/Settings.settings
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,8 @@
<Setting Name="TokenPath" Type="System.String" Scope="User">
<Value Profile="(Default)" />
</Setting>
<Setting Name="CollectionID" Type="System.String" Scope="User">
<Value Profile="(Default)" />
</Setting>
</Settings>
</SettingsFile>
28 changes: 12 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,26 +1,22 @@
# Garry's Mod Server Launcher GUI With Console Support
This is meant to act as a replacement launcher for hosts who want to use the full console while also wanting to choose the map the server starts on, since the normal server GUI doesn't include that feature.
This is a replacement launcher for hosts who want to use the server's console mode while also wanting the full options that the normal GUI provides.

![](https://raw.githubusercontent.com/LambdaGaming/GMod-Server-Launcher-Console/master/reference.PNG)

## Features:
<ul>
<li>Prompts the user to select the file path that contains the server exe if the path is not found.</li>
<li>Console mode toggle. Disables all other options if disabled since the main server GUI will take over at that point and ignore all launch arguments.</li>
<li>Map selection that gets the names of maps inside the garrymod/maps server folder.</li>
<li>Support for the new Steam server tokens requirement so the server isn't stuck at the bottom of the server browser.</li>
<li>Gamemode selection that gets the names of gamemodes inside the garrysmod/gamemodes server folder.</li>
<li>LAN mode toggle.</li>
<li>Max players selection.</li>
<li>Password option.</li>
<li>All settings mentioned above are saved when the app closes and will be automatically set when the app is reopened.</li>
</ul>
- Prompts the user to select the file path that contains the server exe if the path is not found.
- Console mode toggle. Disables all other options if disabled since the main server GUI will take over at that point and ignore all launch arguments.
- Map selection that gets the names of maps inside the garrymod/maps server folder. The map name can also be manually entered into the text box if the map is in a different location.
- Support for the new Steam server tokens requirement so the server isn't stuck at the bottom of the server browser.
- Gamemode selection that gets the names of gamemodes inside the garrysmod/gamemodes server folder.
- LAN mode toggle.
- Max players selection.
- Password option.
- Steam workshop collection option.
- All settings mentioned above are saved when the program closes and will be automatically set when the program is reopened.

## Working with more than one server:
If you need this program to run more than one server, you can copy the exe and rename it to something else to generate a new config, allowing you to basically have an unlimited number of configs for the same program.

## Extra Builds:
I have a separate repository for the launchers that I personally use. These are not very customizable and the the configs are all hard-coded, but feel free to use them if you'd like. [Click here to go to the repository.](https://github.com/LambdaGaming/GMod-Server-Launcher-Console-Extra)
If you need this program to run more than one server, you can copy the exe and rename it to something else to generate a new config.

# Issues & Pull Requests
If you would like to contribute to this repository by creating an issue or pull request, please refer to the [contributing guidelines.](https://lambdagaming.github.io/contributing.html)
Binary file modified reference.PNG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit c31b08b

Please sign in to comment.