Ejemplo n.º 1
0
 public static IntPtr GetISteamGameServerStats(HSteamUser hSteamuser, HSteamPipe hSteamPipe, string pchVersion)
 {
     InteropHelp.TestIfAvailableGameServer();
     using InteropHelp.UTF8StringHandle pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion);
     return(NativeMethods.ISteamClient_GetISteamGameServerStats(CSteamGameServerAPIContext.GetSteamClient(), hSteamuser, hSteamPipe, pchVersion2));
 }
Ejemplo n.º 2
0
 /// <summary>
 /// <para> Releases a previously created communications pipe</para>
 /// <para> NOT THREADSAFE - ensure that no other threads are accessing Steamworks API when calling</para>
 /// </summary>
 public static bool BReleaseSteamPipe(HSteamPipe hSteamPipe)
 {
     InteropHelp.TestIfAvailableClient();
     return(NativeMethods.ISteamClient_BReleaseSteamPipe(CSteamAPIContext.GetSteamClient(), hSteamPipe));
 }
Ejemplo n.º 3
0
 public static bool BReleaseSteamPipe(HSteamPipe hSteamPipe) => default;         // 0x000000018094A4E0-0x000000018094A530
 public static HSteamUser ConnectToGlobalUser(HSteamPipe hSteamPipe) => default; // 0x000000018094A580-0x000000018094A5E0
 /// <summary>
 /// <para> returns the ISteamUtils interface</para>
 /// </summary>
 public static IntPtr GetISteamUtils(HSteamPipe hSteamPipe, string pchVersion)
 {
     InteropHelp.TestIfAvailableClient();
     return(NativeMethods.ISteamClient_GetISteamUtils(hSteamPipe, pchVersion));
 }
        internal bool BReleaseSteamPipe(HSteamPipe hSteamPipe)
        {
            var returnValue = _BReleaseSteamPipe(Self, hSteamPipe);

            return(returnValue);
        }
 private static extern IntPtr _GetISteamRemotePlay(IntPtr self, HSteamUser hSteamUser, HSteamPipe hSteamPipe, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(Utf8StringToNative))] string pchVersion);
