Esempio n. 1
0
 //-----------------------------------------------------------------------------
 // Purpose: Handle clients connecting
 //-----------------------------------------------------------------------------
 void OnP2PSessionRequest(P2PSessionRequest_t pCallback)
 {
     Logging.BMSLog.Log("OnP2PSesssionRequest Called steamIDRemote: " + pCallback.m_steamIDRemote);
     // we'll accept a connection from anyone
     if (AcceptingConnections)
     {
         SteamNetworking.AcceptP2PSessionWithUser(pCallback.m_steamIDRemote);
     }
 }
Esempio n. 2
0
        private void OnP2PSessionRequest(P2PSessionRequest_t result)
        {
            CSteamID mSteamIDRemote = result.m_steamIDRemote;

            if (this._connectionStateMap.ContainsKey(mSteamIDRemote) && this._connectionStateMap[mSteamIDRemote] != NetSocialModule.ConnectionState.Inactive)
            {
                SteamNetworking.AcceptP2PSessionWithUser(mSteamIDRemote);
            }
        }
        private void OnP2PSessionRequest(P2PSessionRequest_t result)
        {
            CSteamID steamIDRemote = result.m_steamIDRemote;

            if (_connectionStateMap.ContainsKey(steamIDRemote) && _connectionStateMap[steamIDRemote] != 0)
            {
                SteamNetworking.AcceptP2PSessionWithUser(steamIDRemote);
            }
        }
Esempio n. 4
0
        /// <summary>
        /// Callback for SteamNetworking.OnP2PSessionRequest
        /// Accepts all incoming connections
        /// </summary>
        /// <param name="requestorSteamId">Incoming P2P request</param>
        private void OnP2PSessionRequest(SteamId requestorSteamId)
        {
            // TODO:  Add logic to check/filter incoming P2Prequests?

            if (!SteamNetworking.AcceptP2PSessionWithUser(requestorSteamId))
            {
                Logging.BMSLog.LogWarning("Could not accept P2P Session with User: " + requestorSteamId.Value);
            }
        }
Esempio n. 5
0
        private void OnP2PSessionRequest(P2PSessionRequest_t request)
        {
            // if (LogHelper.CurrentLogLevel <= LogLevel.Developer) LogHelper.LogInfo("SteamP2PTransport - OnP2PSessionRequest - m_steamIDRemote: " + request.m_steamIDRemote);

            CSteamID userId = request.m_steamIDRemote;

            //Todo: Might want to check if we expect the user before just accepting it.
            SteamNetworking.AcceptP2PSessionWithUser(userId);
        }
Esempio n. 6
0
 void OnNewConnection(P2PSessionRequest_t result)
 {
     //Debug.Log("Wa");
     if (Array.IndexOf(Sender.TOmb, result.m_steamIDRemote) != -1)
     {
         hassession = SteamNetworking.AcceptP2PSessionWithUser(result.m_steamIDRemote);
         return;
     }
 }
        /// <summary>
        /// Callback for SteamNetworking.OnP2PSessionRequest
        /// Currently accepts all P2PSession requests
        /// </summary>
        /// <param name="requestorSteamId">Server SteamId</param>
        private void OnP2PSessionRequest(SteamId requestorSteamId)
        {
            // TODO:  Add in logic to check that the P2PSession request comes from the server

            if (!SteamNetworking.AcceptP2PSessionWithUser(requestorSteamId))
            {
                Logging.BMSLog.LogWarning("Could not accept P2P Session with User: " + requestorSteamId.Value);
            }
        }
Esempio n. 8
0
    void OnP2PSessionRequest(P2PSessionRequest_t pCallback)
    {
        Debug.Log("[" + P2PSessionRequest_t.k_iCallback + " - P2PSessionRequest] - " + pCallback.m_steamIDRemote);

        bool ret = SteamNetworking.AcceptP2PSessionWithUser(pCallback.m_steamIDRemote);

        print("SteamNetworking.AcceptP2PSessionWithUser(" + pCallback.m_steamIDRemote + ") - " + ret);

        m_RemoteSteamId = pCallback.m_steamIDRemote;
    }
