Merge branch 'dev' into dev
This commit is contained in:
commit
c0b071e78a
@ -490,9 +490,6 @@ public:
|
||||
/// - k_EResultInvalidParam - nLanes is bad
|
||||
EResult GetConnectionRealTimeStatus( HSteamNetConnection hConn, SteamNetConnectionRealTimeStatus_t *pStatus, int nLanes, SteamNetConnectionRealTimeLaneStatus_t *pLanes );
|
||||
|
||||
// based on reversing the vftable returned from original steamclient64.dll
|
||||
bool GetConnectionRealTimeStatus_old( HSteamNetConnection hConn, SteamNetConnectionRealTimeStatus_t *pStatus );
|
||||
|
||||
/// Fetch the next available message(s) from the socket, if any.
|
||||
/// Returns the number of messages returned into your array, up to nMaxMessages.
|
||||
/// If the connection handle is invalid, -1 is returned.
|
||||
|
@ -950,24 +950,6 @@ EResult Steam_Networking_Sockets::GetConnectionRealTimeStatus( HSteamNetConnecti
|
||||
return k_EResultOK;
|
||||
}
|
||||
|
||||
// based on reversing the vftable returned from original steamclient64.dll
|
||||
bool Steam_Networking_Sockets::GetConnectionRealTimeStatus_old( HSteamNetConnection hConn, SteamNetConnectionRealTimeStatus_t *pStatus )
|
||||
{
|
||||
PRINT_DEBUG("undocumented API, interface v10-11");
|
||||
/*
|
||||
...
|
||||
xor r9d, r9d // int nLanes = 0
|
||||
mov qword ptr ss:[rsp+0x20], 0x0 // SteamNetConnectionRealTimeLaneStatus_t *pLanes = nullptr
|
||||
...
|
||||
call qword ptr ds:[rax+0x80] // call GetConnectionRealTimeStatus(hConn, pStatus, nLanes, pLanes)
|
||||
test eax, eax
|
||||
setne al if (eax !=0) { al=1 } else { al=0 }
|
||||
...
|
||||
ret
|
||||
*/
|
||||
return GetConnectionRealTimeStatus(hConn, pStatus, 0, nullptr) != EResult::k_EResultNone;
|
||||
}
|
||||
|
||||
/// Fetch the next available message(s) from the socket, if any.
|
||||
/// Returns the number of messages returned into your array, up to nMaxMessages.
|
||||
/// If the connection handle is invalid, -1 is returned.
|
||||
@ -1022,10 +1004,19 @@ bool Steam_Networking_Sockets::GetConnectionInfo( HSteamNetConnection hConn, Ste
|
||||
bool Steam_Networking_Sockets::GetQuickConnectionStatus( HSteamNetConnection hConn, SteamNetworkingQuickConnectionStatus *pStats )
|
||||
{
|
||||
PRINT_DEBUG_ENTRY();
|
||||
if (!pStats)
|
||||
return false;
|
||||
|
||||
return GetConnectionRealTimeStatus(hConn, pStats, 0, NULL) == k_EResultOK;
|
||||
// based on reversing the vftable returned from original steamclient64.dll
|
||||
/*
|
||||
...
|
||||
xor r9d, r9d // int nLanes = 0
|
||||
mov qword ptr ss:[rsp+0x20], 0x0 // SteamNetConnectionRealTimeLaneStatus_t *pLanes = nullptr
|
||||
...
|
||||
call qword ptr ds:[rax+0x80] // call GetConnectionRealTimeStatus(hConn, pStatus, nLanes, pLanes)
|
||||
test eax, eax
|
||||
setne al if (eax !=0) { al=1 } else { al=0 }
|
||||
...
|
||||
ret
|
||||
*/
|
||||
return GetConnectionRealTimeStatus(hConn, pStats, 0, NULL) != k_EResultNone;
|
||||
}
|
||||
|
||||
|
||||
|
@ -186,7 +186,7 @@ unsigned int Steam_User_Stats::cache_leaderboard_ifneeded(const std::string &nam
|
||||
|
||||
// create a new entry in-memory and try reading the entries from disk
|
||||
struct Steam_Leaderboard new_board{};
|
||||
new_board.name = common_helpers::ascii_to_lowercase(name);
|
||||
new_board.name = name;
|
||||
new_board.sort_method = eLeaderboardSortMethod;
|
||||
new_board.display_type = eLeaderboardDisplayType;
|
||||
new_board.entries = load_leaderboard_entries(name);
|
||||
|
@ -301,8 +301,9 @@ public:
|
||||
/// Returns basic information about the high-level state of the connection.
|
||||
virtual bool GetConnectionInfo( HSteamNetConnection hConn, SteamNetConnectionInfo_t *pInfo ) = 0;
|
||||
|
||||
// based on reversing the vftable returned from original steamclient64.dll
|
||||
virtual bool GetConnectionRealTimeStatus_old( HSteamNetConnection hConn, SteamNetConnectionRealTimeStatus_t *pStatus ) = 0;
|
||||
/// Returns a small set of information about the real-time state of the connection
|
||||
/// Returns false if the connection handle is invalid, or the connection has ended.
|
||||
virtual bool GetQuickConnectionStatus( HSteamNetConnection hConn, SteamNetworkingQuickConnectionStatus *pStats ) = 0;
|
||||
|
||||
/// Returns detailed connection stats in text format. Useful
|
||||
/// for dumping to a log, etc.
|
||||
|
@ -301,8 +301,9 @@ public:
|
||||
/// Returns basic information about the high-level state of the connection.
|
||||
virtual bool GetConnectionInfo( HSteamNetConnection hConn, SteamNetConnectionInfo_t *pInfo ) = 0;
|
||||
|
||||
// based on reversing the vftable returned from original steamclient64.dll
|
||||
virtual bool GetConnectionRealTimeStatus_old( HSteamNetConnection hConn, SteamNetConnectionRealTimeStatus_t *pStatus ) = 0;
|
||||
/// Returns a small set of information about the real-time state of the connection
|
||||
/// Returns false if the connection handle is invalid, or the connection has ended.
|
||||
virtual bool GetQuickConnectionStatus( HSteamNetConnection hConn, SteamNetworkingQuickConnectionStatus *pStats ) = 0;
|
||||
|
||||
/// Returns detailed connection stats in text format. Useful
|
||||
/// for dumping to a log, etc.
|
||||
|
@ -30,6 +30,8 @@ keymap_digital = {
|
||||
}
|
||||
|
||||
def add_input_bindings(group, bindings, force_binding=None, keymap=keymap_digital):
|
||||
if "inputs" not in group:
|
||||
return bindings
|
||||
for i in group["inputs"]:
|
||||
for act in group["inputs"][i]:
|
||||
for fp in group["inputs"][i][act]:
|
||||
|
@ -31,9 +31,18 @@
|
||||
#ifdef _WIN32
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#include <windows.h>
|
||||
#else
|
||||
|
||||
#endif
|
||||
|
||||
void title() {
|
||||
#ifdef _WIN32
|
||||
system("cls");
|
||||
#else
|
||||
system("clear");
|
||||
#endif
|
||||
|
||||
std::cout << "\n----Lobby Connect----\n\n";
|
||||
}
|
||||
|
||||
int main() {
|
||||
std::string appid_str(std::to_string(LOBBY_CONNECT_APPID));
|
||||
set_env_variable("SteamAppId", appid_str);
|
||||
@ -45,17 +54,20 @@ int main() {
|
||||
|
||||
//Set appid to: LOBBY_CONNECT_APPID
|
||||
SteamAPI_RestartAppIfNecessary(LOBBY_CONNECT_APPID);
|
||||
std::cout << "Lobby_Connect.exe for Goldberg Steam Emulator " << std::endl << std::endl;
|
||||
std::cout << "Steam Emulator API initialized" << std::endl;
|
||||
top:
|
||||
std::cout << "Waiting a few seconds for connections" << std::endl << std::endl;
|
||||
|
||||
refresh:
|
||||
title();
|
||||
std::cout << "Please wait...\n";
|
||||
|
||||
for (int i = 0; i < 10; ++i) {
|
||||
SteamAPI_RunCallbacks();
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(200));
|
||||
}
|
||||
|
||||
int friend_count = SteamFriends()->GetFriendCount(k_EFriendFlagAll);
|
||||
std::cout << "People on the network: " << friend_count << std::endl;
|
||||
|
||||
/*
|
||||
std::cout << "People on the network: " << friend_count << "\n";
|
||||
for (int i = 0; i < friend_count; ++i) {
|
||||
CSteamID id = SteamFriends()->GetFriendByIndex(i, k_EFriendFlagAll);
|
||||
const char *name = SteamFriends()->GetFriendPersonaName(id);
|
||||
@ -64,8 +76,9 @@ top:
|
||||
SteamFriends()->GetFriendGamePlayed(id, &friend_info);
|
||||
std::cout << name << " is playing: " << friend_info.m_gameID.AppID() << std::endl;
|
||||
}
|
||||
*/
|
||||
|
||||
std::cout << std::endl << "----------------------Menu---------------------" << std::endl << " \tappid\t\tname\t\tcmdline" << std::endl << std::endl;
|
||||
title();
|
||||
|
||||
std::vector<std::pair<std::string, uint32>> arguments;
|
||||
for (int i = 0; i < friend_count; ++i) {
|
||||
@ -77,98 +90,107 @@ top:
|
||||
auto appid = friend_info.m_gameID.AppID();
|
||||
|
||||
if (strlen(connect) > 0) {
|
||||
std::cout << arguments.size() << ": \t" << appid << "\t\t" << name << "\t\t" << connect << std::endl;
|
||||
std::cout << arguments.size() << " - " << name << " is playing " << appid << " (" << connect << ").\n";
|
||||
arguments.emplace_back(connect, appid);
|
||||
} else {
|
||||
if (friend_info.m_steamIDLobby != k_steamIDNil) {
|
||||
std::string connect = "+connect_lobby " + std::to_string(friend_info.m_steamIDLobby.ConvertToUint64());
|
||||
std::cout << arguments.size() << ": \t" << appid << "\t\t" << name << "\t\t" << connect << std::endl;
|
||||
std::cout << arguments.size() << " - " << name << " is playing " << appid << " (" << connect << ").\n";
|
||||
arguments.emplace_back(connect, appid);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
std::cout << arguments.size() << ": \tRetry" << std::endl;
|
||||
std::cout << std::endl << "Enter the number corresponding to your choice then press Enter" << std::endl;
|
||||
std::cout << arguments.size() << " - Refresh.\n\n";
|
||||
std::cout << "Choose an option: ";
|
||||
unsigned int choice;
|
||||
std::cin >> choice;
|
||||
|
||||
if (choice >= arguments.size()) goto top;
|
||||
if (std::cin.fail() || choice >= arguments.size()) {
|
||||
std::cin.clear();
|
||||
std::cin.ignore(std::numeric_limits<std::streamsize>::max(), '\n');
|
||||
goto refresh;
|
||||
}
|
||||
|
||||
title();
|
||||
|
||||
auto connect = arguments[choice].first;
|
||||
#ifdef _WIN32
|
||||
auto appid = arguments[choice].second;
|
||||
std::cout << "Starting the game with: " << connect << std::endl;
|
||||
|
||||
char szBaseDirectory[MAX_PATH] = "";
|
||||
GetModuleFileNameA(0, szBaseDirectory, MAX_PATH);
|
||||
if (auto bs = strrchr(szBaseDirectory, '\\')) {
|
||||
*bs = '\0';
|
||||
}
|
||||
auto lobbyFile = std::string(szBaseDirectory) + "\\lobby_connect_" + std::to_string(appid) + ".txt";
|
||||
#ifdef _WIN32
|
||||
auto appid = arguments[choice].second;
|
||||
std::cout << "Starting the game with: " << connect << "\n";
|
||||
|
||||
auto readLobbyFile = [&lobbyFile]() {
|
||||
std::string data;
|
||||
std::ifstream ifs(std::filesystem::u8path(lobbyFile));
|
||||
if (ifs.is_open())
|
||||
std::getline(ifs, data);
|
||||
return data;
|
||||
};
|
||||
char szBaseDirectory[MAX_PATH] = "";
|
||||
GetModuleFileNameA(0, szBaseDirectory, MAX_PATH);
|
||||
if (auto bs = strrchr(szBaseDirectory, '\\')) {
|
||||
*bs = '\0';
|
||||
}
|
||||
auto lobbyFile = std::string(szBaseDirectory) + "\\lobby_connect_" + std::to_string(appid) + ".txt";
|
||||
|
||||
auto writeLobbyFile = [&lobbyFile](const std::string& data) {
|
||||
std::ofstream ofs(std::filesystem::u8path(lobbyFile));
|
||||
ofs << data << std::endl;
|
||||
};
|
||||
auto readLobbyFile = [&lobbyFile]() {
|
||||
std::string data;
|
||||
std::ifstream ifs(std::filesystem::u8path(lobbyFile));
|
||||
if (ifs.is_open())
|
||||
std::getline(ifs, data);
|
||||
return data;
|
||||
};
|
||||
|
||||
auto fileExists = [](const std::string& filename) {
|
||||
std::ifstream ifs(std::filesystem::u8path(filename));
|
||||
return ifs.is_open();
|
||||
};
|
||||
auto writeLobbyFile = [&lobbyFile](const std::string& data) {
|
||||
std::ofstream ofs(std::filesystem::u8path(lobbyFile));
|
||||
ofs << data << "\n";
|
||||
};
|
||||
|
||||
auto joinLobby = [&connect](std::string filename) {
|
||||
filename = "\"" + filename + "\" " + connect;
|
||||
std::cout << filename << std::endl;
|
||||
auto fileExists = [](const std::string& filename) {
|
||||
std::ifstream ifs(std::filesystem::u8path(filename));
|
||||
return ifs.is_open();
|
||||
};
|
||||
|
||||
STARTUPINFOA lpStartupInfo;
|
||||
PROCESS_INFORMATION lpProcessInfo;
|
||||
auto joinLobby = [&connect](std::string filename) {
|
||||
filename = "\"" + filename + "\" " + connect;
|
||||
std::cout << filename << std::endl;
|
||||
|
||||
ZeroMemory( &lpStartupInfo, sizeof( lpStartupInfo ) );
|
||||
lpStartupInfo.cb = sizeof( lpStartupInfo );
|
||||
ZeroMemory( &lpProcessInfo, sizeof( lpProcessInfo ) );
|
||||
STARTUPINFOA lpStartupInfo;
|
||||
PROCESS_INFORMATION lpProcessInfo;
|
||||
|
||||
auto success = !!CreateProcessA( NULL,
|
||||
const_cast<char *>(filename.c_str()), NULL, NULL,
|
||||
NULL, NULL, NULL, NULL,
|
||||
&lpStartupInfo,
|
||||
&lpProcessInfo
|
||||
);
|
||||
ZeroMemory( &lpStartupInfo, sizeof( lpStartupInfo ) );
|
||||
lpStartupInfo.cb = sizeof( lpStartupInfo );
|
||||
ZeroMemory( &lpProcessInfo, sizeof( lpProcessInfo ) );
|
||||
|
||||
CloseHandle(lpProcessInfo.hThread);
|
||||
CloseHandle(lpProcessInfo.hProcess);
|
||||
return success;
|
||||
};
|
||||
auto success = !!CreateProcessA( NULL,
|
||||
const_cast<char *>(filename.c_str()), NULL, NULL,
|
||||
NULL, NULL, NULL, NULL,
|
||||
&lpStartupInfo,
|
||||
&lpProcessInfo
|
||||
);
|
||||
|
||||
std::string filename = readLobbyFile();
|
||||
if (filename.empty() || !fileExists(filename) || !joinLobby(filename)) {
|
||||
std::cout << "Please browse for game exe" << std::endl;
|
||||
CloseHandle(lpProcessInfo.hThread);
|
||||
CloseHandle(lpProcessInfo.hProcess);
|
||||
return success;
|
||||
};
|
||||
|
||||
OPENFILENAMEA ofn;
|
||||
char szFileName[MAX_PATH] = "";
|
||||
ZeroMemory(&ofn, sizeof(ofn));
|
||||
ofn.lStructSize = sizeof(ofn);
|
||||
ofn.hwndOwner = 0;
|
||||
ofn.lpstrFilter = "Exe Files (*.exe)\0*.exe\0All Files (*.*)\0*.*\0";
|
||||
ofn.lpstrFile = szFileName;
|
||||
ofn.nMaxFile = MAX_PATH;
|
||||
ofn.Flags = OFN_EXPLORER | OFN_FILEMUSTEXIST | OFN_HIDEREADONLY;
|
||||
ofn.lpstrDefExt = "exe";
|
||||
if(GetOpenFileNameA(&ofn) && joinLobby(szFileName)) {
|
||||
writeLobbyFile(szFileName);
|
||||
}
|
||||
}
|
||||
#else
|
||||
std::cout << "Please launch the game with these arguments: " << connect << std::endl;
|
||||
#endif
|
||||
std::string filename = readLobbyFile();
|
||||
if (filename.empty() || !fileExists(filename) || !joinLobby(filename)) {
|
||||
std::cout << "Please select the game executable.\n";
|
||||
|
||||
OPENFILENAMEA ofn;
|
||||
char szFileName[MAX_PATH] = "";
|
||||
ZeroMemory(&ofn, sizeof(ofn));
|
||||
ofn.lStructSize = sizeof(ofn);
|
||||
ofn.hwndOwner = 0;
|
||||
ofn.lpstrFilter = "Exe Files (*.exe)\0*.exe\0All Files (*.*)\0*.*\0";
|
||||
ofn.lpstrFile = szFileName;
|
||||
ofn.nMaxFile = MAX_PATH;
|
||||
ofn.Flags = OFN_EXPLORER | OFN_FILEMUSTEXIST | OFN_HIDEREADONLY;
|
||||
ofn.lpstrDefExt = "exe";
|
||||
if(GetOpenFileNameA(&ofn) && joinLobby(szFileName)) {
|
||||
writeLobbyFile(szFileName);
|
||||
}
|
||||
}
|
||||
#else
|
||||
std::cout << "Please launch the game with these arguments: " << connect << "\n\n";
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
@ -104,6 +104,10 @@ typedef struct SnrDetails {
|
||||
"F6 C? 02 89 ?? ?? ?? ?? ?? A3 ?? ?? ?? ?? 0F 85",
|
||||
"?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? 90 E9 00 03 00 00",
|
||||
},
|
||||
{
|
||||
"F6 05 ?? ?? ?? ?? 02 89 ?? ?? 0F 85 ?? ?? ?? ?? 5? FF ?? 6?",
|
||||
"?? ?? ?? ?? ?? ?? ?? ?? ?? ?? 90 E9 03 03",
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user