Exemple #1
0
 private void OnGameJoinRequested(GameRichPresenceJoinRequested_t data)
 {
     if (OnInvitedToGame != null)
     {
         OnInvitedToGame(Get(data.SteamIDFriend), data.Connect);
     }
 }
    // EVENTS

    private void OnGameRichPresenceJoinRequested(GameRichPresenceJoinRequested_t i_Params)
    {
        CSteamID friendId = i_Params.m_steamIDFriend;

        Friend friend = Internal_GetFriend(friendId);
        string args   = i_Params.m_rgchConnect;

        Invite invite = new Invite(friend, args);

        RaiseInviteAcceptedEvent(invite);
    }
        void OnGameInviteAccepted(GameRichPresenceJoinRequested_t param)
        {
            // This callback function is activated when a steam invite has been received & we're already playing the game.
            // It is not called when the game is opened from scratch in response to an invite.

#if !DEDICATED_SERVER && LOGIN_SERVER
            if (GameManager.instance.loginServer.pendingLobbyConnect)
            {
                // this can only happen if the client's been started in response to another invite (sent when it wasn't running)
                // and has already performed the AsyncLogin & is in the process of switching rooms/lobby.  Hence we'll do
                // nothing with an in-game connect request while the other one's being handled.
                Debug.Log("SteamServices: OnGameInviteAccepted - a pending invite is already being processed, ignoring this one");
                return;
            }

            // the connect string should hold the lobby ID, lets switch to it...
            if (param.m_rgchConnect.Contains("+connect_lobby "))
            {
                var str = param.m_rgchConnect.Substring(15);
                if (!string.IsNullOrEmpty(str))
                {
                    Debug.Log("SteamServices: OnGameInviteAccepted has a '+connect_lobby' string of " + str);
                    uint lobbyID;
                    if (uint.TryParse(str, out lobbyID))
                    {
                        if (lobbyID != 0)
                        {
                            // Set the pendingLobby values, which will be handled in the Tick() loop...
                            GameManager.instance.loginServer.pendingLobbyConnect = true;
                            GameManager.instance.loginServer.pendingLobbyID      = lobbyID;
                            GameManager.instance.loginServer.pendingPassword     = string.Empty;                          // passwords are handled elsewhere
                            Debug.Log("SteamServices: OnGameInviteAccepted - pendingLobbyID set to " + lobbyID);
                        }
                        else
                        {
                            Debug.Log("SteamServices: OnGameInviteAccepted - Error: argument's lobbyID is 0");
                        }
                    }
                    else
                    {
                        Debug.Log("SteamServices: OnGameInviteAccepted failed to parse argument");
                    }
                }
                else
                {
                    Debug.Log("SteamServices: OnGameInviteAccepted was passed an empty string");
                }
            }
            else
            {
                Debug.Log("SteamServices: OnGameInviteAccepted called but not passed a '+connect_lobby' argument");
            }
#endif
        }
Exemple #4
0
        private void OnGameRichPresenceJoinRequested(GameRichPresenceJoinRequested_t callback)
        {
            uint   ip;
            ushort port;
            string password;

            if (!Connection.IsConnected && TryGetConnect(callback.m_rgchConnect, out ip, out port, out password))
            {
                //((ClientConnection)Connection).AttemptConnect(ip, port, password);
                //Todo
            }
        }
Exemple #5
0
 void OnGameRichPresenceJoinRequested(GameRichPresenceJoinRequested_t pCallback)
 {
     Debug.Log("[" + GameRichPresenceJoinRequested_t.k_iCallback + " - GameRichPresenceJoinRequested] - " + pCallback.m_steamIDFriend + " -- " + pCallback.m_rgchConnect);
 }
 private static void OnSteamGameJoinRequest(GameRichPresenceJoinRequested_t callback)
 {
     Plugin.instance.OnActivityJoin(callback.m_rgchConnect);
 }
Exemple #7
0
 void OnGameRichPresenceJoinRequested(GameRichPresenceJoinRequested_t pCallback)
 {
     Console.WriteLine("[" + GameRichPresenceJoinRequested_t.k_iCallback + " - GameRichPresenceJoinRequested] - " + pCallback.m_steamIDFriend + " -- " + pCallback.m_rgchConnect);
 }