steamworks-ffi-node 0.5.2 โ 0.6.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 +65 -55
- 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/SteamCloudManager.d.ts +319 -0
- package/dist/internal/SteamCloudManager.d.ts.map +1 -0
- package/dist/internal/SteamCloudManager.js +584 -0
- package/dist/internal/SteamCloudManager.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 +81 -30
- package/dist/internal/SteamLibraryLoader.js.map +1 -1
- package/dist/steam.d.ts +36 -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/cloud.d.ts +83 -0
- package/dist/types/cloud.d.ts.map +1 -0
- package/dist/types/cloud.js +35 -0
- package/dist/types/cloud.js.map +1 -0
- 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/docs/README.md +155 -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/docs/README.md
ADDED
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
# Steamworks FFI Documentation
|
|
2
|
+
|
|
3
|
+
Complete API documentation for all Steamworks FFI functionality.
|
|
4
|
+
|
|
5
|
+
## ๐ฏ Manager-Based API
|
|
6
|
+
|
|
7
|
+
Steamworks FFI uses a **manager-based architecture** for better organization:
|
|
8
|
+
|
|
9
|
+
```typescript
|
|
10
|
+
import SteamworksSDK from 'steamworks-ffi-node';
|
|
11
|
+
|
|
12
|
+
const steam = new SteamworksSDK();
|
|
13
|
+
steam.init({ appId: 480 });
|
|
14
|
+
|
|
15
|
+
// Access features through specialized managers
|
|
16
|
+
steam.achievements.* // Achievement operations
|
|
17
|
+
steam.stats.* // Statistics operations
|
|
18
|
+
steam.leaderboards.* // Leaderboard operations
|
|
19
|
+
steam.friends.* // Friends and social operations
|
|
20
|
+
steam.richPresence.* // Rich Presence operations
|
|
21
|
+
steam.overlay.* // Overlay control operations
|
|
22
|
+
steam.cloud.* // Cloud storage operations
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
This design:
|
|
26
|
+
- โ
**Groups related functions** - Easy to discover all achievement/stats/leaderboard methods
|
|
27
|
+
- โ
**Clear namespacing** - No naming conflicts
|
|
28
|
+
- โ
**Better IDE support** - Autocomplete shows relevant methods
|
|
29
|
+
- โ
**Logical organization** - Matches Steamworks SDK structure
|
|
30
|
+
|
|
31
|
+
---
|
|
32
|
+
|
|
33
|
+
## ๐ Available Documentation
|
|
34
|
+
|
|
35
|
+
### Core API
|
|
36
|
+
- **[SteamAPICore Documentation](https://github.com/ArtyProf/steamworks-ffi-node/blob/main/docs/STEAM_API_CORE.md)**
|
|
37
|
+
- Initialization and lifecycle management
|
|
38
|
+
- Steam callbacks and event handling
|
|
39
|
+
- Status checking and diagnostics
|
|
40
|
+
- Platform-specific library loading
|
|
41
|
+
|
|
42
|
+
### Achievement System
|
|
43
|
+
- **[Achievement Manager API](https://github.com/ArtyProf/steamworks-ffi-node/blob/main/docs/ACHIEVEMENT_MANAGER.md)**
|
|
44
|
+
- **20 Functions** - 100% Achievement API coverage
|
|
45
|
+
- Core operations (get, unlock, clear, check status)
|
|
46
|
+
- Visual features (icons, progress notifications)
|
|
47
|
+
- Progress tracking (get limits for progress bars)
|
|
48
|
+
- Friend comparisons (see friend achievements)
|
|
49
|
+
- Global statistics (unlock percentages, popularity sorting)
|
|
50
|
+
- Testing tools (reset stats/achievements)
|
|
51
|
+
|
|
52
|
+
### Statistics System
|
|
53
|
+
- **[Stats Manager API](https://github.com/ArtyProf/steamworks-ffi-node/blob/main/docs/STATS_MANAGER.md)**
|
|
54
|
+
- **14 Functions** - 100% Stats API coverage
|
|
55
|
+
- User stats (get/set int/float, average rate tracking)
|
|
56
|
+
- Friend comparisons (compare stats with friends)
|
|
57
|
+
- Global statistics (worldwide aggregated data with history)
|
|
58
|
+
|
|
59
|
+
### Leaderboard System
|
|
60
|
+
- **[Leaderboard Manager API](https://github.com/ArtyProf/steamworks-ffi-node/blob/main/docs/LEADERBOARD_MANAGER.md)**
|
|
61
|
+
- **7 Functions** - 100% Leaderboard API coverage
|
|
62
|
+
- Leaderboard management (find, create, get info)
|
|
63
|
+
- Score operations (upload with optional details)
|
|
64
|
+
- Entry download (global, friends, specific users)
|
|
65
|
+
- UGC integration (attach replays/screenshots to entries)
|
|
66
|
+
|
|
67
|
+
### Friends & Social System
|
|
68
|
+
- **[Friends Manager API](https://github.com/ArtyProf/steamworks-ffi-node/blob/main/docs/FRIENDS_MANAGER.md)**
|
|
69
|
+
- **22 Functions** - Complete friends and social features
|
|
70
|
+
- Current user info (get persona name, online status)
|
|
71
|
+
- Friends list management (count, iterate, retrieve all)
|
|
72
|
+
- Friend information (names, status, relationship types, Steam levels)
|
|
73
|
+
- Friend activity (check what games friends are playing)
|
|
74
|
+
- Friend avatars (small/medium/large avatar handles)
|
|
75
|
+
- Friend groups (manage and query friend tags/categories)
|
|
76
|
+
- Coplay tracking (recently played with users)
|
|
77
|
+
|
|
78
|
+
### Rich Presence System
|
|
79
|
+
- **[Rich Presence Manager API](https://github.com/ArtyProf/steamworks-ffi-node/blob/main/docs/RICH_PRESENCE_MANAGER.md)**
|
|
80
|
+
- **6 Functions** - Complete Rich Presence support
|
|
81
|
+
- Set/clear rich presence key/value pairs
|
|
82
|
+
- Query friend rich presence data
|
|
83
|
+
- Display custom status in Steam friends list
|
|
84
|
+
- Enable friend join functionality
|
|
85
|
+
- Player groups and localization support
|
|
86
|
+
|
|
87
|
+
### Overlay System
|
|
88
|
+
- **[Overlay Manager API](https://github.com/ArtyProf/steamworks-ffi-node/blob/main/docs/OVERLAY_MANAGER.md)**
|
|
89
|
+
- **7 Functions** - Complete overlay control
|
|
90
|
+
- Open overlay to various dialogs (friends, achievements, etc.)
|
|
91
|
+
- Open overlay to user profiles and stats
|
|
92
|
+
- Open overlay browser to URLs
|
|
93
|
+
- Open store pages with purchase options
|
|
94
|
+
- Show invite dialogs for multiplayer
|
|
95
|
+
|
|
96
|
+
### Cloud Storage System
|
|
97
|
+
- **[Cloud Manager API](https://github.com/ArtyProf/steamworks-ffi-node/blob/main/docs/CLOUD_MANAGER.md)**
|
|
98
|
+
- **14 Functions** - Complete Steam Cloud (Remote Storage) support
|
|
99
|
+
- File operations (write, read, delete, check existence)
|
|
100
|
+
- File metadata (size, timestamp, persistence status)
|
|
101
|
+
- File listing (count, iterate, get all with details)
|
|
102
|
+
- Quota management (track storage usage and limits)
|
|
103
|
+
- Cloud settings (check/toggle cloud sync for account and app)
|
|
104
|
+
|
|
105
|
+
## ๐ Quick Links
|
|
106
|
+
|
|
107
|
+
### Getting Started
|
|
108
|
+
- [Installation Guide](https://github.com/ArtyProf/steamworks-ffi-node#installation)
|
|
109
|
+
- [Quick Start Examples](https://github.com/ArtyProf/steamworks-ffi-node#quick-start)
|
|
110
|
+
- [Electron Integration](https://github.com/ArtyProf/steamworks-ffi-node#electron-integration)
|
|
111
|
+
|
|
112
|
+
### Testing
|
|
113
|
+
|
|
114
|
+
**JavaScript Tests** (Production - Uses compiled dist/):
|
|
115
|
+
- Run Achievement Tests: `npm run test:achievements:js` - Tests all 20 achievement functions
|
|
116
|
+
- Run Stats Tests: `npm run test:stats:js` - Tests all 14 stats functions
|
|
117
|
+
- Run Leaderboard Tests: `npm run test:leaderboards:js` - Tests all 7 leaderboard functions
|
|
118
|
+
- Run Friends Tests: `npm run test:friends:js` - Tests all 22 friends functions
|
|
119
|
+
- Run Cloud Tests: `npm run test:cloud:js` - Tests all 14 cloud storage functions
|
|
120
|
+
- Run Rich Presence & Overlay Tests: `npm run test:richpresence-overlay:js` - Tests 6 rich presence + 7 overlay functions
|
|
121
|
+
|
|
122
|
+
**TypeScript Tests** (Development - Direct src/ imports, no rebuild needed):
|
|
123
|
+
- Run Achievement Tests: `npm run test:achievements:ts` - With type safety โจ
|
|
124
|
+
- Run Stats Tests: `npm run test:stats:ts` - With type safety โจ
|
|
125
|
+
- Run Leaderboard Tests: `npm run test:leaderboards:ts` - With type safety โจ
|
|
126
|
+
- Run Friends Tests: `npm run test:friends:ts` - With type safety โจ
|
|
127
|
+
- Run Cloud Tests: `npm run test:cloud:ts` - With type safety โจ
|
|
128
|
+
- Run Rich Presence & Overlay Tests: `npm run test:richpresence-overlay:ts` - With type safety โจ
|
|
129
|
+
|
|
130
|
+
๐ All tests are in `tests/` folder with separate `js/` and `ts/` subfolders.
|
|
131
|
+
|
|
132
|
+
๐ก **Pro tip**: TypeScript tests import directly from `src/` so you can test changes immediately without running `npm run build`!
|
|
133
|
+
|
|
134
|
+
### Additional Resources
|
|
135
|
+
- [GitHub Repository](https://github.com/ArtyProf/steamworks-ffi-node)
|
|
136
|
+
- [NPM Package](https://www.npmjs.com/package/steamworks-ffi-node)
|
|
137
|
+
- [Report Issues](https://github.com/ArtyProf/steamworks-ffi-node/issues)
|
|
138
|
+
|
|
139
|
+
---
|
|
140
|
+
|
|
141
|
+
## ๐ Documentation Structure
|
|
142
|
+
|
|
143
|
+
Each API documentation includes:
|
|
144
|
+
- **Overview** - Architecture and design patterns
|
|
145
|
+
- **Quick Reference** - Function categories and counts
|
|
146
|
+
- **Detailed Functions** - Parameters, returns, SDK mappings, examples
|
|
147
|
+
- **Configuration** - Steamworks Partner setup instructions
|
|
148
|
+
- **TypeScript Types** - Interface definitions
|
|
149
|
+
- **Complete Examples** - Real-world usage scenarios
|
|
150
|
+
- **Best Practices** - Guidelines and recommendations
|
|
151
|
+
- **Error Handling** - Common issues and solutions
|
|
152
|
+
|
|
153
|
+
---
|
|
154
|
+
|
|
155
|
+
**Need help?** Check the [troubleshooting section](https://github.com/ArtyProf/steamworks-ffi-node#troubleshooting) in the main README or [open an issue](https://github.com/ArtyProf/steamworks-ffi-node/issues).
|
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
# Steamworks SDK Setup Guide
|
|
2
|
+
|
|
3
|
+
This guide explains how to properly set up the Steamworks SDK redistributables for use with steamworks-ffi-node, in compliance with Valve's licensing requirements.
|
|
4
|
+
|
|
5
|
+
## โ ๏ธ Important Legal Notice
|
|
6
|
+
|
|
7
|
+
**The Steamworks SDK redistributables cannot be bundled with this package due to Valve's licensing terms.** Users must download and install the Steamworks SDK separately from Valve's official source.
|
|
8
|
+
|
|
9
|
+
## Quick Setup
|
|
10
|
+
|
|
11
|
+
### 1. Download Steamworks SDK
|
|
12
|
+
|
|
13
|
+
1. Visit the [Steamworks Partner site](https://partner.steamgames.com/)
|
|
14
|
+
2. Log in with your Steam account (you need to be a registered Steamworks developer)
|
|
15
|
+
3. Download the latest Steamworks SDK
|
|
16
|
+
4. Extract the downloaded archive
|
|
17
|
+
|
|
18
|
+
> **Note**: This package was built and tested with Steamworks SDK v1.62. While newer versions should be compatible, v1.62 or later is recommended for optimal compatibility.
|
|
19
|
+
|
|
20
|
+
### 2. Install SDK Redistributables
|
|
21
|
+
|
|
22
|
+
Copy the `redistributable_bin` folder from the Steamworks SDK to your project:
|
|
23
|
+
|
|
24
|
+
```
|
|
25
|
+
your-project/
|
|
26
|
+
โโโ steamworks_sdk/
|
|
27
|
+
โ โโโ redistributable_bin/
|
|
28
|
+
โ โโโ win64/
|
|
29
|
+
โ โ โโโ steam_api64.dll
|
|
30
|
+
โ โโโ steam_api.dll
|
|
31
|
+
โ โโโ osx/
|
|
32
|
+
โ โ โโโ libsteam_api.dylib
|
|
33
|
+
โ โโโ linux64/
|
|
34
|
+
โ โโโ libsteam_api.so
|
|
35
|
+
โโโ package.json
|
|
36
|
+
โโโ your-app-files...
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
### 3. Verify Installation
|
|
40
|
+
|
|
41
|
+
Run this command to verify the SDK is properly installed:
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
npm run verify-sdk
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
This will check your steamworks_sdk installation and provide detailed feedback about any missing files or configuration issues.
|
|
48
|
+
|
|
49
|
+
## Detailed Setup Instructions
|
|
50
|
+
|
|
51
|
+
### For Game Developers
|
|
52
|
+
|
|
53
|
+
1. **Get Steamworks Access**
|
|
54
|
+
- Register as a Steamworks developer at [partner.steamgames.com](https://partner.steamgames.com/)
|
|
55
|
+
- Complete the registration process and pay the one-time fee if required
|
|
56
|
+
|
|
57
|
+
2. **Download SDK**
|
|
58
|
+
- Go to the "Downloads" section in Steamworks Partner
|
|
59
|
+
- Download the latest Steamworks SDK (typically a .zip file)
|
|
60
|
+
- Extract the archive to a temporary location
|
|
61
|
+
|
|
62
|
+
3. **Copy Redistributables**
|
|
63
|
+
- Navigate to the extracted SDK folder
|
|
64
|
+
- Find the `redistributable_bin` directory
|
|
65
|
+
- Copy the entire `redistributable_bin` folder to your project's `steamworks_sdk/` directory
|
|
66
|
+
|
|
67
|
+
### For Open Source Projects / Contributors
|
|
68
|
+
|
|
69
|
+
If you're contributing to an open source project that uses steamworks-ffi-node:
|
|
70
|
+
|
|
71
|
+
1. **SDK Access Required**
|
|
72
|
+
- You'll need your own Steamworks developer account to download the SDK
|
|
73
|
+
- The redistributables cannot be shared or bundled due to licensing restrictions
|
|
74
|
+
|
|
75
|
+
2. **Development Setup**
|
|
76
|
+
- Download the SDK using your own Steamworks account
|
|
77
|
+
- Set up the folder structure as described above
|
|
78
|
+
- Never commit the `steamworks_sdk/` folder to version control
|
|
79
|
+
|
|
80
|
+
3. **Testing**
|
|
81
|
+
- Use Spacewar (App ID 480) for testing - it's free and available to all developers
|
|
82
|
+
- Either create a `steam_appid.txt` file with content `480` OR pass `480` to `steam.init(480)`
|
|
83
|
+
|
|
84
|
+
## Supported Platforms and Files
|
|
85
|
+
|
|
86
|
+
### Windows
|
|
87
|
+
- **64-bit**: `steamworks_sdk/redistributable_bin/win64/steam_api64.dll`
|
|
88
|
+
- **32-bit**: `steamworks_sdk/redistributable_bin/steam_api.dll`
|
|
89
|
+
|
|
90
|
+
### macOS
|
|
91
|
+
- **Universal**: `steamworks_sdk/redistributable_bin/osx/libsteam_api.dylib`
|
|
92
|
+
|
|
93
|
+
### Linux
|
|
94
|
+
- **64-bit**: `steamworks_sdk/redistributable_bin/linux64/libsteam_api.so`
|
|
95
|
+
|
|
96
|
+
## Project Structure Examples
|
|
97
|
+
|
|
98
|
+
### Basic Node.js Project
|
|
99
|
+
```
|
|
100
|
+
my-steam-game/
|
|
101
|
+
โโโ steamworks_sdk/
|
|
102
|
+
โ โโโ redistributable_bin/
|
|
103
|
+
โ โโโ win64/steam_api64.dll
|
|
104
|
+
โ โโโ steam_api.dll
|
|
105
|
+
โ โโโ osx/libsteam_api.dylib
|
|
106
|
+
โ โโโ linux64/libsteam_api.so
|
|
107
|
+
โโโ package.json
|
|
108
|
+
โโโ steam_appid.txt
|
|
109
|
+
โโโ src/
|
|
110
|
+
โโโ main.js
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
### Electron Application
|
|
114
|
+
```
|
|
115
|
+
my-electron-app/
|
|
116
|
+
โโโ steamworks_sdk/
|
|
117
|
+
โ โโโ redistributable_bin/
|
|
118
|
+
โ โโโ [platform files...]
|
|
119
|
+
โโโ package.json
|
|
120
|
+
โโโ steam_appid.txt
|
|
121
|
+
โโโ src/
|
|
122
|
+
โ โโโ main.js
|
|
123
|
+
โ โโโ renderer.js
|
|
124
|
+
โโโ dist/
|
|
125
|
+
โโโ [built app...]
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
### Monorepo Setup
|
|
129
|
+
```
|
|
130
|
+
my-monorepo/
|
|
131
|
+
โโโ steamworks_sdk/
|
|
132
|
+
โ โโโ redistributable_bin/
|
|
133
|
+
โ โโโ [platform files...]
|
|
134
|
+
โโโ packages/
|
|
135
|
+
โ โโโ game-client/
|
|
136
|
+
โ โ โโโ package.json
|
|
137
|
+
โ โ โโโ src/
|
|
138
|
+
โ โโโ game-server/
|
|
139
|
+
โ โโโ package.json
|
|
140
|
+
โ โโโ src/
|
|
141
|
+
โโโ steam_appid.txt
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
## Troubleshooting
|
|
145
|
+
|
|
146
|
+
### "Steamworks SDK library not found" Error
|
|
147
|
+
|
|
148
|
+
This error means the redistributables are not properly installed. Check:
|
|
149
|
+
|
|
150
|
+
1. โ
The `steamworks_sdk/redistributable_bin` folder exists in your project root
|
|
151
|
+
2. โ
Platform-specific libraries are in the correct subfolders
|
|
152
|
+
3. โ
File permissions allow reading the library files
|
|
153
|
+
4. โ
You're running from the correct working directory
|
|
154
|
+
|
|
155
|
+
### "Cannot find function 'SteamAPI_Init'" Error
|
|
156
|
+
|
|
157
|
+
This usually indicates:
|
|
158
|
+
- Wrong library architecture (32-bit vs 64-bit)
|
|
159
|
+
- Corrupted or incomplete SDK download
|
|
160
|
+
- Incompatible SDK version
|
|
161
|
+
|
|
162
|
+
**Solution**: Re-download the latest Steamworks SDK and replace the redistributables.
|
|
163
|
+
|
|
164
|
+
### Permission Issues (macOS/Linux)
|
|
165
|
+
|
|
166
|
+
If you get permission errors:
|
|
167
|
+
```bash
|
|
168
|
+
# Make library executable
|
|
169
|
+
chmod +x steamworks_sdk/redistributable_bin/osx/libsteam_api.dylib
|
|
170
|
+
chmod +x steamworks_sdk/redistributable_bin/linux64/libsteam_api.so
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
## Version Compatibility
|
|
174
|
+
|
|
175
|
+
- **steamworks-ffi-node v0.5.x**: Compatible with Steamworks SDK v1.58+
|
|
176
|
+
- **Always use the latest** Steamworks SDK from Valve for best compatibility
|
|
177
|
+
- **Check release notes** for any breaking changes in new SDK versions
|
|
178
|
+
|
|
179
|
+
## Legal Compliance
|
|
180
|
+
|
|
181
|
+
### โ
Allowed
|
|
182
|
+
- Downloading SDK with your own Steamworks developer account
|
|
183
|
+
- Using redistributables in your own games
|
|
184
|
+
- Distributing your game with embedded redistributables
|
|
185
|
+
|
|
186
|
+
### โ Not Allowed
|
|
187
|
+
- Redistributing SDK files in npm packages
|
|
188
|
+
- Sharing SDK files with non-developers
|
|
189
|
+
- Using SDK without proper Steamworks registration
|
|
190
|
+
|
|
191
|
+
### ๐ Requirements for Distribution
|
|
192
|
+
- Register as Steamworks developer
|
|
193
|
+
- Agree to Steamworks SDK license
|
|
194
|
+
- Include redistributables only with your shipped game
|
|
195
|
+
|
|
196
|
+
## Support
|
|
197
|
+
|
|
198
|
+
If you encounter issues:
|
|
199
|
+
|
|
200
|
+
1. **Check this guide** for common solutions
|
|
201
|
+
2. **Verify SDK installation** using the verification script above
|
|
202
|
+
3. **Update to latest SDK** from Valve
|
|
203
|
+
4. **Open an issue** at [steamworks-ffi-node GitHub](https://github.com/ArtyProf/steamworks-ffi-node/issues)
|
|
204
|
+
|
|
205
|
+
For Steamworks SDK licensing questions, contact Valve directly through the Steamworks Partner portal.
|
|
206
|
+
|
|
207
|
+
---
|
|
208
|
+
|
|
209
|
+
**Note**: This package is not affiliated with Valve Corporation. Steamworks is a trademark of Valve Corporation.
|
package/package.json
CHANGED
|
@@ -1,20 +1,25 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "steamworks-ffi-node",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.0",
|
|
4
4
|
"description": "Steamworks SDK wrapper using FFI for Node.js/Electron - Full Steam Integration",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
7
7
|
"scripts": {
|
|
8
8
|
"build": "tsc",
|
|
9
|
+
"postinstall": "node postinstall.js",
|
|
10
|
+
"verify-sdk": "node verify-sdk-setup.js",
|
|
11
|
+
"test:discord": "node test-discord-integration.js",
|
|
9
12
|
"test:achievements:js": "node tests/js/test-complete-achievements.js",
|
|
10
13
|
"test:stats:js": "node tests/js/test-complete-stats.js",
|
|
11
14
|
"test:leaderboards:js": "node tests/js/test-complete-leaderboards.js",
|
|
12
15
|
"test:friends:js": "node tests/js/test-complete-friends.js",
|
|
16
|
+
"test:cloud:js": "node tests/js/test-complete-cloud.js",
|
|
13
17
|
"test:richpresence-overlay:js": "node tests/js/test-richpresence-overlay.js",
|
|
14
18
|
"test:achievements:ts": "ts-node tests/ts/test-complete-achievements.ts",
|
|
15
19
|
"test:stats:ts": "ts-node tests/ts/test-complete-stats.ts",
|
|
16
20
|
"test:leaderboards:ts": "ts-node tests/ts/test-complete-leaderboards.ts",
|
|
17
21
|
"test:friends:ts": "ts-node tests/ts/test-complete-friends.ts",
|
|
22
|
+
"test:cloud:ts": "ts-node tests/ts/test-complete-cloud.ts",
|
|
18
23
|
"test:richpresence-overlay:ts": "ts-node tests/ts/test-richpresence-overlay.ts",
|
|
19
24
|
"prepublishOnly": "npm run build"
|
|
20
25
|
},
|
|
@@ -28,10 +33,11 @@
|
|
|
28
33
|
},
|
|
29
34
|
"files": [
|
|
30
35
|
"dist/**/*",
|
|
31
|
-
"steamworks_sdk/redistributable_bin/**/*",
|
|
32
36
|
"README.md",
|
|
33
37
|
"LICENSE",
|
|
34
|
-
"
|
|
38
|
+
"docs/STEAMWORKS_SDK_SETUP.md",
|
|
39
|
+
"verify-sdk-setup.js",
|
|
40
|
+
"postinstall.js"
|
|
35
41
|
],
|
|
36
42
|
"keywords": [
|
|
37
43
|
"steam",
|
package/postinstall.js
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Post-installation script for steamworks-ffi-node
|
|
5
|
+
*
|
|
6
|
+
* This script provides guidance to users after package installation
|
|
7
|
+
* about setting up the Steamworks SDK redistributables.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
console.log('');
|
|
11
|
+
console.log('๐ steamworks-ffi-node installed successfully!');
|
|
12
|
+
console.log('');
|
|
13
|
+
console.log('๐ Next Steps:');
|
|
14
|
+
console.log('==============');
|
|
15
|
+
console.log('');
|
|
16
|
+
console.log('1. ๐ฅ Download Steamworks SDK redistributables');
|
|
17
|
+
console.log(' - Get them from: https://partner.steamgames.com/');
|
|
18
|
+
console.log(' - Extract and copy "redistributable_bin" to "steamworks_sdk/" in your project');
|
|
19
|
+
console.log('');
|
|
20
|
+
console.log('2. ๐ง Configure your Steam App ID');
|
|
21
|
+
console.log(' - Option A: Create steam_appid.txt with your App ID');
|
|
22
|
+
console.log(' - Option B: Pass App ID to steam.init(yourAppId)');
|
|
23
|
+
console.log(' - For testing: Use App ID 480 (Spacewar)');
|
|
24
|
+
console.log('');
|
|
25
|
+
console.log('3. โ
Verify setup');
|
|
26
|
+
console.log(' Run: npm run verify-sdk');
|
|
27
|
+
console.log('');
|
|
28
|
+
console.log('๐ Complete setup guide:');
|
|
29
|
+
console.log('https://github.com/ArtyProf/steamworks-ffi-node/blob/main/docs/STEAMWORKS_SDK_SETUP.md');
|
|
30
|
+
console.log('');
|
|
31
|
+
console.log('โ ๏ธ Legal Notice:');
|
|
32
|
+
console.log('Due to Valve\'s licensing terms, the Steamworks SDK redistributables');
|
|
33
|
+
console.log('cannot be bundled with this package and must be downloaded separately.');
|
|
34
|
+
console.log('');
|
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Steamworks SDK Installation Verification Script
|
|
5
|
+
*
|
|
6
|
+
* This script checks if the Steamworks SDK redistributables are properly installed
|
|
7
|
+
* and provides helpful guidance if they're missing.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
const fs = require('fs');
|
|
11
|
+
const path = require('path');
|
|
12
|
+
|
|
13
|
+
function checkSteamworksSDK() {
|
|
14
|
+
console.log('๐ Steamworks SDK Installation Verification');
|
|
15
|
+
console.log('===========================================');
|
|
16
|
+
console.log('');
|
|
17
|
+
|
|
18
|
+
const possibleBasePaths = [
|
|
19
|
+
process.cwd(),
|
|
20
|
+
path.resolve(process.cwd(), '..'),
|
|
21
|
+
path.resolve(process.cwd(), '../..'),
|
|
22
|
+
];
|
|
23
|
+
|
|
24
|
+
let foundSdk = false;
|
|
25
|
+
let sdkPath = '';
|
|
26
|
+
|
|
27
|
+
// Check for steamworks_sdk folder
|
|
28
|
+
for (const basePath of possibleBasePaths) {
|
|
29
|
+
const checkPath = path.join(basePath, 'steamworks_sdk', 'redistributable_bin');
|
|
30
|
+
if (fs.existsSync(checkPath)) {
|
|
31
|
+
foundSdk = true;
|
|
32
|
+
sdkPath = checkPath;
|
|
33
|
+
console.log(`โ
Found steamworks_sdk at: ${checkPath}`);
|
|
34
|
+
break;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
if (!foundSdk) {
|
|
39
|
+
console.log('โ Steamworks SDK not found!');
|
|
40
|
+
console.log('');
|
|
41
|
+
console.log('Expected folder structure:');
|
|
42
|
+
console.log(' steamworks_sdk/');
|
|
43
|
+
console.log(' โโโ redistributable_bin/');
|
|
44
|
+
console.log(' โโโ win64/steam_api64.dll');
|
|
45
|
+
console.log(' โโโ steam_api.dll');
|
|
46
|
+
console.log(' โโโ osx/libsteam_api.dylib');
|
|
47
|
+
console.log(' โโโ linux64/libsteam_api.so');
|
|
48
|
+
console.log('');
|
|
49
|
+
console.log('๐ Setup Instructions:');
|
|
50
|
+
console.log('1. Download Steamworks SDK from: https://partner.steamgames.com/');
|
|
51
|
+
console.log('2. Extract the SDK archive');
|
|
52
|
+
console.log('3. Copy the "redistributable_bin" folder to "steamworks_sdk/" in your project');
|
|
53
|
+
console.log('4. See https://github.com/ArtyProf/steamworks-ffi-node/blob/main/docs/STEAMWORKS_SDK_SETUP.md for detailed instructions');
|
|
54
|
+
console.log('');
|
|
55
|
+
console.log('Searched paths:');
|
|
56
|
+
possibleBasePaths.forEach(p => {
|
|
57
|
+
console.log(` - ${path.join(p, 'steamworks_sdk', 'redistributable_bin')}`);
|
|
58
|
+
});
|
|
59
|
+
return false;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
// Check platform-specific files
|
|
63
|
+
console.log('');
|
|
64
|
+
console.log('๐ Checking platform-specific libraries...');
|
|
65
|
+
|
|
66
|
+
const requiredFiles = [
|
|
67
|
+
{ path: 'win64/steam_api64.dll', platform: 'Windows 64-bit' },
|
|
68
|
+
{ path: 'steam_api.dll', platform: 'Windows 32-bit' },
|
|
69
|
+
{ path: 'osx/libsteam_api.dylib', platform: 'macOS' },
|
|
70
|
+
{ path: 'linux64/libsteam_api.so', platform: 'Linux 64-bit' }
|
|
71
|
+
];
|
|
72
|
+
|
|
73
|
+
let allFilesPresent = true;
|
|
74
|
+
let currentPlatformFileExists = false;
|
|
75
|
+
const currentPlatform = process.platform;
|
|
76
|
+
const currentArch = process.arch;
|
|
77
|
+
|
|
78
|
+
requiredFiles.forEach(file => {
|
|
79
|
+
const filePath = path.join(sdkPath, file.path);
|
|
80
|
+
const exists = fs.existsSync(filePath);
|
|
81
|
+
|
|
82
|
+
console.log(` ${exists ? 'โ
' : 'โ'} ${file.platform}: ${file.path}`);
|
|
83
|
+
|
|
84
|
+
if (!exists) {
|
|
85
|
+
allFilesPresent = false;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
// Check if current platform file exists
|
|
89
|
+
if (currentPlatform === 'win32' && currentArch === 'x64' && file.path === 'win64/steam_api64.dll' && exists) {
|
|
90
|
+
currentPlatformFileExists = true;
|
|
91
|
+
} else if (currentPlatform === 'win32' && currentArch !== 'x64' && file.path === 'steam_api.dll' && exists) {
|
|
92
|
+
currentPlatformFileExists = true;
|
|
93
|
+
} else if (currentPlatform === 'darwin' && file.path === 'osx/libsteam_api.dylib' && exists) {
|
|
94
|
+
currentPlatformFileExists = true;
|
|
95
|
+
} else if (currentPlatform === 'linux' && file.path === 'linux64/libsteam_api.so' && exists) {
|
|
96
|
+
currentPlatformFileExists = true;
|
|
97
|
+
}
|
|
98
|
+
});
|
|
99
|
+
|
|
100
|
+
console.log('');
|
|
101
|
+
|
|
102
|
+
// Check steam_appid.txt (optional)
|
|
103
|
+
const steamAppIdPath = path.join(process.cwd(), 'steam_appid.txt');
|
|
104
|
+
const hasAppId = fs.existsSync(steamAppIdPath);
|
|
105
|
+
|
|
106
|
+
console.log('๐ Checking steam_appid.txt (optional)...');
|
|
107
|
+
if (hasAppId) {
|
|
108
|
+
const appId = fs.readFileSync(steamAppIdPath, 'utf8').trim();
|
|
109
|
+
console.log(`โ
steam_appid.txt found with App ID: ${appId}`);
|
|
110
|
+
if (appId === '480') {
|
|
111
|
+
console.log(' Note: Using Spacewar (480) - perfect for testing!');
|
|
112
|
+
}
|
|
113
|
+
} else {
|
|
114
|
+
console.log('โน๏ธ steam_appid.txt not found (this is optional)');
|
|
115
|
+
console.log(' You can either create this file OR pass the App ID to steam.init(appId)');
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
console.log('');
|
|
119
|
+
console.log('๐ Summary');
|
|
120
|
+
console.log('==========');
|
|
121
|
+
|
|
122
|
+
if (foundSdk && currentPlatformFileExists) {
|
|
123
|
+
console.log('๐ Great! Your Steamworks SDK setup is ready.');
|
|
124
|
+
console.log('');
|
|
125
|
+
console.log('โ
Steamworks SDK redistributables installed');
|
|
126
|
+
console.log(`โ
${getCurrentPlatformName()} library available`);
|
|
127
|
+
if (hasAppId) {
|
|
128
|
+
console.log('โ
steam_appid.txt configured');
|
|
129
|
+
} else {
|
|
130
|
+
console.log('โน๏ธ steam_appid.txt not found (pass App ID to steam.init() instead)');
|
|
131
|
+
}
|
|
132
|
+
console.log('');
|
|
133
|
+
console.log('You can now use steamworks-ffi-node in your project!');
|
|
134
|
+
console.log('');
|
|
135
|
+
console.log('Next steps:');
|
|
136
|
+
console.log('1. Make sure Steam client is running');
|
|
137
|
+
console.log('2. Import steamworks-ffi-node in your code');
|
|
138
|
+
if (hasAppId) {
|
|
139
|
+
console.log('3. Initialize the SDK with steam.init()');
|
|
140
|
+
} else {
|
|
141
|
+
console.log('3. Initialize the SDK with steam.init(yourAppId) or create steam_appid.txt');
|
|
142
|
+
}
|
|
143
|
+
return true;
|
|
144
|
+
} else {
|
|
145
|
+
console.log('โ ๏ธ Setup incomplete. Please address the issues above.');
|
|
146
|
+
console.log('');
|
|
147
|
+
|
|
148
|
+
if (!foundSdk) {
|
|
149
|
+
console.log('โ Steamworks SDK redistributables missing');
|
|
150
|
+
} else if (!currentPlatformFileExists) {
|
|
151
|
+
console.log(`โ Library for ${getCurrentPlatformName()} missing`);
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
console.log('');
|
|
155
|
+
console.log('๐ See https://github.com/ArtyProf/steamworks-ffi-node/blob/main/docs/STEAMWORKS_SDK_SETUP.md for detailed setup instructions');
|
|
156
|
+
return false;
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
function getCurrentPlatformName() {
|
|
161
|
+
const platform = process.platform;
|
|
162
|
+
const arch = process.arch;
|
|
163
|
+
|
|
164
|
+
if (platform === 'win32') {
|
|
165
|
+
return arch === 'x64' ? 'Windows 64-bit' : 'Windows 32-bit';
|
|
166
|
+
} else if (platform === 'darwin') {
|
|
167
|
+
return 'macOS';
|
|
168
|
+
} else if (platform === 'linux') {
|
|
169
|
+
return 'Linux 64-bit';
|
|
170
|
+
} else {
|
|
171
|
+
return `${platform} (${arch})`;
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
// Test basic functionality if SDK is installed
|
|
176
|
+
function testBasicFunctionality() {
|
|
177
|
+
console.log('');
|
|
178
|
+
console.log('๐งช Testing Basic Functionality');
|
|
179
|
+
console.log('===============================');
|
|
180
|
+
|
|
181
|
+
try {
|
|
182
|
+
console.log('Attempting to load steamworks-ffi-node...');
|
|
183
|
+
|
|
184
|
+
// Try to require the package
|
|
185
|
+
const SteamworksSDK = require('./dist/index.js').default || require('./dist/index.js');
|
|
186
|
+
console.log('โ
Package loaded successfully');
|
|
187
|
+
|
|
188
|
+
// Try to create instance (this will test SDK loading)
|
|
189
|
+
console.log('Testing SDK initialization...');
|
|
190
|
+
const steam = new SteamworksSDK();
|
|
191
|
+
console.log('โ
SteamworksSDK instance created');
|
|
192
|
+
|
|
193
|
+
console.log('');
|
|
194
|
+
console.log('๐ Basic functionality test passed!');
|
|
195
|
+
console.log('Your setup appears to be working correctly.');
|
|
196
|
+
|
|
197
|
+
} catch (error) {
|
|
198
|
+
console.log('โ Basic functionality test failed');
|
|
199
|
+
console.log(`Error: ${error.message}`);
|
|
200
|
+
console.log('');
|
|
201
|
+
console.log('This could indicate:');
|
|
202
|
+
console.log('- Package not built (run "npm run build")');
|
|
203
|
+
console.log('- Missing dependencies');
|
|
204
|
+
console.log('- Incorrect SDK installation');
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
// Main execution
|
|
209
|
+
if (require.main === module) {
|
|
210
|
+
const success = checkSteamworksSDK();
|
|
211
|
+
|
|
212
|
+
if (success) {
|
|
213
|
+
testBasicFunctionality();
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
console.log('');
|
|
217
|
+
console.log('For more help, visit: https://github.com/ArtyProf/steamworks-ffi-node');
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
module.exports = { checkSteamworksSDK };
|
package/THIRD_PARTY_LICENSES.md
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
# Third-Party Licenses
|
|
2
|
-
|
|
3
|
-
## Steamworks SDK Redistributables
|
|
4
|
-
|
|
5
|
-
This package includes redistributable binaries from the Steamworks SDK.
|
|
6
|
-
|
|
7
|
-
**Copyright**: ยฉ Valve Corporation. All rights reserved.
|
|
8
|
-
|
|
9
|
-
**License**: These redistributables are distributed under the Steamworks SDK Access Agreement.
|
|
10
|
-
|
|
11
|
-
The Steamworks SDK redistributables are provided by Valve Corporation and are subject to the Steamworks SDK Access Agreement available at:
|
|
12
|
-
https://partner.steamgames.com/documentation/sdk_access_agreement
|
|
13
|
-
|
|
14
|
-
### Included Components:
|
|
15
|
-
- `steamworks_sdk/redistributable_bin/` - Platform-specific Steam API libraries
|
|
16
|
-
- Windows: steam_api64.dll, steam_api.dll
|
|
17
|
-
- macOS: libsteam_api.dylib
|
|
18
|
-
- Linux: libsteam_api.so
|
|
19
|
-
|
|
20
|
-
These files are distributed in accordance with Section 1.1(b) of the Steamworks SDK Access Agreement, which permits reproduction and distribution of SDK Redistributables in object code form along with licensee software.
|
|
21
|
-
|
|
22
|
-
## Package License
|
|
23
|
-
|
|
24
|
-
The wrapper code in this package (excluding Steamworks SDK redistributables) is licensed under the MIT License. See LICENSE file for details.
|
|
Binary file
|
|
Binary file
|