steamworks-ffi-node 0.3.0 → 0.4.0
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 +86 -10
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -1
- package/dist/index.js.map +1 -1
- package/dist/internal/SteamAPICore.d.ts +221 -8
- package/dist/internal/SteamAPICore.d.ts.map +1 -1
- package/dist/internal/SteamAPICore.js +234 -14
- package/dist/internal/SteamAPICore.js.map +1 -1
- package/dist/internal/SteamAchievementManager.d.ts +602 -31
- package/dist/internal/SteamAchievementManager.d.ts.map +1 -1
- package/dist/internal/SteamAchievementManager.js +601 -32
- package/dist/internal/SteamAchievementManager.js.map +1 -1
- package/dist/internal/SteamCallbackPoller.d.ts +68 -0
- package/dist/internal/SteamCallbackPoller.d.ts.map +1 -0
- package/dist/internal/SteamCallbackPoller.js +134 -0
- package/dist/internal/SteamCallbackPoller.js.map +1 -0
- package/dist/internal/SteamLeaderboardManager.d.ts +338 -0
- package/dist/internal/SteamLeaderboardManager.d.ts.map +1 -0
- package/dist/internal/SteamLeaderboardManager.js +734 -0
- package/dist/internal/SteamLeaderboardManager.js.map +1 -0
- package/dist/internal/SteamLibraryLoader.d.ts +15 -0
- package/dist/internal/SteamLibraryLoader.d.ts.map +1 -1
- package/dist/internal/SteamLibraryLoader.js +42 -5
- package/dist/internal/SteamLibraryLoader.js.map +1 -1
- package/dist/internal/SteamStatsManager.d.ts +357 -50
- package/dist/internal/SteamStatsManager.d.ts.map +1 -1
- package/dist/internal/SteamStatsManager.js +444 -106
- package/dist/internal/SteamStatsManager.js.map +1 -1
- package/dist/steam.d.ts +169 -9
- package/dist/steam.d.ts.map +1 -1
- package/dist/steam.js +178 -0
- package/dist/steam.js.map +1 -1
- package/dist/types.d.ts +91 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +34 -0
- package/dist/types.js.map +1 -1
- package/package.json +4 -3
package/README.md
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
[](https://www.npmjs.com/package/steamworks-ffi-node)
|
|
2
|
+
[](https://discord.gg/Ruzx4Z7cKr)
|
|
2
3
|
|
|
3
|
-
|
|
4
|
+
# Steamworks FFI - Steamworks SDK Integration
|
|
5
|
+
|
|
6
|
+
A production-ready TypeScript/JavaScript wrapper for the Steamworks SDK using Koffi FFI, designed for Node.js and Electron applications with **Steamworks SDK integration**.
|
|
4
7
|
|
|
5
8
|
> ✅ **No C++ Compilation Required**: Uses Koffi FFI for seamless installation without Visual Studio Build Tools!
|
|
6
9
|
|
|
@@ -8,6 +11,8 @@ A production-ready TypeScript/JavaScript wrapper for the Steamworks SDK using Ko
|
|
|
8
11
|
|
|
9
12
|
> 🎉 **NEW: 100% Stats API Coverage** - All 13 Steam statistics functions implemented! [See Documentation](https://github.com/ArtyProf/steamworks-ffi-node/blob/main/docs/STATS_MANAGER.md)
|
|
10
13
|
|
|
14
|
+
> 🎉 **NEW: 100% Leaderboard API Coverage** - All 7 Steam leaderboard functions implemented! [See Documentation](https://github.com/ArtyProf/steamworks-ffi-node/blob/main/docs/LEADERBOARD_MANAGER.md)
|
|
15
|
+
|
|
11
16
|
## 🎯 Features
|
|
12
17
|
|
|
13
18
|
- **Complete Achievement API**: 100% coverage of Steam Achievement functionality (20/20 functions)
|
|
@@ -21,7 +26,12 @@ A production-ready TypeScript/JavaScript wrapper for the Steamworks SDK using Ko
|
|
|
21
26
|
- ✅ User stats (get/set int/float, average rate tracking)
|
|
22
27
|
- ✅ Friend comparisons (compare stats with friends)
|
|
23
28
|
- ✅ Global statistics (worldwide aggregated data with history)
|
|
24
|
-
- **
|
|
29
|
+
- **Complete Leaderboard API**: 100% coverage of Steam Leaderboard functionality (7/7 functions)
|
|
30
|
+
- ✅ Leaderboard management (find, create, get info)
|
|
31
|
+
- ✅ Score operations (upload with optional details)
|
|
32
|
+
- ✅ Entry download (global, friends, specific users)
|
|
33
|
+
- ✅ UGC integration (attach replays/screenshots to entries)
|
|
34
|
+
- **Steamworks Integration**: Direct FFI calls to Steamworks C++ SDK
|
|
25
35
|
- **Cross-Platform**: Windows, macOS, and Linux support
|
|
26
36
|
- **Batteries Included**: All Steamworks redistributables bundled - no SDK download needed!
|
|
27
37
|
- **Electron Ready**: Perfect for Electron applications
|
|
@@ -51,14 +61,14 @@ npm install steamworks-ffi-node
|
|
|
51
61
|
```typescript
|
|
52
62
|
import Steam from 'steamworks-ffi-node';
|
|
53
63
|
|
|
54
|
-
// Initialize
|
|
64
|
+
// Initialize Steam connection
|
|
55
65
|
const steam = Steam.getInstance();
|
|
56
66
|
const initialized = steam.init({ appId: 480 }); // Your Steam App ID
|
|
57
67
|
|
|
58
68
|
if (initialized) {
|
|
59
69
|
// Get achievements from Steam servers
|
|
60
70
|
const achievements = await steam.getAllAchievements();
|
|
61
|
-
console.log('
|
|
71
|
+
console.log('Steam achievements:', achievements);
|
|
62
72
|
|
|
63
73
|
// Unlock achievement (permanent in Steam!)
|
|
64
74
|
await steam.unlockAchievement('ACH_WIN_ONE_GAME');
|
|
@@ -77,6 +87,31 @@ if (initialized) {
|
|
|
77
87
|
steam.runCallbacks();
|
|
78
88
|
const globalKills = await steam.getGlobalStatInt('global.total_kills');
|
|
79
89
|
console.log('Total kills worldwide:', globalKills);
|
|
90
|
+
|
|
91
|
+
// Work with leaderboards
|
|
92
|
+
const leaderboard = await steam.findOrCreateLeaderboard(
|
|
93
|
+
'HighScores',
|
|
94
|
+
1, // Descending (higher is better)
|
|
95
|
+
0 // Numeric display
|
|
96
|
+
);
|
|
97
|
+
|
|
98
|
+
if (leaderboard) {
|
|
99
|
+
// Upload score
|
|
100
|
+
await steam.uploadLeaderboardScore(
|
|
101
|
+
leaderboard.handle,
|
|
102
|
+
1000,
|
|
103
|
+
1 // Keep best score
|
|
104
|
+
);
|
|
105
|
+
|
|
106
|
+
// Download top 10 scores
|
|
107
|
+
const topScores = await steam.downloadLeaderboardEntries(
|
|
108
|
+
leaderboard.handle,
|
|
109
|
+
0, // Global
|
|
110
|
+
0,
|
|
111
|
+
9
|
|
112
|
+
);
|
|
113
|
+
console.log('Top 10 scores:', topScores);
|
|
114
|
+
}
|
|
80
115
|
}
|
|
81
116
|
|
|
82
117
|
// Cleanup
|
|
@@ -121,18 +156,18 @@ Complete documentation for all APIs is available in the [docs folder](https://gi
|
|
|
121
156
|
|
|
122
157
|
➡️ **[View Complete Documentation](https://github.com/ArtyProf/steamworks-ffi-node/blob/main/docs/README.md)**
|
|
123
158
|
|
|
124
|
-
## 🎮
|
|
159
|
+
## 🎮 Steamworks Integration
|
|
125
160
|
|
|
126
161
|
This library connects directly to the Steam client and Steamworks SDK:
|
|
127
162
|
|
|
128
163
|
```javascript
|
|
129
|
-
//
|
|
164
|
+
// Steam API - no mocking!
|
|
130
165
|
const steam = Steam.getInstance();
|
|
131
166
|
steam.init({ appId: 480 }); // Connects to actual Steam
|
|
132
167
|
|
|
133
168
|
// Live achievements from Steam servers
|
|
134
169
|
const achievements = await steam.getAllAchievements();
|
|
135
|
-
console.log(achievements); //
|
|
170
|
+
console.log(achievements); // Achievement data from your Steam app
|
|
136
171
|
|
|
137
172
|
// Permanent achievement unlock in Steam
|
|
138
173
|
await steam.unlockAchievement('YOUR_ACHIEVEMENT');
|
|
@@ -171,6 +206,45 @@ app.on('before-quit', () => {
|
|
|
171
206
|
});
|
|
172
207
|
```
|
|
173
208
|
|
|
209
|
+
### 📦 Packaging with ASAR
|
|
210
|
+
|
|
211
|
+
When packaging your Electron app with ASAR archives, **native modules must be unpacked**. The library automatically detects ASAR and looks for files in `.asar.unpacked`.
|
|
212
|
+
|
|
213
|
+
#### electron-builder Configuration
|
|
214
|
+
|
|
215
|
+
Add to your `package.json` or `electron-builder.yml`:
|
|
216
|
+
|
|
217
|
+
```json
|
|
218
|
+
{
|
|
219
|
+
"build": {
|
|
220
|
+
"asarUnpack": [
|
|
221
|
+
"node_modules/steamworks-ffi-node/**/*"
|
|
222
|
+
]
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
```
|
|
226
|
+
|
|
227
|
+
#### electron-forge Configuration
|
|
228
|
+
|
|
229
|
+
Add to your `forge.config.js`:
|
|
230
|
+
|
|
231
|
+
```javascript
|
|
232
|
+
module.exports = {
|
|
233
|
+
packagerConfig: {
|
|
234
|
+
asar: {
|
|
235
|
+
unpack: "**/{node_modules/steamworks-ffi-node}/**/*"
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
};
|
|
239
|
+
```
|
|
240
|
+
|
|
241
|
+
The library will automatically:
|
|
242
|
+
1. Detect if running inside an ASAR archive
|
|
243
|
+
2. Replace `.asar` with `.asar.unpacked` in the library path
|
|
244
|
+
3. Load the Steamworks SDK from the unpacked directory
|
|
245
|
+
|
|
246
|
+
This ensures native libraries work correctly in packaged Electron apps!
|
|
247
|
+
|
|
174
248
|
## 🔧 Requirements
|
|
175
249
|
|
|
176
250
|
- **Node.js**: 18+
|
|
@@ -202,7 +276,9 @@ All redistributable binaries are included in the package - no manual SDK downloa
|
|
|
202
276
|
|
|
203
277
|
### Electron-specific issues
|
|
204
278
|
- ❌ Initialized in renderer → **Solution**: Only initialize in main process
|
|
205
|
-
- ❌ Not cleaning up → **Solution**: Call `shutdown()` in `before-quit` event
|
|
279
|
+
- ❌ Not cleaning up → **Solution**: Call `shutdown()` in `before-quit` event
|
|
280
|
+
- ❌ "cannot open shared object file: Not a directory" (Linux) → **Solution**: Add `asarUnpack` configuration (see Electron Integration section above)
|
|
281
|
+
- ❌ Native module errors in packaged app → **Solution**: Ensure `steamworks-ffi-node` is in `asarUnpack` list
|
|
206
282
|
|
|
207
283
|
## 📄 License
|
|
208
284
|
|
|
@@ -213,4 +289,4 @@ MIT License - see LICENSE file for details.
|
|
|
213
289
|
This package includes redistributable binaries from the Steamworks SDK (© Valve Corporation).
|
|
214
290
|
These are distributed under the Steamworks SDK Access Agreement in accordance with Section 1.1(b).
|
|
215
291
|
|
|
216
|
-
See [THIRD_PARTY_LICENSES.md](https://github.com/ArtyProf/steamworks-ffi-node/blob/main/THIRD_PARTY_LICENSES.md) for full details.
|
|
292
|
+
See [THIRD_PARTY_LICENSES.md](https://github.com/ArtyProf/steamworks-ffi-node/blob/main/THIRD_PARTY_LICENSES.md) for full details.
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import SteamworksSDK from './steam';
|
|
2
|
-
import { SteamAchievement, SteamInitOptions, SteamStatus, AchievementProgressLimits, UserAchievement, AchievementGlobalStats, AchievementWithIcon, SteamStat, GlobalStat, GlobalStatHistory, UserStat } from './types';
|
|
3
|
-
export { SteamAchievement, SteamInitOptions, SteamStatus, AchievementProgressLimits, UserAchievement, AchievementGlobalStats, AchievementWithIcon, SteamStat, GlobalStat, GlobalStatHistory, UserStat };
|
|
2
|
+
import { SteamAchievement, SteamInitOptions, SteamStatus, AchievementProgressLimits, UserAchievement, AchievementGlobalStats, AchievementWithIcon, SteamStat, GlobalStat, GlobalStatHistory, UserStat, LeaderboardEntry, LeaderboardInfo, LeaderboardScoreUploadResult, LeaderboardSortMethod, LeaderboardDisplayType, LeaderboardDataRequest, LeaderboardUploadScoreMethod } from './types';
|
|
3
|
+
export { SteamAchievement, SteamInitOptions, SteamStatus, AchievementProgressLimits, UserAchievement, AchievementGlobalStats, AchievementWithIcon, SteamStat, GlobalStat, GlobalStatHistory, UserStat, LeaderboardEntry, LeaderboardInfo, LeaderboardScoreUploadResult, LeaderboardSortMethod, LeaderboardDisplayType, LeaderboardDataRequest, LeaderboardUploadScoreMethod };
|
|
4
4
|
export default SteamworksSDK;
|
|
5
5
|
export { SteamworksSDK as Steam };
|
|
6
6
|
//# 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;AACpC,OAAO,EACL,gBAAgB,EAChB,gBAAgB,EAChB,WAAW,EACX,yBAAyB,EACzB,eAAe,EACf,sBAAsB,EACtB,mBAAmB,EACnB,SAAS,EACT,UAAU,EACV,iBAAiB,EACjB,QAAQ,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,aAAa,MAAM,SAAS,CAAC;AACpC,OAAO,EACL,gBAAgB,EAChB,gBAAgB,EAChB,WAAW,EACX,yBAAyB,EACzB,eAAe,EACf,sBAAsB,EACtB,mBAAmB,EACnB,SAAS,EACT,UAAU,EACV,iBAAiB,EACjB,QAAQ,EACR,gBAAgB,EAChB,eAAe,EACf,4BAA4B,EAC5B,qBAAqB,EACrB,sBAAsB,EACtB,sBAAsB,EACtB,4BAA4B,EAC7B,MAAM,SAAS,CAAC;AAGjB,OAAO,EACL,gBAAgB,EAChB,gBAAgB,EAChB,WAAW,EACX,yBAAyB,EACzB,eAAe,EACf,sBAAsB,EACtB,mBAAmB,EACnB,SAAS,EACT,UAAU,EACV,iBAAiB,EACjB,QAAQ,EACR,gBAAgB,EAChB,eAAe,EACf,4BAA4B,EAC5B,qBAAqB,EACrB,sBAAsB,EACtB,sBAAsB,EACtB,4BAA4B,EAC7B,CAAC;AAGF,eAAe,aAAa,CAAC;AAG7B,OAAO,EAAE,aAAa,IAAI,KAAK,EAAE,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -3,9 +3,14 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.Steam = void 0;
|
|
6
|
+
exports.Steam = exports.LeaderboardUploadScoreMethod = exports.LeaderboardDataRequest = exports.LeaderboardDisplayType = exports.LeaderboardSortMethod = void 0;
|
|
7
7
|
const steam_1 = __importDefault(require("./steam"));
|
|
8
8
|
exports.Steam = steam_1.default;
|
|
9
|
+
const types_1 = require("./types");
|
|
10
|
+
Object.defineProperty(exports, "LeaderboardSortMethod", { enumerable: true, get: function () { return types_1.LeaderboardSortMethod; } });
|
|
11
|
+
Object.defineProperty(exports, "LeaderboardDisplayType", { enumerable: true, get: function () { return types_1.LeaderboardDisplayType; } });
|
|
12
|
+
Object.defineProperty(exports, "LeaderboardDataRequest", { enumerable: true, get: function () { return types_1.LeaderboardDataRequest; } });
|
|
13
|
+
Object.defineProperty(exports, "LeaderboardUploadScoreMethod", { enumerable: true, get: function () { return types_1.LeaderboardUploadScoreMethod; } });
|
|
9
14
|
// Export main Steam class
|
|
10
15
|
exports.default = steam_1.default;
|
|
11
16
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;AAAA,oDAAoC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;AAAA,oDAAoC;AAgDV,gBAhDnB,eAAa,CAgDW;AA/C/B,mCAmBiB;AAkBf,sGAtBA,6BAAqB,OAsBA;AACrB,uGAtBA,8BAAsB,OAsBA;AACtB,uGAtBA,8BAAsB,OAsBA;AACtB,6GAtBA,oCAA4B,OAsBA;AAG9B,0BAA0B;AAC1B,kBAAe,eAAa,CAAC"}
|
|
@@ -1,46 +1,259 @@
|
|
|
1
1
|
import { SteamInitOptions, SteamStatus } from '../types';
|
|
2
2
|
import { SteamLibraryLoader } from './SteamLibraryLoader';
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
4
|
+
* SteamAPICore
|
|
5
|
+
*
|
|
6
|
+
* Core Steam API initialization and lifecycle management.
|
|
7
|
+
* Handles Steam client connection, interface management, and callback processing.
|
|
8
|
+
*
|
|
9
|
+
* This class manages the fundamental Steam API operations:
|
|
10
|
+
* - Initialization and shutdown of the Steam API
|
|
11
|
+
* - Interface retrieval (UserStats, User)
|
|
12
|
+
* - Status monitoring (Steam running, initialization state)
|
|
13
|
+
* - Callback processing for Steam events
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```typescript
|
|
17
|
+
* const loader = new SteamLibraryLoader();
|
|
18
|
+
* const apiCore = new SteamAPICore(loader);
|
|
19
|
+
*
|
|
20
|
+
* const success = apiCore.init({ appId: 480 });
|
|
21
|
+
* if (success) {
|
|
22
|
+
* console.log('[Steamworks] Steam API initialized!');
|
|
23
|
+
* // Use Steam features...
|
|
24
|
+
* apiCore.shutdown();
|
|
25
|
+
* }
|
|
26
|
+
* ```
|
|
5
27
|
*/
|
|
6
28
|
export declare class SteamAPICore {
|
|
29
|
+
/** Steam library loader for FFI function calls */
|
|
7
30
|
private libraryLoader;
|
|
31
|
+
/** Whether the Steam API has been successfully initialized */
|
|
8
32
|
private initialized;
|
|
33
|
+
/** The Steam App ID for this application */
|
|
9
34
|
private appId;
|
|
35
|
+
/** Pointer to the ISteamUserStats interface */
|
|
10
36
|
private userStatsInterface;
|
|
37
|
+
/** Pointer to the ISteamUser interface */
|
|
11
38
|
private userInterface;
|
|
39
|
+
/** Pointer to the ISteamUtils interface */
|
|
40
|
+
private utilsInterface;
|
|
41
|
+
/**
|
|
42
|
+
* Creates a new SteamAPICore instance
|
|
43
|
+
*
|
|
44
|
+
* @param libraryLoader - The Steam library loader for FFI calls
|
|
45
|
+
*/
|
|
12
46
|
constructor(libraryLoader: SteamLibraryLoader);
|
|
13
47
|
/**
|
|
14
|
-
* Initialize Steam API
|
|
48
|
+
* Initialize the Steam API
|
|
49
|
+
*
|
|
50
|
+
* Establishes connection to the Steam client and retrieves necessary interfaces.
|
|
51
|
+
* Creates steam_appid.txt file required by Steam, loads the Steamworks library,
|
|
52
|
+
* and initializes all necessary Steam interfaces.
|
|
53
|
+
*
|
|
54
|
+
* @param options - Initialization options containing the Steam App ID
|
|
55
|
+
* @returns true if initialization was successful, false otherwise
|
|
56
|
+
*
|
|
57
|
+
* @example
|
|
58
|
+
* ```typescript
|
|
59
|
+
* const success = apiCore.init({ appId: 480 });
|
|
60
|
+
* if (success) {
|
|
61
|
+
* console.log('[Steamworks] Connected to Steam for App ID:', 480);
|
|
62
|
+
* } else {
|
|
63
|
+
* console.error('[Steamworks] Failed to initialize Steam API');
|
|
64
|
+
* }
|
|
65
|
+
* ```
|
|
66
|
+
*
|
|
67
|
+
* @remarks
|
|
68
|
+
* - Creates steam_appid.txt file in the current working directory
|
|
69
|
+
* - Sets SteamAppId environment variable
|
|
70
|
+
* - Automatically requests current stats from Steam servers
|
|
71
|
+
* - Runs callbacks to process initial Steam events
|
|
72
|
+
*
|
|
73
|
+
* @warning
|
|
74
|
+
* Requires Steam client to be running and user to be logged in
|
|
75
|
+
*
|
|
76
|
+
* Steamworks SDK Functions:
|
|
77
|
+
* - `SteamAPI_Init()` - Initialize the Steam API
|
|
78
|
+
* - `SteamAPI_IsSteamRunning()` - Check if Steam client is running
|
|
79
|
+
* - `SteamAPI_SteamUserStats_v013()` - Get ISteamUserStats interface
|
|
80
|
+
* - `SteamAPI_SteamUser_v023()` - Get ISteamUser interface
|
|
81
|
+
* - `SteamAPI_ISteamUserStats_RequestCurrentStats()` - Request current stats from Steam
|
|
82
|
+
* - `SteamAPI_RunCallbacks()` - Process Steam callbacks
|
|
15
83
|
*/
|
|
16
84
|
init(options: SteamInitOptions): boolean;
|
|
17
85
|
/**
|
|
18
|
-
* Shutdown Steam API
|
|
86
|
+
* Shutdown the Steam API
|
|
87
|
+
*
|
|
88
|
+
* Cleanly shuts down the Steam API connection and releases all interfaces.
|
|
89
|
+
* Should be called when the application is closing or Steam features are no longer needed.
|
|
90
|
+
*
|
|
91
|
+
* @example
|
|
92
|
+
* ```typescript
|
|
93
|
+
* process.on('SIGINT', () => {
|
|
94
|
+
* apiCore.shutdown();
|
|
95
|
+
* process.exit(0);
|
|
96
|
+
* });
|
|
97
|
+
* ```
|
|
98
|
+
*
|
|
99
|
+
* @remarks
|
|
100
|
+
* - Safe to call multiple times (only shuts down if initialized)
|
|
101
|
+
* - Clears all interface pointers
|
|
102
|
+
* - Sets initialized state to false
|
|
103
|
+
*
|
|
104
|
+
* Steamworks SDK Functions:
|
|
105
|
+
* - `SteamAPI_Shutdown()` - Shutdown the Steam API
|
|
19
106
|
*/
|
|
20
107
|
shutdown(): void;
|
|
21
108
|
/**
|
|
22
|
-
* Get current Steam status
|
|
109
|
+
* Get the current Steam status
|
|
110
|
+
*
|
|
111
|
+
* Returns detailed status information including initialization state,
|
|
112
|
+
* App ID, and the current user's Steam ID.
|
|
113
|
+
*
|
|
114
|
+
* @returns Object containing initialization status, App ID, and Steam ID
|
|
115
|
+
*
|
|
116
|
+
* @example
|
|
117
|
+
* ```typescript
|
|
118
|
+
* const status = apiCore.getStatus();
|
|
119
|
+
* console.log(`[Steamworks] Initialized: ${status.initialized}`);
|
|
120
|
+
* console.log(`[Steamworks] App ID: ${status.appId}`);
|
|
121
|
+
* console.log(`[Steamworks] Steam ID: ${status.steamId}`);
|
|
122
|
+
* ```
|
|
123
|
+
*
|
|
124
|
+
* @remarks
|
|
125
|
+
* - Steam ID is '0' if not initialized or unable to retrieve
|
|
126
|
+
* - App ID is 0 if not initialized
|
|
127
|
+
*
|
|
128
|
+
* Steamworks SDK Functions:
|
|
129
|
+
* - `SteamAPI_ISteamUser_GetSteamID()` - Get current user's Steam ID
|
|
23
130
|
*/
|
|
24
131
|
getStatus(): SteamStatus;
|
|
25
132
|
/**
|
|
26
133
|
* Run Steam callbacks to process pending events
|
|
134
|
+
*
|
|
135
|
+
* Processes all pending Steam callbacks and events. Should be called regularly
|
|
136
|
+
* (e.g., in a game loop or timer) to ensure Steam events are processed promptly.
|
|
137
|
+
*
|
|
138
|
+
* @example
|
|
139
|
+
* ```typescript
|
|
140
|
+
* // In a game loop or setInterval
|
|
141
|
+
* setInterval(() => {
|
|
142
|
+
* apiCore.runCallbacks();
|
|
143
|
+
* }, 100); // Every 100ms
|
|
144
|
+
* ```
|
|
145
|
+
*
|
|
146
|
+
* @remarks
|
|
147
|
+
* - Safe to call even if not initialized (will be ignored)
|
|
148
|
+
* - Automatically called by init() and after stat/achievement operations
|
|
149
|
+
* - Required for receiving Steam events and callbacks
|
|
150
|
+
*
|
|
151
|
+
* Steamworks SDK Functions:
|
|
152
|
+
* - `SteamAPI_RunCallbacks()` - Process all pending Steam callbacks
|
|
27
153
|
*/
|
|
28
154
|
runCallbacks(): void;
|
|
29
155
|
/**
|
|
30
|
-
* Check if Steam client is running
|
|
156
|
+
* Check if the Steam client is running
|
|
157
|
+
*
|
|
158
|
+
* Verifies that the Steam client application is currently running on the user's system.
|
|
159
|
+
*
|
|
160
|
+
* @returns true if Steam is running, false otherwise
|
|
161
|
+
*
|
|
162
|
+
* @example
|
|
163
|
+
* ```typescript
|
|
164
|
+
* if (apiCore.isSteamRunning()) {
|
|
165
|
+
* console.log('[Steamworks] Steam client is active');
|
|
166
|
+
* } else {
|
|
167
|
+
* console.warn('[Steamworks] Steam client is not running');
|
|
168
|
+
* }
|
|
169
|
+
* ```
|
|
170
|
+
*
|
|
171
|
+
* @remarks
|
|
172
|
+
* - Returns false if Steam API is not initialized
|
|
173
|
+
* - Safe to call at any time
|
|
174
|
+
*
|
|
175
|
+
* Steamworks SDK Functions:
|
|
176
|
+
* - `SteamAPI_IsSteamRunning()` - Check if Steam client is running
|
|
31
177
|
*/
|
|
32
178
|
isSteamRunning(): boolean;
|
|
33
179
|
/**
|
|
34
|
-
* Check if initialized
|
|
180
|
+
* Check if the Steam API is initialized
|
|
181
|
+
*
|
|
182
|
+
* Returns the current initialization state of the Steam API.
|
|
183
|
+
*
|
|
184
|
+
* @returns true if initialized and ready to use, false otherwise
|
|
185
|
+
*
|
|
186
|
+
* @example
|
|
187
|
+
* ```typescript
|
|
188
|
+
* if (!apiCore.isInitialized()) {
|
|
189
|
+
* console.error('[Steamworks] Cannot perform Steam operations - not initialized');
|
|
190
|
+
* return;
|
|
191
|
+
* }
|
|
192
|
+
* ```
|
|
35
193
|
*/
|
|
36
194
|
isInitialized(): boolean;
|
|
37
195
|
/**
|
|
38
|
-
* Get
|
|
196
|
+
* Get the ISteamUserStats interface pointer
|
|
197
|
+
*
|
|
198
|
+
* Returns the native pointer to the ISteamUserStats interface, which is used
|
|
199
|
+
* for achievement and stats operations.
|
|
200
|
+
*
|
|
201
|
+
* @returns Pointer to ISteamUserStats interface, or null if not initialized
|
|
202
|
+
*
|
|
203
|
+
* @example
|
|
204
|
+
* ```typescript
|
|
205
|
+
* const userStats = apiCore.getUserStatsInterface();
|
|
206
|
+
* if (userStats) {
|
|
207
|
+
* // Use interface for stats/achievement operations
|
|
208
|
+
* }
|
|
209
|
+
* ```
|
|
210
|
+
*
|
|
211
|
+
* @remarks
|
|
212
|
+
* - Returns null if Steam API is not initialized
|
|
213
|
+
* - This is a native pointer for use with FFI calls
|
|
39
214
|
*/
|
|
40
215
|
getUserStatsInterface(): any;
|
|
41
216
|
/**
|
|
42
|
-
* Get
|
|
217
|
+
* Get the ISteamUser interface pointer
|
|
218
|
+
*
|
|
219
|
+
* Returns the native pointer to the ISteamUser interface, which is used
|
|
220
|
+
* for user identity operations.
|
|
221
|
+
*
|
|
222
|
+
* @returns Pointer to ISteamUser interface, or null if not initialized
|
|
223
|
+
*
|
|
224
|
+
* @example
|
|
225
|
+
* ```typescript
|
|
226
|
+
* const user = apiCore.getUserInterface();
|
|
227
|
+
* if (user) {
|
|
228
|
+
* // Use interface for user operations
|
|
229
|
+
* }
|
|
230
|
+
* ```
|
|
231
|
+
*
|
|
232
|
+
* @remarks
|
|
233
|
+
* - Returns null if Steam API is not initialized
|
|
234
|
+
* - This is a native pointer for use with FFI calls
|
|
43
235
|
*/
|
|
44
236
|
getUserInterface(): any;
|
|
237
|
+
/**
|
|
238
|
+
* Get the ISteamUtils interface pointer
|
|
239
|
+
*
|
|
240
|
+
* Returns the native pointer to the ISteamUtils interface, which is used
|
|
241
|
+
* for utility operations including API call result checking.
|
|
242
|
+
*
|
|
243
|
+
* @returns Pointer to ISteamUtils interface, or null if not initialized
|
|
244
|
+
*
|
|
245
|
+
* @example
|
|
246
|
+
* ```typescript
|
|
247
|
+
* const utils = apiCore.getUtilsInterface();
|
|
248
|
+
* if (utils) {
|
|
249
|
+
* // Use interface for utility operations
|
|
250
|
+
* }
|
|
251
|
+
* ```
|
|
252
|
+
*
|
|
253
|
+
* @remarks
|
|
254
|
+
* - Returns null if Steam API is not initialized
|
|
255
|
+
* - This is a native pointer for use with FFI calls
|
|
256
|
+
*/
|
|
257
|
+
getUtilsInterface(): any;
|
|
45
258
|
}
|
|
46
259
|
//# 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,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAE1D
|
|
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,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAE1D;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,qBAAa,YAAY;IACvB,kDAAkD;IAClD,OAAO,CAAC,aAAa,CAAqB;IAE1C,8DAA8D;IAC9D,OAAO,CAAC,WAAW,CAAkB;IAErC,4CAA4C;IAC5C,OAAO,CAAC,KAAK,CAAa;IAE1B,+CAA+C;IAC/C,OAAO,CAAC,kBAAkB,CAAa;IAEvC,0CAA0C;IAC1C,OAAO,CAAC,aAAa,CAAa;IAElC,2CAA2C;IAC3C,OAAO,CAAC,cAAc,CAAa;IAEnC;;;;OAIG;gBACS,aAAa,EAAE,kBAAkB;IAI7C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAoCG;IACH,IAAI,CAAC,OAAO,EAAE,gBAAgB,GAAG,OAAO;IAyExC;;;;;;;;;;;;;;;;;;;;;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;CAGzB"}
|