Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,8 @@
#include "../../Transport.h"
#include "../NGMP_include.h"


#pragma comment(lib, "ENet/enet.lib")
#include "GameNetwork/GeneralsOnline/Vendor/ValveNetworkingSockets/steam/isteamnetworkingmessages.h"

#pragma comment(lib, "ValveNetworkingSockets/GameNetworkingSockets.lib")
#pragma comment(lib, "ValveNetworkingSockets/abseil_dll.lib")
#pragma comment(lib, "ValveNetworkingSockets/libcrypto.lib")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ enum EWebSocketMessageID
NETWORK_ROOM_MARK_READY = 5,
LOBBY_CURRENT_LOBBY_UPDATE = 6,
NETWORK_ROOM_LOBBY_LIST_UPDATE = 7,
PLAYER_CONNECTION_RELAY_UPGRADE = 8,
UNUSED_PLACEHOLDER = 8, // this was relay upgrade, was removed. We can re-use it later, but service needs this placeholder
PLAYER_NAME_CHANGE = 9,
LOBBY_ROOM_CHAT_FROM_CLIENT = 10,
LOBBY_CHAT_FROM_SERVER = 11,
Expand All @@ -48,6 +48,9 @@ enum EWebSocketMessageID
NETWORK_CONNECTION_START_SIGNALLING = 17,
NETWORK_CONNECTION_DISCONNECT_PLAYER = 18,
NETWORK_CONNECTION_CLIENT_REQUEST_SIGNALLING = 19,
MATCHMAKING_ACTION_JOIN_PREARRANGED_LOBBY = 20,
MATCHMAKING_ACTION_START_GAME = 21,
MATCHMAKING_MESSAGE = 22
};

enum class EQoSRegions
Expand Down Expand Up @@ -159,7 +162,6 @@ class WebSocket
void SendData_JoinNetworkRoom(int roomID);
void SendData_LeaveNetworkRoom();
void SendData_MarkReady(bool bReady);
void SendData_ConnectionRelayUpgrade(int64_t userID);

void SendData_RequestSignalling(int64_t targetUserID);
void SendData_Signalling(int64_t targetUserID, std::vector<uint8_t> vecPayload);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,33 @@ class NGMP_OnlineServices_LobbyInterface

void SearchForLobbies(std::function<void()> onStartCallback, std::function<void(std::vector<LobbyEntry>)> onCompleteCallback);

std::function<void(std::string)> m_fnCallbackMatchmakingMessage = nullptr;
void RegisterForMatchmakingMessageCallback(std::function<void(std::string)> cb)
{
m_fnCallbackMatchmakingMessage = cb;
}
void InvokeMatchmakingMessageCallback(std::string str)
{
if (m_fnCallbackMatchmakingMessage != nullptr)
{
m_fnCallbackMatchmakingMessage(str);
}
}

void InvokeMatchmakingStartGameCallback()
{
if (m_fnCallbackMatchmakingStartGame != nullptr)
{
m_fnCallbackMatchmakingStartGame();
}
}

std::function<void()> m_fnCallbackMatchmakingStartGame = nullptr;
void RegisterForMatchmakingStartGameCallback(std::function<void()> cb)
{
m_fnCallbackMatchmakingStartGame = cb;
}

// updates
void UpdateCurrentLobby_Map(AsciiString strMap, AsciiString strMapPath, bool bIsOfficial, int newMaxPlayers);
void UpdateCurrentLobby_LimitSuperweapons(bool bLimitSuperweapons);
Expand Down Expand Up @@ -373,6 +400,7 @@ class NGMP_OnlineServices_LobbyInterface

void LeaveCurrentLobby();

LobbyEntry GetLobbyFromID(int64_t lobbyID);
LobbyEntry GetLobbyFromIndex(int index);

std::vector<LobbyEntry> m_vecLobbies;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,8 @@ struct NGMP_RoomInfo

class NetworkRoomMember : public NetworkMemberBase
{

public:
bool IsValid() const { return user_id != -1; }
};

class NGMP_OnlineServices_RoomsInterface
Expand Down Expand Up @@ -149,6 +150,20 @@ class NGMP_OnlineServices_RoomsInterface
return nullptr;
}

NetworkRoomMember GetRoomMemberFromName(const char* szTargetName)
{
// TODO_NGMP: Migrate away from this, it's slow. This game relies on names too much.
for (auto kvPair : m_mapMembers)
{
if (strcmp(kvPair.second.display_name.c_str(), szTargetName) == 0)
{
return kvPair.second;
}
}

return NetworkRoomMember();
}

std::map<uint64_t, NetworkRoomMember>& GetMembersListForCurrentRoom();

// Chat
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -438,6 +438,7 @@ class NGMP_OnlineServices_StatsInterface
{
public:
NGMP_OnlineServices_StatsInterface();
~NGMP_OnlineServices_StatsInterface();

void GetGlobalStats(std::function<void(GlobalStats)> cb);

Expand Down

This file was deleted.

Loading
Loading