Compare commits
No commits in common. "af3b7223bdcee3be1016ced9203d2cbf97fb157f" and "747f178b5626f7367cda19251d851c474d90667f" have entirely different histories.
af3b7223bd
...
747f178b56
|
@ -78,7 +78,6 @@ build_windows:
|
||||||
- DLL_FILES="$(ls ImGui/impls/windows/*.cpp | tr "\n" " ")"; sed "s|ImGui/impls/windows/\*.cpp|$DLL_FILES|g" -i *.bat
|
- DLL_FILES="$(ls ImGui/impls/windows/*.cpp | tr "\n" " ")"; sed "s|ImGui/impls/windows/\*.cpp|$DLL_FILES|g" -i *.bat
|
||||||
- DLL_FILES="$(ls dll/*.proto | tr "\n" " " | sed "s/.proto/.pb.cc/g")"; sed "s|dll/\*.cc|$DLL_FILES|g" -i *.bat
|
- DLL_FILES="$(ls dll/*.proto | tr "\n" " " | sed "s/.proto/.pb.cc/g")"; sed "s|dll/\*.cc|$DLL_FILES|g" -i *.bat
|
||||||
- DLL_FILES="$(ls steamclient_loader/*.cpp | tr "\n" " ")"; sed "s|steamclient_loader/\*.cpp|$DLL_FILES|g" -i *.bat
|
- DLL_FILES="$(ls steamclient_loader/*.cpp | tr "\n" " ")"; sed "s|steamclient_loader/\*.cpp|$DLL_FILES|g" -i *.bat
|
||||||
- sed "s| /MP12 | /MP4 |g" -i *.bat
|
|
||||||
- export WINEDEBUG=-all
|
- export WINEDEBUG=-all
|
||||||
- wine cmd /c build_win_debug_experimental.bat
|
- wine cmd /c build_win_debug_experimental.bat
|
||||||
- wine cmd /c build_win_release.bat
|
- wine cmd /c build_win_release.bat
|
||||||
|
@ -97,7 +96,6 @@ build_windows:
|
||||||
build_cmake_linux:
|
build_cmake_linux:
|
||||||
stage: build
|
stage: build
|
||||||
image: ubuntu
|
image: ubuntu
|
||||||
when: manual
|
|
||||||
|
|
||||||
before_script:
|
before_script:
|
||||||
- export DEBIAN_FRONTEND=noninteractive
|
- export DEBIAN_FRONTEND=noninteractive
|
||||||
|
@ -121,7 +119,6 @@ build_cmake_linux:
|
||||||
build_cmake_windows:
|
build_cmake_windows:
|
||||||
stage: build
|
stage: build
|
||||||
image: fedora:29
|
image: fedora:29
|
||||||
when: manual
|
|
||||||
|
|
||||||
before_script:
|
before_script:
|
||||||
- dnf -y install wine wget p7zip sed dos2unix unzip
|
- dnf -y install wine wget p7zip sed dos2unix unzip
|
||||||
|
|
|
@ -44,9 +44,6 @@ struct Connect_Socket {
|
||||||
int64 user_data;
|
int64 user_data;
|
||||||
|
|
||||||
std::queue<std::string> data;
|
std::queue<std::string> data;
|
||||||
HSteamNetPollGroup poll_group;
|
|
||||||
|
|
||||||
unsigned long long packet_receive_counter;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class Steam_Networking_Sockets :
|
class Steam_Networking_Sockets :
|
||||||
|
@ -65,9 +62,6 @@ public ISteamNetworkingSockets
|
||||||
|
|
||||||
std::vector<struct Listen_Socket> listen_sockets;
|
std::vector<struct Listen_Socket> listen_sockets;
|
||||||
std::map<HSteamNetConnection, struct Connect_Socket> connect_sockets;
|
std::map<HSteamNetConnection, struct Connect_Socket> connect_sockets;
|
||||||
std::map<HSteamNetPollGroup, std::list<HSteamNetConnection>> poll_groups;
|
|
||||||
std::chrono::steady_clock::time_point created;
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static void steam_callback(void *object, Common_Message *msg)
|
static void steam_callback(void *object, Common_Message *msg)
|
||||||
{
|
{
|
||||||
|
@ -96,8 +90,6 @@ Steam_Networking_Sockets(class Settings *settings, class Networking *network, cl
|
||||||
|
|
||||||
this->callback_results = callback_results;
|
this->callback_results = callback_results;
|
||||||
this->callbacks = callbacks;
|
this->callbacks = callbacks;
|
||||||
|
|
||||||
this->created = std::chrono::steady_clock::now();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
~Steam_Networking_Sockets()
|
~Steam_Networking_Sockets()
|
||||||
|
@ -162,7 +154,6 @@ HSteamNetConnection new_connect_socket(SteamNetworkingIdentity remote_identity,
|
||||||
socket.remote_id = remote_id;
|
socket.remote_id = remote_id;
|
||||||
socket.status = status;
|
socket.status = status;
|
||||||
socket.user_data = -1;
|
socket.user_data = -1;
|
||||||
socket.poll_group = k_HSteamNetPollGroup_Invalid;
|
|
||||||
|
|
||||||
static HSteamNetConnection socket_id;
|
static HSteamNetConnection socket_id;
|
||||||
++socket_id;
|
++socket_id;
|
||||||
|
@ -734,15 +725,13 @@ SteamNetworkingMessage_t *get_steam_message_connection(HSteamNetConnection hConn
|
||||||
pMsg->m_conn = hConn;
|
pMsg->m_conn = hConn;
|
||||||
pMsg->m_identityPeer = connect_socket->second.remote_identity;
|
pMsg->m_identityPeer = connect_socket->second.remote_identity;
|
||||||
pMsg->m_nConnUserData = connect_socket->second.user_data;
|
pMsg->m_nConnUserData = connect_socket->second.user_data;
|
||||||
pMsg->m_usecTimeReceived = std::chrono::duration_cast<std::chrono::microseconds>(std::chrono::steady_clock::now() - created).count();
|
//TODO
|
||||||
pMsg->m_nMessageNumber = connect_socket->second.packet_receive_counter;
|
//pMsg->m_usecTimeReceived =
|
||||||
++connect_socket->second.packet_receive_counter;
|
//pMsg->m_nMessageNumber =
|
||||||
|
|
||||||
pMsg->m_pfnFreeData = &free_steam_message_data;
|
pMsg->m_pfnFreeData = &free_steam_message_data;
|
||||||
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\n", hConn, size);
|
|
||||||
return pMsg;
|
return pMsg;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1034,13 +1023,7 @@ ESteamNetworkingAvailability GetAuthenticationStatus( SteamNetAuthenticationStat
|
||||||
HSteamNetPollGroup CreatePollGroup()
|
HSteamNetPollGroup CreatePollGroup()
|
||||||
{
|
{
|
||||||
PRINT_DEBUG("Steam_Networking_Sockets::CreatePollGroup\n");
|
PRINT_DEBUG("Steam_Networking_Sockets::CreatePollGroup\n");
|
||||||
std::lock_guard<std::recursive_mutex> lock(global_mutex);
|
return k_HSteamNetPollGroup_Invalid;
|
||||||
static HSteamNetPollGroup poll_group_counter;
|
|
||||||
++poll_group_counter;
|
|
||||||
|
|
||||||
HSteamNetPollGroup poll_group_number = poll_group_counter;
|
|
||||||
poll_groups[poll_group_number] = std::list<HSteamNetConnection>();
|
|
||||||
return poll_group_number;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Destroy a poll group created with CreatePollGroup().
|
/// Destroy a poll group created with CreatePollGroup().
|
||||||
|
@ -1051,21 +1034,7 @@ HSteamNetPollGroup CreatePollGroup()
|
||||||
bool DestroyPollGroup( HSteamNetPollGroup hPollGroup )
|
bool DestroyPollGroup( HSteamNetPollGroup hPollGroup )
|
||||||
{
|
{
|
||||||
PRINT_DEBUG("Steam_Networking_Sockets::DestroyPollGroup\n");
|
PRINT_DEBUG("Steam_Networking_Sockets::DestroyPollGroup\n");
|
||||||
std::lock_guard<std::recursive_mutex> lock(global_mutex);
|
|
||||||
auto group = poll_groups.find(hPollGroup);
|
|
||||||
if (group == poll_groups.end()) {
|
|
||||||
return false;
|
return false;
|
||||||
}
|
|
||||||
|
|
||||||
for (auto c : group->second) {
|
|
||||||
auto connect_socket = connect_sockets.find(c);
|
|
||||||
if (connect_socket != connect_sockets.end()) {
|
|
||||||
connect_socket->second.poll_group = k_HSteamNetPollGroup_Invalid;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
poll_groups.erase(group);
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Assign a connection to a poll group. Note that a connection may only belong to a
|
/// Assign a connection to a poll group. Note that a connection may only belong to a
|
||||||
|
@ -1084,33 +1053,8 @@ bool DestroyPollGroup( HSteamNetPollGroup hPollGroup )
|
||||||
/// is invalid (and not k_HSteamNetPollGroup_Invalid).
|
/// is invalid (and not k_HSteamNetPollGroup_Invalid).
|
||||||
bool SetConnectionPollGroup( HSteamNetConnection hConn, HSteamNetPollGroup hPollGroup )
|
bool SetConnectionPollGroup( HSteamNetConnection hConn, HSteamNetPollGroup hPollGroup )
|
||||||
{
|
{
|
||||||
PRINT_DEBUG("Steam_Networking_Sockets::SetConnectionPollGroup %u %u\n", hConn, hPollGroup);
|
PRINT_DEBUG("Steam_Networking_Sockets::SetConnectionPollGroup\n");
|
||||||
std::lock_guard<std::recursive_mutex> lock(global_mutex);
|
|
||||||
auto connect_socket = connect_sockets.find(hConn);
|
|
||||||
if (connect_socket == connect_sockets.end()) {
|
|
||||||
return false;
|
return false;
|
||||||
}
|
|
||||||
|
|
||||||
auto group = poll_groups.find(hPollGroup);
|
|
||||||
if (group == poll_groups.end() && hPollGroup != k_HSteamNetPollGroup_Invalid) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
HSteamNetPollGroup old_poll_group = connect_socket->second.poll_group;
|
|
||||||
if (old_poll_group != k_HSteamNetPollGroup_Invalid) {
|
|
||||||
auto group = poll_groups.find(hPollGroup);
|
|
||||||
if (group != poll_groups.end()) {
|
|
||||||
group->second.remove(hConn);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
connect_socket->second.poll_group = hPollGroup;
|
|
||||||
if (hPollGroup == k_HSteamNetPollGroup_Invalid) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
group->second.push_back(hConn);
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Same as ReceiveMessagesOnConnection, but will return the next messages available
|
/// Same as ReceiveMessagesOnConnection, but will return the next messages available
|
||||||
|
@ -1130,24 +1074,8 @@ bool SetConnectionPollGroup( HSteamNetConnection hConn, HSteamNetPollGroup hPoll
|
||||||
/// other connections.)
|
/// other connections.)
|
||||||
int ReceiveMessagesOnPollGroup( HSteamNetPollGroup hPollGroup, SteamNetworkingMessage_t **ppOutMessages, int nMaxMessages )
|
int ReceiveMessagesOnPollGroup( HSteamNetPollGroup hPollGroup, SteamNetworkingMessage_t **ppOutMessages, int nMaxMessages )
|
||||||
{
|
{
|
||||||
PRINT_DEBUG("Steam_Networking_Sockets::ReceiveMessagesOnPollGroup %u %i\n", hPollGroup, nMaxMessages);
|
PRINT_DEBUG("Steam_Networking_Sockets::ReceiveMessagesOnPollGroup\n");
|
||||||
std::lock_guard<std::recursive_mutex> lock(global_mutex);
|
return -1;
|
||||||
auto group = poll_groups.find(hPollGroup);
|
|
||||||
if (group == poll_groups.end()) {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
SteamNetworkingMessage_t *msg = NULL;
|
|
||||||
int messages = 0;
|
|
||||||
|
|
||||||
for (auto c : group->second) {
|
|
||||||
while ((msg = get_steam_message_connection(c)) && messages < nMaxMessages) {
|
|
||||||
ppOutMessages[messages] = msg;
|
|
||||||
++messages;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return messages;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue