Merge branch 'master' into windows_random

merge-requests/8/head
Nemirtingas 2019-07-11 15:59:14 +02:00
commit 6910d5aba5
3 changed files with 58 additions and 33 deletions

View File

@ -23,11 +23,10 @@ std::string Settings::sanitize(std::string name)
name.erase(std::remove(name.begin(), name.end(), '\n'), name.end()); name.erase(std::remove(name.begin(), name.end(), '\n'), name.end());
name.erase(std::remove(name.begin(), name.end(), '\r'), name.end()); name.erase(std::remove(name.begin(), name.end(), '\r'), name.end());
for (int i = 0; i < name.size(); ++i) { for (auto& i : name)
if (name[i] >= 'a' && name[i] <= 'z') continue; {
if (name[i] >= 'A' && name[i] <= 'Z') continue; if (!isprint(i))
if (name[i] >= '0' && name[i] <= '9') continue; i = ' ';
name[i] = ' ';
} }
return name; return name;

View File

@ -776,6 +776,10 @@ void RequestFriendRichPresence( CSteamID steamIDFriend )
bool InviteUserToGame( CSteamID steamIDFriend, const char *pchConnectString ) bool InviteUserToGame( CSteamID steamIDFriend, const char *pchConnectString )
{ {
PRINT_DEBUG("Steam_Friends::InviteUserToGame\n"); PRINT_DEBUG("Steam_Friends::InviteUserToGame\n");
std::lock_guard<std::recursive_mutex> lock(global_mutex);
Friend *f = find_friend(steamIDFriend);
if (!f) return false;
Common_Message msg; Common_Message msg;
Friend_Messages *friend_messages = new Friend_Messages(); Friend_Messages *friend_messages = new Friend_Messages();
friend_messages->set_type(Friend_Messages::GAME_INVITE); friend_messages->set_type(Friend_Messages::GAME_INVITE);
@ -1028,13 +1032,14 @@ void Callback(Common_Message *msg)
data.m_steamIDFriend = CSteamID((uint64)msg->source_id()); data.m_steamIDFriend = CSteamID((uint64)msg->source_id());
callbacks->addCBResult(data.k_iCallback, &data, sizeof(data)); callbacks->addCBResult(data.k_iCallback, &data, sizeof(data));
} }
if (msg->friend_messages().type() == Friend_Messages::GAME_INVITE) { if (msg->friend_messages().type() == Friend_Messages::GAME_INVITE) {
PRINT_DEBUG("Steam_Friends Got Game Invite\n"); PRINT_DEBUG("Steam_Friends Got Game Invite\n");
//TODO: I'm pretty sure that the user should accept the invite before this is posted but we do like above
std::string const& connect_str = msg->friend_messages().connect_str(); std::string const& connect_str = msg->friend_messages().connect_str();
GameRichPresenceJoinRequested_t data; GameRichPresenceJoinRequested_t data = {};
data.m_steamIDFriend = CSteamID((uint64)msg->source_id()); data.m_steamIDFriend = CSteamID((uint64)msg->source_id());
strncpy(data.m_rgchConnect, connect_str.c_str(), connect_str.length()+1); strncpy(data.m_rgchConnect, connect_str.c_str(), k_cchMaxRichPresenceValueLength - 1);
callbacks->addCBResult(data.k_iCallback, &data, sizeof(data)); callbacks->addCBResult(data.k_iCallback, &data, sizeof(data));
} }
} }

View File

