Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/onebit5/steamcmd
Project that simulates Steam with the Windows CMD.
https://github.com/onebit5/steamcmd
c-plus-plus c-programming clone cplusplus cpp object-oriented-programming opp steam windows-10 windows-11
Last synced: 3 days ago
JSON representation
Project that simulates Steam with the Windows CMD.
- Host: GitHub
- URL: https://github.com/onebit5/steamcmd
- Owner: Onebit5
- License: mit
- Created: 2024-06-16T14:26:34.000Z (5 months ago)
- Default Branch: main
- Last Pushed: 2024-06-16T17:26:56.000Z (5 months ago)
- Last Synced: 2024-10-18T16:33:10.109Z (28 days ago)
- Topics: c-plus-plus, c-programming, clone, cplusplus, cpp, object-oriented-programming, opp, steam, windows-10, windows-11
- Language: C++
- Homepage:
- Size: 9.77 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# SteamCMD Documentation
## Table of Contents* Overview
* Project Structure
* Class Descriptions
* User Class
* Game Class
* Utility Functions
* Main Program Flow
* Creating an Account
* Logging In
* Activating a Game Key
* Viewing the Game Library
* Downloading a Game
* Uninstalling a Game
* Running a Game
* Building and Running the Project## Overview
SteamCMD is a command-line based application that simulates the basic functionalities of the Steam client. It allows users to create accounts, log in, activate game keys, view their game library, download games, uninstall games, and run games.
### Project StructureThe project is organized into several files, each serving a specific purpose:
* User.h/User.cpp: Define and implement the User class.
* Game.h/Game.cpp: Define and implement the Game class.
* Utils.h/Utils.cpp: Provide utility functions for saving/loading data and other operations.
* ANSIColors.h: Define ANSI color codes for console output.
* SteamCMD.cpp: Contains the main program logic and user interaction flow.
* data/: Directory containing user and game data files.### Class Descriptions
#### User ClassThe User class represents a user in the SteamCMD application.
#### Properties* username: Stores the username of the user.
* password: Stores the user's password.
* games: A list of game keys that the user owns.
* installedGames: A list of game keys that are installed.#### Methods
1. Constructor: Initializes a user with a username and password.
2. Get Username: Returns the username.
3. Check Password: Verifies if the provided password matches the user's password.
4. Add Game: Adds a game key to the user's library.
5. Get Games: Returns the list of game keys owned by the user.
6. Is Game Installed: Checks if a game is installed.
7. Install Game: Marks a game as installed.
8. Uninstall Game: Marks a game as uninstalled.#### Game Class
The Game class represents a game in the SteamCMD application.
####Properties* key: The unique key of the game.
* name: The name of the game.
* downloadDuration: The time it takes to download the game (in seconds).#### Methods
1. Constructor: Initializes a game with a key, name, and download duration.
2. Get Key: Returns the game key.
3. Get Name: Returns the game name.
4. Get Download Duration: Returns the download duration.#### Utility Functions
Utility functions are provided to handle operations such as saving and loading user data and converting between strings and bytes.
Key Functions* String to Bytes: Converts a string to a byte vector.
* Bytes to String: Converts a byte vector to a string.
* Save Users: Saves the user data to a file.
* Load Users: Loads user data from a file.## Main Program Flow
The main program handles user interactions and invokes appropriate methods from the User and Game classes based on user input.
* Creating an Account1. Prompts the user to enter a username and password.
2. Creates a new User object with the provided credentials.
3. Saves the new user to the user data file.
4. Displays a success message.* Logging In
1. Prompts the user to enter a username and password.
2. Searches for a user with matching credentials.
3. If found, sets the current user to the logged-in user and displays a success message.
4. If not found, displays an error message.* Activating a Game Key
1. Ensures the user is logged in.
2. Prompts the user to enter a game key.
3. Searches for the game with the provided key.
4. If found, confirms the activation with the user.
5. Adds the game to the user's library and saves the user data.
6. Displays appropriate messages based on the activation status.* Viewing the Game Library
1. Ensures the user is logged in.
2. Displays the list of games in the user's library.
3. Indicates whether each game is installed or not.* Downloading a Game
1. Ensures the user is logged in.
2. Prompts the user to enter the game name.
3. Searches for the game in the user's library.
4. If found, displays a progress bar simulating the download.
5. Marks the game as installed and saves the user data.
6. Displays appropriate messages based on the download status.* Uninstalling a Game
1. Ensures the user is logged in.
2. Prompts the user to enter the game name.
3. Searches for the game in the user's library.
4. If found and installed, displays a progress bar simulating the uninstallation.
5. Marks the game as uninstalled and saves the user data.
6. Displays appropriate messages based on the uninstallation status.* Running a Game
1. Ensures the user is logged in.
2. Prompts the user to enter the game name.
3. Searches for the game in the user's library.
4. If found and installed, simulates running the game.
5. Displays appropriate messages based on the game run status.## Building and Running the Project
* Build the Project: Use a C++ compiler to compile the source files.
* Run the Executable: Execute the compiled program from the command line.
* Interact with the Program: Follow the prompts to create accounts, log in, manage the game library, and perform other actions.