Esempio n. 9
0
        private void OnP2PSessionRequest(SteamId userId)
        {
            if (NetworkLog.CurrentLogLevel <= LogLevel.Developer)
            {
                NetworkLog.LogInfo("SteamP2PTransport - OnP2PSessionRequest - m_steamIDRemote: " + userId);
            }

            //Todo: Might want to check if we expect the user before just accepting it.
            SteamNetworking.AcceptP2PSessionWithUser(userId);
        }
        private void OnP2PSessionRequest(P2PSessionRequest_t result)
        {
            CSteamID steamIdRemote = (CSteamID)result.m_steamIDRemote;

            if (!this._connectionStateMap.ContainsKey(steamIdRemote) || this._connectionStateMap[steamIdRemote] == NetSocialModule.ConnectionState.Inactive)
            {
                return;
            }
            SteamNetworking.AcceptP2PSessionWithUser(steamIdRemote);
        }
Esempio n. 11
0
        void OnP2PSessionRequest(P2PSessionRequest_t pCallback)
        {
            Console.WriteLine("[OnP2PSessionRequest] -- Got session request from {0}", pCallback.m_steamIDRemote);

            bool ok = SteamNetworking.AcceptP2PSessionWithUser(pCallback.m_steamIDRemote);

            Console.WriteLine("[OnP2PSessionRequest] -- Accept ok: {0}", ok);

            m_RemoteSteamID = pCallback.m_steamIDRemote;
        }
Esempio n. 12
0
    private void OnP2PSessionRequest(P2PSessionRequest_t pCallback, bool bIOFailure)
    {
        Debug.Log("[" + P2PSessionRequest_t.k_iCallback + " - P2PSessionRequest] - " + pCallback.m_steamIDRemote);

        bool ret = SteamNetworking.AcceptP2PSessionWithUser(pCallback.m_steamIDRemote);

        Debug.Log("SteamNetworking.AcceptP2PSessionWithUser(" + pCallback.m_steamIDRemote + ") - " + ret);
        //add this to the list of id's we have accepted
        m_AcceptedIDs.Add(pCallback.m_steamIDRemote);
    }
Esempio n. 13
0
 void OnNewConnection(P2PSessionRequest_t result)
 {
     foreach (CSteamID id in lobby_members_)
     {
         if (id == result.m_steamIDRemote)
         {
             SteamNetworking.AcceptP2PSessionWithUser(result.m_steamIDRemote);
             return;
         }
     }
 }
Esempio n. 14
0
 public void OnP2PSessionRequest(P2PSessionRequest_t callback)
 {
     if (!SteamNetworking.AcceptP2PSessionWithUser(callback.m_steamIDRemote))
     {
         LogUtils.Debug("Failde to accept P2P Request: " + callback.m_steamIDRemote);
     }
     else
     {
         LogUtils.Debug("Accepted P2P Request: " + callback.m_steamIDRemote);
     }
 }
Esempio n. 15
0
 //------------    ACCEPT OR REJECT INCOMING CONNECTION    ------------
 private void OnP2PSessionRequest(P2PSessionRequest_t request)
 {
     if (request.m_steamIDRemote.Equals(_globals.HostId) || _globals.UserIds.Contains(request.m_steamIDRemote))
     {
         SteamNetworking.AcceptP2PSessionWithUser(request.m_steamIDRemote);
     }
     else
     {
         GD.Print($"A connection was just rejected from {request.m_steamIDRemote}.");
     }
 }
Esempio n. 16
0
 protected override void OnNewConnection(SteamId id)
 {
     if (hostSteamID == id)
     {
         SteamNetworking.AcceptP2PSessionWithUser(id);
     }
     else
     {
         Debug.LogError("P2P Acceptance Request from unknown host ID.");
     }
 }
Esempio n. 17
0
 protected override void OnNewConnection(P2PSessionRequest_t result)
 {
     if (hostSteamID == result.m_steamIDRemote)
     {
         SteamNetworking.AcceptP2PSessionWithUser(result.m_steamIDRemote);
     }
     else
     {
         Debug.LogError("P2P Acceptance Request from unknown host ID.");
     }
 }