@ -3,37 +3,58 @@ $fi = $args[0]
if( ! $fi ) if( ! $fi )
{ {
$fi = "steam_api.dll" $fi = "steam_api.dll"
if( !(Test-Path $fi) )
{
$fi = "steam_api64.dll"
}
if( !(Test-Path $fi) )
{
Write-Output "Failed to find steam_api or steam_api64"
Return 1
}
}
else
{
if( !(Test-Path $fi) )
{
Write-Output "Failed to find $fi"
Return 1
}
} }
function findinterface($api) function findinterface
($api)
{ {
$str = Select-String "$api[0-9][0-9][0-9]" $fi $str = Select-String "$api[0-9][0-9][0-9]" $fi
if( $str -match "$api[0-9]{3}" ) if( $str -match "$api[0-9]{3}" )
{ {
Write-Output "$($matches[0])" Write-Output "$($matches[0])"
} }
} }
findinterface SteamClient >steam_interfaces.txt findinterface SteamClient | Out-File -Encoding ASCII -FilePath steam_interfaces.txt
findinterface SteamGameServer >>steam_interfaces.txt findinterface SteamGameServer | Out-File -Encoding ASCII -Append -FilePath steam_interfaces.txt
findinterface SteamGameServerStats >>steam_interfaces.txt findinterface SteamGameServerStats | Out-File -Encoding ASCII -Append -FilePath steam_interfaces.txt
findinterface SteamUser >>steam_interfaces.txt findinterface SteamUser | Out-File -Encoding ASCII -Append -FilePath steam_interfaces.txt
findinterface SteamFriends >>steam_interfaces.txt findinterface SteamFriends | Out-File -Encoding ASCII -Append -FilePath steam_interfaces.txt
findinterface SteamUtils >>steam_interfaces.txt findinterface SteamUtils | Out-File -Encoding ASCII -Append -FilePath steam_interfaces.txt
findinterface SteamMatchMaking >>steam_interfaces.txt findinterface SteamMatchMaking | Out-File -Encoding ASCII -Append -FilePath steam_interfaces.txt
findinterface SteamMatchMakingServers >>steam_interfaces.txt findinterface SteamMatchMakingServers | Out-File -Encoding ASCII -Append -FilePath steam_interfaces.txt
findinterface STEAMUSERSTATS_INTERFACE_VERSION >>steam_interfaces.txt findinterface STEAMUSERSTATS_INTERFACE_VERSION | Out-File -Encoding ASCII -Append -FilePath steam_interfaces.txt
findinterface STEAMAPPS_INTERFACE_VERSION >>steam_interfaces.txt findinterface STEAMAPPS_INTERFACE_VERSION | Out-File -Encoding ASCII -Append -FilePath steam_interfaces.txt
findinterface SteamNetworking >>steam_interfaces.txt findinterface SteamNetworking | Out-File -Encoding ASCII -Append -FilePath steam_interfaces.txt
findinterface STEAMREMOTESTORAGE_INTERFACE_VERSION >>steam_interfaces.txt findinterface STEAMREMOTESTORAGE_INTERFACE_VERSION | Out-File -Encoding ASCII -Append -FilePath steam_interfaces.txt
findinterface STEAMSCREENSHOTS_INTERFACE_VERSION >>steam_interfaces.txt findinterface STEAMSCREENSHOTS_INTERFACE_VERSION | Out-File -Encoding ASCII -Append -FilePath steam_interfaces.txt
findinterface STEAMHTTP_INTERFACE_VERSION >>steam_interfaces.txt findinterface STEAMHTTP_INTERFACE_VERSION | Out-File -Encoding ASCII -Append -FilePath steam_interfaces.txt
findinterface STEAMUNIFIEDMESSAGES_INTERFACE_VERSION >>steam_interfaces.txt findinterface STEAMUNIFIEDMESSAGES_INTERFACE_VERSION | Out-File -Encoding ASCII -Append -FilePath steam_interfaces.txt
findinterface STEAMCONTROLLER_INTERFACE_VERSION >>steam_interfaces.txt findinterface STEAMCONTROLLER_INTERFACE_VERSION | Out-File -Encoding ASCII -Append -FilePath steam_interfaces.txt
findinterface STEAMUGC_INTERFACE_VERSION >>steam_interfaces.txt findinterface STEAMUGC_INTERFACE_VERSION | Out-File -Encoding ASCII -Append -FilePath steam_interfaces.txt
findinterface STEAMAPPLIST_INTERFACE_VERSION >>steam_interfaces.txt findinterface STEAMAPPLIST_INTERFACE_VERSION | Out-File -Encoding ASCII -Append -FilePath steam_interfaces.txt
findinterface STEAMMUSIC_INTERFACE_VERSION >>steam_interfaces.txt findinterface STEAMMUSIC_INTERFACE_VERSION | Out-File -Encoding ASCII -Append -FilePath steam_interfaces.txt
findinterface STEAMMUSICREMOTE_INTERFACE_VERSION >>steam_interfaces.txt findinterface STEAMMUSICREMOTE_INTERFACE_VERSION | Out-File -Encoding ASCII -Append -FilePath steam_interfaces.txt
findinterface STEAMHTMLSURFACE_INTERFACE_VERSION_ >>steam_interfaces.txt findinterface STEAMHTMLSURFACE_INTERFACE_VERSION_ | Out-File -Encoding ASCII -Append -FilePath steam_interfaces.txt
findinterface STEAMINVENTORY_INTERFACE_V >>steam_interfaces.txt findinterface STEAMINVENTORY_INTERFACE_V | Out-File -Encoding ASCII -Append -FilePath steam_interfaces.txt
findinterface SteamController >>steam_interfaces.txt findinterface SteamController | Out-File -Encoding ASCII -Append -FilePath steam_interfaces.txt