Ejemplo n.º 7
0
        internal static bool Init()
        {
            HSteamUser hSteamUser = SteamAPI.GetHSteamUser();
            HSteamPipe hSteamPipe = SteamAPI.GetHSteamPipe();

            if (hSteamPipe == (HSteamPipe)0)
            {
                return(false);
            }
            using (InteropHelp.UTF8StringHandle ver = new InteropHelp.UTF8StringHandle("SteamClient020"))
            {
                m_pSteamClient = NativeMethods.SteamInternal_CreateInterface(ver);
            }
            if (m_pSteamClient == IntPtr.Zero)
            {
                return(false);
            }
            m_pSteamUser = SteamClient.GetISteamUser(hSteamUser, hSteamPipe, "SteamUser021");
            if (m_pSteamUser == IntPtr.Zero)
            {
                return(false);
            }
            m_pSteamFriends = SteamClient.GetISteamFriends(hSteamUser, hSteamPipe, "SteamFriends017");
            if (m_pSteamFriends == IntPtr.Zero)
            {
                return(false);
            }
            m_pSteamUtils = SteamClient.GetISteamUtils(hSteamPipe, "SteamUtils009");
            if (m_pSteamUtils == IntPtr.Zero)
            {
                return(false);
            }
            m_pSteamMatchmaking = SteamClient.GetISteamMatchmaking(hSteamUser, hSteamPipe, "SteamMatchMaking009");
            if (m_pSteamMatchmaking == IntPtr.Zero)
            {
                return(false);
            }
            m_pSteamMatchmakingServers = SteamClient.GetISteamMatchmakingServers(hSteamUser, hSteamPipe, "SteamMatchMakingServers002");
            if (m_pSteamMatchmakingServers == IntPtr.Zero)
            {
                return(false);
            }
            m_pSteamUserStats = SteamClient.GetISteamUserStats(hSteamUser, hSteamPipe, "STEAMUSERSTATS_INTERFACE_VERSION012");
            if (m_pSteamUserStats == IntPtr.Zero)
            {
                return(false);
            }
            m_pSteamApps = SteamClient.GetISteamApps(hSteamUser, hSteamPipe, "STEAMAPPS_INTERFACE_VERSION008");
            if (m_pSteamApps == IntPtr.Zero)
            {
                return(false);
            }
            m_pSteamNetworking = SteamClient.GetISteamNetworking(hSteamUser, hSteamPipe, "SteamNetworking006");
            if (m_pSteamNetworking == IntPtr.Zero)
            {
                return(false);
            }
            m_pSteamRemoteStorage = SteamClient.GetISteamRemoteStorage(hSteamUser, hSteamPipe, "STEAMREMOTESTORAGE_INTERFACE_VERSION014");
            if (m_pSteamRemoteStorage == IntPtr.Zero)
            {
                return(false);
            }
            m_pSteamScreenshots = SteamClient.GetISteamScreenshots(hSteamUser, hSteamPipe, "STEAMSCREENSHOTS_INTERFACE_VERSION003");
            if (m_pSteamScreenshots == IntPtr.Zero)
            {
                return(false);
            }
            m_pSteamGameSearch = SteamClient.GetISteamGameSearch(hSteamUser, hSteamPipe, "SteamMatchGameSearch001");
            if (m_pSteamGameSearch == IntPtr.Zero)
            {
                return(false);
            }
            m_pSteamHTTP = SteamClient.GetISteamHTTP(hSteamUser, hSteamPipe, "STEAMHTTP_INTERFACE_VERSION003");
            if (m_pSteamHTTP == IntPtr.Zero)
            {
                return(false);
            }
            m_pController = SteamClient.GetISteamController(hSteamUser, hSteamPipe, "SteamController007");
            if (m_pController == IntPtr.Zero)
            {
                return(false);
            }
            m_pSteamUGC = SteamClient.GetISteamUGC(hSteamUser, hSteamPipe, "STEAMUGC_INTERFACE_VERSION014");
            if (m_pSteamUGC == IntPtr.Zero)
            {
                return(false);
            }
            m_pSteamAppList = SteamClient.GetISteamAppList(hSteamUser, hSteamPipe, "STEAMAPPLIST_INTERFACE_VERSION001");
            if (m_pSteamAppList == IntPtr.Zero)
            {
                return(false);
            }
            m_pSteamMusic = SteamClient.GetISteamMusic(hSteamUser, hSteamPipe, "STEAMMUSIC_INTERFACE_VERSION001");
            if (m_pSteamMusic == IntPtr.Zero)
            {
                return(false);
            }
            m_pSteamMusicRemote = SteamClient.GetISteamMusicRemote(hSteamUser, hSteamPipe, "STEAMMUSICREMOTE_INTERFACE_VERSION001");
            if (m_pSteamMusicRemote == IntPtr.Zero)
            {
                return(false);
            }
            m_pSteamHTMLSurface = SteamClient.GetISteamHTMLSurface(hSteamUser, hSteamPipe, "STEAMHTMLSURFACE_INTERFACE_VERSION_005");
            if (m_pSteamHTMLSurface == IntPtr.Zero)
            {
                return(false);
            }
            m_pSteamInventory = SteamClient.GetISteamInventory(hSteamUser, hSteamPipe, "STEAMINVENTORY_INTERFACE_V003");
            if (m_pSteamInventory == IntPtr.Zero)
            {
                return(false);
            }
            m_pSteamVideo = SteamClient.GetISteamVideo(hSteamUser, hSteamPipe, "STEAMVIDEO_INTERFACE_V002");
            if (m_pSteamVideo == IntPtr.Zero)
            {
                return(false);
            }
            m_pSteamParentalSettings = SteamClient.GetISteamParentalSettings(hSteamUser, hSteamPipe, "STEAMPARENTALSETTINGS_INTERFACE_VERSION001");
            if (m_pSteamParentalSettings == IntPtr.Zero)
            {
                return(false);
            }
            m_pSteamInput = SteamClient.GetISteamInput(hSteamUser, hSteamPipe, "SteamInput001");
            if (m_pSteamInput == IntPtr.Zero)
            {
                return(false);
            }
            m_pSteamParties = SteamClient.GetISteamParties(hSteamUser, hSteamPipe, "SteamParties002");
            if (m_pSteamParties == IntPtr.Zero)
            {
                return(false);
            }
            m_pSteamRemotePlay = SteamClient.GetISteamRemotePlay(hSteamUser, hSteamPipe, "STEAMREMOTEPLAY_INTERFACE_VERSION001");
            if (m_pSteamRemotePlay == IntPtr.Zero)
            {
                return(false);
            }
            using (InteropHelp.UTF8StringHandle pszVersion = new InteropHelp.UTF8StringHandle("SteamNetworkingUtils003"))
            {
                m_pSteamNetworkingUtils = ((NativeMethods.SteamInternal_FindOrCreateUserInterface(hSteamUser, pszVersion) != IntPtr.Zero) ? NativeMethods.SteamInternal_FindOrCreateUserInterface(hSteamUser, pszVersion) : NativeMethods.SteamInternal_FindOrCreateGameServerInterface(hSteamUser, pszVersion));
            }
            if (m_pSteamNetworkingUtils == IntPtr.Zero)
            {
                return(false);
            }
            using (InteropHelp.UTF8StringHandle pszVersion2 = new InteropHelp.UTF8StringHandle("SteamNetworkingSockets008"))
            {
                m_pSteamNetworkingSockets = NativeMethods.SteamInternal_FindOrCreateUserInterface(hSteamUser, pszVersion2);
            }
            if (m_pSteamNetworkingSockets == IntPtr.Zero)
            {
                return(false);
            }
            return(true);
        }
