As you can see, this project is aimed to extend modern features to Steamworks.NET on regular .NET projects that targeting to up to date framework.
- Allow get Steam API CallResult by
await, achived byToValueTask<T>()extension method series onSteamAPICall_t. These methods build on top of originalCallResult<T>and can be accessed by using namespaceFaGe.Steamworks.NET.Extensions. In current version, there are 2 variants.- Method
ToValueTask<T>()is suitable for those call-results that don't considering cancellation. Example:var queryResult = await SteamUGC.SendQueryUGCRequest(queryHandle).ToValueTask<SteamUGCQueryCompleted_t>();
- Method
ToValueTaskWithCancellation<T>()returns aValueTask<T>and carry out aCancellationTokenSourcefor cancellation, you can later cancel this operation by thatCancellationTokenSource. Example:// do async operation var result = SteamUGC.SendQueryUGCRequest(queryHandle).ToValueTaskWithCancellation<SteamUGCQueryCompleted_t>(out var ctsInSomeField); // somewhere else that want to cancel ctsInSomeField.Cancel()
SteamAPICallExceptionwill thrown if call-result is failed.
- Method
- Spawn automatic steam callback dispatcher thread by
SteamCallbackDispatch.Singleton.SpawnCallbackDispatchThread()method.- Stop the dispatcher thread by the returned
CancellationTokenSource.SteamCallbackDispatch.Singleton.StopDispatchSourceis also the same. Beware, once the thread is stopped, it can't be restarted. - Lived in namespace
FaGe.Steamworks.NET.Extensions
- Stop the dispatcher thread by the returned
- Wrap
UgcQueryHandle_tfor both query and result.- Create fluent query builder from methods in static class
FaGe.Steamworks.NET.Extensions.Ugc.UgcQueryBuilders. Each factory method wraps a correspondingCreateQuery*UGCRequest().- Exception
UgcQueryBuildException: query operator is failed to apply.
- If you want to abandon a query, you should call
*UgcQueryBuilder.AbandonQuery()to release handle. - For now in the unit test project
DetailsUgcQueryBuilder.FilterCloudFileName()will fail due to unknown reason, no corresponding IPC log found in steam console. Not sure if real application will fail too.
- Exception
- Once query built, call
UgcQuery.Send()to get result wrapped inUgcQueryResult.UgcQueryFailedExceptionwill thrown for failed query.
- The
UgcQueryResultis a collection of query result, each item is aUgcQueryResultItem. Methods likeGetDetails()andGetTags()are used to retrieve information of a single UGC item. There are also some count properties.
- Create fluent query builder from methods in static class