-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsteam.h
88 lines (63 loc) · 1.66 KB
/
steam.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
#pragma once
#include <steam_api.h>
#include <string>
enum Result
{
Success,
ELegal,
EPermissions,
ETimeout,
ELoggedOut,
EGeneral,
ENotFound,
ELimit,
};
class UpdateWorkshop
{
private:
PublishedFileId_t m_fileid;
UGCUpdateHandle_t m_handle;
AppId_t m_game;
std::string m_changelog;
bool m_finished = false;
EResult m_result;
EItemUpdateStatus m_status;
uint64 m_bytes_uploaded;
uint64 m_bytes_total;
CCallResult<UpdateWorkshop, SubmitItemUpdateResult_t> m_update_result;
void submit_callback(SubmitItemUpdateResult_t *result, bool failure);
public:
UpdateWorkshop(PublishedFileId_t fileid, AppId_t game);
void StartUpdateItem();
bool SetTitle(std::string title);
bool SetDescription(std::string description);
bool SetPreviewImage(std::string image);
bool SetLanguage(std::string language);
bool SetVisibility(ERemoteStoragePublishedFileVisibility visibility);
bool SetItemContent(std::string path);
void SetChangelog(std::string changelog);
void FinishUpdateItem();
bool IsFinished();
EResult GetResult();
void UpdateStats();
uint64 GetUploadedBytes();
uint64 GetTotalBytes();
EItemUpdateStatus GetStatus();
};
class CreateWorkshop
{
private:
PublishedFileId_t m_fileid;
AppId_t m_game;
bool m_finished = false;
Result m_result;
CCallResult<CreateWorkshop, CreateItemResult_t> m_create_result;
void create_callback(CreateItemResult_t *result, bool failure);
public:
CreateWorkshop(AppId_t game);
void CreateItem();
bool IsFinished();
Result GetResult();
PublishedFileId_t GetFileID();
};
AppId_t GetAppIdFromFile();