Ejemplo n.º 1
0
        public void OnJoinLobby(LobbyEnter_t pCallback, bool bIOFailure)
        {
            if (!bIOFailure && !SteamCore.InOfflineMode())
            {
                SteamMatches.s_CurrentLobby = new SteamLobby(pCallback.m_ulSteamIDLobby);
            }

            SteamMatches.s_OnJoinLobby.Invoke(bIOFailure);
        }
Ejemplo n.º 2
0
        public static int GetLobbyMemberCount()
        {
            if (SteamCore.InOfflineMode())
            {
                return(1);
            }

            //REMOVE//if ( s_CurrentLobby.m_handle == null ) return -1;
            return(SteamMatchmaking.GetNumLobbyMembers(s_CurrentLobby.m_handle));
        }
Ejemplo n.º 3
0
        public static bool IsLobbyOwner()
        {
            if (SteamCore.InOfflineMode())
            {
                return(true);
            }

            //REMOVE//if ( s_CurrentLobby.m_handle == null ) return false;
            return((CSteamID)SteamUser.GetSteamID() == (CSteamID)SteamMatchmaking.GetLobbyOwner(s_CurrentLobby.m_handle));
        }
Ejemplo n.º 4
0
        public static bool SetLobbyMemberLimit(int MaxMembers)
        {
            if (SteamCore.InOfflineMode())
            {
                return(false);
            }
            //REMOVE//if ( s_CurrentLobby.m_handle == null ) return false;

            return(SteamMatchmaking.SetLobbyMemberLimit(s_CurrentLobby.m_handle, MaxMembers));
        }
Ejemplo n.º 5
0
        public static void SetLobbyType(int LobbyType)
        {
            if (SteamCore.InOfflineMode())
            {
                return;
            }
            //REMOVE//if ( s_CurrentLobby.m_handle == null ) return;

            ELobbyType type = IntToLobbyType(LobbyType);

            SteamMatchmaking.SetLobbyType(s_CurrentLobby.m_handle, type);
        }
Ejemplo n.º 6
0
        public static UInt64 GetMemberId(int Index)
        {
            if (SteamCore.InOfflineMode())
            {
                return(SteamCore.PlayerId());
            }

            //REMOVE//if ( s_CurrentLobby.m_handle == null ) return 0;

            CSteamID steamIDLobbyMember = (CSteamID)SteamMatchmaking.GetLobbyMemberByIndex(s_CurrentLobby.m_handle, Index);

            return((UInt64)steamIDLobbyMember);
        }
Ejemplo n.º 7
0
        public static String GetMemberName(int Index)
        {
            if (SteamCore.InOfflineMode())
            {
                return("Local player");
            }

            //REMOVE//if ( s_CurrentLobby.m_handle == null ) return "";

            CSteamID steamIDLobbyMember = (CSteamID)SteamMatchmaking.GetLobbyMemberByIndex(s_CurrentLobby.m_handle, Index);

            return(SteamFriends.GetFriendPersonaName(steamIDLobbyMember));
        }
Ejemplo n.º 8
0
        public static void SetLobbyData(string Key, string Value)
        {
            if (SteamCore.InOfflineMode())
            {
                s_LocalLobbyData[Key] = Value;
                //REMOVE//SteamStats.g_CallbackClassInstance.OnDataUpdate(null);
                return;
            }

            //REMOVE//if ( s_CurrentLobby.m_handle == null ) return;

            SteamMatchmaking.SetLobbyData(s_CurrentLobby.m_handle, Key, Value);
        }
Ejemplo n.º 9
0
        public static void SendChatMsg(string Msg)
        {
            if (SteamCore.InOfflineMode())
            {
                s_OnChatMsg.Invoke(Msg, SteamCore.PlayerId(), "player");
                return;
            }

            //REMOVE//if ( s_CurrentLobby.m_handle == null ) return;

            var bytes = StringHelper.GetBytes(Msg);

            SteamMatchmaking.SendLobbyChatMsg(s_CurrentLobby.m_handle, bytes, bytes.Length);
        }
Ejemplo n.º 10
0
        public static void JoinCreatedLobby(
            Action <bool> OnJoinLobby,
            Action <int, UInt64> OnChatUpdate,
            Action <String, UInt64, String> OnChatMsg,
            Action OnDataUpdate)
        {
            if (SteamCore.InOfflineMode())
            {
                SetLobbyCallbacks(OnJoinLobby, OnChatUpdate, OnChatMsg, OnDataUpdate);
                s_OnJoinLobby.Invoke(false);
                return;
            }

            //REMOVE//if ( s_CurrentLobby.m_handle == null ) return;

            JoinLobby(s_CurrentLobby.m_handle, OnJoinLobby, OnChatUpdate, OnChatMsg, OnDataUpdate);
        }
Ejemplo n.º 11
0
        public static string GetLobbyData(string Key)
        {
            if (SteamCore.InOfflineMode())
            {
                try
                {
                    return(s_LocalLobbyData[Key]);
                }
                catch (Exception e)
                {
                    return(e.ToString());
                }
            }

            //REMOVE//if ( s_CurrentLobby.m_handle == null ) return "";

            return(SteamMatchmaking.GetLobbyData(s_CurrentLobby.m_handle, Key));
        }
Ejemplo n.º 12
0
        public static void CreateLobby(Action <bool> OnCreateLobby, int LobbyType)
        {
            if (SteamCore.InOfflineMode())
            {
                s_LocalLobbyData = new Dictionary <String, String>();

                OnCreateLobby(false);

                return;
            }

            s_OnCreateLobby = OnCreateLobby;

            ELobbyType type = IntToLobbyType(LobbyType);

            InteropHelp.TestIfAvailableClient();
            SteamAPICall_t hSteamAPICall = (SteamAPICall_t)SteamMatchmaking.CreateLobby(type, 4);

            g_CallResultLobbyCreated = new CallResult <LobbyCreated_t>(CallbackClass.instance.OnLobbyCreated);
            g_CallResultLobbyCreated.Set(hSteamAPICall); //, SteamStats.g_CallbackClassInstance, CallbackClass.OnLobbyCreated );
        }