Esempio n. 18
0
 private void OnP2PSessionRequest(SteamId id)
 {
     if (id != ServerId)
     {
         MelonModLogger.LogError("Got a P2P session request from something that is not the server.");
     }
     else
     {
         SteamNetworking.AcceptP2PSessionWithUser(id);
     }
 }
Esempio n. 19
0
 // Token: 0x060009A4 RID: 2468 RVA: 0x0004673C File Offset: 0x0004493C
 private static void OnSessionRequest(P2PSessionRequest_t data)
 {
     ZLog.Log("Got session request from " + data.m_steamIDRemote);
     if (SteamNetworking.AcceptP2PSessionWithUser(data.m_steamIDRemote))
     {
         ZSteamSocketOLD listner = ZSteamSocketOLD.GetListner();
         if (listner != null)
         {
             listner.QueuePendingConnection(data.m_steamIDRemote);
         }
     }
 }
 // ----------- ACCEPT OR REJECT INCOMING CONNECTION -----------
 public void OnP2PSessionRequest(P2PSessionRequest_t request)
 {
     if (request.m_steamIDRemote == global.player1 || request.m_steamIDRemote == global.player2)
     {
         SteamNetworking.AcceptP2PSessionWithUser(request.m_steamIDRemote);
         GD.Print("You have accepted incoming connection from " + SteamFriends.GetFriendPersonaName(request.m_steamIDRemote));
     }
     else
     {
         GD.Print("A connection was just rejected from " + request.m_steamIDRemote + ".");
     }
 }
Esempio n. 21
0
        private void OnP2PSessionRequest(P2PSessionRequest_t request)
        {
            if (NetworkingManager.Singleton.LogLevel <= LogLevel.Developer)
            {
                UnityEngine.Debug.Log("SteamP2PTransport - OnP2PSessionRequest - m_steamIDRemote: " + request.m_steamIDRemote);
            }

            CSteamID userId = request.m_steamIDRemote;

            //Todo: Might want to check if we expect the user before just accepting it.
            SteamNetworking.AcceptP2PSessionWithUser(userId);
        }
Esempio n. 22
0
    void OnP2PSessionRequest(P2PSessionRequest_t request)
    {
        CSteamID clientId = request.m_steamIDRemote;

        // if (SteamNetworking)
        // {
        SteamNetworking.AcceptP2PSessionWithUser(clientId);
        // }
        // else
        // {
        //     Debug.LogWarning("Unexpected session request from " + clientId);
        // }
    }
Esempio n. 23
0
        protected override void OnNewConnectionInternal(P2PSessionRequest_t result)
        {
            Debug.Log("OnNewConnectionInternal in client");

            if (hostSteamID == result.m_steamIDRemote)
            {
                SteamNetworking.AcceptP2PSessionWithUser(result.m_steamIDRemote);
            }
            else
            {
                Debug.LogError("");
            }
        }
Esempio n. 24
0
        protected override void OnNewConnectionInternal(SteamId id)
        {
            Debug.Log("OnNewConnectionInternal in client");

            if (hostSteamID == id)
            {
                SteamNetworking.AcceptP2PSessionWithUser(id);
            }
            else
            {
                Debug.LogError("");
            }
        }
