Compare commits

..

No commits in common. "eda9abd2aae78972994bcd0b2b77ba7048cafdac" and "f147638f993d804567959bf9193f52ba7eb89190" have entirely different histories.

2 changed files with 21 additions and 39 deletions

View File

@ -44,13 +44,12 @@ static char old_inventory[128] = "STEAMINVENTORY_INTERFACE_V001";
static char old_video[128] = "STEAMVIDEO_INTERFACE_V001";
static char old_masterserver_updater[128] = "SteamMasterServerUpdater001";
static bool try_load_steam_interfaces(std::string interfaces_path)
static void load_old_interface_versions()
{
static bool loaded = false;
if (loaded) return;
std::string interfaces_path = Local_Storage::get_program_path() + "steam_interfaces.txt";
std::ifstream input( utf8_decode(interfaces_path) );
if (!input.is_open()) {
return false;
}
PRINT_DEBUG("load from: %s\n", interfaces_path.c_str());
for( std::string line; getline( input, line ); )
@ -84,17 +83,6 @@ static bool try_load_steam_interfaces(std::string interfaces_path)
#undef REPLACE_WITH_FILE
}
return true;
}
static void load_old_interface_versions()
{
static bool loaded = false;
if (loaded) return;
if (!try_load_steam_interfaces(Local_Storage::get_game_settings_path() + "steam_interfaces.txt"))
try_load_steam_interfaces(Local_Storage::get_program_path() + "steam_interfaces.txt");
PRINT_DEBUG("client: %s\n", old_client);
PRINT_DEBUG("gameserver: %s\n", old_gameserver);
PRINT_DEBUG("gameserver stats: %s\n", old_gameserver_stats);

View File

@ -210,27 +210,6 @@ ESteamNetworkingConnectionState convert_status(enum connect_socket_status old_st
return k_ESteamNetworkingConnectionState_None;
}
void set_steamnetconnectioninfo(std::map<HSteamNetConnection, Connect_Socket>::iterator connect_socket, SteamNetConnectionInfo_t *pInfo)
{
pInfo->m_identityRemote = connect_socket->second.remote_identity;
pInfo->m_nUserData = connect_socket->second.user_data;
pInfo->m_hListenSocket = connect_socket->second.listen_socket_id;
pInfo->m_addrRemote.Clear(); //TODO
if (connect_socket->second.real_port != SNS_DISABLED_PORT) {
pInfo->m_addrRemote.SetIPv4(network->getIP(connect_socket->second.remote_identity.GetSteamID()), connect_socket->first);
}
pInfo->m_idPOPRemote = 0;
pInfo->m_idPOPRelay = 0;
pInfo->m_eState = convert_status(connect_socket->second.status);
pInfo->m_eEndReason = 0; //TODO
pInfo->m_szEndDebug[0] = 0;
sprintf(pInfo->m_szConnectionDescription, "%u", connect_socket->first);
//Note some games might not allocate a struct the whole size of SteamNetConnectionInfo_t when calling GetConnectionInfo
//keep this in mind in future interface updates
}
void launch_callback(HSteamNetConnection m_hConn, enum connect_socket_status old_status)
{
auto connect_socket = connect_sockets.find(m_hConn);
@ -238,8 +217,14 @@ void launch_callback(HSteamNetConnection m_hConn, enum connect_socket_status old
struct SteamNetConnectionStatusChangedCallback_t data = {};
data.m_hConn = connect_socket->first;
data.m_info.m_identityRemote = connect_socket->second.remote_identity;
data.m_info.m_hListenSocket = connect_socket->second.listen_socket_id;
data.m_info.m_nUserData = connect_socket->second.user_data;
//TODO
//m_addrRemote
//m_eEndReason
data.m_info.m_eState = convert_status(connect_socket->second.status);
data.m_eOldState = convert_status(old_status);
set_steamnetconnectioninfo(connect_socket, &data.m_info);
callbacks->addCBResult(data.k_iCallback, &data, sizeof(data));
}
@ -898,7 +883,16 @@ bool GetConnectionInfo( HSteamNetConnection hConn, SteamNetConnectionInfo_t *pIn
auto connect_socket = connect_sockets.find(hConn);
if (connect_socket == connect_sockets.end()) return false;
set_steamnetconnectioninfo(connect_socket, pInfo);
pInfo->m_identityRemote = connect_socket->second.remote_identity;
pInfo->m_nUserData = connect_socket->second.user_data;
pInfo->m_hListenSocket = connect_socket->second.listen_socket_id;
pInfo->m_addrRemote.Clear(); //TODO
pInfo->m_idPOPRemote = 0;
pInfo->m_idPOPRelay = 0;
pInfo->m_eState = convert_status(connect_socket->second.status);
pInfo->m_eEndReason = 0; //TODO
pInfo->m_szEndDebug[0] = 0;
sprintf(pInfo->m_szConnectionDescription, "%u", hConn);
//Note some games might not allocate a struct the whole size of SteamNetConnectionInfo_t
//keep this in mind in future interface updates