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); }
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)); }
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)); }
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)); }
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); }
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); }
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)); }
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); }
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); }
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); }
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)); }
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 ); }