Esempio n. 25
0
        private void OnP2PSessionRequest(P2PSessionRequest_t request)
        {
            CSteamID clientId = request.m_steamIDRemote;

            if (IsExpectingClient(clientId))
            {
                SteamNetworking.AcceptP2PSessionWithUser(clientId);
            }
            else
            {
                Debug.LogWarning("Unexpected session request from " + clientId);
            }
        }
 /// <summary>
 /// Callback for SteamNetworking.OnP2PSessionRequest
 /// Accepts all incoming connections
 /// </summary>
 /// <param name="requestorSteamId">Incoming P2P request</param>
 private void OnP2PSessionRequest(SteamId requestorSteamId)
 {
     if (AcceptingConnections)
     {
         if (!SteamNetworking.AcceptP2PSessionWithUser(requestorSteamId))
         {
             Logging.BMSLog.LogWarning("Could not accept P2P Session with user: "******"P2P Request received but server is not accepting connections");
     }
 }
Esempio n. 27
0
    void OnP2PSessionRequested(P2PSessionRequest_t pCallback)
    {
        Debug.Log("P2P session request received");

        var member = pCallback.m_steamIDRemote;

        if (NetworkServer.active && SteamNetworkManager.Instance.IsMemberInSteamLobby(member))
        {
            // Accept the connection if this user is in the lobby
            Debug.Log("P2P connection accepted");
            SteamNetworking.AcceptP2PSessionWithUser(member);

            CreateP2PConnectionWithPeer(member);
        }
    }
Esempio n. 28
0
        private void OnP2PSessionRequest(P2PSessionRequest_t result)
        {
            //IL_0010: Unknown result type (might be due to invalid IL or missing references)
            //IL_0011: Unknown result type (might be due to invalid IL or missing references)
            //IL_0016: Unknown result type (might be due to invalid IL or missing references)
            //IL_001d: Unknown result type (might be due to invalid IL or missing references)
            //IL_002b: Unknown result type (might be due to invalid IL or missing references)
            //IL_0033: Unknown result type (might be due to invalid IL or missing references)
            WeGameHelper.WriteDebugString(" OnP2PSessionRequest");
            CSteamID steamIDRemote = result.m_steamIDRemote;

            if (_connectionStateMap.ContainsKey(steamIDRemote) && _connectionStateMap[steamIDRemote] != 0)
            {
                SteamNetworking.AcceptP2PSessionWithUser(steamIDRemote);
            }
        }
        private void OnP2PSessionRequest(P2PSessionRequest_t request)
        {
            if (NetworkManager.Singleton.LogLevel <= LogLevel.Developer)
            {
                NetworkLog.LogInfoServer(nameof(SteamNetworkingTransport) + " - OnP2PSessionRequest - m_steamIDRemote: " + request.m_steamIDRemote);
            }

            CSteamID userId = request.m_steamIDRemote;

            //Todo: Might want to check if we expect the user before just accepting it.
#if UNITY_SERVER
            SteamGameServerNetworking.AcceptP2PSessionWithUser(userId);
#else
            SteamNetworking.AcceptP2PSessionWithUser(userId);
#endif
        }
Esempio n. 30
0
            public void OnStateEnter()
            {
                if (!SteamAPI.Init())
                {
                    DialogResult eResult = MessageBox.Show("Coult not initialize Steam API...\n" +
                                                           "Make sure Steam is not closed\n" +
                                                           "What do you want to do?\n" +
                                                           "Press OK to get back to Main Menu\n" +
                                                           "Press Cancel to Abort the Game.",
                                                           "Steam API Error!", MessageBoxButtons.OKCancel, MessageBoxIcon.Error);

                    if (eResult == DialogResult.OK)
                    {
                        //go back to main menu!
                    }
                    else
                    {
                    }
                }

                SteamMatchmaking.AddRequestLobbyListStringFilter("name", "Glukosesirup's game", ELobbyComparison.k_ELobbyComparisonEqual);

                //Creation and management of lobby, the lobbies created must be set with SteamMatchmackig.SetData();
                lobbyCreated = Callback <LobbyCreated_t> .Create(OnLobbyCreated);

                lobbyList = Callback <LobbyMatchList_t> .Create(OnGetLobbiesList);

                lobbyEnter = Callback <LobbyEnter_t> .Create(OnLobbyEntered);

                lobbyChatMsg = Callback <LobbyChatMsg_t> .Create(OnLobbyChatMsg);

                connectionInfo = Callback <P2PSessionRequest_t> .Create(OnNewP2PConnection);


                //To accept a P2P connection
                Callback <P2PSessionRequest_t> .Create(cb =>
                {
                    SteamNetworking.AcceptP2PSessionWithUser(cb.m_steamIDRemote);
                }
                                                       );

                //SteamMatchmaking.RequestLobbyList();

                //start multiplayer game, look for lobbies, if no lobbies are found then create a single lobby and join it
            }