Created
May 14, 2020 12:27
-
-
Save ShimmyMySherbet/2ca1002f0cc23fe7ee2419153bf883d7 to your computer and use it in GitHub Desktop.
A Steam Protocol Helper for C#
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace SteamProtocal | |
{ | |
public static class SteamProtocalHelper | |
{ | |
public static string Advertise(int GameID) | |
{ | |
return $@"steam://advertise/{GameID}"; | |
} | |
public static string AppNews(int GameID) | |
{ | |
return $@"steam://appnews/{GameID}"; | |
} | |
public static string Backup(int GameID) | |
{ | |
return $@"steam://backup/{GameID}"; | |
} | |
public static string BrowseMedia = "steam://browsemedia"; | |
public static string CheckSystemRequirements(int GameID) | |
{ | |
return $@"steam://checksysreqs/{GameID}"; | |
} | |
public static string Connect(string IP, int Port = -1, string Password = null) | |
{ | |
string ResultComm = "steam://connect/" + IP; | |
if (Port != -1) | |
{ | |
ResultComm += $":{Port}"; | |
} | |
if (!string.IsNullOrEmpty(Password)) | |
{ | |
ResultComm += $@"/{Password}"; | |
} | |
return ResultComm; | |
} | |
public static string Defrag(int GameID) | |
{ | |
return $@"steam://defrag/{GameID}"; | |
} | |
public static string ExitSteam = $@"steam://ExitSteam"; | |
public static string Friends = $@"steam://friends/"; | |
public static string AddFriend(ulong UserID) | |
{ | |
return $@"steam://friends/add/{UserID}"; | |
} | |
public static string RecentyPlayedWith = $@"steam://friends/players"; | |
public static string JoinChat(int ChatID) | |
{ | |
return $@"steam://friends/joinchat/{ChatID}"; | |
} | |
public static string MessageUser(ulong UserID) | |
{ | |
return $@"steam://friends/message/{UserID}"; | |
} | |
public static string FlushConfigs = $@"steam://flushconfig"; | |
public static string Install(int GameID) | |
{ | |
return $@"steam://install/{GameID}"; | |
} | |
public static string InstallAddon(string Addon) | |
{ | |
return $@"steam://installaddon/{Addon}"; | |
} | |
public static string PlayMusic = "steam://musicplayer/play"; | |
public static string PauseMusic = "steam://musicplayer/pause"; | |
public static string ToggleMusic = "steam://musicplayer/toggleplaypause"; | |
public static string SkipMusicBack = "steam://musicplayer/playprevious"; | |
public static string SkipMusicForward = "steam://musicplayer/playnext"; | |
public static string ToggleMusicMute = "steam://musicplayer/togglemute"; | |
public static string IncreaseMusicVolume = "steam://musicplayer/increasevolume"; | |
public static string DecreaseMusicVolume = "steam://musicplayer/decreasevolume"; | |
public static string ToggleMusicRepeat = "steam://musicplayer/toggleplayingrepeatstatus"; | |
public static string ToggleMusicShuffle = "steam://musicplayer/toggleplayingshuffled"; | |
public static string DownloadsPage = "steam://nav/downloads"; | |
public static string GamesPage = "steam://nav/games"; | |
public static string GameDetailsPageGeneral = "steam://nav/games/details"; | |
public static string GameDetailsPage(int GameID) | |
{ | |
return $@"steam://nav/games/details/{GameID}"; | |
} | |
public static string GamesGridPage = "steam://nav/games/grid"; | |
public static string GamesListPage = "steam://nav/games/list"; | |
public static string MediaPage = "steam://nav/media"; | |
public static string MusicPage = "steam://nav/music"; | |
public static string ToolsPage = "steam://nav/tools"; | |
public static string OpenActivateProduct = "steam://open/activateproduct"; | |
public static string OpenBigPicture = "steam://open/bigpicture"; | |
public static string OpenConsole = "steam://open/console"; | |
public static string OpenDownloads = "steam://open/downloads"; | |
public static string OpenFriends = "steam://open/friends"; | |
public static string OpenGames = "steam://open/games"; | |
public static string OpengamesDetails = "steam://open/games/details"; | |
public static string OpenGamesGrid = "steam://open/games/grid"; | |
public static string OpenGamesList = "steam://open/games/list"; | |
public static string OpenLargeGamesList = "steam://open/largegameslist"; | |
public static string OpenMiniGamesList = "steam://open/minigameslist"; | |
public static string OpenFavorites = "steam://open/main"; | |
public static string OpenMusic = "steam://open/music"; | |
public static string OpenMusicPlayer = "steam://open/musicplayer"; | |
public static string OpenMedia = "steam://open/mymedia"; | |
public static string OpenNews = "steam://open/news"; | |
public static string OpenRegisterProduct = "steam://open/registerproduct"; | |
public static string OpenTools = "steam://open/tools"; | |
public static string OpenScreenshots = "steam://open/screenshots"; | |
public static string OpenServers = "steam://open/servers"; | |
public static string OpenSettings = "steam://open/settings"; | |
public static string OpenUrl(string url) | |
{ | |
return $"steam://openurl/{url}"; | |
} | |
public static string OpenUrlExternal(string url) | |
{ | |
return $"steam://openurl_external/{url}"; | |
} | |
public static string CancelPaypalTransaction = "steam://paypal/cancel"; | |
public static string PreloadGame(int GameID) | |
{ | |
return $"steam://preload/{GameID}"; | |
} | |
public static string OpenPublisher(string Publisher) | |
{ | |
return $"steam://publisher/{Publisher}"; | |
} | |
public static string OpenPurchase(int ID) | |
{ | |
return $"steam://purchase/{ID}"; | |
} | |
public static string OpenPurchaseSubscription(int ID) | |
{ | |
return $"steam://purchase/subscription/{ID}"; | |
} | |
public static string UninstallAddon(string AddonID) | |
{ | |
return $"steam://removeaddon/{AddonID}"; | |
} | |
public static string RunGame(int GameID, string Args = null) | |
{ | |
string ReturnCommand = $"steam://run/{GameID}"; | |
if (!string.IsNullOrEmpty(Args)) | |
{ | |
ReturnCommand += $"//{Args}"; | |
} | |
return ReturnCommand; | |
} | |
public static string RunGameSafe(int GameID) | |
{ | |
return $"steam://runsafe/{GameID}"; | |
} | |
public static string RunGameID(int GameID) | |
{ | |
return $"steam://rungameid/{GameID}"; | |
} | |
public static string OpenAccountSettings = "steam://settings/account"; | |
public static string OpenFriendSettings = "steam://settings/friends"; | |
public static string OpenInterfaceSettings = "steam://settings/interface"; | |
public static string OpenInGameSettings = "steam://settings/ingame"; | |
public static string OpenDownloadsSettings = "steam://settings/downloads"; | |
public static string OpenVoiceSettings = "steam://settings/voice"; | |
public static string StopStreaming = "steam://stopstreaming"; | |
public static string OpenStorePage(int GameID) | |
{ | |
return $"steam://store/{GameID}"; | |
} | |
public static string OpenMassGameInstall(params int[] IDs) | |
{ | |
return $"steam://subscriptioninstall/{string.Join("/", IDs)}"; | |
} | |
/// <summary> | |
/// The list of support params can be found at | |
/// https://developer.valvesoftware.com/wiki/Steam_Support_strings | |
/// </summary> | |
/// <param name="PageParams">Support String</param> | |
/// <returns></returns> | |
public static string OpenSupportPage(string PageParams) | |
{ | |
return $"steam://support/{PageParams}"; | |
} | |
public static string OpenSurvey(int SurveyID) | |
{ | |
return $"steam://takesurvey/{SurveyID}"; | |
} | |
public static string UninstallApp(int GameID) | |
{ | |
return $"steam://uninstall/{GameID}"; | |
} | |
public static string UpdateFirmware = "steam://UpdateFirmware"; | |
public static string OpenGameUpdateNews(int GameID) | |
{ | |
return $"steam://updatenews/{GameID}"; | |
} | |
public static string ValidateGameFiles(int GameID) | |
{ | |
return $"steam://validate/{GameID}"; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment