292 lines
9.6 KiB
C#
292 lines
9.6 KiB
C#
#if !(STEAM_CHANNEL || STEAMWORKS_NET)
|
|
using System;
|
|
|
|
namespace Steamworks
|
|
{
|
|
public struct CSteamID : IEquatable<CSteamID>
|
|
{
|
|
public static readonly CSteamID Nil = new CSteamID(0);
|
|
public ulong m_SteamID;
|
|
|
|
public CSteamID(ulong value)
|
|
{
|
|
m_SteamID = value;
|
|
}
|
|
|
|
public bool IsValid() => m_SteamID != 0;
|
|
public uint GetAccountID() => (uint)(m_SteamID & 0xffffffff);
|
|
public bool Equals(CSteamID other) => m_SteamID == other.m_SteamID;
|
|
public override bool Equals(object obj) => obj is CSteamID other && Equals(other);
|
|
public override int GetHashCode() => m_SteamID.GetHashCode();
|
|
public override string ToString() => m_SteamID.ToString();
|
|
public static bool operator ==(CSteamID left, CSteamID right) => left.Equals(right);
|
|
public static bool operator !=(CSteamID left, CSteamID right) => !left.Equals(right);
|
|
}
|
|
|
|
public struct PublishedFileId_t : IEquatable<PublishedFileId_t>
|
|
{
|
|
public ulong m_PublishedFileId;
|
|
|
|
public PublishedFileId_t(ulong value)
|
|
{
|
|
m_PublishedFileId = value;
|
|
}
|
|
|
|
public bool Equals(PublishedFileId_t other) => m_PublishedFileId == other.m_PublishedFileId;
|
|
public override bool Equals(object obj) => obj is PublishedFileId_t other && Equals(other);
|
|
public override int GetHashCode() => m_PublishedFileId.GetHashCode();
|
|
public override string ToString() => m_PublishedFileId.ToString();
|
|
public static bool operator ==(PublishedFileId_t left, PublishedFileId_t right) => left.Equals(right);
|
|
public static bool operator !=(PublishedFileId_t left, PublishedFileId_t right) => !left.Equals(right);
|
|
}
|
|
|
|
public struct AppId_t
|
|
{
|
|
public uint m_AppId;
|
|
|
|
public AppId_t(uint value)
|
|
{
|
|
m_AppId = value;
|
|
}
|
|
}
|
|
|
|
public struct SteamAPICall_t
|
|
{
|
|
public ulong m_SteamAPICall;
|
|
}
|
|
|
|
public struct UGCQueryHandle_t
|
|
{
|
|
public ulong m_UGCQueryHandle;
|
|
}
|
|
|
|
public struct UGCUpdateHandle_t
|
|
{
|
|
public ulong m_UGCUpdateHandle;
|
|
}
|
|
|
|
public struct SteamNetworkingIdentity
|
|
{
|
|
public CSteamID SteamID;
|
|
|
|
public void SetSteamID(CSteamID steamId)
|
|
{
|
|
SteamID = steamId;
|
|
}
|
|
}
|
|
|
|
public enum EResult
|
|
{
|
|
k_EResultOK = 1,
|
|
k_EResultFail = 2,
|
|
k_EResultNoConnection = 3,
|
|
k_EResultInvalidPassword = 5,
|
|
k_EResultLimitExceeded = 25,
|
|
k_EResultIgnored = 43,
|
|
k_EResultAccessDenied = 15
|
|
}
|
|
|
|
public enum EPersonaState
|
|
{
|
|
k_EPersonaStateOffline = 0,
|
|
k_EPersonaStateOnline = 1,
|
|
k_EPersonaStateBusy = 2,
|
|
k_EPersonaStateAway = 3,
|
|
k_EPersonaStateSnooze = 4,
|
|
k_EPersonaStateInvisible = 7
|
|
}
|
|
|
|
public enum ETextFilteringContext
|
|
{
|
|
k_ETextFilteringContextUnknown = 0,
|
|
k_ETextFilteringContextGameContent = 1,
|
|
k_ETextFilteringContextChat = 2,
|
|
k_ETextFilteringContextName = 3
|
|
}
|
|
|
|
[Flags]
|
|
public enum EItemState
|
|
{
|
|
k_EItemStateNone = 0,
|
|
k_EItemStateSubscribed = 1,
|
|
k_EItemStateInstalled = 4
|
|
}
|
|
|
|
public enum EItemUpdateStatus
|
|
{
|
|
k_EItemUpdateStatusInvalid = 0
|
|
}
|
|
|
|
public enum EWorkshopFileType
|
|
{
|
|
k_EWorkshopFileTypeCommunity = 0
|
|
}
|
|
|
|
public enum ERemoteStoragePublishedFileVisibility
|
|
{
|
|
k_ERemoteStoragePublishedFileVisibilityPublic = 0
|
|
}
|
|
|
|
public enum EUGCQuery
|
|
{
|
|
k_EUGCQuery_RankedByPublicationDate = 0
|
|
}
|
|
|
|
public enum EUGCMatchingUGCType
|
|
{
|
|
k_EUGCMatchingUGCType_Items = 0,
|
|
k_EUGCMatchingUGCType_Items_ReadyToUse = 1
|
|
}
|
|
|
|
public enum EUserUGCList
|
|
{
|
|
k_EUserUGCList_Published = 0
|
|
}
|
|
|
|
public enum EUserUGCListSortOrder
|
|
{
|
|
k_EUserUGCListSortOrder_CreationOrderDesc = 0
|
|
}
|
|
|
|
public struct SteamUGCDetails_t
|
|
{
|
|
public PublishedFileId_t m_nPublishedFileId;
|
|
public string m_rgchTitle;
|
|
public string m_rgchDescription;
|
|
public string m_rgchTags;
|
|
public uint m_unVotesUp;
|
|
public uint m_unVotesDown;
|
|
public int m_nFileSize;
|
|
public uint m_rtimeCreated;
|
|
public uint m_rtimeUpdated;
|
|
public ulong m_ulSteamIDOwner;
|
|
}
|
|
|
|
public struct SteamUGCQueryCompleted_t
|
|
{
|
|
public UGCQueryHandle_t m_handle;
|
|
public EResult m_eResult;
|
|
public uint m_unNumResultsReturned;
|
|
public uint m_unTotalMatchingResults;
|
|
}
|
|
|
|
public struct CreateItemResult_t
|
|
{
|
|
public EResult m_eResult;
|
|
public PublishedFileId_t m_nPublishedFileId;
|
|
public bool m_bUserNeedsToAcceptWorkshopLegalAgreement;
|
|
}
|
|
|
|
public struct SubmitItemUpdateResult_t
|
|
{
|
|
public EResult m_eResult;
|
|
public bool m_bUserNeedsToAcceptWorkshopLegalAgreement;
|
|
}
|
|
|
|
public struct RemoteStorageSubscribePublishedFileResult_t
|
|
{
|
|
public EResult m_eResult;
|
|
public PublishedFileId_t m_nPublishedFileId;
|
|
}
|
|
|
|
public struct RemoteStorageUnsubscribePublishedFileResult_t
|
|
{
|
|
public EResult m_eResult;
|
|
public PublishedFileId_t m_nPublishedFileId;
|
|
}
|
|
|
|
public sealed class CallResult<T>
|
|
{
|
|
public static CallResult<T> Create(Action<T, bool> callback) => new CallResult<T>();
|
|
public void Set(SteamAPICall_t apiCall) { }
|
|
public void Set(SteamAPICall_t apiCall, Action<T, bool> callback) { }
|
|
}
|
|
|
|
public static class CallbackDispatcher
|
|
{
|
|
public static bool IsInitialized => false;
|
|
}
|
|
|
|
public static class SteamAPI
|
|
{
|
|
public static bool IsSteamRunning() => false;
|
|
public static void RunCallbacks() { }
|
|
}
|
|
|
|
public static class SteamUtils
|
|
{
|
|
public static AppId_t GetAppID() => new AppId_t(0);
|
|
public static bool InitFilterText(uint filterOptions = 0) => false;
|
|
|
|
public static int FilterText(ETextFilteringContext context, CSteamID sourceSteamId, string input, out string filtered, uint filteredSize)
|
|
{
|
|
filtered = input;
|
|
return -1;
|
|
}
|
|
}
|
|
|
|
public static class SteamUser
|
|
{
|
|
public static bool BLoggedOn() => false;
|
|
public static CSteamID GetSteamID() => CSteamID.Nil;
|
|
|
|
public static uint GetAuthSessionTicket(byte[] ticket, int maxTicket, out uint ticketSize, ref SteamNetworkingIdentity identity)
|
|
{
|
|
ticketSize = 0;
|
|
return 0;
|
|
}
|
|
}
|
|
|
|
public static class SteamFriends
|
|
{
|
|
public static string GetPersonaName() => string.Empty;
|
|
public static bool RequestUserInformation(CSteamID steamId, bool requireNameOnly) => false;
|
|
public static string GetFriendPersonaName(CSteamID steamId) => string.Empty;
|
|
}
|
|
|
|
public static class SteamUGC
|
|
{
|
|
public static UGCQueryHandle_t CreateQueryAllUGCRequest(EUGCQuery queryType, EUGCMatchingUGCType matchingType, AppId_t creatorAppId, AppId_t consumerAppId, uint page) => default;
|
|
public static UGCQueryHandle_t CreateQueryUserUGCRequest(uint accountId, EUserUGCList listType, EUGCMatchingUGCType matchingType, EUserUGCListSortOrder sortOrder, AppId_t creatorAppId, AppId_t consumerAppId, uint page) => default;
|
|
public static bool SetReturnLongDescription(UGCQueryHandle_t handle, bool value) => false;
|
|
public static bool SetReturnTotalOnly(UGCQueryHandle_t handle, bool value) => false;
|
|
public static SteamAPICall_t SendQueryUGCRequest(UGCQueryHandle_t handle) => default;
|
|
public static bool ReleaseQueryUGCRequest(UGCQueryHandle_t handle) => true;
|
|
public static bool GetQueryUGCResult(UGCQueryHandle_t handle, uint index, out SteamUGCDetails_t details)
|
|
{
|
|
details = default;
|
|
return false;
|
|
}
|
|
|
|
public static uint GetItemState(PublishedFileId_t fileId) => 0;
|
|
public static bool GetItemInstallInfo(PublishedFileId_t fileId, out ulong sizeOnDisk, out string folder, uint folderSize, out uint timestamp)
|
|
{
|
|
sizeOnDisk = 0;
|
|
folder = string.Empty;
|
|
timestamp = 0;
|
|
return false;
|
|
}
|
|
|
|
public static uint GetNumSubscribedItems() => 0;
|
|
public static uint GetSubscribedItems(PublishedFileId_t[] publishedFileIds, uint maxEntries) => 0;
|
|
public static SteamAPICall_t SubscribeItem(PublishedFileId_t fileId) => default;
|
|
public static SteamAPICall_t UnsubscribeItem(PublishedFileId_t fileId) => default;
|
|
public static SteamAPICall_t CreateItem(AppId_t consumerAppId, EWorkshopFileType fileType) => default;
|
|
public static UGCUpdateHandle_t StartItemUpdate(AppId_t consumerAppId, PublishedFileId_t fileId) => default;
|
|
public static bool SetItemTitle(UGCUpdateHandle_t handle, string title) => false;
|
|
public static bool SetItemDescription(UGCUpdateHandle_t handle, string description) => false;
|
|
public static bool SetItemContent(UGCUpdateHandle_t handle, string contentFolder) => false;
|
|
public static bool SetItemPreview(UGCUpdateHandle_t handle, string previewFile) => false;
|
|
public static bool SetItemVisibility(UGCUpdateHandle_t handle, ERemoteStoragePublishedFileVisibility visibility) => false;
|
|
public static bool SetItemTags(UGCUpdateHandle_t handle, System.Collections.Generic.IList<string> tags) => false;
|
|
public static SteamAPICall_t SubmitItemUpdate(UGCUpdateHandle_t handle, string changeNote) => default;
|
|
public static EItemUpdateStatus GetItemUpdateProgress(UGCUpdateHandle_t handle, out ulong bytesProcessed, out ulong bytesTotal)
|
|
{
|
|
bytesProcessed = 0;
|
|
bytesTotal = 0;
|
|
return EItemUpdateStatus.k_EItemUpdateStatusInvalid;
|
|
}
|
|
}
|
|
}
|
|
#endif
|