Ejemplo n.º 8
0
 /// <summary>
 /// <para> removes an allocated user</para>
 /// <para> NOT THREADSAFE - ensure that no other threads are accessing Steamworks API when calling</para>
 /// </summary>
 public static void ReleaseUser(HSteamPipe hSteamPipe, HSteamUser hUser)
 {
     InteropHelp.TestIfAvailableClient();
     NativeMethods.ISteamClient_ReleaseUser(CSteamAPIContext.GetSteamClient(), hSteamPipe, hUser);
 }
Ejemplo n.º 9
0
 internal static extern bool SteamAPI_ManualDispatch_GetNextCallback(HSteamPipe pipe, [In, Out] ref CallbackMsg_t msg);
Ejemplo n.º 10
0
 internal static extern bool SteamAPI_ManualDispatch_FreeLastCallback(HSteamPipe pipe);
Ejemplo n.º 11
0
 internal static extern void SteamAPI_ManualDispatch_RunFrame(HSteamPipe pipe);
Ejemplo n.º 12
0
        internal static bool Init()
        {
            HSteamUser hSteamUser = SteamAPI.GetHSteamUser();
            HSteamPipe hSteamPipe = SteamAPI.GetHSteamPipe();

            if (hSteamPipe == (HSteamPipe)0)
            {
                return(false);
            }

            using (var pchVersionString = new InteropHelp.UTF8StringHandle(Constants.STEAMCLIENT_INTERFACE_VERSION)) {
                m_pSteamClient = NativeMethods.SteamInternal_CreateInterface(pchVersionString);
            }

            if (m_pSteamClient == IntPtr.Zero)
            {
                return(false);
            }

            m_pSteamUser = SteamClient.GetISteamUser(hSteamUser, hSteamPipe, Constants.STEAMUSER_INTERFACE_VERSION);
            if (m_pSteamUser == IntPtr.Zero)
            {
                return(false);
            }

            m_pSteamFriends = SteamClient.GetISteamFriends(hSteamUser, hSteamPipe, Constants.STEAMFRIENDS_INTERFACE_VERSION);
            if (m_pSteamFriends == IntPtr.Zero)
            {
                return(false);
            }

            m_pSteamUtils = SteamClient.GetISteamUtils(hSteamPipe, Constants.STEAMUTILS_INTERFACE_VERSION);
            if (m_pSteamUtils == IntPtr.Zero)
            {
                return(false);
            }

            m_pSteamMatchmaking = SteamClient.GetISteamMatchmaking(hSteamUser, hSteamPipe, Constants.STEAMMATCHMAKING_INTERFACE_VERSION);
            if (m_pSteamMatchmaking == IntPtr.Zero)
            {
                return(false);
            }

            m_pSteamMatchmakingServers = SteamClient.GetISteamMatchmakingServers(hSteamUser, hSteamPipe, Constants.STEAMMATCHMAKINGSERVERS_INTERFACE_VERSION);
            if (m_pSteamMatchmakingServers == IntPtr.Zero)
            {
                return(false);
            }

            m_pSteamUserStats = SteamClient.GetISteamUserStats(hSteamUser, hSteamPipe, Constants.STEAMUSERSTATS_INTERFACE_VERSION);
            if (m_pSteamUserStats == IntPtr.Zero)
            {
                return(false);
            }

            m_pSteamApps = SteamClient.GetISteamApps(hSteamUser, hSteamPipe, Constants.STEAMAPPS_INTERFACE_VERSION);
            if (m_pSteamApps == IntPtr.Zero)
            {
                return(false);
            }

            m_pSteamNetworking = SteamClient.GetISteamNetworking(hSteamUser, hSteamPipe, Constants.STEAMNETWORKING_INTERFACE_VERSION);
            if (m_pSteamNetworking == IntPtr.Zero)
            {
                return(false);
            }

            m_pSteamRemoteStorage = SteamClient.GetISteamRemoteStorage(hSteamUser, hSteamPipe, Constants.STEAMREMOTESTORAGE_INTERFACE_VERSION);
            if (m_pSteamRemoteStorage == IntPtr.Zero)
            {
                return(false);
            }

            m_pSteamScreenshots = SteamClient.GetISteamScreenshots(hSteamUser, hSteamPipe, Constants.STEAMSCREENSHOTS_INTERFACE_VERSION);
            if (m_pSteamScreenshots == IntPtr.Zero)
            {
                return(false);
            }

            m_pSteamHTTP = SteamClient.GetISteamHTTP(hSteamUser, hSteamPipe, Constants.STEAMHTTP_INTERFACE_VERSION);
            if (m_pSteamHTTP == IntPtr.Zero)
            {
                return(false);
            }

            // Unified Messages are deprecated in latest Steamworks.  Additionally, this API fails to initialize on Mac platforms.
            // If this problem should become evident on other platforms, it may be wise to remove this entire section of code for
            // those platforms (if not all) as well.
            #if !UNITY_EDITOR_OSX && !UNITY_STANDALONE_OSX
            m_pSteamUnifiedMessages = SteamClient.GetISteamUnifiedMessages(hSteamUser, hSteamPipe, Constants.STEAMUNIFIEDMESSAGES_INTERFACE_VERSION);
            if (m_pSteamUnifiedMessages == IntPtr.Zero)
            {
                return(false);
            }
            #endif

            m_pController = SteamClient.GetISteamController(hSteamUser, hSteamPipe, Constants.STEAMCONTROLLER_INTERFACE_VERSION);
            if (m_pController == IntPtr.Zero)
            {
                return(false);
            }

            m_pSteamUGC = SteamClient.GetISteamUGC(hSteamUser, hSteamPipe, Constants.STEAMUGC_INTERFACE_VERSION);
            if (m_pSteamUGC == IntPtr.Zero)
            {
                return(false);
            }

            m_pSteamAppList = SteamClient.GetISteamAppList(hSteamUser, hSteamPipe, Constants.STEAMAPPLIST_INTERFACE_VERSION);
            if (m_pSteamAppList == IntPtr.Zero)
            {
                return(false);
            }

            m_pSteamMusic = SteamClient.GetISteamMusic(hSteamUser, hSteamPipe, Constants.STEAMMUSIC_INTERFACE_VERSION);
            if (m_pSteamMusic == IntPtr.Zero)
            {
                return(false);
            }

            m_pSteamMusicRemote = SteamClient.GetISteamMusicRemote(hSteamUser, hSteamPipe, Constants.STEAMMUSICREMOTE_INTERFACE_VERSION);
            if (m_pSteamMusicRemote == IntPtr.Zero)
            {
                return(false);
            }

            m_pSteamHTMLSurface = SteamClient.GetISteamHTMLSurface(hSteamUser, hSteamPipe, Constants.STEAMHTMLSURFACE_INTERFACE_VERSION);
            if (m_pSteamHTMLSurface == IntPtr.Zero)
            {
                return(false);
            }

            m_pSteamInventory = SteamClient.GetISteamInventory(hSteamUser, hSteamPipe, Constants.STEAMINVENTORY_INTERFACE_VERSION);
            if (m_pSteamInventory == IntPtr.Zero)
            {
                return(false);
            }

            m_pSteamVideo = SteamClient.GetISteamVideo(hSteamUser, hSteamPipe, Constants.STEAMVIDEO_INTERFACE_VERSION);
            if (m_pSteamVideo == IntPtr.Zero)
            {
                return(false);
            }

            m_pSteamParentalSettings = SteamClient.GetISteamParentalSettings(hSteamUser, hSteamPipe, Constants.STEAMPARENTALSETTINGS_INTERFACE_VERSION);
            if (m_pSteamParentalSettings == IntPtr.Zero)
            {
                return(false);
            }

            return(true);
        }
