Skip to content

Commit

Permalink
Improve clearity instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
loki committed Mar 21, 2020
1 parent 34b1ef8 commit a942357
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 10 deletions.
18 changes: 14 additions & 4 deletions README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ Requirements:
Ubuntu 19.10: cmake libssl-dev libavdevice-dev libboost-thread-dev libboost-filesystem-dev libboost-log-dev libpulse-dev libopus-dev libxtst-dev libx11-dev libxfixes-dev libevdev-dev libxcb1-dev libxcb-shm0-dev libxcb-xfixes0-dev

Compilation:
* git clone <repository> --recurse-submodules
* mkdir build && cd build
* git clone https://github.com/loki-47-6F-64/sunshine.git --recurse-submodules
* cd sunshine && mkdir build && cd build
* cmake ..
* make

Expand Down Expand Up @@ -41,14 +41,24 @@ Requirements:
MSYS2 : mingw-w64-x86_64-openssl mingw-w64-x86_64-cmake mingw-w64-x86_64-toolchain mingw-w64-x86_64-ffmpeg mingw-w64-x86_64-boost

Compilation:
* git clone <repository> --recurse-submodules
* mkdir build && cd build
* git clone https://github.com/loki-47-6F-64/sunshine.git --recurse-submodules
* cd sunshine && mkdir build && cd build
* cmake -G"Unix Makefiles" ..
* make

Setup:
* <optional> Gamepad support: Download and run 'ViGEmBus_Setup_1.16.116.exe' from [https://github.com/ViGEm/ViGEmBus/releases]

== Static build ==
Requirements:
MSYS2 : mingw-w64-x86_64-openssl mingw-w64-x86_64-cmake mingw-w64-x86_64-toolchain mingw-w64-x86_64-ffmpeg mingw-w64-x86_64-boost git-lfs

Compilation:
* git lfs install
* git clone https://github.com/loki-47-6F-64/sunshine.git --recurse-submodules
* cd sunshine && mkdir build && cd build
* cmake -DSUNSHINE_STANDALONE=ON -DSUNSHINE_ASSETS_DIR=assets -G"Unix Makefiles" ..
* make



Expand Down
7 changes: 4 additions & 3 deletions sunshine/config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -152,11 +152,12 @@ void int_between_f(std::unordered_map<std::string, std::string> &vars, const std
void print_help(const char *name) {
std::cout <<
"Usage: "sv << name << " [options] [/path/to/configuration_file]"sv << std::endl <<
" Any configurable option can be overwritten with: <name>=<value>"sv << std::endl << std::endl <<
" Any configurable option can be overwritten with: \"name=value\""sv << std::endl << std::endl <<
" --help | print help"sv << std::endl << std::endl <<
" flags"sv << std::endl <<
" -0 | Read PIN from stdin"sv << std::endl <<
" -1 | Do not read/write state to/from disk" << std::endl;
" -1 | Do not load previously saved state and do retain any state after shutdown"sv << std::endl <<
" | Effectively starting as if for the first time without overwriting any pairings with your devices"sv;
}

int apply_flags(const char *line) {
Expand All @@ -167,7 +168,7 @@ int apply_flags(const char *line) {
config::sunshine.flags[config::flag::PIN_STDIN].flip();
break;
case '1':
config::sunshine.flags[config::flag::CLEAN_SLATE].flip();
config::sunshine.flags[config::flag::FRESH_STATE].flip();
break;
default:
std::cout << "Warning: Unrecognized flag: ["sv << *line << ']' << std::endl;
Expand Down
2 changes: 1 addition & 1 deletion sunshine/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ struct input_t {
namespace flag {
enum flag_e : std::size_t {
PIN_STDIN = 0, // Read PIN from stdin instead of http
CLEAN_SLATE, // Do not load or save state
FRESH_STATE, // Do not load or save state
FLAG_SIZE
};
}
Expand Down
4 changes: 2 additions & 2 deletions sunshine/nvhttp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ void update_id_client(const std::string &uniqueID, std::string &&cert, op_e op)
break;
}

if(!config::sunshine.flags[config::flag::CLEAN_SLATE]) {
if(!config::sunshine.flags[config::flag::FRESH_STATE]) {
save_state();
}
}
Expand Down Expand Up @@ -724,7 +724,7 @@ int create_creds(const std::string &pkey, const std::string &cert) {
}

void start(std::shared_ptr<safe::signal_t> shutdown_event) {
bool clean_slate = config::sunshine.flags[config::flag::CLEAN_SLATE];
bool clean_slate = config::sunshine.flags[config::flag::FRESH_STATE];
if(clean_slate) {
unique_id = util::uuid_t::generate().string();

Expand Down

0 comments on commit a942357

Please sign in to comment.