示例#1
0
        public async Task SendMessageToPeers(Message message, bool IsAlsoInternalMessage = true)
        {
            await JSRuntime.InvokeVoidAsync("sendMessageToAllPeers", message);

            if (IsAlsoInternalMessage)
            {
                OnNewGameMessage?.Invoke(message);
            }
        }
示例#2
0
 public PeerConnection(IJSRuntime jSRuntime)
 {
     JSRuntime    = jSRuntime;
     OnNewMessage = (message) => OnNewGameMessage?.Invoke(message);
     OnSetPeerID  = (peerID) => PeerID = peerID;
 }