online game working
This commit is contained in:
@@ -121,6 +121,27 @@ namespace MegaKoop.Game.Networking
|
||||
p2pTransport?.Send(target, type, payload, sendType);
|
||||
}
|
||||
|
||||
public void SynchronizeWithLobby(MegaKoop.Steam.SteamLobbyService steamService)
|
||||
{
|
||||
if (steamService == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
isConnected = steamService.IsInLobby;
|
||||
isHost = steamService.IsHost;
|
||||
|
||||
#if STEAMWORKSNET
|
||||
if (steamService.IsInLobby && p2pTransport != null)
|
||||
{
|
||||
if (ulong.TryParse(steamService.LobbyIdString, out ulong lobbyValue) && lobbyValue != 0)
|
||||
{
|
||||
p2pTransport.SetActiveLobby(new CSteamID(lobbyValue));
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
private void DispatchMessage(NetworkMessage message)
|
||||
{
|
||||
if (handlers.TryGetValue(message.Type, out Action<NetworkMessage> handler))
|
||||
|
||||
Reference in New Issue
Block a user