Compare commits
No commits in common. "802d8bcc8fc33fed263b98590373a3bacaa19a9c" and "c231c873120439f14c374f274a3fe5e5660f73cc" have entirely different histories.
802d8bcc8f
...
c231c87312
|
@ -6,7 +6,7 @@ Then use my emu like you normally would. (Don't forget to put a steam_appid.txt)
|
||||||
|
|
||||||
|
|
||||||
For the LAN only connections feature:
|
For the LAN only connections feature:
|
||||||
If for some reason you want to disable this feature create a file named: disable_lan_only.txt beside the steam_api dll or inside the steam_settings folder beside the steam api dll.
|
If for some reason you want to disable this feature create a file named: disable_lan_only.txt beside the steam_api dll.
|
||||||
|
|
||||||
I noticed a lot of games seem to connect to analytics services and other crap that I hate.
|
I noticed a lot of games seem to connect to analytics services and other crap that I hate.
|
||||||
|
|
||||||
|
|
|
@ -824,7 +824,7 @@ static bool network_functions_attached = false;
|
||||||
BOOL WINAPI DllMain( HINSTANCE, DWORD dwReason, LPVOID ) {
|
BOOL WINAPI DllMain( HINSTANCE, DWORD dwReason, LPVOID ) {
|
||||||
switch ( dwReason ) {
|
switch ( dwReason ) {
|
||||||
case DLL_PROCESS_ATTACH:
|
case DLL_PROCESS_ATTACH:
|
||||||
if (!file_exists(get_full_program_path() + "disable_lan_only.txt") && !file_exists(get_full_program_path() + "\\steam_settings\\disable_lan_only.txt")) {
|
if (!file_exists(get_full_program_path() + "disable_lan_only.txt")) {
|
||||||
PRINT_DEBUG("Hooking lan only functions\n");
|
PRINT_DEBUG("Hooking lan only functions\n");
|
||||||
DetourTransactionBegin();
|
DetourTransactionBegin();
|
||||||
DetourUpdateThread( GetCurrentThread() );
|
DetourUpdateThread( GetCurrentThread() );
|
||||||
|
|
|
@ -809,20 +809,17 @@ bool SetLobbyData( CSteamID steamIDLobby, const char *pchKey, const char *pchVal
|
||||||
std::lock_guard<std::recursive_mutex> lock(global_mutex);
|
std::lock_guard<std::recursive_mutex> lock(global_mutex);
|
||||||
|
|
||||||
Lobby *lobby = get_lobby(steamIDLobby);
|
Lobby *lobby = get_lobby(steamIDLobby);
|
||||||
if (!lobby || lobby->deleted()) {
|
if (!lobby || lobby->owner() != settings->get_local_steam_id().ConvertToUint64() || lobby->deleted()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
auto result = caseinsensitive_find(lobby->values(), pchKey);
|
||||||
bool changed = true;
|
bool changed = true;
|
||||||
//callback is always triggered when setlobbydata is called from non owner however no data is actually changed.
|
if (result == lobby->values().end()) {
|
||||||
if (lobby->owner() == settings->get_local_steam_id().ConvertToUint64()) {
|
(*lobby->mutable_values())[pchKey] = pchValue;
|
||||||
auto result = caseinsensitive_find(lobby->values(), pchKey);
|
} else {
|
||||||
if (result == lobby->values().end()) {
|
if (result->second == std::string(pchValue)) changed = false;
|
||||||
(*lobby->mutable_values())[pchKey] = pchValue;
|
(*lobby->mutable_values())[result->first] = pchValue;
|
||||||
} else {
|
|
||||||
if (result->second == std::string(pchValue)) changed = false;
|
|
||||||
(*lobby->mutable_values())[result->first] = pchValue;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (changed)
|
if (changed)
|
||||||
|
|
|
@ -881,7 +881,7 @@ SteamNetworkingMessage_t *get_steam_message_connection(HSteamNetConnection hConn
|
||||||
pMsg->m_pfnRelease = &delete_steam_message;
|
pMsg->m_pfnRelease = &delete_steam_message;
|
||||||
pMsg->m_nChannel = 0;
|
pMsg->m_nChannel = 0;
|
||||||
connect_socket->second.data.pop();
|
connect_socket->second.data.pop();
|
||||||
PRINT_DEBUG("get_steam_message_connection %u %u, %u\n", hConn, size, pMsg->m_nMessageNumber);
|
PRINT_DEBUG("get_steam_message_connection %u %u\n", hConn, size);
|
||||||
return pMsg;
|
return pMsg;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -913,7 +913,6 @@ int ReceiveMessagesOnConnection( HSteamNetConnection hConn, SteamNetworkingMessa
|
||||||
++messages;
|
++messages;
|
||||||
}
|
}
|
||||||
|
|
||||||
PRINT_DEBUG("messages %u\n", messages);
|
|
||||||
return messages;
|
return messages;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2086,13 +2085,13 @@ void Callback(Common_Message *msg)
|
||||||
auto connect_socket = s->connect_sockets.find(msg->networking_sockets().connection_id());
|
auto connect_socket = s->connect_sockets.find(msg->networking_sockets().connection_id());
|
||||||
if (connect_socket != s->connect_sockets.end()) {
|
if (connect_socket != s->connect_sockets.end()) {
|
||||||
if (connect_socket->second.remote_identity.GetSteamID64() == msg->source_id() && (connect_socket->second.status == CONNECT_SOCKET_CONNECTED)) {
|
if (connect_socket->second.remote_identity.GetSteamID64() == msg->source_id() && (connect_socket->second.status == CONNECT_SOCKET_CONNECTED)) {
|
||||||
PRINT_DEBUG("Steam_Networking_Sockets: got data len %u, num %u on connection %u\n", msg->networking_sockets().data().size(), msg->networking_sockets().message_number(), connect_socket->first);
|
PRINT_DEBUG("Steam_Networking_Sockets: got data len %u on connection %u\n", msg->networking_sockets().data().size(), connect_socket->first);
|
||||||
connect_socket->second.data.push(msg->networking_sockets());
|
connect_socket->second.data.push(msg->networking_sockets());
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
connect_socket = std::find_if(s->connect_sockets.begin(), s->connect_sockets.end(), [msg](const auto &in) {return in.second.remote_identity.GetSteamID64() == msg->source_id() && (in.second.status == CONNECT_SOCKET_NOT_ACCEPTED || in.second.status == CONNECT_SOCKET_CONNECTED) && in.second.remote_id == msg->networking_sockets().connection_id_from();});
|
connect_socket = std::find_if(s->connect_sockets.begin(), s->connect_sockets.end(), [msg](const auto &in) {return in.second.remote_identity.GetSteamID64() == msg->source_id() && (in.second.status == CONNECT_SOCKET_NOT_ACCEPTED || in.second.status == CONNECT_SOCKET_CONNECTED) && in.second.remote_id == msg->networking_sockets().connection_id_from();});
|
||||||
if (connect_socket != s->connect_sockets.end()) {
|
if (connect_socket != s->connect_sockets.end()) {
|
||||||
PRINT_DEBUG("Steam_Networking_Sockets: got data len %u, num %u on not accepted connection %u\n", msg->networking_sockets().data().size(), msg->networking_sockets().message_number(), connect_socket->first);
|
PRINT_DEBUG("Steam_Networking_Sockets: got data len %u on not accepted connection %u\n", msg->networking_sockets().data().size(), connect_socket->first);
|
||||||
connect_socket->second.data.push(msg->networking_sockets());
|
connect_socket->second.data.push(msg->networking_sockets());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue