public SteamCloud.UGCDetailsCallback GetUGCDetails(UGCHandle ugcHandle) { bool completed = false; SteamCloud.UGCDetailsCallback details = null; Action <SteamCloud.UGCDetailsCallback> cbMethod = callback => { completed = true; if (callback.Result == EResult.OK) { details = callback; } else if (callback.Result == EResult.FileNotFound) { details = null; } else { throw new Exception($"EResult {(int)callback.Result} ({callback.Result}) while retrieving UGC details for {ugcHandle}."); } }; WaitUntilCallback(() => { callbacks.Subscribe(steamCloud.RequestUGCDetails(ugcHandle), cbMethod); }, () => { return(completed); }); return(details); }
void TestCloud() { ICloud cloud = null; RemoteStoragePlatform remoteStorrage = RemoteStoragePlatform.All; cloud.CloudFileShareResult += (CloudFileShareResult x, bool y) => { }; cloud.CloudDownloadUGCResult += (CloudDownloadUGCResult x, bool y) => { }; b = cloud.Write(s, ba); i = cloud.Read(s, ba); b = cloud.Forget(s); b = cloud.Delete(s); cloud.Share(s); b = cloud.SetSyncPlatforms(s, remoteStorrage); b = cloud.Exists(s); b = cloud.Persisted(s); i = cloud.GetSize(s); l = cloud.Timestamp(s); remoteStorrage = cloud.GetSyncPlatforms(s); i = cloud.GetFileCount(); s = cloud.GetFileNameAndSize(i, out i); b = cloud.GetQuota(out i, out i); b = cloud.IsEnabledForAccount(); b = cloud.IsEnabledForApplication(); cloud.SetEnabledForApplication(b); cloud.UGCDownload(ugcHandle); b = cloud.GetUGCDetails(ugcHandle, out appID, out s, out i, out steamID); i = cloud.UGCRead(ugcHandle, ba); i = cloud.GetCachedUGCCount(); ugcHandle = cloud.GetUGCHandle(i); }
void TestCloud() { ICloud cloud = null; RemoteStoragePlatform remoteStorrage = RemoteStoragePlatform.All; cloud.CloudFileShareResult += (CloudFileShareResult x, bool y) => { }; cloud.CloudDownloadUGCResult += (CloudDownloadUGCResult x, bool y) => { }; b = cloud.Write(s, ba); i = cloud.Read(s, ba); b = cloud.Forget(s); b = cloud.Delete(s); cloud.Share(s); b = cloud.SetSyncPlatforms(s, remoteStorrage); b = cloud.Exists(s); b = cloud.Persisted(s); i = cloud.GetSize(s); l = cloud.Timestamp(s); remoteStorrage = cloud.GetSyncPlatforms(s); i = cloud.GetFileCount(); s = cloud.GetFileNameAndSize(i, out i); b = cloud.GetQuota(out i, out i); b = cloud.IsEnabledForAccount(); b = cloud.IsEnabledForApplication(); cloud.SetEnabledForApplication(b); cloud.UGCDownload(ugcHandle); b = cloud.GetUGCDetails(ugcHandle, out appID, out s, out i, out steamID); i = cloud.UGCRead(ugcHandle, ba); i = cloud.GetCachedUGCCount(); ugcHandle = cloud.GetUGCHandle(i); }
public CloudGetUGCDetailsResult GetUGCDetails(UGCHandle handle) { CloudGetUGCDetailsResult result = new CloudGetUGCDetailsResult(); result.result = GetUGCDetails(handle, out result.appIDSender, out result.nameSender, out result.fileSizeSender, out result.creatorSender); return(result); }
internal ScreenshotAddedCallback( JobID jobID, CMsgClientUCMAddScreenshotResponse msg ) { JobID = jobID; Result = ( EResult )msg.eresult; ScreenshotID = msg.screenshotid; }
public bool GetUGCDownloadProgress(UGCHandle handle, out int bytesDownloaded, out int bytesExpected) { CheckIfUsable(); bytesDownloaded = 0; bytesExpected = 0; return(NativeMethods.Cloud_GetUGCDownloadProgress(handle.AsUInt64, ref bytesDownloaded, ref bytesExpected)); }
public CloudGetUGCDownloadProgressResult GetUGCDownloadProgress(UGCHandle handle) { CloudGetUGCDownloadProgressResult result = new CloudGetUGCDownloadProgressResult(); result.result = GetUGCDownloadProgress(handle, out result.bytesDownloadedSender, out result.bytesExpectedSender); return(result); }
/// <summary> /// Requests details for a specific item of user generated content from the Steam servers. /// Results are returned in a <see cref="UGCDetailsCallback"/> from a <see cref="SteamClient.JobCallback<T>"/>. /// </summary> /// <param name="ugcId">The unique user generated content id.</param> /// <returns>The Job ID of the request. This can be used to find the appropriate <see cref="SteamClient.JobCallback<T>"/>.</returns> public JobID RequestUGCDetails( UGCHandle ugcId ) { var request = new ClientMsgProtobuf<CMsgClientUFSGetUGCDetails>( EMsg.ClientUFSGetUGCDetails ); request.SourceJobID = Client.GetNextJobID(); request.Body.hcontent = ugcId; this.Client.Send( request ); return request.SourceJobID; }
public void ReturnsReplayId() { // Arrange var ugcId = new UGCHandle(3489753984753); // Act var replayId = ugcId.ToReplayId(); // Assert Assert.Equal(3489753984753, replayId); }
public void UgcIdIsZero_ReturnsNull() { // Arrange var ugcId = new UGCHandle(0); // Act var replayId = ugcId.ToReplayId(); // Assert Assert.Null(replayId); }
public void UgcIdIsUInt64MaxValue_ReturnsNull() { // Arrange var ugcId = new UGCHandle(ulong.MaxValue); // Act var replayId = ugcId.ToReplayId(); // Assert Assert.Null(replayId); }
/// <summary> /// Requests details for a specific item of user generated content from the Steam servers. /// Results are returned in a <see cref="UGCDetailsCallback"/>. /// The returned <see cref="AsyncJob{T}"/> can also be awaited to retrieve the callback result. /// </summary> /// <param name="ugcId">The unique user generated content id.</param> /// <returns>The Job ID of the request. This can be used to find the appropriate <see cref="UGCDetailsCallback"/>.</returns> public AsyncJob<UGCDetailsCallback> RequestUGCDetails( UGCHandle ugcId ) { var request = new ClientMsgProtobuf<CMsgClientUFSGetUGCDetails>( EMsg.ClientUFSGetUGCDetails ); request.SourceJobID = Client.GetNextJobID(); request.Body.hcontent = ugcId; this.Client.Send( request ); return new AsyncJob<UGCDetailsCallback>( this.Client, request.SourceJobID ); }
/// <summary> /// /// </summary> public bool GetUGCDetails(UGCHandle handle, out AppID appID, out string name, out int fileSize, out SteamID creator) { CheckIfUsable(); IntPtr stringPointer = IntPtr.Zero; uint rawAppID = 0; ulong rawCreator = 0; fileSize = 0; bool result = NativeMethods.Cloud_GetUGCDetails(handle.AsUInt64, ref rawAppID, ref stringPointer, ref fileSize, ref rawCreator); appID = new AppID(rawAppID); name = NativeHelpers.ToStringAnsi(stringPointer); creator = new SteamID(rawCreator); return(result); }
/// <summary> /// Invokes LeaderboardUGCSet /// </summary> /// <param name="handle"></param> /// <param name="ugcHandle"></param> public void AttachLeaderboardUGC(LeaderboardHandle handle, UGCHandle ugcHandle) { CheckIfUsable(); NativeMethods.Stats_AttachLeaderboardUGC(handle.AsUInt64, ugcHandle.AsUInt64); }
internal LeaderboardEntry( CMsgClientLBSGetLBEntriesResponse.Entry entry ) { GlobalRank = entry.global_rank; Score = entry.score; SteamID = new SteamID( entry.steam_id_user ); UGCId = new UGCHandle( entry.ugc_id ); var details = new List<int>(); using ( var stream = new MemoryStream( entry.details ) ) { while ( ( stream.Length - stream.Position ) >= sizeof( int ) ) { details.Add( stream.ReadInt32() ); } } Details = new ReadOnlyCollection<int>( details ); }
public static long?ToReplayId(this UGCHandle ugcHandle) { return(((ulong)ugcHandle).ToReplayId()); }
/// <summary> /// Invokes LeaderboardUGCSet /// </summary> /// <param name="handle"></param> /// <param name="ugcHandle"></param> public void AttachLeaderboardUGC(LeaderboardHandle handle, UGCHandle ugcHandle) { CheckIfUsable(); NativeMethods.Stats_AttachLeaderboardUGC(handle.AsUInt64, ugcHandle.AsUInt64); }
public bool GetUGCDownloadProgress(UGCHandle handle, out int bytesDownloaded, out int bytesExpected) { CheckIfUsable(); bytesDownloaded = 0; bytesExpected = 0; return NativeMethods.Cloud_GetUGCDownloadProgress(handle.AsUInt64, ref bytesDownloaded, ref bytesExpected); }
public CloudGetUGCDetailsResult GetUGCDetails(UGCHandle handle) { CloudGetUGCDetailsResult result = new CloudGetUGCDetailsResult(); result.result = GetUGCDetails(handle, out result.appIDSender, out result.nameSender, out result.fileSizeSender, out result.creatorSender); return result; }
/// <summary> /// /// </summary> public bool GetUGCDetails(UGCHandle handle, out AppID appID, out string name, out int fileSize, out SteamID creator) { CheckIfUsable(); IntPtr stringPointer = IntPtr.Zero; uint rawAppID = 0; ulong rawCreator = 0; fileSize = 0; bool result = NativeMethods.Cloud_GetUGCDetails(handle.AsUInt64, ref rawAppID, ref stringPointer, ref fileSize, ref rawCreator); appID = new AppID(rawAppID); name = NativeHelpers.ToStringAnsi(stringPointer); creator = new SteamID(rawCreator); return result; }
public CloudGetUGCDownloadProgressResult GetUGCDownloadProgress(UGCHandle handle) { CloudGetUGCDownloadProgressResult result = new CloudGetUGCDownloadProgressResult(); result.result = GetUGCDownloadProgress(handle, out result.bytesDownloadedSender, out result.bytesExpectedSender); return result; }