Merge branch 'dev' into dev

This commit is contained in:
alex47exe 2024-09-16 15:17:36 +01:00 committed by GitHub
commit c0b071e78a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
8 changed files with 143 additions and 125 deletions

View File

@ -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.

View File

@ -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;
}

View File

@ -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);

View File

@ -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.

View File

@ -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.

View File

@ -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]:

View File

@ -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,28 +90,35 @@ 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;
std::cout << "Starting the game with: " << connect << "\n";
char szBaseDirectory[MAX_PATH] = "";
GetModuleFileNameA(0, szBaseDirectory, MAX_PATH);
@ -117,7 +137,7 @@ top:
auto writeLobbyFile = [&lobbyFile](const std::string& data) {
std::ofstream ofs(std::filesystem::u8path(lobbyFile));
ofs << data << std::endl;
ofs << data << "\n";
};
auto fileExists = [](const std::string& filename) {
@ -150,7 +170,7 @@ top:
std::string filename = readLobbyFile();
if (filename.empty() || !fileExists(filename) || !joinLobby(filename)) {
std::cout << "Please browse for game exe" << std::endl;
std::cout << "Please select the game executable.\n";
OPENFILENAMEA ofn;
char szFileName[MAX_PATH] = "";
@ -167,8 +187,10 @@ top:
}
}
#else
std::cout << "Please launch the game with these arguments: " << connect << std::endl;
std::cout << "Please launch the game with these arguments: " << connect << "\n\n";
#endif
return 0;
}

View File

@ -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",
},
},
},