Ejemplo n.º 1
0
        public bool SendHTTPRequestAndStreamResponse(HTTPRequestHandle request, out SteamAPICall callHandle)
        {
            CheckIfUsable();

            ulong tempCallHandle = 0;

            bool result = NativeMethods.HTTP_SendHTTPRequestAndStreamResponse(request.AsUInt32, ref tempCallHandle);

            callHandle = new SteamAPICall(tempCallHandle);

            return(result);
        }
        public bool GetAPICallResult <T>(SteamAPICall steamAPICall, ref T callback, out bool failed) where T : struct
        {
            failed = false;
            int structSize = Marshal.SizeOf(typeof(T));

            if (_CallResultBuffer == null)
            {
                _CallResultBuffer = new byte[256];
            }
            GCHandle handle = GCHandle.Alloc(_CallResultBuffer, GCHandleType.Pinned);

            try
            {
                IntPtr ptr    = Marshal.UnsafeAddrOfPinnedArrayElement(_CallResultBuffer, 0);
                bool   result = NativeMethods.Utils_GetAPICallResult(steamAPICall.AsUInt64, ptr, 256, 154, ref failed);
                callback = (T)Marshal.PtrToStructure(ptr, typeof(T));
                return(result);
            }
            finally
            {
                handle.Free();
            }
        }
Ejemplo n.º 3
0
 /// <summary>
 /// <para> Sends the HTTP request, will return false on a bad handle, otherwise use SteamCallHandle to wait on</para>
 /// <para> asynchronous response via callback for completion, and listen for HTTPRequestHeadersReceived and</para>
 /// <para> HTTPRequestDataReceived callbacks while streaming.</para>
 /// </summary>
 public static bool SendHTTPRequestAndStreamResponse(HTTPRequestHandle hRequest, out SteamAPICall pCallHandle)
 {
     InteropHelp.TestIfAvailableGameServer();
     return(NativeMethods.ISteamGameServerHTTP_SendHTTPRequestAndStreamResponse(hRequest, out pCallHandle));
 }
        public bool SendHTTPRequestAndStreamResponse(HTTPRequestHandle request, out SteamAPICall callHandle)
        {
            CheckIfUsable();

            ulong tempCallHandle = 0;

            bool result = NativeMethods.HTTP_SendHTTPRequestAndStreamResponse(request.AsUInt32, ref tempCallHandle);

            callHandle = new SteamAPICall(tempCallHandle);

            return result;
        }
Ejemplo n.º 5
0
 /// <summary>
 /// <para> Sends the HTTP request, will return false on a bad handle, otherwise use SteamCallHandle to wait on</para>
 /// <para> asynchronous response via callback.</para>
 /// <para> Note: If the user is in offline mode in Steam, then this will add a only-if-cached cache-control</para>
 /// <para> header and only do a local cache lookup rather than sending any actual remote request.</para>
 /// </summary>
 public static bool SendHTTPRequest(HTTPRequestHandle hRequest, out SteamAPICall pCallHandle)
 {
     InteropHelp.TestIfAvailableClient();
     return(NativeMethods.ISteamHTTP_SendHTTPRequest(hRequest, out pCallHandle));
 }
 public bool IsAPICallCompleted(SteamAPICall steamAPICall, out bool failed)
 {
     failed = false;
     return(NativeMethods.Utils_IsAPICallCompleted(steamAPICall.AsUInt64, ref failed));
 }