Ejemplo n.º 13
0
        public static HSteamUser ConnectToGlobalUser(HSteamPipe hSteamPipe) => default; // 0x000000018094A580-0x000000018094A5E0

        public static HSteamUser CreateLocalUser(out HSteamPipe phSteamPipe, EAccountType eAccountType)
        {
            phSteamPipe = default;
            return(default);
Ejemplo n.º 14
0
 /// <summary>
 /// <para> connects to an existing global user, failing if none exists</para>
 /// <para> used by the game to coordinate with the steamUI</para>
 /// <para> NOT THREADSAFE - ensure that no other threads are accessing Steamworks API when calling</para>
 /// </summary>
 public static HSteamUser ConnectToGlobalUser(HSteamPipe hSteamPipe)
 {
     InteropHelp.TestIfAvailableClient();
     return((HSteamUser)NativeMethods.ISteamClient_ConnectToGlobalUser(CSteamAPIContext.GetSteamClient(), hSteamPipe));
 }
Ejemplo n.º 15
0
        internal static bool Init()
        {
            HSteamUser hSteamUser = SteamAPI.GetHSteamUser();
            HSteamPipe hSteamPipe = SteamAPI.GetHSteamPipe();

            if (hSteamPipe == (HSteamPipe)0)
            {
                return(false);
            }

            using (var pchVersionString = new InteropHelp.UTF8StringHandle(Constants.STEAMCLIENT_INTERFACE_VERSION)) {
                m_pSteamClient = NativeMethods.SteamInternal_CreateInterface(pchVersionString);
            }

            if (m_pSteamClient == IntPtr.Zero)
            {
                return(false);
            }

            m_pSteamUser = SteamClient.GetISteamUser(hSteamUser, hSteamPipe, Constants.STEAMUSER_INTERFACE_VERSION);
            if (m_pSteamUser == IntPtr.Zero)
            {
                return(false);
            }

            m_pSteamFriends = SteamClient.GetISteamFriends(hSteamUser, hSteamPipe, Constants.STEAMFRIENDS_INTERFACE_VERSION);
            if (m_pSteamFriends == IntPtr.Zero)
            {
                return(false);
            }

            m_pSteamUtils = SteamClient.GetISteamUtils(hSteamPipe, Constants.STEAMUTILS_INTERFACE_VERSION);
            if (m_pSteamUtils == IntPtr.Zero)
            {
                return(false);
            }

            m_pSteamMatchmaking = SteamClient.GetISteamMatchmaking(hSteamUser, hSteamPipe, Constants.STEAMMATCHMAKING_INTERFACE_VERSION);
            if (m_pSteamMatchmaking == IntPtr.Zero)
            {
                return(false);
            }

            m_pSteamMatchmakingServers = SteamClient.GetISteamMatchmakingServers(hSteamUser, hSteamPipe, Constants.STEAMMATCHMAKINGSERVERS_INTERFACE_VERSION);
            if (m_pSteamMatchmakingServers == IntPtr.Zero)
            {
                return(false);
            }

            m_pSteamUserStats = SteamClient.GetISteamUserStats(hSteamUser, hSteamPipe, Constants.STEAMUSERSTATS_INTERFACE_VERSION);
            if (m_pSteamUserStats == IntPtr.Zero)
            {
                return(false);
            }

            m_pSteamApps = SteamClient.GetISteamApps(hSteamUser, hSteamPipe, Constants.STEAMAPPS_INTERFACE_VERSION);
            if (m_pSteamApps == IntPtr.Zero)
            {
                return(false);
            }

            m_pSteamNetworking = SteamClient.GetISteamNetworking(hSteamUser, hSteamPipe, Constants.STEAMNETWORKING_INTERFACE_VERSION);
            if (m_pSteamNetworking == IntPtr.Zero)
            {
                return(false);
            }

            m_pSteamRemoteStorage = SteamClient.GetISteamRemoteStorage(hSteamUser, hSteamPipe, Constants.STEAMREMOTESTORAGE_INTERFACE_VERSION);
            if (m_pSteamRemoteStorage == IntPtr.Zero)
            {
                return(false);
            }

            m_pSteamScreenshots = SteamClient.GetISteamScreenshots(hSteamUser, hSteamPipe, Constants.STEAMSCREENSHOTS_INTERFACE_VERSION);
            if (m_pSteamScreenshots == IntPtr.Zero)
            {
                return(false);
            }

            m_pSteamGameSearch = SteamClient.GetISteamGameSearch(hSteamUser, hSteamPipe, Constants.STEAMGAMESEARCH_INTERFACE_VERSION);
            if (m_pSteamGameSearch == IntPtr.Zero)
            {
                return(false);
            }

            m_pSteamHTTP = SteamClient.GetISteamHTTP(hSteamUser, hSteamPipe, Constants.STEAMHTTP_INTERFACE_VERSION);
            if (m_pSteamHTTP == IntPtr.Zero)
            {
                return(false);
            }

            m_pController = SteamClient.GetISteamController(hSteamUser, hSteamPipe, Constants.STEAMCONTROLLER_INTERFACE_VERSION);
            if (m_pController == IntPtr.Zero)
            {
                return(false);
            }

            m_pSteamUGC = SteamClient.GetISteamUGC(hSteamUser, hSteamPipe, Constants.STEAMUGC_INTERFACE_VERSION);
            if (m_pSteamUGC == IntPtr.Zero)
            {
                return(false);
            }

            m_pSteamAppList = SteamClient.GetISteamAppList(hSteamUser, hSteamPipe, Constants.STEAMAPPLIST_INTERFACE_VERSION);
            if (m_pSteamAppList == IntPtr.Zero)
            {
                return(false);
            }

            m_pSteamMusic = SteamClient.GetISteamMusic(hSteamUser, hSteamPipe, Constants.STEAMMUSIC_INTERFACE_VERSION);
            if (m_pSteamMusic == IntPtr.Zero)
            {
                return(false);
            }

            m_pSteamMusicRemote = SteamClient.GetISteamMusicRemote(hSteamUser, hSteamPipe, Constants.STEAMMUSICREMOTE_INTERFACE_VERSION);
            if (m_pSteamMusicRemote == IntPtr.Zero)
            {
                return(false);
            }

            m_pSteamHTMLSurface = SteamClient.GetISteamHTMLSurface(hSteamUser, hSteamPipe, Constants.STEAMHTMLSURFACE_INTERFACE_VERSION);
            if (m_pSteamHTMLSurface == IntPtr.Zero)
            {
                return(false);
            }

            m_pSteamInventory = SteamClient.GetISteamInventory(hSteamUser, hSteamPipe, Constants.STEAMINVENTORY_INTERFACE_VERSION);
            if (m_pSteamInventory == IntPtr.Zero)
            {
                return(false);
            }

            m_pSteamVideo = SteamClient.GetISteamVideo(hSteamUser, hSteamPipe, Constants.STEAMVIDEO_INTERFACE_VERSION);
            if (m_pSteamVideo == IntPtr.Zero)
            {
                return(false);
            }

            m_pSteamParentalSettings = SteamClient.GetISteamParentalSettings(hSteamUser, hSteamPipe, Constants.STEAMPARENTALSETTINGS_INTERFACE_VERSION);
            if (m_pSteamParentalSettings == IntPtr.Zero)
            {
                return(false);
            }

            m_pSteamInput = SteamClient.GetISteamInput(hSteamUser, hSteamPipe, Constants.STEAMINPUT_INTERFACE_VERSION);
            if (m_pSteamInput == IntPtr.Zero)
            {
                return(false);
            }

            m_pSteamParties = SteamClient.GetISteamParties(hSteamUser, hSteamPipe, Constants.STEAMPARTIES_INTERFACE_VERSION);
            if (m_pSteamParties == IntPtr.Zero)
            {
                return(false);
            }

            m_pSteamRemotePlay = SteamClient.GetISteamRemotePlay(hSteamUser, hSteamPipe, Constants.STEAMREMOTEPLAY_INTERFACE_VERSION);
            if (m_pSteamRemotePlay == IntPtr.Zero)
            {
                return(false);
            }

            using (var pchVersionString = new InteropHelp.UTF8StringHandle(Constants.STEAMNETWORKINGUTILS_INTERFACE_VERSION))
            {
                m_pSteamNetworkingUtils =
                    NativeMethods.SteamInternal_FindOrCreateUserInterface(hSteamUser, pchVersionString) != IntPtr.Zero ?
                    NativeMethods.SteamInternal_FindOrCreateUserInterface(hSteamUser, pchVersionString) :
                    NativeMethods.SteamInternal_FindOrCreateGameServerInterface(hSteamUser, pchVersionString);
            }
            if (m_pSteamNetworkingUtils == IntPtr.Zero)
            {
                return(false);
            }

            using (var pchVersionString = new InteropHelp.UTF8StringHandle(Constants.STEAMNETWORKINGSOCKETS_INTERFACE_VERSION))
            {
                m_pSteamNetworkingSockets =
                    NativeMethods.SteamInternal_FindOrCreateUserInterface(hSteamUser, pchVersionString);
            }
            if (m_pSteamNetworkingSockets == IntPtr.Zero)
            {
                return(false);
            }

            return(true);
        }
Ejemplo n.º 16
0
 /// <summary>
 /// <para> used by game servers, create a steam user that won't be shared with anyone else</para>
 /// <para> NOT THREADSAFE - ensure that no other threads are accessing Steamworks API when calling</para>
 /// </summary>
 public static HSteamUser CreateLocalUser(out HSteamPipe phSteamPipe, EAccountType eAccountType)
 {
     InteropHelp.TestIfAvailableClient();
     return((HSteamUser)NativeMethods.ISteamClient_CreateLocalUser(CSteamAPIContext.GetSteamClient(), out phSteamPipe, eAccountType));
 }
Ejemplo n.º 17
0
        internal static bool Init()
        {
            HSteamUser hSteamUser = GameServer.GetHSteamUser();
            HSteamPipe hSteamPipe = GameServer.GetHSteamPipe();

            if (hSteamPipe == (HSteamPipe)0)
            {
                return(false);
            }

            using (var pchVersionString = new InteropHelp.UTF8StringHandle(Constants.STEAMCLIENT_INTERFACE_VERSION)) {
                m_pSteamClient = NativeMethods.SteamInternal_CreateInterface(pchVersionString);
            }
            if (m_pSteamClient == IntPtr.Zero)
            {
                return(false);
            }

            m_pSteamGameServer = SteamGameServerClient.GetISteamGameServer(hSteamUser, hSteamPipe, Constants.STEAMGAMESERVER_INTERFACE_VERSION);
            if (m_pSteamGameServer == IntPtr.Zero)
            {
                return(false);
            }

            m_pSteamUtils = SteamGameServerClient.GetISteamUtils(hSteamPipe, Constants.STEAMUTILS_INTERFACE_VERSION);
            if (m_pSteamUtils == IntPtr.Zero)
            {
                return(false);
            }

            m_pSteamNetworking = SteamGameServerClient.GetISteamNetworking(hSteamUser, hSteamPipe, Constants.STEAMNETWORKING_INTERFACE_VERSION);
            if (m_pSteamNetworking == IntPtr.Zero)
            {
                return(false);
            }

            m_pSteamGameServerStats = SteamGameServerClient.GetISteamGameServerStats(hSteamUser, hSteamPipe, Constants.STEAMGAMESERVERSTATS_INTERFACE_VERSION);
            if (m_pSteamGameServerStats == IntPtr.Zero)
            {
                return(false);
            }

            m_pSteamHTTP = SteamGameServerClient.GetISteamHTTP(hSteamUser, hSteamPipe, Constants.STEAMHTTP_INTERFACE_VERSION);
            if (m_pSteamHTTP == IntPtr.Zero)
            {
                return(false);
            }

            m_pSteamInventory = SteamGameServerClient.GetISteamInventory(hSteamUser, hSteamPipe, Constants.STEAMINVENTORY_INTERFACE_VERSION);
            if (m_pSteamInventory == IntPtr.Zero)
            {
                return(false);
            }

            m_pSteamUGC = SteamGameServerClient.GetISteamUGC(hSteamUser, hSteamPipe, Constants.STEAMUGC_INTERFACE_VERSION);
            if (m_pSteamUGC == IntPtr.Zero)
            {
                return(false);
            }

            m_pSteamApps = SteamGameServerClient.GetISteamApps(hSteamUser, hSteamPipe, Constants.STEAMAPPS_INTERFACE_VERSION);
            if (m_pSteamApps == IntPtr.Zero)
            {
                return(false);
            }

            using (var pchVersionString = new InteropHelp.UTF8StringHandle(Constants.STEAMNETWORKINGUTILS_INTERFACE_VERSION))
            {
                m_pSteamNetworkingUtils =
                    NativeMethods.SteamInternal_FindOrCreateUserInterface(hSteamUser, pchVersionString) != IntPtr.Zero ?
                    NativeMethods.SteamInternal_FindOrCreateUserInterface(hSteamUser, pchVersionString) :
                    NativeMethods.SteamInternal_FindOrCreateGameServerInterface(hSteamUser, pchVersionString);
            }
            if (m_pSteamNetworkingUtils == IntPtr.Zero)
            {
                return(false);
            }

            using (var pchVersionString = new InteropHelp.UTF8StringHandle(Constants.STEAMNETWORKINGSOCKETS_INTERFACE_VERSION))
            {
                m_pSteamNetworkingSockets =
                    NativeMethods.SteamInternal_FindOrCreateGameServerInterface(hSteamUser, pchVersionString);
            }
            if (m_pSteamNetworkingSockets == IntPtr.Zero)
            {
                return(false);
            }

            return(true);
        }
Ejemplo n.º 18
0
 private static extern bool _BReleaseSteamPipe(IntPtr self, HSteamPipe hSteamPipe);
 /// <summary>
 /// <para> returns the ISteamMatchmakingServers interface</para>
 /// </summary>
 public static IntPtr GetISteamMatchmakingServers(HSteamUser hSteamUser, HSteamPipe hSteamPipe, string pchVersion)
 {
     InteropHelp.TestIfAvailableClient();
     return(NativeMethods.ISteamClient_GetISteamMatchmakingServers(hSteamUser, hSteamPipe, pchVersion));
 }
Ejemplo n.º 20
0
 private static extern HSteamUser _ConnectToGlobalUser(IntPtr self, HSteamPipe hSteamPipe);
 /// <summary>
 /// <para> html page display</para>
 /// </summary>
 public static IntPtr GetISteamHTMLSurface(HSteamUser hSteamuser, HSteamPipe hSteamPipe, string pchVersion)
 {
     InteropHelp.TestIfAvailableClient();
     return(NativeMethods.ISteamClient_GetISteamHTMLSurface(hSteamuser, hSteamPipe, pchVersion));
 }
Ejemplo n.º 22
0
        internal IntPtr GetISteamRemotePlay(HSteamUser hSteamUser, HSteamPipe hSteamPipe, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(Utf8StringToNative))] string pchVersion)
        {
            var returnValue = _GetISteamRemotePlay(Self, hSteamUser, hSteamPipe, pchVersion);

            return(returnValue);
        }
Ejemplo n.º 23
0
 public static HSteamPipe CreateSteamPipe() => default;                          // 0x000000018094A650-0x000000018094A6A0
 public static bool BReleaseSteamPipe(HSteamPipe hSteamPipe) => default;         // 0x000000018094A4E0-0x000000018094A530