steamworks-ffi-node 0.5.3 → 0.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +98 -55
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -1
- package/dist/index.js.map +1 -1
- package/dist/internal/SteamAPICore.d.ts +23 -0
- package/dist/internal/SteamAPICore.d.ts.map +1 -1
- package/dist/internal/SteamAPICore.js +30 -0
- package/dist/internal/SteamAPICore.js.map +1 -1
- package/dist/internal/SteamCallbackPoller.d.ts +72 -0
- package/dist/internal/SteamCallbackPoller.d.ts.map +1 -1
- package/dist/internal/SteamCallbackPoller.js +144 -2
- package/dist/internal/SteamCallbackPoller.js.map +1 -1
- package/dist/internal/SteamCloudManager.d.ts.map +1 -1
- package/dist/internal/SteamCloudManager.js +18 -18
- package/dist/internal/SteamCloudManager.js.map +1 -1
- package/dist/internal/SteamLibraryLoader.d.ts +28 -0
- package/dist/internal/SteamLibraryLoader.d.ts.map +1 -1
- package/dist/internal/SteamLibraryLoader.js +96 -30
- package/dist/internal/SteamLibraryLoader.js.map +1 -1
- package/dist/internal/SteamOverlayManager.js +21 -21
- package/dist/internal/SteamOverlayManager.js.map +1 -1
- package/dist/internal/SteamRichPresenceManager.js +18 -18
- package/dist/internal/SteamRichPresenceManager.js.map +1 -1
- package/dist/internal/SteamWorkshopManager.d.ts +602 -0
- package/dist/internal/SteamWorkshopManager.d.ts.map +1 -0
- package/dist/internal/SteamWorkshopManager.js +1426 -0
- package/dist/internal/SteamWorkshopManager.js.map +1 -0
- package/dist/internal/callbackTypes/SteamCallbackIds.d.ts +26 -0
- package/dist/internal/callbackTypes/SteamCallbackIds.d.ts.map +1 -0
- package/dist/internal/callbackTypes/SteamCallbackIds.js +35 -0
- package/dist/internal/callbackTypes/SteamCallbackIds.js.map +1 -0
- package/dist/internal/callbackTypes/SteamCallbackTypes.d.ts +89 -0
- package/dist/internal/callbackTypes/SteamCallbackTypes.d.ts.map +1 -0
- package/dist/internal/callbackTypes/SteamCallbackTypes.js +9 -0
- package/dist/internal/callbackTypes/SteamCallbackTypes.js.map +1 -0
- package/dist/internal/callbackTypes/index.d.ts +6 -0
- package/dist/internal/callbackTypes/index.d.ts.map +1 -0
- package/dist/internal/callbackTypes/index.js +22 -0
- package/dist/internal/callbackTypes/index.js.map +1 -0
- package/dist/steam.d.ts +42 -0
- package/dist/steam.d.ts.map +1 -1
- package/dist/steam.js +4 -0
- package/dist/steam.js.map +1 -1
- package/dist/types/index.d.ts +2 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js +3 -0
- package/dist/types/index.js.map +1 -1
- package/dist/types/workshop.d.ts +302 -0
- package/dist/types/workshop.d.ts.map +1 -0
- package/dist/types/workshop.js +203 -0
- package/dist/types/workshop.js.map +1 -0
- package/docs/README.md +167 -0
- package/docs/STEAMWORKS_SDK_SETUP.md +209 -0
- package/package.json +9 -3
- package/postinstall.js +34 -0
- package/verify-sdk-setup.js +220 -0
- package/THIRD_PARTY_LICENSES.md +0 -24
- package/steamworks_sdk/redistributable_bin/linux32/libsteam_api.so +0 -0
- package/steamworks_sdk/redistributable_bin/linux64/libsteam_api.so +0 -0
- package/steamworks_sdk/redistributable_bin/osx/libsteam_api.dylib +0 -0
- package/steamworks_sdk/redistributable_bin/steam_api.dll +0 -0
- package/steamworks_sdk/redistributable_bin/steam_api.lib +0 -0
- package/steamworks_sdk/redistributable_bin/win64/steam_api64.dll +0 -0
- package/steamworks_sdk/redistributable_bin/win64/steam_api64.lib +0 -0
package/README.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
# Steamworks FFI - Steamworks SDK Integration
|
|
5
5
|
|
|
6
|
-
A
|
|
6
|
+
A TypeScript/JavaScript wrapper for the Steamworks SDK using Koffi FFI, designed for Node.js and Electron applications with **Steamworks SDK v1.62 integration**.
|
|
7
7
|
|
|
8
8
|
> ✅ **No C++ Compilation Required**: Uses Koffi FFI for seamless installation without Visual Studio Build Tools!
|
|
9
9
|
|
|
@@ -23,6 +23,8 @@ A production-ready TypeScript/JavaScript wrapper for the Steamworks SDK using Ko
|
|
|
23
23
|
|
|
24
24
|
> 🎉 **NEW: Cloud Storage API** - 14 functions for complete Steam Cloud (Remote Storage) integration! [See Documentation](https://github.com/ArtyProf/steamworks-ffi-node/blob/main/docs/CLOUD_MANAGER.md)
|
|
25
25
|
|
|
26
|
+
> 🎉 **NEW: Workshop API** - 25+ functions for complete Steam Workshop/UGC integration! [See Documentation](https://github.com/ArtyProf/steamworks-ffi-node/blob/main/docs/WORKSHOP_MANAGER.md)
|
|
27
|
+
|
|
26
28
|
## 🎯 Features
|
|
27
29
|
|
|
28
30
|
- **Complete Achievement API**: 100% coverage of Steam Achievement functionality (20/20 functions)
|
|
@@ -66,9 +68,15 @@ A production-ready TypeScript/JavaScript wrapper for the Steamworks SDK using Ko
|
|
|
66
68
|
- ✅ File listing (count, iterate, get all with details)
|
|
67
69
|
- ✅ Quota management (track storage usage and limits)
|
|
68
70
|
- ✅ Cloud settings (check/toggle cloud sync for account and app)
|
|
71
|
+
- **Workshop API**: Complete Steam Workshop/UGC integration (25+ functions)
|
|
72
|
+
- ✅ Subscription management (subscribe, unsubscribe, list items)
|
|
73
|
+
- ✅ Item state & information (download progress, installation info)
|
|
74
|
+
- ✅ Query operations (search, browse, filter Workshop content)
|
|
75
|
+
- ✅ Item creation & update (create, upload, manage your Workshop items)
|
|
76
|
+
- ✅ Voting & favorites (vote on items, manage favorites)
|
|
69
77
|
- **Steamworks Integration**: Direct FFI calls to Steamworks C++ SDK
|
|
70
78
|
- **Cross-Platform**: Windows, macOS, and Linux support
|
|
71
|
-
- **
|
|
79
|
+
- **Easy Setup**: Simple installation with clear SDK setup guide
|
|
72
80
|
- **Electron Ready**: Perfect for Electron applications
|
|
73
81
|
- **TypeScript Support**: Complete TypeScript definitions included
|
|
74
82
|
- **No C++ Compilation**: Uses Koffi FFI for seamless installation
|
|
@@ -78,18 +86,25 @@ A production-ready TypeScript/JavaScript wrapper for the Steamworks SDK using Ko
|
|
|
78
86
|
### Installation
|
|
79
87
|
|
|
80
88
|
```bash
|
|
81
|
-
# Install the package
|
|
89
|
+
# Install the package
|
|
82
90
|
npm install steamworks-ffi-node
|
|
83
91
|
```
|
|
84
92
|
|
|
85
93
|
### Setup
|
|
86
94
|
|
|
87
|
-
1. **
|
|
95
|
+
1. **Download Steamworks SDK** (required separately due to licensing):
|
|
96
|
+
- Visit [Steamworks Partner site](https://partner.steamgames.com/)
|
|
97
|
+
- Download the latest Steamworks SDK
|
|
98
|
+
- Extract and copy `redistributable_bin` folder to your project
|
|
99
|
+
- See [STEAMWORKS_SDK_SETUP.md](https://github.com/ArtyProf/steamworks-ffi-node/blob/main/docs/STEAMWORKS_SDK_SETUP.md) for detailed instructions
|
|
100
|
+
|
|
101
|
+
2. **Create `steam_appid.txt` (optional)** in your project root:
|
|
88
102
|
```bash
|
|
89
103
|
echo "480" > steam_appid.txt # Use 480 for testing, or your Steam App ID
|
|
90
104
|
```
|
|
105
|
+
*Note: You can skip this file and pass the App ID directly to `steam.init(appId)` instead*
|
|
91
106
|
|
|
92
|
-
|
|
107
|
+
3. **Make sure Steam is running** and you're logged in
|
|
93
108
|
|
|
94
109
|
### Basic Usage
|
|
95
110
|
|
|
@@ -232,6 +247,70 @@ if (initialized) {
|
|
|
232
247
|
const status = file.persisted ? '☁️' : '⏳';
|
|
233
248
|
console.log(`${status} ${file.name} - ${kb} KB`);
|
|
234
249
|
});
|
|
250
|
+
|
|
251
|
+
// Steam Workshop operations
|
|
252
|
+
// Subscribe to a Workshop item
|
|
253
|
+
const subscribeResult = await steam.workshop.subscribeItem(123456789n);
|
|
254
|
+
if (subscribeResult.success) {
|
|
255
|
+
console.log('✅ Subscribed to Workshop item');
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
// Get all subscribed items
|
|
259
|
+
const subscribedItems = steam.workshop.getSubscribedItems();
|
|
260
|
+
console.log(`Subscribed to ${subscribedItems.length} Workshop items`);
|
|
261
|
+
|
|
262
|
+
// Query Workshop items
|
|
263
|
+
const query = steam.workshop.createQueryAllUGCRequest(
|
|
264
|
+
0, // Most popular
|
|
265
|
+
1, // Items
|
|
266
|
+
1, // Subscribed content
|
|
267
|
+
1, // Subscribed items
|
|
268
|
+
480 // App ID
|
|
269
|
+
);
|
|
270
|
+
|
|
271
|
+
if (query) {
|
|
272
|
+
const queryResult = await steam.workshop.sendQueryUGCRequest(query);
|
|
273
|
+
if (queryResult.success) {
|
|
274
|
+
console.log(`Found ${queryResult.numResults} Workshop items`);
|
|
275
|
+
|
|
276
|
+
// Get details for each item
|
|
277
|
+
for (let i = 0; i < queryResult.numResults; i++) {
|
|
278
|
+
const details = steam.workshop.getQueryUGCResult(query, i);
|
|
279
|
+
if (details) {
|
|
280
|
+
console.log(`📦 ${details.title} by ${details.steamIDOwner}`);
|
|
281
|
+
console.log(` Score: ${details.score}, Downloads: ${details.numUniqueSubscriptions}`);
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
steam.workshop.releaseQueryUGCRequest(query);
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
// Check download progress for subscribed items
|
|
289
|
+
subscribedItems.forEach(itemId => {
|
|
290
|
+
const state = steam.workshop.getItemState(itemId);
|
|
291
|
+
const stateFlags = [];
|
|
292
|
+
if (state & 1) stateFlags.push('Subscribed');
|
|
293
|
+
if (state & 4) stateFlags.push('Needs Update');
|
|
294
|
+
if (state & 8) stateFlags.push('Installed');
|
|
295
|
+
if (state & 16) stateFlags.push('Downloading');
|
|
296
|
+
|
|
297
|
+
console.log(`Item ${itemId}: ${stateFlags.join(', ')}`);
|
|
298
|
+
|
|
299
|
+
if (state & 16) { // If downloading
|
|
300
|
+
const progress = steam.workshop.getItemDownloadInfo(itemId);
|
|
301
|
+
if (progress) {
|
|
302
|
+
const percent = (progress.downloaded / progress.total * 100).toFixed(1);
|
|
303
|
+
console.log(` Download: ${percent}% (${progress.downloaded}/${progress.total} bytes)`);
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
if (state & 8) { // If installed
|
|
308
|
+
const info = steam.workshop.getItemInstallInfo(itemId);
|
|
309
|
+
if (info.success) {
|
|
310
|
+
console.log(` Installed at: ${info.folder}`);
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
});
|
|
235
314
|
}
|
|
236
315
|
|
|
237
316
|
// Cleanup
|
|
@@ -283,6 +362,8 @@ Complete documentation for all APIs is available in the [docs folder](https://gi
|
|
|
283
362
|
- **[Friends Manager](https://github.com/ArtyProf/steamworks-ffi-node/blob/main/docs/FRIENDS_MANAGER.md)** - Friends and social features (22 functions)
|
|
284
363
|
- **[Rich Presence Manager](https://github.com/ArtyProf/steamworks-ffi-node/blob/main/docs/RICH_PRESENCE_MANAGER.md)** - Custom status display and join functionality (6 functions)
|
|
285
364
|
- **[Overlay Manager](https://github.com/ArtyProf/steamworks-ffi-node/blob/main/docs/OVERLAY_MANAGER.md)** - Steam overlay control (7 functions)
|
|
365
|
+
- **[Cloud Storage Manager](https://github.com/ArtyProf/steamworks-ffi-node/blob/main/docs/CLOUD_STORAGE_MANAGER.md)** - Steam Cloud file operations (14 functions)
|
|
366
|
+
- **[Workshop Manager](https://github.com/ArtyProf/steamworks-ffi-node/blob/main/docs/WORKSHOP_MANAGER.md)** - Steam Workshop/UGC operations (25+ functions)
|
|
286
367
|
- **[Cloud Manager](https://github.com/ArtyProf/steamworks-ffi-node/blob/main/docs/CLOUD_MANAGER.md)** - Steam Cloud storage operations (14 functions)
|
|
287
368
|
|
|
288
369
|
## 🎮 Steamworks Integration
|
|
@@ -336,66 +417,33 @@ app.on('before-quit', () => {
|
|
|
336
417
|
});
|
|
337
418
|
```
|
|
338
419
|
|
|
339
|
-
### 📦 Packaging
|
|
420
|
+
### 📦 Electron Packaging
|
|
340
421
|
|
|
341
|
-
|
|
422
|
+
For Electron applications, the library will automatically detect the Steamworks SDK files in your project directory. No special packaging configuration is needed - just ensure your `steamworks_sdk/redistributable_bin` folder is present in your project.
|
|
342
423
|
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
Add to your `package.json` or `electron-builder.yml`:
|
|
346
|
-
|
|
347
|
-
```json
|
|
348
|
-
{
|
|
349
|
-
"build": {
|
|
350
|
-
"asarUnpack": [
|
|
351
|
-
"node_modules/steamworks-ffi-node/**/*"
|
|
352
|
-
]
|
|
353
|
-
}
|
|
354
|
-
}
|
|
355
|
-
```
|
|
356
|
-
|
|
357
|
-
#### electron-forge Configuration
|
|
358
|
-
|
|
359
|
-
Add to your `forge.config.js`:
|
|
360
|
-
|
|
361
|
-
```javascript
|
|
362
|
-
module.exports = {
|
|
363
|
-
packagerConfig: {
|
|
364
|
-
asar: {
|
|
365
|
-
unpack: "**/{node_modules/steamworks-ffi-node}/**/*"
|
|
366
|
-
}
|
|
367
|
-
}
|
|
368
|
-
};
|
|
369
|
-
```
|
|
370
|
-
|
|
371
|
-
The library will automatically:
|
|
372
|
-
1. Detect if running inside an ASAR archive
|
|
373
|
-
2. Replace `.asar` with `.asar.unpacked` in the library path
|
|
374
|
-
3. Load the Steamworks SDK from the unpacked directory
|
|
375
|
-
|
|
376
|
-
This ensures native libraries work correctly in packaged Electron apps!
|
|
424
|
+
The library searches for the SDK in standard locations within your Electron app bundle.
|
|
377
425
|
|
|
378
426
|
## 🔧 Requirements
|
|
379
427
|
|
|
380
428
|
- **Node.js**: 18+
|
|
381
429
|
- **Steam Client**: Must be running and logged in
|
|
382
430
|
- **Steam App ID**: Get yours at [Steamworks Partner](https://partner.steamgames.com/)
|
|
383
|
-
- **steam_appid.txt**:
|
|
431
|
+
- **steam_appid.txt**: Optional - create in your project root OR pass to `steam.init(appId)`
|
|
384
432
|
|
|
385
433
|
### Platform Support
|
|
386
|
-
- ✅ **Windows**:
|
|
387
|
-
- ✅ **macOS**:
|
|
388
|
-
- ✅ **Linux**:
|
|
434
|
+
- ✅ **Windows**: steam_api64.dll / steam_api.dll
|
|
435
|
+
- ✅ **macOS**: libsteam_api.dylib
|
|
436
|
+
- ✅ **Linux**: libsteam_api.so
|
|
389
437
|
|
|
390
438
|
**Steamworks SDK Version**: v1.62 (Latest)
|
|
391
439
|
|
|
392
|
-
|
|
440
|
+
*Note: You must download and install the SDK redistributables separately as described in the Setup section above.*
|
|
393
441
|
|
|
394
442
|
## 🔧 Troubleshooting
|
|
395
443
|
|
|
396
444
|
### "SteamAPI_Init failed"
|
|
397
445
|
- ❌ Steam client not running → **Solution**: Start Steam and log in
|
|
398
|
-
- ❌
|
|
446
|
+
- ❌ No App ID specified → **Solution**: Create `steam_appid.txt` in project root OR pass App ID to `steam.init(appId)`
|
|
399
447
|
- ❌ Invalid App ID → **Solution**: Use 480 for testing, or your registered App ID
|
|
400
448
|
|
|
401
449
|
### "Cannot find module 'steamworks-ffi-node'"
|
|
@@ -409,16 +457,11 @@ All redistributable binaries are included in the package - no manual SDK downloa
|
|
|
409
457
|
### Electron-specific issues
|
|
410
458
|
- ❌ Initialized in renderer → **Solution**: Only initialize in main process
|
|
411
459
|
- ❌ Not cleaning up → **Solution**: Call `shutdown()` in `before-quit` event
|
|
412
|
-
- ❌ "
|
|
413
|
-
- ❌ Native module errors in packaged app → **Solution**: Ensure
|
|
460
|
+
- ❌ "Steamworks SDK library not found" in packaged app → **Solution**: Include SDK redistributables in your build (see Electron Packaging section above)
|
|
461
|
+
- ❌ Native module errors in packaged app → **Solution**: Ensure Steamworks SDK files are properly included in your app bundle
|
|
414
462
|
|
|
415
463
|
## 📄 License
|
|
416
464
|
|
|
417
465
|
MIT License - see LICENSE file for details.
|
|
418
466
|
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
This package includes redistributable binaries from the Steamworks SDK (© Valve Corporation).
|
|
422
|
-
These are distributed under the Steamworks SDK Access Agreement in accordance with Section 1.1(b).
|
|
423
|
-
|
|
424
|
-
See [THIRD_PARTY_LICENSES.md](https://github.com/ArtyProf/steamworks-ffi-node/blob/main/THIRD_PARTY_LICENSES.md) for full details.
|
|
467
|
+
**Note**: This package requires the Steamworks SDK redistributables to be installed separately by users. Users are responsible for complying with Valve's Steamworks SDK Access Agreement when downloading and using the SDK.
|
package/dist/index.d.ts
CHANGED
|
@@ -5,6 +5,8 @@ export { SteamLeaderboardManager } from './internal/SteamLeaderboardManager';
|
|
|
5
5
|
export { SteamFriendsManager } from './internal/SteamFriendsManager';
|
|
6
6
|
export { SteamRichPresenceManager } from './internal/SteamRichPresenceManager';
|
|
7
7
|
export { SteamOverlayManager } from './internal/SteamOverlayManager';
|
|
8
|
+
export { SteamCloudManager } from './internal/SteamCloudManager';
|
|
9
|
+
export { SteamWorkshopManager } from './internal/SteamWorkshopManager';
|
|
8
10
|
export * from './types';
|
|
9
11
|
export default SteamworksSDK;
|
|
10
12
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,aAAa,MAAM,SAAS,CAAC;AAGpC,OAAO,EAAE,uBAAuB,EAAE,MAAM,oCAAoC,CAAC;AAC7E,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACjE,OAAO,EAAE,uBAAuB,EAAE,MAAM,oCAAoC,CAAC;AAC7E,OAAO,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;AACrE,OAAO,EAAE,wBAAwB,EAAE,MAAM,qCAAqC,CAAC;AAC/E,OAAO,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,aAAa,MAAM,SAAS,CAAC;AAGpC,OAAO,EAAE,uBAAuB,EAAE,MAAM,oCAAoC,CAAC;AAC7E,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACjE,OAAO,EAAE,uBAAuB,EAAE,MAAM,oCAAoC,CAAC;AAC7E,OAAO,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;AACrE,OAAO,EAAE,wBAAwB,EAAE,MAAM,qCAAqC,CAAC;AAC/E,OAAO,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;AACrE,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACjE,OAAO,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AAGvE,cAAc,SAAS,CAAC;AAGxB,eAAe,aAAa,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -17,7 +17,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
17
17
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
18
18
|
};
|
|
19
19
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
|
-
exports.SteamOverlayManager = exports.SteamRichPresenceManager = exports.SteamFriendsManager = exports.SteamLeaderboardManager = exports.SteamStatsManager = exports.SteamAchievementManager = void 0;
|
|
20
|
+
exports.SteamWorkshopManager = exports.SteamCloudManager = exports.SteamOverlayManager = exports.SteamRichPresenceManager = exports.SteamFriendsManager = exports.SteamLeaderboardManager = exports.SteamStatsManager = exports.SteamAchievementManager = void 0;
|
|
21
21
|
const steam_1 = __importDefault(require("./steam"));
|
|
22
22
|
// Export manager classes for advanced usage
|
|
23
23
|
var SteamAchievementManager_1 = require("./internal/SteamAchievementManager");
|
|
@@ -32,6 +32,10 @@ var SteamRichPresenceManager_1 = require("./internal/SteamRichPresenceManager");
|
|
|
32
32
|
Object.defineProperty(exports, "SteamRichPresenceManager", { enumerable: true, get: function () { return SteamRichPresenceManager_1.SteamRichPresenceManager; } });
|
|
33
33
|
var SteamOverlayManager_1 = require("./internal/SteamOverlayManager");
|
|
34
34
|
Object.defineProperty(exports, "SteamOverlayManager", { enumerable: true, get: function () { return SteamOverlayManager_1.SteamOverlayManager; } });
|
|
35
|
+
var SteamCloudManager_1 = require("./internal/SteamCloudManager");
|
|
36
|
+
Object.defineProperty(exports, "SteamCloudManager", { enumerable: true, get: function () { return SteamCloudManager_1.SteamCloudManager; } });
|
|
37
|
+
var SteamWorkshopManager_1 = require("./internal/SteamWorkshopManager");
|
|
38
|
+
Object.defineProperty(exports, "SteamWorkshopManager", { enumerable: true, get: function () { return SteamWorkshopManager_1.SteamWorkshopManager; } });
|
|
35
39
|
// Export all types from organized structure
|
|
36
40
|
__exportStar(require("./types"), exports);
|
|
37
41
|
// Export main Steam class
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA,oDAAoC;AAEpC,4CAA4C;AAC5C,8EAA6E;AAApE,kIAAA,uBAAuB,OAAA;AAChC,kEAAiE;AAAxD,sHAAA,iBAAiB,OAAA;AAC1B,8EAA6E;AAApE,kIAAA,uBAAuB,OAAA;AAChC,sEAAqE;AAA5D,0HAAA,mBAAmB,OAAA;AAC5B,gFAA+E;AAAtE,oIAAA,wBAAwB,OAAA;AACjC,sEAAqE;AAA5D,0HAAA,mBAAmB,OAAA;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA,oDAAoC;AAEpC,4CAA4C;AAC5C,8EAA6E;AAApE,kIAAA,uBAAuB,OAAA;AAChC,kEAAiE;AAAxD,sHAAA,iBAAiB,OAAA;AAC1B,8EAA6E;AAApE,kIAAA,uBAAuB,OAAA;AAChC,sEAAqE;AAA5D,0HAAA,mBAAmB,OAAA;AAC5B,gFAA+E;AAAtE,oIAAA,wBAAwB,OAAA;AACjC,sEAAqE;AAA5D,0HAAA,mBAAmB,OAAA;AAC5B,kEAAiE;AAAxD,sHAAA,iBAAiB,OAAA;AAC1B,wEAAuE;AAA9D,4HAAA,oBAAoB,OAAA;AAE7B,4CAA4C;AAC5C,0CAAwB;AAExB,0BAA0B;AAC1B,kBAAe,eAAa,CAAC"}
|
|
@@ -42,6 +42,8 @@ export declare class SteamAPICore {
|
|
|
42
42
|
private friendsInterface;
|
|
43
43
|
/** Pointer to the ISteamRemoteStorage interface */
|
|
44
44
|
private remoteStorageInterface;
|
|
45
|
+
/** Pointer to the ISteamUGC interface */
|
|
46
|
+
private ugcInterface;
|
|
45
47
|
/**
|
|
46
48
|
* Creates a new SteamAPICore instance
|
|
47
49
|
*
|
|
@@ -301,5 +303,26 @@ export declare class SteamAPICore {
|
|
|
301
303
|
* - This is a native pointer for use with FFI calls
|
|
302
304
|
*/
|
|
303
305
|
getRemoteStorageInterface(): any;
|
|
306
|
+
/**
|
|
307
|
+
* Get the ISteamUGC interface pointer
|
|
308
|
+
*
|
|
309
|
+
* Provides access to the Workshop/UGC (User Generated Content) interface for managing
|
|
310
|
+
* Steam Workshop items.
|
|
311
|
+
*
|
|
312
|
+
* @returns Pointer to ISteamUGC interface, or null if not initialized
|
|
313
|
+
*
|
|
314
|
+
* @example
|
|
315
|
+
* ```typescript
|
|
316
|
+
* const ugc = apiCore.getUGCInterface();
|
|
317
|
+
* if (ugc) {
|
|
318
|
+
* // Use interface for Workshop operations
|
|
319
|
+
* }
|
|
320
|
+
* ```
|
|
321
|
+
*
|
|
322
|
+
* @remarks
|
|
323
|
+
* - Returns null if Steam API is not initialized
|
|
324
|
+
* - This is a native pointer for use with FFI calls
|
|
325
|
+
*/
|
|
326
|
+
getUGCInterface(): any;
|
|
304
327
|
}
|
|
305
328
|
//# sourceMappingURL=SteamAPICore.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SteamAPICore.d.ts","sourceRoot":"","sources":["../../src/internal/SteamAPICore.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AACzD,OAAO,EAAE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AmD;IACnD,OAAO,CAAC,sBAAsB,CAAa;IAE3C,yCAAyC;IACzC,OAAO,CAAC,YAAY,CAAa;IAEjC;;;;OAIG;gBACS,aAAa,EAAE,kBAAkB;IAI7C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAoCG;IACH,IAAI,CAAC,OAAO,EAAE,gBAAgB,GAAG,OAAO;IA2FxC;;;;;;;;;;;;;;;;;;;;;OAqBG;IACH,QAAQ,IAAI,IAAI;IAYhB;;;;;;;;;;;;;;;;;;;;;;OAsBG;IACH,SAAS,IAAI,WAAW;IAmBxB;;;;;;;;;;;;;;;;;;;;;OAqBG;IACH,YAAY,IAAI,IAAI;IAUpB;;;;;;;;;;;;;;;;;;;;;;OAsBG;IACH,cAAc,IAAI,OAAO;IAYzB;;;;;;;;;;;;;;OAcG;IACH,aAAa,IAAI,OAAO;IAIxB;;;;;;;;;;;;;;;;;;;OAmBG;IACH,qBAAqB,IAAI,GAAG;IAI5B;;;;;;;;;;;;;;;;;;;OAmBG;IACH,gBAAgB,IAAI,GAAG;IAIvB;;;;;;;;;;;;;;;;;;;OAmBG;IACH,iBAAiB,IAAI,GAAG;IAIxB;;;;;;;;;;;;;;;;;;;OAmBG;IACH,mBAAmB,IAAI,GAAG;IAI1B;;;;;;;;;;;;;;;;;;;OAmBG;IACH,yBAAyB,IAAI,GAAG;IAIhC;;;;;;;;;;;;;;;;;;;OAmBG;IACH,eAAe,IAAI,GAAG;CAGvB"}
|
|
@@ -82,6 +82,8 @@ class SteamAPICore {
|
|
|
82
82
|
this.friendsInterface = null;
|
|
83
83
|
/** Pointer to the ISteamRemoteStorage interface */
|
|
84
84
|
this.remoteStorageInterface = null;
|
|
85
|
+
/** Pointer to the ISteamUGC interface */
|
|
86
|
+
this.ugcInterface = null;
|
|
85
87
|
this.libraryLoader = libraryLoader;
|
|
86
88
|
}
|
|
87
89
|
/**
|
|
@@ -165,6 +167,11 @@ class SteamAPICore {
|
|
|
165
167
|
if (!this.remoteStorageInterface || this.remoteStorageInterface === null) {
|
|
166
168
|
console.warn('[Steamworks] WARNING: Failed to get SteamRemoteStorage interface');
|
|
167
169
|
}
|
|
170
|
+
// Get UGC interface
|
|
171
|
+
this.ugcInterface = this.libraryLoader.SteamAPI_SteamUGC_v021();
|
|
172
|
+
if (!this.ugcInterface || this.ugcInterface === null) {
|
|
173
|
+
console.warn('[Steamworks] WARNING: Failed to get SteamUGC interface');
|
|
174
|
+
}
|
|
168
175
|
// Request current stats from Steam servers
|
|
169
176
|
console.log('[Steamworks] Requesting current stats from Steam...');
|
|
170
177
|
const statsRequested = this.libraryLoader.SteamAPI_ISteamUserStats_RequestCurrentStats(this.userStatsInterface, 0);
|
|
@@ -460,6 +467,29 @@ class SteamAPICore {
|
|
|
460
467
|
getRemoteStorageInterface() {
|
|
461
468
|
return this.remoteStorageInterface;
|
|
462
469
|
}
|
|
470
|
+
/**
|
|
471
|
+
* Get the ISteamUGC interface pointer
|
|
472
|
+
*
|
|
473
|
+
* Provides access to the Workshop/UGC (User Generated Content) interface for managing
|
|
474
|
+
* Steam Workshop items.
|
|
475
|
+
*
|
|
476
|
+
* @returns Pointer to ISteamUGC interface, or null if not initialized
|
|
477
|
+
*
|
|
478
|
+
* @example
|
|
479
|
+
* ```typescript
|
|
480
|
+
* const ugc = apiCore.getUGCInterface();
|
|
481
|
+
* if (ugc) {
|
|
482
|
+
* // Use interface for Workshop operations
|
|
483
|
+
* }
|
|
484
|
+
* ```
|
|
485
|
+
*
|
|
486
|
+
* @remarks
|
|
487
|
+
* - Returns null if Steam API is not initialized
|
|
488
|
+
* - This is a native pointer for use with FFI calls
|
|
489
|
+
*/
|
|
490
|
+
getUGCInterface() {
|
|
491
|
+
return this.ugcInterface;
|
|
492
|
+
}
|
|
463
493
|
}
|
|
464
494
|
exports.SteamAPICore = SteamAPICore;
|
|
465
495
|
//# sourceMappingURL=SteamAPICore.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SteamAPICore.js","sourceRoot":"","sources":["../../src/internal/SteamAPICore.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uCAAyB;AACzB,2CAA6B;AAI7B;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,MAAa,YAAY;
|
|
1
|
+
{"version":3,"file":"SteamAPICore.js","sourceRoot":"","sources":["../../src/internal/SteamAPICore.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uCAAyB;AACzB,2CAA6B;AAI7B;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,MAAa,YAAY;IA4BvB;;;;OAIG;IACH,YAAY,aAAiC;QA7B7C,8DAA8D;QACtD,gBAAW,GAAY,KAAK,CAAC;QAErC,4CAA4C;QACpC,UAAK,GAAW,CAAC,CAAC;QAE1B,+CAA+C;QACvC,uBAAkB,GAAQ,IAAI,CAAC;QAEvC,0CAA0C;QAClC,kBAAa,GAAQ,IAAI,CAAC;QAElC,2CAA2C;QACnC,mBAAc,GAAQ,IAAI,CAAC;QAEnC,6CAA6C;QACrC,qBAAgB,GAAQ,IAAI,CAAC;QAErC,mDAAmD;QAC3C,2BAAsB,GAAQ,IAAI,CAAC;QAE3C,yCAAyC;QACjC,iBAAY,GAAQ,IAAI,CAAC;QAQ/B,IAAI,CAAC,aAAa,GAAG,aAAa,CAAC;IACrC,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAoCG;IACH,IAAI,CAAC,OAAyB;QAC5B,IAAI,CAAC;YACH,IAAI,CAAC,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC;YAE3B,kCAAkC;YAClC,OAAO,CAAC,GAAG,CAAC,UAAU,GAAG,IAAI,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC;YAE/C,uDAAuD;YACvD,MAAM,aAAa,GAAG,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,iBAAiB,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AI,CAAC,aAAa,CAAC;IAC5B,CAAC;IAED;;;;;;;;;;;;;;;;;;;OAmBG;IACH,iBAAiB;QACf,OAAO,IAAI,CAAC,cAAc,CAAC;IAC7B,CAAC;IAED;;;;;;;;;;;;;;;;;;;OAmBG;IACH,mBAAmB;QACjB,OAAO,IAAI,CAAC,gBAAgB,CAAC;IAC/B,CAAC;IAED;;;;;;;;;;;;;;;;;;;OAmBG;IACH,yBAAyB;QACvB,OAAO,IAAI,CAAC,sBAAsB,CAAC;IACrC,CAAC;IAED;;;;;;;;;;;;;;;;;;;OAmBG;IACH,eAAe;QACb,OAAO,IAAI,CAAC,YAAY,CAAC;IAC3B,CAAC;CACF;AAtdD,oCAsdC"}
|
|
@@ -64,5 +64,77 @@ export declare class SteamCallbackPoller {
|
|
|
64
64
|
* - Logs failure reason using GetAPICallFailureReason()
|
|
65
65
|
*/
|
|
66
66
|
poll<T>(callHandle: bigint, resultStruct: any, callbackId: number, maxRetries?: number, delayMs?: number): Promise<T | null>;
|
|
67
|
+
/**
|
|
68
|
+
* Decodes a callback result, using custom parsing for packed structs
|
|
69
|
+
*
|
|
70
|
+
* Steam SDK uses #pragma pack which causes tight struct packing without natural alignment.
|
|
71
|
+
* Koffi doesn't support custom pack alignment, so we manually parse bytes for affected callbacks.
|
|
72
|
+
*
|
|
73
|
+
* @param callbackId - The callback ID to identify the struct type
|
|
74
|
+
* @param result - Koffi-allocated result buffer
|
|
75
|
+
* @param resultStruct - Koffi struct type definition
|
|
76
|
+
* @returns Decoded result object
|
|
77
|
+
*/
|
|
78
|
+
private decodeCallbackResult;
|
|
79
|
+
/**
|
|
80
|
+
* Manually parses CreateItemResult_t from raw bytes
|
|
81
|
+
*
|
|
82
|
+
* Layout: [int32:0-3][uint64:4-11][uint8:12] = 13 bytes, padded to 16
|
|
83
|
+
* Steam's packed struct has no padding between int32 and uint64
|
|
84
|
+
*
|
|
85
|
+
* @param result - Koffi-allocated result buffer
|
|
86
|
+
* @returns Parsed CreateItemResult_t object
|
|
87
|
+
*/
|
|
88
|
+
private parseCreateItemResult;
|
|
89
|
+
/**
|
|
90
|
+
* Manually parses SubmitItemUpdateResult_t from raw bytes
|
|
91
|
+
*
|
|
92
|
+
* Layout: [int32:0-3][bool:4][padding:5-7][uint64:8-15] = 16 bytes
|
|
93
|
+
* Steam's packed struct has 3 bytes padding after bool to align uint64
|
|
94
|
+
*
|
|
95
|
+
* @param result - Koffi-allocated result buffer
|
|
96
|
+
* @returns Parsed SubmitItemUpdateResult_t object
|
|
97
|
+
*/
|
|
98
|
+
private parseSubmitItemUpdateResult;
|
|
99
|
+
/**
|
|
100
|
+
* Manually parses RemoteStorageSubscribePublishedFileResult_t from raw bytes
|
|
101
|
+
*
|
|
102
|
+
* Layout: [int32:0-3][uint64:4-11] = 12 bytes (NO padding!)
|
|
103
|
+
* Steam's packed struct has no padding between int32 and uint64
|
|
104
|
+
*
|
|
105
|
+
* @param result - Koffi-allocated result buffer
|
|
106
|
+
* @returns Parsed RemoteStorageSubscribePublishedFileResult_t object
|
|
107
|
+
*/
|
|
108
|
+
private parseSubscribeResult;
|
|
109
|
+
/**
|
|
110
|
+
* Manually parses RemoteStorageUnsubscribePublishedFileResult_t from raw bytes
|
|
111
|
+
*
|
|
112
|
+
* Layout: [int32:0-3][uint64:4-11] = 12 bytes (NO padding!)
|
|
113
|
+
* Steam's packed struct has no padding between int32 and uint64
|
|
114
|
+
*
|
|
115
|
+
* @param result - Koffi-allocated result buffer
|
|
116
|
+
* @returns Parsed RemoteStorageUnsubscribePublishedFileResult_t object
|
|
117
|
+
*/
|
|
118
|
+
private parseUnsubscribeResult;
|
|
119
|
+
/**
|
|
120
|
+
* Manually parses SetUserItemVoteResult_t from raw bytes
|
|
121
|
+
*
|
|
122
|
+
* Layout: [uint64:0-7][int32:8-11][bool:12] = 13 bytes
|
|
123
|
+
* Steam's packed struct has no padding after bool
|
|
124
|
+
*
|
|
125
|
+
* @param result - Koffi-allocated result buffer
|
|
126
|
+
* @returns Parsed SetUserItemVoteResult_t object
|
|
127
|
+
*/
|
|
128
|
+
private parseSetUserItemVoteResult;
|
|
129
|
+
/**
|
|
130
|
+
* Manually parses GetUserItemVoteResult_t from raw bytes
|
|
131
|
+
*
|
|
132
|
+
* Layout: [uint64:0-7][int32:8-11][bool×3:12-14] = 15 bytes
|
|
133
|
+
* Steam's packed struct has no padding after bools
|
|
134
|
+
*
|
|
135
|
+
* @param result - Koffi-allocated result buffer
|
|
136
|
+
* @returns Parsed GetUserItemVoteResult_t object
|
|
137
|
+
*/
|
|
138
|
+
private parseGetUserItemVoteResult;
|
|
67
139
|
}
|
|
68
140
|
//# sourceMappingURL=SteamCallbackPoller.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SteamCallbackPoller.d.ts","sourceRoot":"","sources":["../../src/internal/SteamCallbackPoller.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"SteamCallbackPoller.d.ts","sourceRoot":"","sources":["../../src/internal/SteamCallbackPoller.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAgB9C;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,qBAAa,mBAAmB;IAC9B,OAAO,CAAC,aAAa,CAAqB;IAC1C,OAAO,CAAC,OAAO,CAAe;gBAElB,aAAa,EAAE,kBAAkB,EAAE,OAAO,EAAE,YAAY;IAKpE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA+BG;IACG,IAAI,CAAC,CAAC,EACV,UAAU,EAAE,MAAM,EAClB,YAAY,EAAE,GAAG,EACjB,UAAU,EAAE,MAAM,EAClB,UAAU,GAAE,MAAW,EACvB,OAAO,GAAE,MAAY,GACpB,OAAO,CAAC,CAAC,GAAG,IAAI,CAAC;IAoDpB;;;;;;;;;;OAUG;IACH,OAAO,CAAC,oBAAoB;IA2B5B;;;;;;;;OAQG;IACH,OAAO,CAAC,qBAAqB;IAW7B;;;;;;;;OAQG;IACH,OAAO,CAAC,2BAA2B;IAWnC;;;;;;;;OAQG;IACH,OAAO,CAAC,oBAAoB;IAU5B;;;;;;;;OAQG;IACH,OAAO,CAAC,sBAAsB;IAU9B;;;;;;;;OAQG;IACH,OAAO,CAAC,0BAA0B;IAWlC;;;;;;;;OAQG;IACH,OAAO,CAAC,0BAA0B;CAYnC"}
|
|
@@ -35,6 +35,7 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
36
|
exports.SteamCallbackPoller = void 0;
|
|
37
37
|
const koffi = __importStar(require("koffi"));
|
|
38
|
+
const callbackTypes_1 = require("./callbackTypes");
|
|
38
39
|
/**
|
|
39
40
|
* SteamCallbackPoller
|
|
40
41
|
*
|
|
@@ -117,11 +118,13 @@ class SteamCallbackPoller {
|
|
|
117
118
|
const failedResult = koffi.alloc('bool', 1);
|
|
118
119
|
const success = this.libraryLoader.SteamAPI_ISteamUtils_GetAPICallResult(utilsInterface, callHandle, result, koffi.sizeof(resultStruct), callbackId, failedResult);
|
|
119
120
|
if (success && !koffi.decode(failedResult, 'bool')) {
|
|
120
|
-
|
|
121
|
+
// Use custom parsing for packed structs, otherwise use standard Koffi decoding
|
|
122
|
+
const decoded = this.decodeCallbackResult(callbackId, result, resultStruct);
|
|
123
|
+
return decoded;
|
|
121
124
|
}
|
|
122
125
|
else {
|
|
123
126
|
const failureReason = this.libraryLoader.SteamAPI_ISteamUtils_GetAPICallFailureReason(utilsInterface, callHandle);
|
|
124
|
-
console.error(`[Steamworks] API call failed. Reason: ${failureReason}`);
|
|
127
|
+
console.error(`[Steamworks] API call failed. Callback ID: ${callbackId}, Struct size: ${koffi.sizeof(resultStruct)}, Reason: ${failureReason}`);
|
|
125
128
|
return null;
|
|
126
129
|
}
|
|
127
130
|
}
|
|
@@ -129,6 +132,145 @@ class SteamCallbackPoller {
|
|
|
129
132
|
console.warn(`[Steamworks] API call timed out after ${maxRetries * delayMs}ms`);
|
|
130
133
|
return null;
|
|
131
134
|
}
|
|
135
|
+
/**
|
|
136
|
+
* Decodes a callback result, using custom parsing for packed structs
|
|
137
|
+
*
|
|
138
|
+
* Steam SDK uses #pragma pack which causes tight struct packing without natural alignment.
|
|
139
|
+
* Koffi doesn't support custom pack alignment, so we manually parse bytes for affected callbacks.
|
|
140
|
+
*
|
|
141
|
+
* @param callbackId - The callback ID to identify the struct type
|
|
142
|
+
* @param result - Koffi-allocated result buffer
|
|
143
|
+
* @param resultStruct - Koffi struct type definition
|
|
144
|
+
* @returns Decoded result object
|
|
145
|
+
*/
|
|
146
|
+
decodeCallbackResult(callbackId, result, resultStruct) {
|
|
147
|
+
// Special handling for packed structs - manual byte parsing
|
|
148
|
+
switch (callbackId) {
|
|
149
|
+
case callbackTypes_1.K_I_CREATE_ITEM_RESULT:
|
|
150
|
+
return this.parseCreateItemResult(result);
|
|
151
|
+
case callbackTypes_1.K_I_SUBMIT_ITEM_UPDATE_RESULT:
|
|
152
|
+
return this.parseSubmitItemUpdateResult(result);
|
|
153
|
+
case callbackTypes_1.K_I_REMOTE_STORAGE_SUBSCRIBE_PUBLISHED_FILE_RESULT:
|
|
154
|
+
return this.parseSubscribeResult(result);
|
|
155
|
+
case callbackTypes_1.K_I_REMOTE_STORAGE_UNSUBSCRIBE_PUBLISHED_FILE_RESULT:
|
|
156
|
+
return this.parseUnsubscribeResult(result);
|
|
157
|
+
case callbackTypes_1.K_I_SET_USER_ITEM_VOTE_RESULT:
|
|
158
|
+
return this.parseSetUserItemVoteResult(result);
|
|
159
|
+
case callbackTypes_1.K_I_GET_USER_ITEM_VOTE_RESULT:
|
|
160
|
+
return this.parseGetUserItemVoteResult(result);
|
|
161
|
+
default:
|
|
162
|
+
// Standard Koffi decoding for non-packed structs
|
|
163
|
+
return koffi.decode(result, resultStruct);
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
/**
|
|
167
|
+
* Manually parses CreateItemResult_t from raw bytes
|
|
168
|
+
*
|
|
169
|
+
* Layout: [int32:0-3][uint64:4-11][uint8:12] = 13 bytes, padded to 16
|
|
170
|
+
* Steam's packed struct has no padding between int32 and uint64
|
|
171
|
+
*
|
|
172
|
+
* @param result - Koffi-allocated result buffer
|
|
173
|
+
* @returns Parsed CreateItemResult_t object
|
|
174
|
+
*/
|
|
175
|
+
parseCreateItemResult(result) {
|
|
176
|
+
const rawBytes = koffi.decode(result, koffi.array('uint8', 16));
|
|
177
|
+
const buffer = Buffer.from(rawBytes);
|
|
178
|
+
return {
|
|
179
|
+
m_eResult: buffer.readInt32LE(0),
|
|
180
|
+
m_nPublishedFileId: buffer.readBigUInt64LE(4),
|
|
181
|
+
m_bUserNeedsToAcceptWorkshopLegalAgreement: buffer.readUInt8(12) !== 0
|
|
182
|
+
};
|
|
183
|
+
}
|
|
184
|
+
/**
|
|
185
|
+
* Manually parses SubmitItemUpdateResult_t from raw bytes
|
|
186
|
+
*
|
|
187
|
+
* Layout: [int32:0-3][bool:4][padding:5-7][uint64:8-15] = 16 bytes
|
|
188
|
+
* Steam's packed struct has 3 bytes padding after bool to align uint64
|
|
189
|
+
*
|
|
190
|
+
* @param result - Koffi-allocated result buffer
|
|
191
|
+
* @returns Parsed SubmitItemUpdateResult_t object
|
|
192
|
+
*/
|
|
193
|
+
parseSubmitItemUpdateResult(result) {
|
|
194
|
+
const rawBytes = koffi.decode(result, koffi.array('uint8', 16));
|
|
195
|
+
const buffer = Buffer.from(rawBytes);
|
|
196
|
+
return {
|
|
197
|
+
m_eResult: buffer.readInt32LE(0),
|
|
198
|
+
m_bUserNeedsToAcceptWorkshopLegalAgreement: buffer.readUInt8(4) !== 0,
|
|
199
|
+
m_nPublishedFileId: buffer.readBigUInt64LE(8)
|
|
200
|
+
};
|
|
201
|
+
}
|
|
202
|
+
/**
|
|
203
|
+
* Manually parses RemoteStorageSubscribePublishedFileResult_t from raw bytes
|
|
204
|
+
*
|
|
205
|
+
* Layout: [int32:0-3][uint64:4-11] = 12 bytes (NO padding!)
|
|
206
|
+
* Steam's packed struct has no padding between int32 and uint64
|
|
207
|
+
*
|
|
208
|
+
* @param result - Koffi-allocated result buffer
|
|
209
|
+
* @returns Parsed RemoteStorageSubscribePublishedFileResult_t object
|
|
210
|
+
*/
|
|
211
|
+
parseSubscribeResult(result) {
|
|
212
|
+
const rawBytes = koffi.decode(result, koffi.array('uint8', 12));
|
|
213
|
+
const buffer = Buffer.from(rawBytes);
|
|
214
|
+
return {
|
|
215
|
+
m_eResult: buffer.readInt32LE(0),
|
|
216
|
+
m_nPublishedFileId: buffer.readBigUInt64LE(4)
|
|
217
|
+
};
|
|
218
|
+
}
|
|
219
|
+
/**
|
|
220
|
+
* Manually parses RemoteStorageUnsubscribePublishedFileResult_t from raw bytes
|
|
221
|
+
*
|
|
222
|
+
* Layout: [int32:0-3][uint64:4-11] = 12 bytes (NO padding!)
|
|
223
|
+
* Steam's packed struct has no padding between int32 and uint64
|
|
224
|
+
*
|
|
225
|
+
* @param result - Koffi-allocated result buffer
|
|
226
|
+
* @returns Parsed RemoteStorageUnsubscribePublishedFileResult_t object
|
|
227
|
+
*/
|
|
228
|
+
parseUnsubscribeResult(result) {
|
|
229
|
+
const rawBytes = koffi.decode(result, koffi.array('uint8', 12));
|
|
230
|
+
const buffer = Buffer.from(rawBytes);
|
|
231
|
+
return {
|
|
232
|
+
m_eResult: buffer.readInt32LE(0),
|
|
233
|
+
m_nPublishedFileId: buffer.readBigUInt64LE(4)
|
|
234
|
+
};
|
|
235
|
+
}
|
|
236
|
+
/**
|
|
237
|
+
* Manually parses SetUserItemVoteResult_t from raw bytes
|
|
238
|
+
*
|
|
239
|
+
* Layout: [uint64:0-7][int32:8-11][bool:12] = 13 bytes
|
|
240
|
+
* Steam's packed struct has no padding after bool
|
|
241
|
+
*
|
|
242
|
+
* @param result - Koffi-allocated result buffer
|
|
243
|
+
* @returns Parsed SetUserItemVoteResult_t object
|
|
244
|
+
*/
|
|
245
|
+
parseSetUserItemVoteResult(result) {
|
|
246
|
+
const rawBytes = koffi.decode(result, koffi.array('uint8', 13));
|
|
247
|
+
const buffer = Buffer.from(rawBytes);
|
|
248
|
+
return {
|
|
249
|
+
m_nPublishedFileId: buffer.readBigUInt64LE(0),
|
|
250
|
+
m_eResult: buffer.readInt32LE(8),
|
|
251
|
+
m_bVoteUp: buffer.readUInt8(12) !== 0
|
|
252
|
+
};
|
|
253
|
+
}
|
|
254
|
+
/**
|
|
255
|
+
* Manually parses GetUserItemVoteResult_t from raw bytes
|
|
256
|
+
*
|
|
257
|
+
* Layout: [uint64:0-7][int32:8-11][bool×3:12-14] = 15 bytes
|
|
258
|
+
* Steam's packed struct has no padding after bools
|
|
259
|
+
*
|
|
260
|
+
* @param result - Koffi-allocated result buffer
|
|
261
|
+
* @returns Parsed GetUserItemVoteResult_t object
|
|
262
|
+
*/
|
|
263
|
+
parseGetUserItemVoteResult(result) {
|
|
264
|
+
const rawBytes = koffi.decode(result, koffi.array('uint8', 15));
|
|
265
|
+
const buffer = Buffer.from(rawBytes);
|
|
266
|
+
return {
|
|
267
|
+
m_nPublishedFileId: buffer.readBigUInt64LE(0),
|
|
268
|
+
m_eResult: buffer.readInt32LE(8),
|
|
269
|
+
m_bVotedUp: buffer.readUInt8(12) !== 0,
|
|
270
|
+
m_bVotedDown: buffer.readUInt8(13) !== 0,
|
|
271
|
+
m_bVoteSkipped: buffer.readUInt8(14) !== 0
|
|
272
|
+
};
|
|
273
|
+
}
|
|
132
274
|
}
|
|
133
275
|
exports.SteamCallbackPoller = SteamCallbackPoller;
|
|
134
276
|
//# sourceMappingURL=SteamCallbackPoller.js.map
|