mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-07-12 20:55:56 +00:00
some more draft work
This commit is contained in:
parent
6c64deecde
commit
4bccf7a2db
6 changed files with 61 additions and 0 deletions
|
@ -794,6 +794,8 @@ set(CORE src/core/aerolib/stubs.cpp
|
||||||
src/core/thread.h
|
src/core/thread.h
|
||||||
src/core/tls.cpp
|
src/core/tls.cpp
|
||||||
src/core/tls.h
|
src/core/tls.h
|
||||||
|
src/core/user_account.cpp
|
||||||
|
src/core/user_account.h
|
||||||
)
|
)
|
||||||
|
|
||||||
if (ARCHITECTURE STREQUAL "x86_64")
|
if (ARCHITECTURE STREQUAL "x86_64")
|
||||||
|
|
|
@ -74,7 +74,12 @@ static bool compatibilityData = false;
|
||||||
static bool checkCompatibilityOnStartup = false;
|
static bool checkCompatibilityOnStartup = false;
|
||||||
static std::string trophyKey;
|
static std::string trophyKey;
|
||||||
static bool isPSNSignedIn = false;
|
static bool isPSNSignedIn = false;
|
||||||
|
std::string userid{"00000001"};
|
||||||
|
std::string selectedUserid{"00000001"};
|
||||||
|
|
||||||
|
std::string getDefaultUserId() {
|
||||||
|
return userid;
|
||||||
|
}
|
||||||
// Gui
|
// Gui
|
||||||
static bool load_game_size = true;
|
static bool load_game_size = true;
|
||||||
static std::vector<GameInstallDir> settings_install_dirs = {};
|
static std::vector<GameInstallDir> settings_install_dirs = {};
|
||||||
|
|
|
@ -34,6 +34,7 @@ bool getEnableDiscordRPC();
|
||||||
bool getCompatibilityEnabled();
|
bool getCompatibilityEnabled();
|
||||||
bool getCheckCompatibilityOnStartup();
|
bool getCheckCompatibilityOnStartup();
|
||||||
bool getPSNSignedIn();
|
bool getPSNSignedIn();
|
||||||
|
std::string getDefaultUserId();
|
||||||
|
|
||||||
std::string getLogFilter();
|
std::string getLogFilter();
|
||||||
std::string getLogType();
|
std::string getLogType();
|
||||||
|
|
18
src/core/user_account.cpp
Normal file
18
src/core/user_account.cpp
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
// SPDX-FileCopyrightText: Copyright 2025 shadPS4 Emulator Project
|
||||||
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||||
|
|
||||||
|
#include <filesystem>
|
||||||
|
#include "user_account.h"
|
||||||
|
|
||||||
|
user_account::user_account(const std::string& user_id) {
|
||||||
|
// Setting userId.
|
||||||
|
m_user_id = user_id;
|
||||||
|
// TODO
|
||||||
|
}
|
||||||
|
|
||||||
|
std::map<u32, user_account> user_account::GetUserAccounts(const std::string& base_dir) {
|
||||||
|
std::map<u32, user_account> user_list;
|
||||||
|
// TODO
|
||||||
|
|
||||||
|
return user_list;
|
||||||
|
}
|
29
src/core/user_account.h
Normal file
29
src/core/user_account.h
Normal file
|
@ -0,0 +1,29 @@
|
||||||
|
// SPDX-FileCopyrightText: Copyright 2025 shadPS4 Emulator Project
|
||||||
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
#include <map>
|
||||||
|
#include <string>
|
||||||
|
#include "common/types.h"
|
||||||
|
|
||||||
|
class user_account {
|
||||||
|
public:
|
||||||
|
explicit user_account(const std::string& user_id = "00000001");
|
||||||
|
|
||||||
|
const std::string& GetUserId() const {
|
||||||
|
return m_user_id;
|
||||||
|
}
|
||||||
|
const std::string& GetUserDir() const {
|
||||||
|
return m_user_dir;
|
||||||
|
}
|
||||||
|
const std::string& GetUsername() const {
|
||||||
|
return m_username;
|
||||||
|
}
|
||||||
|
|
||||||
|
static std::map<u32, user_account> GetUserAccounts(const std::string& base_dir);
|
||||||
|
|
||||||
|
private:
|
||||||
|
std::string m_user_id;
|
||||||
|
std::string m_user_dir;
|
||||||
|
std::string m_username;
|
||||||
|
};
|
|
@ -32,6 +32,12 @@ int main(int argc, char* argv[]) {
|
||||||
const auto user_dir = Common::FS::GetUserPath(Common::FS::PathType::UserDir);
|
const auto user_dir = Common::FS::GetUserPath(Common::FS::PathType::UserDir);
|
||||||
Config::load(user_dir / "config.toml");
|
Config::load(user_dir / "config.toml");
|
||||||
|
|
||||||
|
const auto& default_user_dir =
|
||||||
|
Common::FS::GetUserPath(Common::FS::PathType::HomeDir) / Config::getDefaultUserId();
|
||||||
|
if (!std::filesystem::exists(default_user_dir)) {
|
||||||
|
std::filesystem::create_directory(default_user_dir);
|
||||||
|
}
|
||||||
|
|
||||||
bool has_command_line_argument = argc > 1;
|
bool has_command_line_argument = argc > 1;
|
||||||
bool show_gui = false, has_game_argument = false;
|
bool show_gui = false, has_game_argument = false;
|
||||||
std::string game_path;
|
std::string game_path;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue